:root {
  color-scheme: dark;
  --ink: #ede9da;
  --muted: #a3b5ac;
  --line: #a7c3ae29;
  --gold: #ead0a1;
  --sage: #b7cfb3;
  --night: #0c1616;
  --panel: #142220;
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse at 45% -24%, #293a31, transparent 66%), var(--night); color: var(--ink); }
button { color: inherit; font: inherit; cursor: pointer; }
button:focus-visible, .map:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
button:disabled { cursor: default; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.symbols { position: absolute; width: 0; height: 0; }
.masthead { height: 75px; padding: 0 clamp(18px, 4vw, 62px); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.brand, .header-tools { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #e4c89b4d; border-radius: 13px; color: var(--gold); background: #e9d1a915; }
.brand-mark svg { width: 18px; height: 18px; fill: #e7cb9e30; }
.brand strong { display: block; letter-spacing: .15em; font-size: 16px; }
.brand span { display: block; color: var(--muted); font: 12px/1.3 Georgia, serif; }
.icon-button, .timer-button, .presence { height: 44px; background: #172823; border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.icon-button { width: 44px; }
.timer-button { padding: 0 11px; color: #d3ddd1; font-size: 13px; }
.timer-button svg { width: 16px; height: 16px; }
.timer-wrap { position: relative; }
.timer-menu { position: absolute; z-index: 8; top: 52px; right: 0; width: 140px; background: #20332d; border: 1px solid var(--line); border-radius: 12px; padding: 5px; box-shadow: 0 12px 30px #0006; }
.timer-menu button { display: block; width: 100%; min-height: 44px; text-align: left; background: none; border: 0; padding: 0 10px; border-radius: 7px; }
.timer-menu button:hover, .icon-button:hover, .timer-button:hover { background: #263c34; }
.presence { padding: 0 13px; min-width: 110px; font-size: 13px; color: #d6e4d0; font-variant-numeric: tabular-nums; }
.presence i, .availability i { width: 7px; height: 7px; border-radius: 50%; background: #9ccea2; box-shadow: 0 0 10px #a5e0a252; }
.presence[data-state="offline"] i { background: #d4a474; }
.shell { margin: auto; max-width: 1660px; padding: 24px clamp(18px, 4vw, 62px) 0; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.eyebrow { display: flex; align-items: center; gap: 7px; color: #c8d7c1; font-size: 12px; letter-spacing: .12em; }
.eyebrow svg { width: 16px; height: 16px; color: #a2bdac; }
h1 { font: 400 clamp(24px, 3.1vw, 43px)/1.25 "Songti SC", "Noto Serif CJK SC", serif; letter-spacing: .035em; margin: 8px 0 0; }
h1 em { font-style: normal; }
.intro p { margin: 0 0 3px; color: #bac9bc; font-size: 13px; line-height: 1.8; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: stretch; }
.map { height: clamp(510px, 68vh, 780px); isolation: isolate; overflow: hidden; position: relative; border: 1px solid #849f8c50; border-radius: 16px; background: radial-gradient(ellipse at 45% 48%, #2e4944, #152625 72%); }
.scene, .map-labels { position: absolute; inset: 0; }
.scene { touch-action: pan-y; cursor: grab; user-select: none; }
.scene.is-dragging { cursor: grabbing; }
.scene canvas { display: block; width: 100%; height: 100%; }
.map-labels { pointer-events: none; }
.map-title, .view-tools, .north, .map-help, .zoom, .notice, .map-rest { position: absolute; z-index: 1; }
.map-title { top: 14px; left: 14px; display: flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #13211eea; color: #dbe7d6; font-size: 12px; }
.map-title svg { width: 16px; height: 16px; }
.view-tools { top: 14px; right: 14px; display: flex; gap: 6px; }
.view-tools button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px; background: #13211eeb; }
.view-tools button:hover:not(:disabled) { background: #263c34; }
.view-tools button:disabled { opacity: .45; }
.north { top: 68px; right: 14px; width: 38px; height: 42px; text-align: center; color: #e9d5ae; line-height: 1; pointer-events: none; }
.north b { font-size: 11px; font-weight: 400; }
.north span { display: block; font-size: 21px; }
.map-help { left: 14px; bottom: 14px; max-width: calc(100% - 119px); border: 1px solid var(--line); border-radius: 8px; background: #13211eeb; padding: 9px 10px; color: #d4dfd2; font-size: 12px; }
.touch-only { display: none; }
.zoom { right: 14px; bottom: 14px; display: flex; border: 1px solid var(--line); border-radius: 8px; background: #13211eeb; }
.zoom button { width: 43px; height: 43px; border: 0; background: none; font-size: 22px; }
.zoom button + button { border-left: 1px solid var(--line); }
.zoom button:disabled { opacity: .38; }
.zone-label, .player-label, .entrance-label { position: absolute; transform: translate(-50%, -100%); white-space: nowrap; text-shadow: 0 1px 3px #000; }
.zone-label { padding: 3px 8px; border-radius: 5px; border: 1px solid #b5cbbb42; background: #13211de6; color: #e4eee0; font-size: 11px; letter-spacing: .06em; }
.zone-label.selected { border-color: #f3d7a3; color: #ffe2ad; background: #354137; }
.entrance-label { font-size: 11px; color: #ffdfae; }
.player-label { border: 1px solid #e1d2a5; border-radius: 20px; padding: 1px 7px; background: #233b33; font-size: 11px; color: #fff4d9; }
.notice, .map-rest { left: 50%; transform: translateX(-50%); border: 1px solid #e7cc9960; border-radius: 9px; box-shadow: 0 5px 16px #0005; }
.notice { top: 66px; padding: 8px 12px; max-width: calc(100% - 114px); width: max-content; background: #1e2c25f5; font-size: 13px; }
.map-rest { bottom: 69px; min-height: 44px; padding: 0 13px; display: flex; align-items: center; gap: 7px; background: #ead0a1; color: #252c24; font-weight: 650; white-space: nowrap; }
.map-rest svg { width: 17px; height: 17px; }
.map-join { display: none; }
.map-join:disabled { opacity: .7; }
.map[data-expanded] { position: fixed; inset: 0; z-index: 30; }
.map:is(:fullscreen, [data-expanded]) { width: 100%; height: 100%; height: 100dvh; border: 0; border-radius: 0; }
.map:is(:fullscreen, [data-expanded]) .scene { touch-action: none; }
.map:is(:fullscreen, [data-expanded]) .map-join { display: flex; }
.map:is(:fullscreen, [data-expanded]) .inline-view-hint { display: none; }
body.map-expanded { overflow: hidden; }
.map-error { position: absolute; inset: 48% 15% auto; text-align: center; color: var(--ink); }
.guide { background: linear-gradient(160deg, #1a2b26, #13221e 65%); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; }
.guide-head { display: flex; gap: 11px; align-items: center; }
.guide-icon, .journey-icon { display: grid; place-items: center; flex: none; background: #b1cfaa18; border: 1px solid #c1d7b829; border-radius: 9px; color: #ceddc2; width: 40px; height: 40px; }
.guide h2 { margin: 0; font: 400 20px/1.2 "Songti SC", "Noto Serif CJK SC", serif; letter-spacing: .08em; }
.guide-head p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.availability { border-block: 1px solid var(--line); display: flex; align-items: center; gap: 10px; margin: 16px 0 5px; padding: 8px 0; color: var(--muted); font-size: 11px; }
.availability span { display: flex; align-items: center; gap: 5px; }
.availability span:nth-child(2) i { background: #c68d76; box-shadow: none; }
.availability strong { margin-left: auto; color: #dce8d8; font-weight: 500; font-variant-numeric: tabular-nums; }
.zones { display: grid; }
.zone { display: flex; width: 100%; min-height: 48px; align-items: center; gap: 8px; padding: 5px 4px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.zone:hover, .zone[aria-pressed="true"] { background: #bfd8ad0e; }
.zone .number { color: var(--zone); font: 12px/1 Georgia, serif; width: 24px; text-align: center; }
.zone .name { flex: 1; font-size: 14px; }
.zone .direction { color: var(--muted); font-size: 11px; }
.zone .free { min-width: 36px; text-align: right; color: #c6dfc3; font-variant-numeric: tabular-nums; font-size: 12px; }
.journey { display: flex; gap: 9px; padding: 12px 0; margin-top: auto; }
.journey-icon { width: 30px; height: 30px; border-radius: 7px; }
.journey-icon svg { width: 17px; height: 17px; }
.journey strong { display: block; font-size: 13px; }
.journey p { margin: 3px 0 0; font-size: 12px; color: #b6c5b8; min-height: 36px; }
.primary { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 13px; border: 1px solid #ebd3ad; border-radius: 9px; color: #292d23; background: #e8cfa5; font-weight: 650; }
.primary:hover:not(:disabled), .map-rest:hover { background: #f5ddb2; }
.primary:disabled { opacity: .65; }
.leave { margin-top: 5px; min-height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.leave:hover { color: var(--ink); }
.page-footer { padding: 12px 0 15px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }
.page-footer span:first-child { display: flex; gap: 6px; align-items: center; }
.page-footer svg { width: 12px; height: 12px; color: #cdb78e; }
@media (max-width: 850px) {
  .layout { grid-template-columns: minmax(0, 1fr) 245px; gap: 10px; }
  .guide { padding: 13px; }
  .intro p { max-width: 220px; }
}
@media (max-width: 680px) {
  .masthead { padding-inline: 12px; height: 64px; }
  .brand, .header-tools { gap: 6px; }
  .brand-mark { width: 33px; height: 33px; }
  .brand strong { font-size: 13px; }
  .brand span { font-size: 10px; }
  .presence { min-width: auto; padding: 0 6px; font-size: 11px; }
  .timer-button { font-size: 11px; padding: 0 6px; gap: 3px; }
  .shell { padding: 15px 10px 0; }
  .intro { padding-inline: 3px; margin-bottom: 12px; display: block; }
  .intro p { margin: 5px 0 0; max-width: none; font-size: 12px; }
  .intro p br { display: none; }
  .layout { display: flex; flex-direction: column; }
  .map { height: clamp(365px, 54svh, 550px); }
  .map-join { display: flex; }
  .map-title { top: 8px; left: 8px; }
  .map-help { left: 8px; bottom: 8px; }
  .zoom { right: 8px; bottom: 8px; }
  .view-tools { top: 8px; right: 8px; }
  .north { top: 60px; right: 8px; }
  .notice { top: 60px; max-width: calc(100% - 96px); }
  .guide { padding: 14px; }
}
@media (pointer: coarse) { .keyboard-only { display: none; } .touch-only { display: inline; } }
body::after, .map:is(:fullscreen, [data-expanded])::after { content: ""; position: fixed; inset: 0; z-index: 20; background: #050907; opacity: 0; pointer-events: none; transition: opacity 2s ease; }
body.resting-dark::after, body.resting-dark .map:is(:fullscreen, [data-expanded])::after { opacity: .72; }
@media (prefers-reduced-motion: reduce) { body::after, .map:is(:fullscreen, [data-expanded])::after { transition: none; } }
