/* The terminal (/terminal): the site as an airport you walk around.
   This page does not load styles.css, so the four palettes are repeated here.
   Keep them in step with :root[data-theme=...] in styles.css. */
:root {
  --bg: #061a1f; --bg-2: #0a242a; --panel: #0e2c33; --panel-2: #12363e; --line: #1f4a52;
  --text: #e6f6f3; --text-2: #c3dcd7; --muted: #86aaa4;
  --accent: #2dd4bf; --accent-2: #fb7185; --on-accent: #04201c; --ok: #4ade80; --glow: #0f4c55;
  --route-ahead: #86aaa4; --route-flown: #2dd4bf; --plane: #fde68a; --plane-stroke: #04201c;
  --map-style: dark_all;
  --radius: 16px;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;

  /* The floor plan, derived from the palette so every theme gets one. */
  --field: color-mix(in srgb, var(--bg) 86%, #000); --apron: var(--bg-2); --runway: color-mix(in srgb, var(--bg) 45%, #000);
  --mark: var(--muted); --floor: var(--panel); --hall: var(--bg-2); --room: var(--panel-2);
  --wall: color-mix(in srgb, var(--line) 55%, var(--muted)); --npc: var(--muted); --jet: var(--text-2);
  --gold: #fde68a; --on-gold: #2a2204; --gold-text: #fde68a;
  --sign: color-mix(in srgb, var(--bg) 45%, #000); --sign-text: #eef6f5; --shadow: rgba(0, 0, 0, .35);
}
:root[data-theme="sunset"] {
  --bg: #170c1c; --bg-2: #211126; --panel: #2a1631; --panel-2: #341b3c; --line: #4a2a53;
  --text: #fdf0f6; --text-2: #e7cfe0; --muted: #b996b3;
  --accent: #ffa94d; --accent-2: #ff4f8b; --on-accent: #2a0d12; --ok: #7ee2a8; --glow: #4a1f4f;
  --route-ahead: #b996b3; --route-flown: #ffa94d; --plane: #ffe3b3; --plane-stroke: #2a0d12;
  --map-style: dark_all; color-scheme: dark;
}
:root[data-theme="daylight"] {
  --bg: #eef3fa; --bg-2: #ffffff; --panel: #ffffff; --panel-2: #f2f6fc; --line: #d7e0ee;
  --text: #13213b; --text-2: #34445f; --muted: #5d6f8f;
  --accent: #2563eb; --accent-2: #f97316; --on-accent: #ffffff; --ok: #15803d; --glow: #cfe0ff;
  --route-ahead: #64748b; --route-flown: #2563eb; --plane: #f97316; --plane-stroke: #ffffff;
  --map-style: voyager; color-scheme: light;
  --field: #dce7f4; --apron: #cbd9ea; --runway: #56657e; --mark: #eef3fa; --floor: #f8fbff; --hall: #edf3fb;
  --room: #e3ecf9; --wall: #9fb3d1; --gold: #fbbf24; --gold-text: #a16207; --sign: #13213b; --shadow: rgba(19, 33, 59, .18);
}
:root[data-theme="midnight"] {
  --bg: #0b1020; --bg-2: #111832; --panel: #141c3a; --panel-2: #1a2347; --line: #26305a;
  --text: #e8ecf8; --text-2: #c8cfe8; --muted: #8f9bc4;
  --accent: #ffb547; --accent-2: #ff5f6d; --on-accent: #1a1020; --ok: #3ddc97; --glow: #1b2552;
  --route-ahead: #8f9bc4; --route-flown: #ffb547; --plane: #ffb547; --plane-stroke: #1a1020;
  --map-style: dark_all; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
[hidden] { display: none !important; }
body {
  background: radial-gradient(1100px 520px at 85% -10%, var(--glow) 0%, transparent 60%), var(--bg);
  color: var(--text); font: 16px/1.5 var(--sans); min-height: 100vh;
  padding: 14px max(16px, env(safe-area-inset-right, 0px)) 28px max(16px, env(safe-area-inset-left, 0px));
}
.wrap { max-width: 1640px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.mono { font-family: var(--mono); }
a { color: var(--accent); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.top-left, .top-right { display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 23px; font-weight: 600; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.brand .logo { width: 32px; height: 32px; flex: none; }
.logo-a { stop-color: var(--accent); } .logo-b { stop-color: var(--accent-2); } .logo-dial { stroke: var(--line); }
.brand b { font-weight: 700; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tag { font: 700 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.classic { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap;
  padding: 9px 16px; border-radius: 999px; color: var(--on-gold);
  background: linear-gradient(90deg, var(--gold), color-mix(in srgb, var(--accent-2) 75%, var(--gold)));
  box-shadow: 0 6px 18px -8px var(--accent-2); transition: transform .15s, box-shadow .15s; }
.classic svg { width: 16px; height: 16px; transform: scaleX(-1); transition: transform .3s; }
.classic:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -8px var(--accent-2); }
.classic:hover svg { transform: scaleX(-1) translateX(3px); }
.tip { font-weight: 600; font-size: 14px; color: var(--text); padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 80%, transparent); white-space: nowrap; text-decoration: none; }
.tip:hover { border-color: var(--accent); }
.clock { font: 700 15px var(--mono); color: var(--gold-text); font-variant-numeric: tabular-nums; }
.themes { display: flex; gap: 6px; align-items: center; padding: 5px 6px; border-radius: 999px; background: color-mix(in srgb, var(--panel) 80%, transparent); border: 1px solid var(--line); }
.themes button { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.themes button[aria-pressed="true"] { border-color: var(--bg); box-shadow: 0 0 0 2px var(--accent); }
.themes [data-t="aurora"] { background: linear-gradient(135deg, #0e2c33 50%, #2dd4bf 50%); }
.themes [data-t="sunset"] { background: linear-gradient(135deg, #2a1631 50%, #ffa94d 50%); }
.themes [data-t="daylight"] { background: linear-gradient(135deg, #ffffff 50%, #2563eb 50%); }
.themes [data-t="midnight"] { background: linear-gradient(135deg, #141c3a 50%, #ffb547 50%); }
.spin {
  border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 700; text-decoration: none; display: inline-block; text-align: center;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--accent-2)));
  color: var(--on-accent); box-shadow: 0 6px 18px -8px var(--accent); transition: transform .15s;
}
.spin:hover { transform: translateY(-1px); }
.spin:disabled { filter: grayscale(.6) brightness(.85); cursor: progress; transform: none; }
.spin.big { width: 100%; padding: 14px 18px; font-size: 17px; }
.spin-top { display: inline-flex; align-items: center; gap: 6px; }
.spin-top svg { width: 15px; height: 15px; }

/* Roulette wheel, as on the classic home page (keep in step with styles.css). */
.spin-desk { display: flex; align-items: center; gap: 16px; }
.spin-desk .result { flex: 1; min-width: 0; }
.spin-wheel { position: relative; width: 140px; height: 140px; flex-shrink: 0; border: 0; padding: 0; margin-top: 8px; border-radius: 50%; cursor: pointer; background: none; color: var(--on-accent);
  filter: drop-shadow(0 12px 24px color-mix(in srgb, var(--accent-2) 45%, transparent)); transition: transform .15s ease; }
.spin-wheel:hover { transform: translateY(-2px); }
.spin-wheel:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; }
.spin-wheel:disabled { cursor: progress; }
.wheel-ring { position: absolute; inset: 0; border-radius: 50%;
  background: repeating-conic-gradient(from -15deg, var(--accent) 0 30deg, var(--panel) 30deg 60deg, var(--accent-2) 60deg 90deg, var(--panel) 90deg 120deg);
  box-shadow: 0 0 0 4px var(--bg-2), 0 0 0 5px var(--line);
  animation: wheel-idle 60s linear infinite; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.spin-wheel:hover .wheel-ring { animation-play-state: paused; transform: rotate(30deg); }
.spin-wheel.busy .wheel-ring { animation: wheel-idle .7s linear infinite; }
.wheel-pointer { position: absolute; top: -10px; left: 50%; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top: 12px solid var(--plane); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
.wheel-hub { position: absolute; inset: 21px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .3), 0 6px 18px rgba(0, 0, 0, .35); }
.wheel-hub svg { width: 22px; height: 22px; transition: transform .3s ease; }
.spin-wheel:hover .wheel-hub svg { transform: translateX(3px) rotate(-8deg); }
.wheel-spin { font: 800 18px Inter, sans-serif; letter-spacing: .04em; text-transform: uppercase; }
.wheel-sub { font: 700 9px var(--mono); letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
@keyframes wheel-idle { to { transform: rotate(360deg); } }

/* ---------- PA line and overhead sign ---------- */
.pa { margin: 0; display: flex; align-items: baseline; gap: 10px; color: var(--text-2); font-size: 15px; min-height: 24px; }
.pa-tag { flex: none; font: 700 10px var(--mono); letter-spacing: .1em; color: var(--on-gold); background: var(--gold); border-radius: 4px; padding: 2px 6px; }
#pa-text { transition: opacity .35s; min-width: 0; }
.signs-scroll { overflow-x: auto; border-radius: 12px; background: var(--sign); scrollbar-width: none; }
.signs-scroll::-webkit-scrollbar { display: none; }
.signs { display: flex; gap: 2px; padding: 6px; width: max-content; min-width: 100%; }
.sign { display: flex; align-items: center; gap: 9px; padding: 7px 14px 7px 7px; border: 0; border-radius: 8px; background: transparent; color: var(--sign-text); font: 600 14px var(--sans); white-space: nowrap; }
.sign:hover { background: color-mix(in srgb, var(--sign-text) 10%, transparent); }
.sign[aria-current="true"] { background: color-mix(in srgb, var(--sign-text) 16%, transparent); }
.pic { width: 26px; height: 26px; border-radius: 5px; background: var(--gold); color: var(--on-gold); display: grid; place-items: center; flex: none; font: 700 12px var(--mono); }
.pic svg { width: 17px; height: 17px; }

/* ---------- stage ---------- */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) clamp(380px, 28vw, 460px); gap: 20px; align-items: start; }
.map-card { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--field); min-width: 0; }
#plan { display: block; width: 100%; height: auto; transition: transform .7s cubic-bezier(.5, 0, .2, 1), opacity .6s; }
#plan.zoom { transform: scale(3.4); opacity: 0; }
.hint { margin: 0; padding: 10px 16px; font-size: 14px; color: var(--muted); background: var(--bg-2); border-top: 1px solid var(--line); }

/* floor plan */
#plan text { font-family: var(--mono); user-select: none; pointer-events: none; }
.g-field { fill: var(--field); } .g-apron { fill: var(--apron); } .g-runway { fill: var(--runway); }
.g-mark { fill: var(--mark); } .g-markl { stroke: var(--mark); stroke-width: 2; stroke-dasharray: 16 14; fill: none; }
.g-rnum { font-weight: 700; font-size: 12px; fill: var(--mark); text-anchor: middle; }
.g-taxi { stroke: var(--gold); stroke-width: 1.4; stroke-dasharray: 7 6; opacity: .5; fill: none; }
.g-floor { fill: var(--floor); } .g-grid { stroke: var(--wall); stroke-width: .5; opacity: .18; }
.g-hall { fill: var(--hall); }
.g-shell { fill: none; stroke: var(--wall); stroke-width: 3; }
.g-gap { stroke: var(--floor); stroke-width: 5; }
.g-road { fill: var(--runway); } .g-lane { stroke: var(--mark); stroke-width: 1.2; stroke-dasharray: 9 9; opacity: .6; }
.g-kerb { stroke: var(--wall); stroke-width: 2; }
.g-code { font-size: 8px; font-weight: 500; letter-spacing: .14em; fill: var(--muted); }
.room { fill: var(--room); stroke: var(--wall); stroke-width: 1.5; transition: fill .2s, stroke .2s; }
.door { stroke: var(--floor); stroke-width: 4; }
.lbl { font-size: 13.5px; font-weight: 700; letter-spacing: .1em; fill: var(--text); }
.sub { font-size: 9.5px; font-weight: 500; fill: var(--muted); }
.zone { cursor: pointer; outline: none; }
.zone:hover .room, .zone:focus-visible .room { stroke: var(--accent); stroke-width: 2.2; }
.zone.sel .room { stroke: var(--accent); stroke-width: 2.5; fill: color-mix(in srgb, var(--accent) 14%, var(--room)); }
.zone.sel .lbl { fill: var(--accent); }
.hit { fill: transparent; stroke: transparent; stroke-width: 1.5; }
.zone:hover .hit, .zone:focus-visible .hit { stroke: color-mix(in srgb, var(--accent) 60%, transparent); stroke-dasharray: 4 4; }
.zone.sel .hit { stroke: var(--accent); fill: color-mix(in srgb, var(--accent) 9%, transparent); }
.jet { fill: var(--jet); stroke: var(--field); stroke-width: 1; transition: fill .2s; }
.zone:hover .jet, .zone.sel .jet { fill: var(--accent); }
.zone[data-id="gfly"] .jet { fill: var(--gold); }
.zone[data-id="gfly"]:hover .jet, .zone[data-id="gfly"].sel .jet { fill: var(--accent); }
.bridge { fill: var(--wall); }
.lead { stroke: var(--gold); stroke-width: 1.2; stroke-dasharray: 4 4; opacity: .45; }
.gtag { fill: var(--gold); } .gtag-t { font-size: 10.5px; font-weight: 700; fill: var(--on-gold); text-anchor: middle; }
.gname { font-size: 8.5px; font-weight: 500; fill: var(--muted); text-anchor: middle; letter-spacing: .06em; }
.beacon { fill: var(--accent-2); animation: blink 1.6s steps(1) infinite; }
.board { fill: #03110f; stroke: var(--wall); stroke-width: 1; }
.b-g { font-size: 10.5px; font-weight: 700; fill: #fde68a; }
.b-n { font-size: 10.5px; font-weight: 500; fill: #e6f6f3; }
.b-s { font-size: 10.5px; font-weight: 700; text-anchor: end; }
.s-hot { fill: #fb7185; } .s-ok { fill: #4ade80; } .s-gold { fill: #fde68a; }
.shelf { fill: var(--floor); stroke: var(--wall); stroke-width: 1; }
.it0 { fill: var(--accent); } .it1 { fill: var(--accent-2); } .it2 { fill: var(--gold); }
.l-screen { fill: #04171c; stroke: var(--wall); stroke-width: 1.5; }
.l-land { fill: none; stroke: #1f4c4a; stroke-width: 5; stroke-linecap: round; opacity: .8; }
.l-route { fill: none; stroke: #fde68a; stroke-width: 1; stroke-dasharray: 3 3; opacity: .75; }
.l-ap { fill: #fde68a; }
.l-jet { fill: #fde68a; }
.l-live { fill: #fb7185; animation: blink 1.6s steps(1) infinite; }
.l-live-t { font-size: 6px; font-weight: 700; letter-spacing: .1em; fill: #fb7185; }
.chair { fill: color-mix(in srgb, var(--accent-2) 60%, var(--room)); stroke: color-mix(in srgb, var(--accent-2) 40%, var(--wall)); stroke-width: .6; }
.cushion { fill: color-mix(in srgb, var(--accent-2) 28%, var(--gold)); opacity: .9; }
.side { fill: var(--floor); stroke: var(--wall); stroke-width: .8; }
.pot { fill: #a16207; }
.leaf { fill: #22c55e; opacity: .85; } .leaf.l2 { fill: #4ade80; }
.desk { fill: var(--floor); stroke: var(--wall); stroke-width: 1; } .screen { fill: var(--accent); }
.queue { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 4; opacity: .7; }
.belt { fill: none; stroke: var(--runway); stroke-width: 9; }
.belt-m { fill: none; stroke: var(--mark); stroke-width: 9; stroke-dasharray: 1 7; opacity: .35; animation: belt 1.2s linear infinite; }
.bag { stroke: var(--runway); stroke-width: .6; }
#plan .kiosk-i { font-family: var(--sans); font-size: 22px; font-weight: 700; fill: var(--on-gold); text-anchor: middle; }
.kiosk { fill: var(--gold); stroke: var(--wall); stroke-width: 1.5; }
.zone:hover .kiosk, .zone.sel .kiosk { stroke: var(--accent); stroke-width: 3; }
.tower { fill: var(--room); stroke: var(--wall); stroke-width: 1.5; }
.sweep { fill: var(--accent); opacity: .22; animation: rot 6s linear infinite; }
.car { animation: drive linear infinite; }
.npc { fill: var(--npc); opacity: .85; }
.you-dot { fill: var(--accent-2); stroke: var(--floor); stroke-width: 1.8; }
.you-ring { fill: none; stroke: var(--accent-2); stroke-width: 1.5; animation: ring 1.8s ease-out infinite; }
.you-t { font-size: 7.5px; font-weight: 700; fill: var(--accent-2); text-anchor: middle; letter-spacing: .1em; }
.roll { animation: roll 16s linear infinite; }
.lift { animation: lift 16s linear infinite; }
.jshadow { fill: var(--shadow); animation: shade 16s linear infinite; }
.taxiing { animation: taxi 48s linear infinite; }
@keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .15; } }
@keyframes belt { to { stroke-dashoffset: -8; } }
@keyframes rot { to { transform: rotate(360deg); } }
@keyframes ring { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }
@keyframes drive { from { transform: translateX(0); } to { transform: translateX(var(--d)); } }
@keyframes taxi { from { transform: translateX(0); } to { transform: translateX(calc(var(--d) * -1)); } }
@keyframes roll {
  0% { transform: translateX(0); opacity: 0; } 5% { opacity: 1; }
  38% { transform: translateX(0); animation-timing-function: cubic-bezier(.55, 0, .9, .45); }
  80% { transform: translateX(var(--run)); opacity: 1; }
  86%, 100% { transform: translateX(calc(var(--run) * 1.1)); opacity: 0; }
}
@keyframes lift { 0%, 64% { transform: scale(1); } 86%, 100% { transform: scale(1.5); } }
@keyframes shade { 0%, 64% { transform: translate(0, 0); opacity: .9; } 86%, 100% { transform: translate(-10px, 16px); opacity: .2; } }

/* ---------- flight view: the real map ---------- */
.sky { animation: skyin .6s ease both; }
@keyframes skyin { from { opacity: 0; transform: scale(1.05); } to { opacity: 1; transform: none; } }
.sky-stage { position: relative; }
#fmap { width: 100%; aspect-ratio: 1000 / 640; background: var(--field); z-index: 0; }
.leaflet-container { font-family: var(--sans); background: var(--field); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--bg) 75%, transparent) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-bar a { background: var(--panel) !important; color: var(--text) !important; border-color: var(--line) !important; }
.plane-icon { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45)); }
.plane-icon .plane-svg { width: 34px; height: 34px; display: block; transform-origin: 50% 50%; }
.ap-icon { display: grid; place-items: center; }
.ap-pin { background: var(--panel); border: 2px solid var(--accent); color: var(--text); font: 700 12px var(--mono); padding: 3px 7px; border-radius: 8px; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
.ap-pin.to { border-color: var(--accent-2); }
.hud { position: absolute; z-index: 1100; left: 12px; right: 12px; top: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-card { background: color-mix(in srgb, var(--sign) 90%, transparent); color: var(--sign-text); border-radius: 10px; padding: 8px 12px; font-family: var(--mono); display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hud-card small { font-size: 10px; letter-spacing: .1em; color: #fde68a; font-weight: 700; text-transform: uppercase; }
.hud-card b { font-size: 14px; overflow-wrap: anywhere; }
.over-card { position: absolute; z-index: 1100; left: 12px; bottom: 26px; max-width: calc(100% - 24px); }
.back { flex: none; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 999px; padding: 8px 14px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.back:hover { border-color: var(--accent); }
.back[aria-pressed="true"] { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.landed { position: absolute; z-index: 1100; left: 50%; bottom: 26px; transform: translateX(-50%); width: min(92%, 400px); background: var(--panel); border: 1px solid var(--accent); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 18px 40px -18px var(--shadow); }
.landed b { font-size: 18px; } .landed span { color: var(--text-2); font-size: 14px; }
.sky-info { padding: 14px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); background: var(--bg-2); }
@media (min-width: 1000px) { .sky-info { display: none; } }
.map-card:fullscreen { border-radius: 0; border: 0; }
.map-card:fullscreen #fmap { aspect-ratio: auto; height: 100vh; }
.map-card:fullscreen .sky-info { display: none; }
.prog { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.prog span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .6s; }
.board-btn { width: 100%; border: 0; border-radius: 999px; padding: 14px 18px; font-weight: 700; font-size: 16px; background: var(--gold); color: var(--on-gold); animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 55%, transparent); } 60% { box-shadow: 0 0 0 9px transparent; } }

/* ---------- a game, played on top of the terminal ---------- */
.gameframe { position: fixed; inset: 0; z-index: 3000; display: flex; flex-direction: column; background: var(--bg); }
.gf-bar { display: flex; align-items: center; gap: 10px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); background: var(--sign); color: var(--sign-text); }
.gf-bar b { flex: 1; min-width: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#gf-frame { flex: 1; width: 100%; border: 0; background: var(--bg); }
body.gaming { overflow: hidden; }

/* ---------- panel ---------- */
.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0;
  position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow-y: auto;
}
.p-close { display: none; }
.p-head { display: flex; flex-direction: column; gap: 4px; }
.p-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.p-code { font: 700 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--on-gold); background: var(--gold); border-radius: 4px; padding: 2px 7px; }
.pill { font: 700 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ok); }
.panel h2 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
.panel h3, .sky-info h3 { margin: 4px 0 0; font: 700 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.p-sub { margin: 0; color: var(--text-2); }
.note { margin: 0; font-size: 13px; color: var(--muted); }
.live { align-self: flex-start; font-weight: 600; text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; color: var(--text); background: var(--panel-2); }
.live:hover { border-color: var(--accent); }
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; background: var(--sign); border-radius: 10px; overflow: hidden; }
.rows li + li { border-top: 1px solid color-mix(in srgb, var(--sign-text) 12%, transparent); }
.rowb { width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 14px; background: transparent; border: 0; text-align: left; text-decoration: none; color: var(--sign-text); font: 500 14px var(--mono); }
.rowb:hover { background: color-mix(in srgb, var(--sign-text) 9%, transparent); }
.rowb .g { color: #fde68a; font-weight: 700; } .rowb .s { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; text-align: right; }
.rowb .s.hot { color: #fb7185; } .rowb .s.ok { color: #4ade80; } .rowb .s.gold { color: #fde68a; }
.result { background: var(--sign); color: var(--sign-text); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; font-family: var(--mono); min-height: 86px; }
.result small { color: color-mix(in srgb, var(--sign-text) 60%, transparent); font-size: 10px; letter-spacing: .1em; }
.result .r-flight { color: #fde68a; font-weight: 700; font-size: 14px; }
.result .r-route { font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.result .r-meta { font-size: 13px; color: #4ade80; }
.result.err .r-meta { color: #fb7185; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--panel-2); display: flex; flex-direction: column; gap: 4px; text-align: left; text-decoration: none; color: var(--text); }
button.card:hover, a.card:hover { border-color: var(--accent); }
.card b { font-size: 15px; } .card span { font-size: 14px; color: var(--text-2); } .card small { font: 500 10px var(--mono); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.pass { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.pass small { display: block; font: 500 10px var(--mono); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.pass b { font-size: 16px; overflow-wrap: anywhere; }
.pass .bars { grid-column: 1 / -1; height: 26px; border-top: 1px dashed var(--line); margin-top: 2px; padding-top: 10px;
  background: repeating-linear-gradient(90deg, var(--text) 0 2px, transparent 2px 5px, var(--text) 5px 6px, transparent 6px 10px) bottom / 100% 14px no-repeat; opacity: .8; }
.stamps, .badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.stamps li { border: 1px dashed var(--wall); border-radius: 8px; padding: 3px 8px; font-size: 13px; }
.badges li { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); font-size: 17px; opacity: .3; filter: grayscale(1); }
.badges li.got { opacity: 1; filter: none; border-color: var(--gold); }
.stamps.hangar li { opacity: .35; border-style: dotted; }
.stamps.hangar li.got { opacity: 1; border-style: dashed; border-color: var(--gold); }
.list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.list li { padding: 9px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; color: var(--text-2); }
.list li:first-child { border-top: 0; }
.list a { font-weight: 600; text-decoration: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px; padding: 6px 13px; font: 700 13px var(--mono); text-decoration: none; color: var(--text); }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"], .chip[aria-selected="true"] { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.partner { border: 1px solid var(--line); background: var(--panel-2); border-radius: 12px; padding: 11px 14px; font-weight: 600; font-size: 15px; text-decoration: none; color: var(--text); }
.partner:hover { border-color: var(--accent); }
.shop { display: flex; flex-direction: column; gap: 8px; }
.score { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.score td { padding: 7px 4px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.score tr:first-child td { border-top: 0; }
.score td:first-child { width: 34px; font: 700 13px var(--mono); color: var(--gold-text); }
.score td:last-child { text-align: right; font: 700 13px var(--mono); white-space: nowrap; }
.score tr.you td { color: var(--accent); font-weight: 700; }
.foot { margin: 0; font-size: 13px; color: var(--muted); }
.foot a { color: var(--muted); }
.toast { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); background: var(--panel-2); border: 1px solid var(--line); padding: 10px 18px; border-radius: 999px; z-index: 3000; font-size: 14px; text-align: center; box-shadow: 0 10px 30px -12px var(--shadow); }

@media (max-width: 999px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 1500; max-height: 58%;
    max-width: 620px; margin: 0 auto; border-radius: 18px 18px 0 0; border-bottom: 0;
    padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    box-shadow: 0 -18px 40px -18px var(--shadow);
    transform: translateY(105%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); visibility: hidden;
  }
  .panel.open { transform: none; visibility: visible; }
  .p-close { display: grid; place-items: center; position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); font-size: 18px; line-height: 1; }
  .p-head { padding-right: 40px; }
  .wrap.sheet-open { padding-bottom: 56vh; }
  .panel h2 { font-size: 21px; }
}
@media (max-width: 700px) {
  #fmap { aspect-ratio: 420 / 460; }
  .clock, .tag { display: none; }
  .brand { font-size: 18px; }
  .spin { padding: 9px 14px; }
  .themes button { width: 16px; height: 16px; }
}
@media (max-width: 520px) { .tip { display: none; } .classic .long { display: none; } }
@media (max-width: 420px) { .classic { padding: 8px 12px; } .spin-top span { display: none; } .spin-top { padding: 9px 12px; } .spin-wheel { width: 108px; height: 108px; } .wheel-hub { inset: 16px; } .wheel-sub { display: none; } }
@media (prefers-reduced-motion: reduce) {
  #plan, #plan *, .sky, .panel, .spin, .spin-wheel, .wheel-ring, .board-btn, .prog span { animation: none !important; transition: none !important; }
  .roll { opacity: 1; }
}

/* Follow links at the Information desk (public/js/social.js). */
.social { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 6px 0 10px; }
.social a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 13px; }
.social a:hover { color: var(--accent); }
