@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600&family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --bg: #10121c;
  --surface: #1b1e2c;
  --raised: #222638;
  --ink: #f5f3ff;
  --muted: #b9bfd2;
  --border: #383c53;
  --mint: #a7f3d1;
  --lavender: #c8b9ff;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --bs-body-font-family: "Inter", system-ui, sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-link-color: var(--lavender);
  --bs-link-hover-color: var(--mint);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 20px; }
body {
  margin: 0;
  background: radial-gradient(ellipse 750px 360px at 50% 155px, #242138 0%, transparent 100%), var(--bg);
  color: var(--ink);
  font: 400 1rem/1.65 var(--bs-body-font-family);
}
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h2 { font-size: clamp(1.55rem, 3.2vw, 2.1rem); font-weight: 750; letter-spacing: -.035em; }
h3 { font-size: 1.04rem; font-weight: 750; }
p { margin: 0; }
a { color: var(--lavender); text-underline-offset: .23em; }
a:hover { color: var(--mint); }
button, textarea { font: inherit; }
button:not(:disabled), summary { cursor: pointer; }
:focus-visible { outline: 2px solid var(--lavender); outline-offset: 3px; }
.container { width: min(calc(100% - 32px), 1060px); max-width: none; padding: 0; margin-inline: auto; }
.skip-link { background: var(--lavender); color: var(--bg); position: absolute; z-index: 2; top: 8px; left: 8px; padding: .5rem .75rem; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.site-header { background: #141623; border-bottom: 1px solid #2f3145; }
.site-header-inner, .site-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: .75rem 2rem; flex-wrap: wrap; }
.site-header-inner { min-height: 66px; }
.site-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 800; letter-spacing: -.03em; font-size: 1.16rem; text-decoration: none; }
.site-brand img { display: block; object-fit: contain; }
.site-nav, .site-footer nav { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem clamp(.8rem, 3vw, 1.9rem); }
.site-nav a, .site-footer nav a { padding-block: .55rem; color: var(--muted); font-size: .85rem; font-weight: 650; text-decoration: none; }
.site-nav a:hover, .site-footer nav a:hover { color: var(--mint); }
.site-footer { border-top: 1px solid #2f3145; background: #141623; padding: 2.1rem 0; }
.site-footer p { margin-top: .35rem; font-size: .84rem; color: var(--muted); }
.intro { text-align: center; padding: 3.2rem 0 1.65rem; }
.intro h1 { font-size: clamp(2.55rem, 7.5vw, 5rem); line-height: 1.05; letter-spacing: -.065em; font-weight: 800; }
.intro p { color: var(--muted); max-width: 37rem; margin: .85rem auto 0; font-size: clamp(.97rem, 2vw, 1.15rem); text-wrap: balance; }
.game-wrap { max-width: 826px; }
.game-frame {
  overflow: hidden;
  border: 1px solid #50496d;
  border-radius: 26px;
  background: #1a1b2a;
  box-shadow: 0 24px 65px #08091285, 0 0 45px #8d68db20;
}
.game-header, .game-body, .game-footer { padding-inline: clamp(14px, 4.4vw, 30px); }
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding-block: .85rem;
  background:
    radial-gradient(ellipse at 8% 0%, #8d5fbb45, transparent 64%),
    linear-gradient(112deg, #31294a, #222337 76%);
  border-bottom: 1px solid #4a4363;
}
.game-header h2 { font-size: clamp(1.16rem, 2.6vw, 1.42rem); letter-spacing: -.035em; }
.game-header p, .game-footer, .game-progress { color: var(--muted); font: 500 .75rem/1.45 var(--mono); }
.game-header p { margin-top: .22rem; }
.mode-switch {
  display: flex;
  gap: .25rem;
  padding: 4px;
  border: 1px solid #514967;
  border-radius: 13px;
  background: #181827;
}
.mode-switch button {
  min-height: 44px;
  min-width: 54px;
  padding: .3rem .75rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: .83rem;
  font-weight: 700;
  transition: background-color .16s, color .16s;
}
.mode-switch button[aria-pressed="false"]:hover:not(:disabled) { color: var(--ink); background: #302b45; }
.mode-switch button[aria-pressed="true"] { color: #241d3b; background: var(--lavender); }
.game-body {
  padding-block: .9rem 1.2rem;
  background:
    radial-gradient(ellipse at 100% 65%, #54bca518, transparent 54%),
    radial-gradient(ellipse at 0% 28%, #9b6ae327, transparent 66%),
    radial-gradient(circle at 1px 1px, #b6a0e915 1px, transparent 1.5px) 0 0 / 17px 17px;
}
.game-progress {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .45rem;
  margin-bottom: .9rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid #3c3652;
}
.game-score { justify-self: end; text-align: right; color: var(--mint); font-weight: 600; }
#round-track { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
#round-track li {
  min-width: 27px;
  height: 26px;
  display: grid;
  place-items: center;
  background: #252438;
  border: 1px solid #48425e;
  border-radius: 7px;
}
#round-track li[aria-current="step"] { outline: 1px solid var(--lavender); outline-offset: 2px; color: var(--lavender); }
#round-track li[data-points="3"] { color: var(--mint); background: #233937; border-color: #608c7c; }
#round-track li[data-points="2"] { color: var(--lavender); background: #352a4c; border-color: #77679b; }
#round-track li[data-points="0"] { color: #ffd0d2; background: #3a2938; border-color: #9b6675; }
.clues, .choices { display: grid; gap: .65rem; }
.clues { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 1rem; }
.clue {
  min-width: 0;
  min-height: 77px;
  padding: .65rem .85rem;
  border: 1px solid var(--clue-border);
  border-radius: 13px;
  background: var(--clue-bg);
}
.clue-main { --clue-border: #48736d; --clue-bg: #223337; --clue-accent: var(--mint); }
.clue-bonus { --clue-border: #675885; --clue-bg: #30283f; --clue-accent: var(--lavender); }
.clue-meta { display: flex; align-items: baseline; justify-content: space-between; gap: .25rem; color: var(--clue-accent); }
.clue-meta p, .clue-meta span { font: 600 .7rem/1.4 var(--mono); }
.clue-meta p { letter-spacing: .025em; text-transform: uppercase; }
.clue-meta span { white-space: nowrap; }
.clue strong { display: block; margin-top: .28rem; line-height: 1.3; font-size: clamp(.82rem, 2vw, 1.1rem); }
.choice-set { margin: 0; padding: 0; border: 0; min-width: 0; }
.choice-set legend { float: none; width: auto; margin-bottom: .5rem; color: var(--ink); font-size: .86rem; font-weight: 650; }
.choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-card {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: clamp(94px, 13vw, 123px);
  padding: 1rem .2rem;
  border: 2px solid #fbf4ff;
  border-bottom-width: 4px;
  border-radius: 16px;
  background: linear-gradient(155deg, #fcf8ff, #e2d9f6);
  color: #29203f;
  box-shadow: 0 5px 12px #10101d60;
  transition: box-shadow .17s, border-color .17s, transform .17s;
}
.choice-value { font: 600 clamp(1.65rem, 6vw, 2.9rem)/1 var(--mono); letter-spacing: -.055em; }
.choice-card:has(input:not(:disabled)) { cursor: pointer; }
.choice-card::after {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 14px;
  height: 14px;
  border: 1px solid #766787;
  border-radius: 50%;
  content: "";
}
.choice-card:has(input:checked) {
  border-color: #a58be6;
  background: linear-gradient(155deg, #f1ebff, #cbb9f8);
  box-shadow: 0 0 0 2px #a58be65c, 0 0 22px #b099fa6b, 0 8px 18px #0d0c19a1;
}
.choice-card:has(input:checked)::after {
  border-color: #563997;
  background: radial-gradient(circle, #563997 0 43%, transparent 47%);
}
.choice-card:has(input:disabled)::after { display: none; }
.choice-card:has(input:disabled):not([data-review]) { background: #cfc7df; border-color: #dcd4ea; }
.choice-card[data-review="best"] {
  background: linear-gradient(155deg, #ecfff5, #b2efd4);
  border-color: #83d7b6;
  color: #183b30;
  box-shadow: 0 0 24px #82e7b854, 0 6px 13px #0d181a82;
}
.choice-caption {
  position: absolute;
  inset: auto 3px 5px;
  color: inherit;
  text-align: center;
  font-size: .7rem;
  font-weight: 750;
  line-height: 1.2;
}
.choice-card:has(input:focus-visible) { outline: 2px solid var(--lavender); outline-offset: 3px; }
.choice-card:has(input:not(:disabled)):active { transform: translateY(1px); }
@media (hover: hover) {
  .choice-card:has(input:not(:disabled)):hover { border-color: #bca6ef; transform: translateY(-2px); }
}
.choice-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-width: 0;
  padding: 0;
  margin: -1px;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
.game-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.game-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .58rem 1rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--mint);
  color: #163229;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 800;
  line-height: 1.35;
}
.game-button:hover:not(:disabled) { background: #c7ffe8; color: #163229; }
.game-button:disabled { background: #30354a; color: #c5cbe0; }
.game-button-secondary { background: #302a45; color: var(--lavender); border-color: #5a4f7f; }
.game-button-secondary:hover:not(:disabled) { background: #42385c; color: var(--ink); }
.game-frame .game-button { min-height: 46px; transition: background-color .17s, color .17s; }
.round-actions { align-items: center; justify-content: space-between; }
.round-actions #confirm { margin-inline-start: auto; min-width: 9.4rem; }
.pick-hint { color: var(--muted); font-size: .84rem; }
.round-feedback {
  display: flex;
  flex: 1 1 15rem;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .2rem .65rem;
  padding: .5rem .65rem;
  border-left: 3px solid var(--feedback-accent);
  border-radius: 0 8px 8px 0;
  background: #25263a;
  color: var(--ink);
  font-size: .83rem;
}
.round-feedback[data-points="3"] { --feedback-accent: var(--mint); }
.round-feedback[data-points="2"] { --feedback-accent: var(--lavender); }
.round-feedback[data-points="0"] { --feedback-accent: #ffc6cd; }
.round-feedback strong { color: var(--feedback-accent); white-space: nowrap; }
.game-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .35rem 1rem;
  padding-block: .7rem;
  border-top: 1px solid #433b5b;
  background: #171726;
}
.game-status { margin-top: .7rem; color: var(--lavender); font-size: .83rem; }
.game-status:empty,
#game-round:has(#feedback:not([hidden])) ~ .game-status {
  position: absolute;
  height: 1px;
  width: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
.result-overview { display: grid; grid-template-columns: 1.1fr 1fr; gap: .85rem; }
.result-summary {
  display: grid;
  align-content: center;
  gap: .4rem;
  padding: .9rem 1rem;
  border: 1px solid #4d7167;
  border-radius: 13px;
  background: linear-gradient(140deg, #263d3b, #242939);
}
#result-title { font: 600 clamp(1.55rem, 4vw, 2.2rem)/1.15 var(--mono); color: var(--mint); }
#result-copy { color: var(--ink); font-size: .85rem; }
.result-list {
  list-style: none;
  border: 1px solid #4b4360;
  border-radius: 13px;
  margin: 0;
  padding: .2rem .85rem;
  background: #252338;
}
.result-list li { display: flex; justify-content: space-between; gap: .9rem; padding: .5rem 0; font-size: .84rem; }
.result-list li + li { border-top: 1px solid #494158; }
.result-list span { color: var(--lavender); font-family: var(--mono); }
#share-text { width: 100%; margin-top: .8rem; padding: .6rem; color: var(--ink); background: var(--raised); border: 1px solid var(--border); border-radius: 8px; }

@media (prefers-reduced-motion: no-preference) {
  [data-stage="deal"] .choice-card { animation: draft-deal .32s cubic-bezier(.2,.7,.25,1) backwards; }
  [data-stage="deal"] .choice-card:nth-child(2) { animation-delay: .045s; }
  [data-stage="deal"] .choice-card:nth-child(3) { animation-delay: .09s; }
  [data-stage="review"] .choice-card[data-review="best"] {
    animation: draft-reveal .36s cubic-bezier(.2,.7,.25,1);
  }
  [data-stage="review"] .choice-card[data-review="best"]::before {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: "";
    background: linear-gradient(110deg, transparent 23%, #ffffff83 48%, transparent 72%);
    animation: draft-shine .48s ease-out both;
  }
  [data-stage="result"] .result-overview { animation: draft-deal .35s ease-out; }
}
@keyframes draft-deal {
  from { opacity: .45; transform: translateY(11px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes draft-reveal {
  0%, 100% { transform: scale(1); }
  42% { transform: scale(1.04); }
}
@keyframes draft-shine {
  from { transform: translateX(-90%); }
  to { transform: translateX(105%); }
}

@media (max-width: 575px) {
  .game-progress { grid-template-columns: auto 1fr auto; font-size: .69rem; }
  #round-track { justify-content: center; gap: 5px; }
  #round-track li { min-width: 21px; height: 23px; }
  .round-actions { gap: .65rem; }
  .round-actions #confirm { width: 100%; }
  .pick-hint { width: 100%; }
  .result-overview { grid-template-columns: 1fr; gap: .65rem; }
  #game-result .game-actions { display: grid; grid-template-columns: auto 1fr; gap: .5rem; }
}

.content-section { padding-top: clamp(2.6rem, 7.5vw, 4.2rem); }
.section-intro { max-width: 72ch; margin-top: .65rem; color: var(--muted); }
.steps-grid, .pattern-grid, .example-grid { display: grid; gap: .75rem; padding: 0; margin: 1rem 0 0; list-style: none; }
.steps-grid, .example-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pattern-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.reading-card, .worked-example, .original-panel, .faq-list details { border: 1px solid var(--border); border-radius: 15px; background: var(--surface); }
.reading-card { padding: clamp(.9rem, 2.4vw, 1.25rem); }
.reading-card p, .worked-example p, .pattern-note, .original-panel p, .faq-list p, .document p, .document li { color: var(--muted); font-size: .94rem; line-height: 1.68; }
.reading-card p, .worked-example > p:first-of-type, .original-panel p { margin-top: .5rem; }
.worked-example, .original-panel { padding: clamp(.9rem, 3.2vw, 1.5rem); }
.guide-examples {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.07fr);
  gap: .8rem;
  margin: .8rem 0;
}
.gameplay-shot {
  display: grid;
  align-content: center;
  margin: 0;
  padding: .75rem;
  border: 1px solid #51456d;
  border-radius: 15px;
  background: radial-gradient(ellipse at 25% 10%, #302842, var(--surface) 65%);
}
.gameplay-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 9px;
}
.gameplay-shot figcaption {
  margin: .6rem .2rem 0;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.45;
}
.example-grid li { padding: .65rem .8rem; border: 1px solid var(--border); border-radius: 11px; background: #23273a; }
.example-grid li > div { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .25rem; }
.example-grid strong { font: 600 1.38rem/1.2 var(--mono); }
.example-grid span { color: var(--lavender); font: 600 .71rem/1.3 var(--mono); text-align: right; }
.example-grid li:first-child span { color: var(--mint); }
.example-note, .pattern-note { margin-top: .8rem; }
.practice-tip { margin-top: 1.25rem; }
.text-link { display: inline-block; font-size: .9rem; font-weight: 650; }
.original-panel { background: linear-gradient(120deg, #242339, #1b1e2c 75%); }
.original-panel p { max-width: 80ch; }
.faq-section { padding-bottom: clamp(2.6rem, 7.5vw, 4.2rem); }
.faq-list { display: grid; gap: .55rem; margin-top: 1rem; }
.faq-list summary { padding: .8rem 1rem; font-weight: 700; border-radius: inherit; }
.faq-list summary::marker { color: var(--lavender); }
.faq-list details[open] { border-color: #665c87; }
.faq-list p { padding: 0 1rem .85rem; max-width: 80ch; }
.document { max-width: 780px; padding-block: 3.5rem; min-height: 55vh; }
.document h1 { margin-bottom: .85rem; font-size: clamp(2rem, 7vw, 3.8rem); letter-spacing: -.05em; }
.document h2 { margin-top: 1.65rem; font-size: 1.4rem; }
.document p { margin: .65rem 0; }
.document .game-button { margin-top: .65rem; }
@media (max-width: 991px) {
  .guide-examples { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .intro { padding-top: 2.15rem; padding-bottom: 1.3rem; }
  .steps-grid, .pattern-grid, .example-grid { grid-template-columns: 1fr; }
  .game-frame { border-radius: 19px; }
  .site-header-inner { min-height: 61px; }
}
@media (max-width: 380px) {
  .intro h1 { font-size: 2.25rem; }
  .mode-switch button { padding-inline: .52rem; }
  .site-nav { column-gap: .65rem; }
  .site-nav a { font-size: .79rem; }
  .game-header h2 { font-size: 1.06rem; }
  .game-header p { font-size: .69rem; }
  .clues, .choices { gap: .5rem; }
  .clue { padding-inline: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
