:root {
  color-scheme: dark;
  --bg: #0d1018;
  --surface: #161b27;
  --surface-raised: #202737;
  --line: #30394d;
  --text: #f4f1e9;
  --muted: #aaaebe;
  --gold: #e9bd68;
  --gold-dark: #342916;
  --danger: #ff8e8e;
  --success: #8dd9a4;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 70% -10%, #2a2137 0, transparent 38rem), var(--bg); color: var(--text); }
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 10; padding: .7rem 1rem; background: var(--gold); color: #16120b; }
.skip-link:focus { top: 1rem; }
.topbar { height: 74px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(1rem, 4vw, 4rem); border-bottom: 1px solid var(--line); background: rgb(13 16 24 / 80%); backdrop-filter: blur(14px); }
.brand { display: flex; gap: .7rem; align-items: center; border: 0; background: none; color: var(--text); font-weight: 750; font-size: 1.1rem; cursor: pointer; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font-family: Georgia, serif; }
main { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; min-height: calc(100vh - 140px); }
.hero { max-width: 720px; padding: clamp(4rem, 10vw, 8rem) 0 3rem; }
.hero h1, .game-heading h1 { margin: .2rem 0 .9rem; font-family: Georgia, "Times New Roman", serif; font-weight: 500; line-height: 1.05; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 5.5rem); }
.hero > p:last-child { color: var(--muted); font-size: 1.1rem; line-height: 1.7; }
.eyebrow { margin: 0 0 .5rem; color: var(--gold); font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.adventure-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 1.2rem; padding-bottom: 5rem; }
.adventure-card { display: flex; flex-direction: column; min-height: 270px; padding: 1.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, var(--surface-raised), var(--surface)); box-shadow: 0 22px 60px rgb(0 0 0 / 18%); }
.adventure-card h2 { margin: .5rem 0 .8rem; font-family: Georgia, serif; font-size: 1.7rem; }
.adventure-card p { flex: 1; color: var(--muted); line-height: 1.65; }
.button { min-height: 44px; padding: .72rem 1rem; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-weight: 750; transition: transform .15s, background .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .65; }
.button-primary { background: var(--gold); color: #19140c; }
.button-ghost { border-color: var(--line); background: transparent; color: var(--text); }
.notice { margin: 1rem 0; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); line-height: 1.5; }
.notice.error { border-color: #7a3c45; color: #ffd4d4; }
.notice.success { border-color: #316747; color: #cef3d9; }
.loading-panel { display: flex; gap: .8rem; align-items: center; padding: 1.2rem; color: var(--muted); }
.spinner { width: 20px; height: 20px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.game-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 3rem 0 2rem; }
.game-heading h1 { font-size: clamp(2rem, 5vw, 3.3rem); }
.game-layout { display: grid; grid-template-columns: minmax(220px, 310px) 1fr; gap: 1.5rem; padding-bottom: 5rem; }
.status-panel, .story-panel { border: 1px solid var(--line); border-radius: var(--radius); background: rgb(22 27 39 / 92%); }
.status-panel { padding: 1.4rem; align-self: start; }
.stat-life { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.stat-life strong { color: var(--gold); font-size: 2.1rem; }
.stat-label, dt { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.facts { margin: 0; }
.facts > div { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
dd { margin: 0; text-align: right; }
.status-panel h2 { margin: 1.5rem 0 .7rem; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; }
.compact-list, .objective-list { margin: 0; padding: 0; list-style: none; color: var(--muted); }
.compact-list li, .objective-list li { padding: .42rem 0; }
.objective-list li { display: grid; grid-template-columns: 20px 1fr; gap: .5rem; }
.objective-list .complete { color: var(--success); }
.status-badge { display: inline-block; padding: .2rem .5rem; border-radius: 999px; background: var(--gold-dark); color: var(--gold); font-size: .75rem; font-weight: 800; }
.story-panel { padding: clamp(1.4rem, 5vw, 3.5rem); }
.mission-panel { margin: 0 0 2.2rem; padding: clamp(1.2rem, 3vw, 1.8rem); border: 1px solid #8c6b31; border-radius: 14px; background: linear-gradient(135deg, #2c2418, #211e1c); box-shadow: inset 0 1px rgb(255 255 255 / 4%); }
.mission-panel-highlight { border-color: var(--gold); box-shadow: 0 0 0 3px rgb(233 189 104 / 10%), 0 18px 45px rgb(0 0 0 / 18%); }
.mission-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.mission-header h2 { margin: .15rem 0 0; font-family: Georgia, serif; font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.2; }
.mission-toggle { flex: 0 0 auto; min-height: 40px; padding: .55rem .75rem; border-color: #7e673e; background: rgb(13 16 24 / 35%); color: var(--gold); font-size: .84rem; }
.mission-briefing { max-width: 68ch; margin: 1.2rem 0; color: #ebe3d4; font-size: 1.06rem; line-height: 1.7; }
.mission-panel h3 { margin: 1.2rem 0 .65rem; color: var(--gold); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.mission-goals { display: grid; gap: .65rem; margin: 0; padding: 0; list-style: none; }
.mission-goals li { display: grid; grid-template-columns: 24px 1fr; align-items: start; line-height: 1.5; }
.mission-goals .complete { color: var(--success); text-decoration: line-through; text-decoration-color: rgb(141 217 164 / 55%); }
.mission-goal-mark { color: var(--gold); font-weight: 800; }
.narrative { max-width: 72ch; white-space: pre-line; font-family: Georgia, serif; font-size: clamp(1.15rem, 2vw, 1.35rem); line-height: 1.85; }
.choices { display: grid; gap: .75rem; }
#choices-title { margin-top: 2.5rem; font-size: 1rem; }
.choice-button { width: 100%; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); color: var(--text); text-align: left; cursor: pointer; line-height: 1.45; }
.choice-button:hover:not(:disabled) { border-color: var(--gold); background: #2a2c38; }
.choice-button:disabled { cursor: wait; opacity: .55; }
.ending { margin-top: 2rem; padding: 1.2rem; border: 1px solid var(--gold); border-radius: 12px; background: var(--gold-dark); }
.ending h2 { margin: 0 0 .4rem; font-family: Georgia, serif; }
.empty-state { grid-column: 1 / -1; padding: 2rem; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
footer { padding: 2rem; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: .85rem; }
@media (max-width: 720px) {
  .game-layout { grid-template-columns: 1fr; }
  .status-panel { order: 2; }
  .story-panel { order: 1; }
  .game-heading { align-items: flex-start; }
  .game-heading .button { white-space: nowrap; }
  .mission-header { display: grid; }
  .mission-toggle { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition: none !important; } }
