:root {
  color-scheme: dark;
  --bg: #07100c;
  --panel: #0d1913;
  --panel-2: #132219;
  --line: rgba(223, 193, 116, .18);
  --gold: #dfc174;
  --gold-2: #9f8243;
  --text: #edf2e9;
  --muted: #9aa99d;
  --green: #65c68a;
  --blue: #79add9;
  --red: #e77b72;
  --orange: #d9a15f;
  --radius: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% -10%, rgba(74, 127, 79, .18), transparent 32rem),
    linear-gradient(180deg, #09130e 0, var(--bg) 24rem);
  color: var(--text);
  font: 15px/1.7 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

a { color: var(--gold); }
button { font: inherit; }
.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 12, .88);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(223, 193, 116, .55);
  border-radius: 10px 4px 10px 4px;
  background: linear-gradient(145deg, #2c3d28, #101b14);
  color: var(--gold);
  font: 700 20px Georgia, serif;
  box-shadow: inset 0 0 18px rgba(223, 193, 116, .08);
}
.brand strong { display: block; color: var(--gold); font: 700 14px/1.1 Georgia, serif; letter-spacing: .17em; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; letter-spacing: .16em; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.live-dot { color: var(--muted); font-size: 12px; }
.live-dot i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.menu-button, #closeMenu { display: none; border: 0; background: transparent; color: var(--text); font-size: 24px; }

.layout { display: grid; grid-template-columns: 250px minmax(0, 920px); justify-content: center; gap: 48px; padding: 34px 28px 90px; }
.sidebar { position: sticky; top: 102px; align-self: start; max-height: calc(100vh - 120px); overflow: auto; }
.sidebar-head { display: flex; justify-content: space-between; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
#toc { margin-top: 12px; border-left: 1px solid var(--line); }
#toc a { display: block; padding: 7px 12px; border-left: 2px solid transparent; color: var(--muted); font-size: 12px; line-height: 1.4; text-decoration: none; }
#toc a:hover, #toc a.active { border-left-color: var(--gold); color: var(--text); background: linear-gradient(90deg, rgba(223, 193, 116, .09), transparent); }
#toc a.sub { padding-left: 24px; font-size: 11px; }
.back-game { display: inline-block; margin: 22px 0 0 13px; color: var(--muted); font-size: 12px; text-decoration: none; }

main { min-width: 0; }
.hero { padding: 28px 0 36px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 8px; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .19em; }
.hero h1 { margin: 0; font: 600 clamp(34px, 6vw, 56px)/1.05 Georgia, serif; letter-spacing: -.025em; }
.hero > p:not(.eyebrow) { max-width: 660px; margin: 15px 0 0; color: var(--muted); font-size: 16px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 28px; }
.summary-grid article { min-height: 94px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(145deg, rgba(20, 36, 26, .9), rgba(10, 20, 14, .9)); }
.summary-grid article { min-width: 0; }
.summary-grid span { display: block; color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.summary-grid strong { display: block; margin-top: 8px; color: var(--text); font-size: 14px; line-height: 1.35; }
.summary-grid strong { overflow-wrap: anywhere; }

.loading { display: grid; min-height: 42vh; place-items: center; align-content: center; color: var(--muted); }
.rune { width: 36px; height: 36px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.roadmap { padding-top: 18px; }
.roadmap h1 { display: none; }
.roadmap h2 { margin: 48px 0 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--gold); font: 600 25px/1.25 Georgia, serif; }
.roadmap h3 { margin: 35px 0 14px; color: var(--text); font: 600 19px/1.35 Georgia, serif; }
.roadmap h4 { margin: 26px 0 8px; color: var(--gold); }
.roadmap p { margin: 10px 0; color: #d7ded6; }
.roadmap ul, .roadmap ol { margin: 10px 0; padding-left: 23px; }
.roadmap li { margin: 5px 0; color: #d2dbd2; }
.roadmap code { padding: 2px 6px; border: 1px solid rgba(223, 193, 116, .14); border-radius: 5px; background: #101b14; color: #e9cd89; font: 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.roadmap blockquote { margin: 18px 0; padding: 12px 17px; border-left: 3px solid var(--gold-2); background: rgba(223, 193, 116, .06); color: var(--muted); }
.roadmap table { width: 100%; margin: 16px 0 24px; border-spacing: 0; border-collapse: separate; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 12px; }
.roadmap th { background: var(--panel-2); color: var(--gold); text-align: left; }
.roadmap th, .roadmap td { padding: 10px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: top; }
.roadmap tr:last-child td { border-bottom: 0; }
.roadmap th:last-child, .roadmap td:last-child { border-right: 0; }
.roadmap input[type="checkbox"] { accent-color: var(--green); }
.status { display: inline-flex; align-items: center; padding: 2px 7px; border: 1px solid currentColor; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.status.done { color: var(--green); }
.status.progress, .status.validating { color: var(--blue); }
.status.planned, .status.paused { color: var(--muted); }
.status.blocked { color: var(--red); }
.status.question, .status.observation { color: var(--orange); }
.error { margin-top: 32px; padding: 28px; border: 1px solid rgba(231, 123, 114, .35); border-radius: var(--radius); background: rgba(104, 35, 31, .15); }
.error button { padding: 9px 14px; border: 1px solid var(--gold-2); border-radius: 9px; background: var(--panel-2); color: var(--text); }

@media (max-width: 900px) {
  .layout { width: 100%; max-width: 100%; grid-template-columns: minmax(0, 1fr); padding: 18px 18px 70px; }
  main, .hero, .roadmap { width: 100%; max-width: 100%; min-width: 0; }
  .sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(82vw, 320px); max-height: none; padding: 24px; transform: translateX(-105%); background: #0b1610; transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-head { margin-bottom: 18px; }
  #closeMenu, .menu-button { display: block; cursor: pointer; }
  .scrim { position: fixed; z-index: 30; inset: 0; background: rgba(0, 0, 0, .62); }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .roadmap table { display: block; overflow-x: auto; white-space: normal; }
  .roadmap table { width: 100%; max-width: 100%; }
  .roadmap p, .roadmap li, .roadmap h2, .roadmap h3, .roadmap td { overflow-wrap: anywhere; }
  .live-dot { display: none; }
}

@media (max-width: 520px) {
  .topbar { height: 62px; }
  .layout { padding-inline: 15px; }
  .hero { padding-top: 18px; }
  .summary-grid { gap: 8px; }
  .summary-grid article { min-height: 87px; padding: 12px; }
  .roadmap h2 { margin-top: 38px; font-size: 22px; }
  .roadmap h3 { font-size: 18px; }
  .roadmap th, .roadmap td { min-width: 120px; padding: 9px; }
}
