:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", sans-serif;
  color: #f5edf7;
  background: #12101c;
  --panel: #1d1829;
  --line: #4b405b;
  --muted: #c8bbd2;
  --copper: #ffc7a3;
  --violet: #dfc4f5;
  --measure: Georgia, serif;
  --mono: "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
body, h1, h2, h3, h4, p { margin: 0; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
a { color: inherit; text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 4px; }
[hidden] { display: none !important; }
.wrap { width: min(1100px, calc(100% - 64px)); margin-inline: auto; }

header { border-bottom: 1px solid var(--line); }
.bar, .brand, nav { display: flex; align-items: center; }
.bar { min-height: 60px; justify-content: space-between; gap: 12px; }
.brand { gap: 8px; font-size: 1.38rem; font-weight: 700; letter-spacing: -.04em; text-decoration: none; }
.brand img { width: 33px; height: 33px; }
nav { gap: clamp(8px, 3vw, 24px); }
nav button { background: none; border: 0; min-height: 44px; padding: 0 3px; color: var(--muted); font-size: .9rem; }
nav button:hover { color: #fff; text-decoration: underline; }

.hero {
  margin: 20px 0 18px;
  display: grid;
  align-items: center;
  min-height: 208px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1c1428;
}
.sky {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(90deg, #171020 4%, #1c1328d9 30%, transparent 76%),
    url("images/cosmic-cliffs.jpg") right 50% / cover no-repeat;
}
.hero:has(.plate:not([data-photo="none"])) .sky { opacity: .30; }
.hero h1 {
  padding: 26px clamp(20px, 4vw, 48px);
  font: normal clamp(3.05rem, 6vw, 5rem)/.93 var(--measure);
  letter-spacing: -.055em;
}
.hero em { color: var(--copper); }
.plate { position: absolute; inset: 0 0 0 auto; width: 60%; z-index: -1; }
.plate img { width: 100%; height: 100%; object-fit: cover; mask-image: linear-gradient(to right, transparent, #000 42%); }
.plate[data-photo="saturn"] { mix-blend-mode: screen; }
.plate[data-photo="saturn"] img { object-fit: contain; transform: rotate(-12deg) scale(1.2); mask-image: none; }
#photo-source { position: absolute; right: 10px; bottom: 8px; padding: 3px 5px; border-radius: 3px; background: #12101cd9; font-size: .75rem; color: #ece1f2; }
#photo-source a { text-decoration: none; }
#photo-source a:hover { text-decoration: underline; }

.difficulty { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
#difficulty-label { padding: 0; color: var(--muted); font-size: .875rem; margin-bottom: 7px; }
#modes { display: flex; gap: 3px; padding: 3px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.mode-option { position: relative; cursor: pointer; text-align: center; font-size: .9rem; }
.mode-option input { position: absolute; inset: 0; margin: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.mode-option span { display: block; padding: 9px 14px; border-radius: 3px; }
.mode-option input:checked + span { background: #503461; color: #fff; font-weight: 650; }
.mode-option input:focus-visible + span { outline: 2px solid var(--violet); outline-offset: -2px; }
#endless { min-height: 44px; white-space: nowrap; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--violet); font-size: .9rem; font-weight: 600; }
#endless:hover, #endless[aria-pressed="true"] { border-color: var(--violet); background: #352442; }

.boardhead { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 18px 0 13px; }
.kicker { color: var(--copper); font: 500 .82rem var(--mono); letter-spacing: .04em; margin-bottom: 5px; }
.boardhead h2, dialog h2 { font: normal clamp(1.8rem, 4vw, 2.4rem)/1.1 var(--measure); letter-spacing: -.03em; }
.topic { color: var(--muted); text-align: right; font-size: .875rem; }
#choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 126px;
  padding: 14px 16px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}
label.card { cursor: pointer; }
label.card:hover { border-color: #ae8bc3; }
.card:has(:checked) { background: #31213b; border-color: var(--copper); }
.card:has(:focus-visible) { outline: 2px solid var(--violet); outline-offset: 3px; }
.cardtop { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.letter { color: var(--muted); font: 500 .9rem var(--mono); }
.card input { width: 18px; height: 18px; margin: 0; accent-color: var(--copper); }
.claim { font-size: clamp(1rem, 1.6vw, 1.17rem); font-weight: 600; line-height: 1.38; }
.card.done { min-height: auto; }
.card.lie { background: #302031; border-color: #b98070; }
.status { color: #a9ddce; font-size: .85rem; text-align: right; }
.card.lie .status { color: var(--copper); }
.explanation { color: var(--muted); line-height: 1.54; }
.card a { align-self: flex-start; margin-top: auto; color: var(--violet); font-size: .9rem; }
.verdict { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 11px; padding: 11px 14px; border-left: 2px solid var(--copper); background: var(--panel); }
.verdict h3 { font-size: 1.06rem; }
#score { color: var(--muted); font-size: .9rem; }
.controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 13px 0 22px; color: var(--muted); font-size: .94rem; }
.continue { justify-content: flex-end; }
.action { min-height: 44px; padding: 10px 18px; border: 1px solid transparent; border-radius: 6px; background: var(--copper); color: #261629; font-weight: 700; }
.action:hover:enabled { background: #ffddc5; }
.action:disabled { border-color: var(--line); background: var(--panel); color: var(--muted); cursor: default; }
footer { border-top: 1px solid var(--line); padding: 13px 0 20px; font-size: .8rem; color: var(--muted); }
dialog { width: min(540px, 90vw); max-height: 85dvh; padding: 22px; background: var(--panel); color: inherit; border: 1px solid var(--line); border-radius: 8px; }
dialog::backdrop { background: #0b0912d9; }
.dialoghead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
#close { min-width: 44px; min-height: 44px; border: 0; background: transparent; font-size: 1.8rem; }
dialog p { line-height: 1.5; }
dialog p + p { margin-top: 10px; }
.note { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 0; background: none; border: 0; border-bottom: 1px solid var(--line); }
.note:hover { text-decoration: underline; }
.note small { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }

@media (max-width: 650px) {
  .wrap { width: calc(100% - 32px); }
  .brand { font-size: 1.2rem; }
  .brand img { width: 27px; height: 27px; }
  .hero { min-height: 154px; margin: 14px 0; }
  .hero h1 { padding-block: 17px; }
  .sky { background-position: 62% 50%; }
  .plate { width: 52%; }
  #photo-source { max-width: 95%; text-align: right; font-size: .7rem; }
  .mode-option span { padding: 9px 7px; }
  #endless { padding-inline: 8px; }
  #choices { grid-template-columns: 1fr; gap: 8px; }
  label.card { display: grid; position: relative; align-items: center; padding: 12px 38px 12px 34px; min-height: 65px; }
  label.card .cardtop { display: contents; }
  label.card .letter { position: absolute; left: 12px; }
  label.card input { position: absolute; right: 12px; }
}
@media (max-width: 360px) {
  .difficulty { flex-wrap: wrap; }
  .mode-option span { padding-inline: 9px; }
}
