:root {
  color-scheme: light;
  --ink: #22304a;
  --muted: #5f6d82;
  --paper: #fffef9;
  --cream: #fffaf0;
  --green: #75639a;
  --green-dark: #49317c;
  --green-soft: #eee7f7;
  --berry: #d985a6;
  --berry-soft: #f8e3eb;
  --gold: #d3a84d;
  --blue-soft: #e7f4fb;
  --line: rgba(34, 48, 74, .14);
  --shadow: 0 14px 38px rgba(54, 60, 80, .13);
  font-family: ui-rounded, "Trebuchet MS", "Avenir Next Rounded", "Avenir Next", system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 14% 10%, rgba(243,191,209,.24), transparent 26rem), radial-gradient(circle at 92% 82%, rgba(185,218,237,.25), transparent 30rem), var(--cream); }
button, select { font: inherit; }
button { color: inherit; }
button:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid #75639a; outline-offset: 4px; }
.skip-link { position: fixed; z-index: 20; left: 12px; top: -80px; background: var(--ink); color: white; padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.noscript { margin: 30px auto; max-width: 42rem; padding: 18px; background: white; }
#app { min-height: 80vh; }
.game-header { max-width: 1180px; margin: 0 auto; padding: 18px clamp(18px, 4vw, 42px); display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.brand { border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; }
.brand span { display: block; font-size: clamp(1.2rem, 2vw, 1.55rem); font-weight: 900; letter-spacing: -.03em; }
.brand small, .progress-copy { color: var(--muted); font-weight: 700; }
.primary, .quiet, .text-button, .back { border: 0; border-radius: 999px; cursor: pointer; font-weight: 850; }
.primary { padding: 12px 19px; background: var(--green-dark); color: white; box-shadow: 0 5px 0 #31264e; }
.primary:hover { background: #5f4190; transform: translateY(-1px); }
.primary:active { box-shadow: 0 2px 0 var(--green-dark); transform: translateY(3px); }
.primary:disabled { opacity: .48; cursor: not-allowed; transform: none; box-shadow: none; }
.quiet { padding: 12px 17px; background: white; border: 1px solid var(--line); }
.text-button, .back { padding: 7px 0; background: transparent; color: var(--green-dark); text-decoration: underline; text-underline-offset: 3px; }
.eyebrow { margin: 0 0 7px; color: var(--green); font-size: .76rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: break-word; }
h1 { margin: 0 0 18px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.35rem, 6vw, 5.4rem); line-height: .98; letter-spacing: -.045em; }
h2 { margin: 0 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.55rem, 3vw, 2.5rem); letter-spacing: -.025em; }
h3 { margin: 0; font-size: 1.06rem; }
p { line-height: 1.58; }
.hero { max-width: 1180px; margin: 0 auto; padding: clamp(44px, 8vw, 92px) clamp(18px, 4vw, 42px); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); gap: clamp(34px, 8vw, 90px); align-items: center; }
.hero > div:first-child > p:not(.eyebrow) { max-width: 43rem; font-size: 1.13rem; }
.hero-actions, .debrief-actions, .run-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 25px; }
.noticeboard { min-height: 310px; padding: 34px; transform: rotate(1.5deg); display: grid; align-content: center; gap: 10px; border: 11px solid #a77352; border-radius: 7px; background: #f3dfa2; box-shadow: var(--shadow), inset 0 0 30px rgba(73,48,28,.11); }
.noticeboard span { font-size: .72rem; letter-spacing: .18em; font-weight: 900; }
.noticeboard b { width: fit-content; padding: 5px 10px; background: #fff9dd; box-shadow: 1px 2px 3px rgba(0,0,0,.12); font-size: 1.55rem; }
.noticeboard i { margin-top: 12px; font-family: Georgia, serif; font-size: 1.2rem; }
.episode-list { padding: 70px max(18px, calc((100vw - 1100px) / 2)); background: #eee7f7; }
.section-heading { margin-bottom: 24px; }
.episode-card { display: grid; grid-template-columns: minmax(220px, 34%) 1fr; overflow: hidden; margin: 0 0 24px; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: 0 10px 28px rgba(39,53,45,.07); }
.episode-card img { width: 100%; height: 100%; min-height: 300px; max-height: 390px; object-fit: cover; }
.episode-card > div { align-self: center; padding: clamp(24px, 5vw, 50px); }
.episode-card h2 { font-size: clamp(1.8rem, 4vw, 3.1rem); }
.episode-card.is-complete { border-color: rgba(53,101,74,.5); }
.explored { display: block; margin-top: 17px; color: var(--green); font-weight: 800; }
.privacy-note { max-width: 780px; margin: 70px auto; padding: 0 22px; text-align: center; }
.brief { max-width: 1120px; margin: 25px auto 80px; padding: 0 22px; display: grid; grid-template-columns: minmax(280px, .85fr) minmax(0, 1.15fr); gap: clamp(35px, 7vw, 80px); align-items: center; }
.cover-frame { padding: 14px; border-radius: 22px; background: white; box-shadow: var(--shadow); transform: rotate(-1deg); }
.cover-frame img { display: block; width: 100%; max-height: 650px; object-fit: contain; border-radius: 13px; }
.brief-copy .back { margin-bottom: 35px; }
.intro { max-width: 42rem; font-size: 1.15rem; }
.brief-rule { display: grid; grid-template-columns: auto 1fr; gap: 12px 18px; margin: 25px 0; padding: 18px; border-radius: 13px; background: var(--green-soft); }
.brief-rule b { color: var(--green-dark); }
.sources { max-width: 50rem; margin-top: 28px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.68); }
.sources summary { cursor: pointer; color: var(--green-dark); font-weight: 850; }
.sources ul { columns: 2; padding-left: 20px; }
.planner-intro, .people, .tasks, .day-stage, .debrief { max-width: 1160px; margin: 0 auto; padding: 35px 22px; }
.planner-intro { padding-top: 55px; }
.planner-intro h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); }
.planner-intro > p:last-child { max-width: 52rem; }
.people-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.person { min-width: 0; min-height: 140px; display: grid; grid-template-columns: 78px 1fr; gap: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.person-art { min-height: 100px; display: grid; place-items: end center; overflow: hidden; }
.person-art img { max-width: 100%; max-height: 112px; object-fit: contain; }
.person p { margin: 5px 0; font-size: .89rem; line-height: 1.4; }
.person small { color: var(--green-dark); font-weight: 850; }
.tasks { padding-bottom: 80px; }
.task-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.task-card { padding: clamp(19px, 3vw, 28px); border: 1px solid var(--line); border-radius: 19px; background: white; box-shadow: 0 9px 24px rgba(39,53,45,.06); }
.task-card header { display: flex; gap: 13px; align-items: center; }
.task-card header > span { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: white; font-weight: 900; }
.task-card header p { margin: 0; color: var(--green); font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.task-controls { display: grid; gap: 10px; margin-top: 20px; }
.task-controls label { display: grid; grid-template-columns: 105px 1fr; gap: 10px; align-items: center; font-size: .83rem; font-weight: 900; }
.task-controls select { min-width: 0; width: 100%; padding: 10px 34px 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); }
.approach-note { min-height: 55px; margin: 17px 0 0; padding: 12px; border-radius: 9px; background: var(--cream); color: var(--muted); font-size: .9rem; }
.approach-note span { display: block; color: var(--green-dark); font-weight: 800; }
.start-day { margin: 28px 0; padding: 23px; display: flex; justify-content: space-between; gap: 22px; align-items: center; border-radius: 17px; background: var(--ink); color: white; }
.start-day p { margin: 0; }
.time-track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 50px; }
.time-track span { padding: 9px; border-bottom: 5px solid #d4d8d1; color: var(--muted); font-size: .77rem; font-weight: 900; text-align: center; text-transform: uppercase; }
.time-track .past { border-color: var(--green); color: var(--green); }
.time-track .now { border-color: var(--gold); color: var(--ink); }
.day-stage h1 { font-size: clamp(3rem, 7vw, 5.6rem); }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.result { padding: 20px; border-radius: 16px; border: 1px solid var(--line); background: white; }
.result.done { border-top: 6px solid var(--green); }
.result.changed { border-top: 6px solid var(--gold); }
.result.deferred { border-top: 6px solid var(--berry); }
.result-label { margin: 0 0 7px; color: var(--muted); font-size: .7rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.result p:last-child { margin-bottom: 0; }
.quiet-result { border-style: dashed; }
.surprise { margin: 32px 0; padding: clamp(22px, 4vw, 38px); border-radius: 20px; background: var(--blue-soft); }
.surprise h2 { max-width: 54rem; }
.surprise-choices { display: grid; gap: 10px; }
.choice { padding: 14px 17px; border: 2px solid transparent; border-radius: 12px; background: white; cursor: pointer; text-align: left; font-weight: 750; }
.choice:hover { border-color: var(--green); }
.choice.selected { border-color: var(--green); background: var(--green-soft); }
.choice-result { margin-bottom: 0; font-weight: 750; }
.run-actions { justify-content: space-between; }
.debrief { max-width: 1040px; padding-bottom: 90px; }
.debrief h1 { max-width: 850px; }
.debrief-lead { max-width: 720px; font-size: 1.14rem; }
.debrief-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 45px 0; align-items: start; }
.debrief-groups section { display: grid; gap: 12px; }
.debrief-groups h2 { font-size: 1.45rem; }
.debrief-groups .result { min-height: 0; }
.debrief-groups > section:only-child { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.debrief-groups > section:only-child h2 { grid-column: 1 / -1; }
.change-review { padding: 26px; border-radius: 18px; background: var(--blue-soft); }
.how-dialog { width: min(630px, calc(100vw - 28px)); border: 0; border-radius: 20px; padding: 0; box-shadow: 0 30px 100px rgba(0,0,0,.3); }
.how-dialog::backdrop { background: rgba(25,35,29,.62); }
.how-dialog form { position: relative; padding: clamp(25px, 5vw, 44px); }
.how-dialog li { margin: 11px 0; line-height: 1.45; }
.dialog-close { position: absolute; right: 13px; top: 10px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--cream); cursor: pointer; font-size: 1.8rem; }

@media (max-width: 820px) {
  .hero, .brief { grid-template-columns: 1fr; }
  .noticeboard { min-height: 230px; }
  .episode-card { grid-template-columns: 1fr; }
  .episode-card img { max-height: 380px; object-position: center 28%; }
  .cover-frame { max-width: 520px; margin: auto; }
  .people-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-grid, .result-grid { grid-template-columns: 1fr; }
  .debrief-groups { grid-template-columns: 1fr; }
  .debrief-groups > section:only-child { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .game-header { align-items: flex-start; }
  .brand small { display: none; }
  .progress-copy { max-width: 9rem; font-size: .78rem; text-align: right; }
  .hero { padding-top: 35px; }
  .noticeboard { display: none; }
  .people-strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .person { flex: 0 0 87%; scroll-snap-align: start; }
  .task-controls label { grid-template-columns: 1fr; gap: 5px; }
  .start-day, .run-actions { align-items: stretch; flex-direction: column; }
  .start-day .primary, .run-actions button, .debrief-actions button { width: 100%; }
  .sources ul { columns: 1; }
  .brief-rule { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(15,25,19,.55); }
  .primary { outline: 2px solid var(--ink); }
}
