:root {
  --bg: #0b0f14;
  --ink: #f3f5f7;
  --muted: #93a0ad;
  --line: rgba(255, 255, 255, 0.09);
  --tile: #161d26;
  --glass: rgba(18, 24, 32, 0.82);
  --live: #7bfa5f;
  --radius: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 70% -10%, #18222e 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1;
}
a { color: var(--ink); text-underline-offset: 3px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 10px; }
.skip:focus { left: 12px; z-index: 10; }

.top, main, footer { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
h1 { margin: 0; font-size: 26px; letter-spacing: -0.02em; font-weight: 750; }
h1 span { color: var(--muted); font-weight: 500; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 0 rgba(123, 250, 95, 0.6); }
.dot.ok { background: var(--live); animation: pulse 2.4s infinite; }
.dot.warn { background: #ff9900; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(123, 250, 95, 0.55); } 70% { box-shadow: 0 0 0 10px rgba(123, 250, 95, 0); } 100% { box-shadow: 0 0 0 0 rgba(123, 250, 95, 0); } }
@media (prefers-reduced-motion: reduce) { .dot.ok { animation: none; } }
.status { margin: 0; color: var(--muted); font-size: 14px; }

.hero { padding: 28px 0 8px; }
.strap { margin: 0; font-size: clamp(24px, 4vw, 44px); line-height: 1.08; letter-spacing: -0.025em; font-weight: 700; max-width: 820px; }
.summary { margin: 14px 0 0; color: var(--muted); font-size: 16px; min-height: 24px; }

.stage { position: relative; margin-top: 18px; }
.map { position: relative; border-radius: var(--radius); border: 1px solid var(--line); background: radial-gradient(800px 300px at 50% 60%, rgba(120, 170, 255, 0.06), rgba(255,255,255,0)); overflow: hidden; min-height: 200px; }
.map svg { display: block; width: 100%; height: auto; touch-action: pan-x pan-y; }
.map .r { stroke: rgba(11, 15, 20, 0.85); stroke-width: 0.6; transition: filter 0.15s, opacity 0.15s; cursor: pointer; outline: none; }
.map .r.none { fill: var(--tile); stroke: rgba(255, 255, 255, 0.07); }
.map .r:hover, .map .r:focus-visible { filter: brightness(1.18); stroke: #fff; stroke-width: 1.2; }
.map .r.on { stroke: #fff; stroke-width: 2.2; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.55)); }
.map .loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.plain { padding: 24px; color: var(--muted); }
.hint { display: none; margin: 8px 4px 0; color: var(--muted); font-size: 13px; }

.stage.open { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
.panel { position: relative; background: var(--glass); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); }
.panel h2 { margin: 0 34px 12px 0; font-size: 19px; line-height: 1.25; letter-spacing: -0.01em; }
.panel .close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--ink); font-size: 22px; cursor: pointer; }
.panel .close:hover { background: rgba(255,255,255,0.08); }
.level { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.chip { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-size: 34px; font-weight: 800; color: #0b0f14; flex: none; }
.chip.five { background-image: repeating-conic-gradient(#ff0000 0 25%, #111 0 50%) !important; background-size: 16px 16px; color: #fff; text-shadow: 0 1px 2px #000; }
.chip.grey { background: var(--tile); color: var(--muted); border: 1px solid var(--line); font-size: 26px; }
.level .name { font-size: 24px; font-weight: 750; line-height: 1.1; }
.level .sub { color: var(--muted); font-size: 14px; }
.panel ul { margin: 0 0 12px; padding-left: 18px; }
.panel .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.panel .tags li { border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 13px; color: var(--ink); }
.panel .meta { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.panel .go { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 999px; background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 650; margin: 4px 0 10px; }
.panel .credit { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.panel .credit a { color: var(--muted); }
.panel .sos { display: grid; gap: 8px; margin: 12px 0; }
.panel .sos a { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 16px; border-radius: 14px; background: rgba(255, 60, 60, 0.14); border: 1px solid rgba(255, 90, 90, 0.35); text-decoration: none; font-weight: 650; }
.panel .sos a b { font-size: 22px; }
.panel .small { font-size: 13px; color: var(--muted); margin: 0; }

.tools { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 320px; }
.search input { width: 100%; min-height: 52px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); color: var(--ink); padding: 0 20px; font: inherit; }
.search input:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
.results { position: absolute; z-index: 5; left: 0; right: 0; top: 58px; margin: 0; padding: 6px; list-style: none; background: #121922; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 40px rgba(0,0,0,0.5); }
.results li { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; cursor: pointer; }
.results li:hover, .results li[aria-selected="true"] { background: rgba(255,255,255,0.07); }
.results i { width: 14px; height: 14px; border-radius: 4px; flex: none; background: var(--tile); border: 1px solid var(--line); }
.locate { min-height: 52px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--ink); background: transparent; color: var(--ink); font: inherit; font-weight: 650; cursor: pointer; }
.locate:hover { background: rgba(255,255,255,0.06); }

.key ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.key li { display: flex; align-items: center; gap: 8px; }
.key i { width: 16px; height: 16px; border-radius: 5px; display: inline-block; }
.l1 { background: #ccff66; } .l2 { background: #ffff00; } .l3 { background: #ff9900; } .l4 { background: #ff0000; }
.l5 { background-image: repeating-conic-gradient(#ff0000 0 25%, #111 0 50%); background-size: 8px 8px; }
.none { background: var(--tile); border: 1px solid var(--line); }

.notes { margin-top: 26px; display: grid; gap: 6px; color: var(--ink); max-width: 760px; }
.notes p { margin: 0; }
.sources { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); }
.sources h2 { font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; font-weight: 650; }
.sources ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.sources li { font-size: 15px; }
.sources li span { color: var(--muted); }
.elsewhere { color: var(--muted); font-size: 15px; }
.elsewhere a { color: var(--muted); }

footer { padding-top: 26px; padding-bottom: 48px; margin-top: 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer p { margin: 0 0 8px; }
footer .sos { color: var(--ink); font-size: 16px; font-weight: 600; }
footer .sos a { font-size: 18px; }
.sponsor { margin: 16px 0; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 14px; color: var(--ink); }
.made a { color: var(--muted); }

@media (max-width: 900px) {
  .stage.open { display: block; }
  .panel { margin-top: 12px; }
  .map { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .map::-webkit-scrollbar { display: none; }
  .map svg { width: 900px; max-width: none; }
  .hint { display: block; }
}
