/* Night-mission HUD: true black base, neutral greys for structure, acid lime for anything you act on (black look from Nov 16, 2026; was blue-tinted). */
:root {
  --midnight: #000000;
  --surface: #0b0b0c;
  --surface-2: #161618;
  --line: #242427;
  --line-bright: #3a3a3f;
  --ink: #f5f5f7;
  --muted: #8e8e93;
  --cobalt: #6e6e73;
  --cobalt-deep: #2c2c2e;
  --cobalt-glow: rgba(255, 255, 255, 0.122);
  --lime: #c8ff1e;
  --lime-dim: rgba(200, 255, 30, 0.14);
  --lime-glow: rgba(200, 255, 30, 0.45);
  --danger: #ff4d5e;
  --ok: #c8ff1e;
  --ice: #7fd4ff;
  --radius: 14px;
  --display: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
  --body: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(700px 420px at -10% 110%, rgba(200, 255, 30, 0.045), transparent 60%),
    var(--midnight);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
}
button, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.2em; margin: 10px 0 0; font-size: 14px; }
::selection { background: var(--lime); color: var(--midnight); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 900;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px max(16px, env(safe-area-inset-left, 0px));
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.brand b { color: var(--lime); font-weight: 700; margin-left: 4px; }
.brand-mark { width: 22px; height: 22px; border: 2px solid var(--lime); transform: rotate(45deg); border-radius: 4px; box-shadow: 0 0 14px var(--lime-glow), inset 0 0 0 4px var(--midnight), inset 0 0 0 8px var(--cobalt); }
#roomInfo { font-family: var(--mono); font-size: 13px; color: var(--muted); }
#roomInfo b { color: var(--lime); letter-spacing: 0.2em; margin-left: 6px; }

main { padding: 20px max(16px, env(safe-area-inset-left, 0px)) 32px; }

/* ---------- shared building blocks ---------- */
.card {
  background: linear-gradient(180deg, rgba(22, 22, 24, 0.92), rgba(12, 12, 13, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.narrow { max-width: 460px; margin: 28px auto; }
h1 { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 5vw, 56px); line-height: 1.02; margin: 0 0 14px; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-family: var(--display); font-weight: 600; font-size: 22px; margin: 0 0 14px; letter-spacing: 0.01em; }
h3 { font-family: var(--mono); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); margin: 0 0 12px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 16px; letter-spacing: 0.02em; }
input, select {
  width: 100%; padding: 12px 14px; margin-top: 8px;
  background: var(--midnight); border: 1px solid var(--line-bright); border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: #5a5a60; }
input:focus, select:focus { outline: none; border-color: var(--lime); box-shadow: 0 0 0 3px var(--lime-dim); }
select option { background: var(--surface); }
.row { display: flex; gap: 8px; align-items: center; }
.row input { margin-top: 0; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.btn {
  padding: 11px 18px; border-radius: 10px; cursor: pointer; white-space: nowrap;
  background: transparent; border: 1px solid var(--line-bright); color: var(--ink);
  font-weight: 600; letter-spacing: 0.01em;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s, background 0.15s;
}
.btn:hover:not(:disabled) { border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-glow); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary { background: var(--lime); color: var(--midnight); border-color: var(--lime); font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.btn.primary:hover:not(:disabled) { box-shadow: 0 0 24px var(--lime-glow); border-color: var(--lime); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.btn.danger:hover:not(:disabled) { box-shadow: 0 0 22px rgba(255, 77, 94, 0.5); border-color: var(--danger); }
.btn.wide { width: 100%; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }

/* ---------- home ---------- */
.home { max-width: 1040px; margin: 6vh auto 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr); gap: 48px; align-items: center; }
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cobalt); margin-bottom: 16px; filter: brightness(1.4); }
.home h1 span { display: block; color: var(--lime); text-shadow: 0 0 30px rgba(200, 255, 30, 0.35); }
.home-copy p { max-width: 46ch; font-size: 16px; margin: 0 0 24px; }
.home-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.home-steps li { padding: 8px 14px; border: 1px solid var(--line-bright); border-radius: 999px; font-size: 13px; color: var(--muted); background: rgba(255, 255, 255, 0.054); }
.home-steps b { font-family: var(--mono); color: var(--ink); margin-right: 4px; }
.home-card { position: relative; overflow: hidden; }
.home-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--cobalt), var(--lime)); }

/* ---------- lobby ---------- */
.lobby { max-width: 820px; margin: 0 auto; display: grid; gap: 16px; }
.lobby-code { font-family: var(--mono); font-size: clamp(40px, 9vw, 64px); font-weight: 700; letter-spacing: 0.22em; color: var(--lime); text-shadow: 0 0 28px var(--lime-glow); margin: 4px 0 14px; line-height: 1; }
.players { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.players li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, 0.55); }
.players li select { width: auto; margin: 0; padding: 8px 10px; }
.players .pl-ctl { display: flex; align-items: center; gap: 6px; }
.players .rm-player { padding: 6px 10px; min-width: 36px; color: var(--muted); }
.players .rm-player:hover { color: var(--ink); border-color: #ff5a5a; }
.players .rm-player.ask { color: #fff; background: #d93636; border-color: #ff5a5a; }
.players .off { opacity: 0.45; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.team-box { border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px; padding: 12px; background: rgba(0, 0, 0, 0.55); }
.team-box b { font-family: var(--display); font-size: 16px; letter-spacing: 0.04em; text-transform: uppercase; }
.team-box .members { font-size: 13px; color: var(--muted); min-height: 1.2em; margin-top: 4px; }

/* ---------- game ---------- */
.game { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 16px; height: calc(100vh - 100px); height: calc(100dvh - 100px); }
.map-wrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-bright); min-height: 320px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 0 40px rgba(255, 255, 255, 0.063); }
.map-wrap::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 450; box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.75); }
#map { position: absolute; inset: 0; background: #000; }
.map-label { position: absolute; left: 14px; bottom: 14px; z-index: 500; background: rgba(0, 0, 0, 0.85); border: 1px solid var(--lime); color: var(--lime); border-radius: 999px; padding: 7px 14px; font-family: var(--display); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 13px; box-shadow: 0 0 18px var(--lime-dim); backdrop-filter: blur(6px); }
.map-label:empty { display: none; }
.leaflet-container { font-family: var(--body); }
.leaflet-bar a { background: rgba(0, 0, 0, 0.9) !important; color: var(--ink) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { background: rgba(0, 0, 0, 0.7) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--ink) !important; }

.side { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; padding-right: 2px; min-width: 0; }
.side::-webkit-scrollbar { width: 6px; }
.side::-webkit-scrollbar-thumb { background: var(--line-bright); border-radius: 6px; }
.panel { background: linear-gradient(180deg, rgba(22, 22, 24, 0.95), rgba(12, 12, 13, 0.95)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: relative; }
.clue-panel { border-color: var(--line-bright); box-shadow: 0 0 30px rgba(255, 255, 255, 0.042); }
.team-head { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: var(--radius); color: #fff; font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: 0.08em; text-transform: uppercase; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
.team-head::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, rgba(0, 0, 0, 0.55), transparent 55%), repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0 6px, transparent 6px 14px); pointer-events: none; }
.team-head > * { position: relative; z-index: 1; }
.team-head small { font-family: var(--body); font-weight: 600; font-size: 12px; letter-spacing: 0.04em; text-transform: none; }

.stop-label { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--lime); text-transform: uppercase; letter-spacing: 0.16em; }
.clue { font-size: 19px; line-height: 1.45; font-weight: 500; margin: 10px 0 14px; }
.hint { background: var(--lime-dim); border: 1px solid rgba(200, 255, 30, 0.35); padding: 9px 12px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }
.slips { display: flex; gap: 12px; justify-content: center; margin: 14px 0 6px; }
.slip {
  width: 78px; height: 104px; border-radius: 12px; cursor: pointer; font-size: 30px; font-family: var(--display); font-weight: 700; color: var(--lime);
  border: 1px solid var(--cobalt);
  background: linear-gradient(160deg, var(--cobalt-deep), var(--midnight) 75%), var(--midnight);
  box-shadow: inset 0 0 0 4px var(--midnight), inset 0 0 0 5px rgba(255, 255, 255, 0.175), 0 8px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.slip:hover:not(:disabled) { transform: translateY(-6px) rotate(-3deg); border-color: var(--lime); box-shadow: inset 0 0 0 4px var(--midnight), inset 0 0 0 5px var(--lime), 0 0 26px var(--lime-glow); }
.slip:nth-child(2):hover:not(:disabled) { transform: translateY(-6px); }
.slip:nth-child(3):hover:not(:disabled) { transform: translateY(-6px) rotate(3deg); }
.objects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.object { padding: 14px 6px; border-radius: 12px; border: 1px solid var(--line-bright); background: rgba(0, 0, 0, 0.6); cursor: pointer; text-align: center; font-size: 13px; font-weight: 600; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.object span { display: block; font-size: 30px; margin-bottom: 6px; }
.object:hover:not(:disabled) { border-color: var(--lime); box-shadow: 0 0 20px var(--lime-dim); transform: translateY(-2px); }

.freeze { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: var(--radius); background: rgba(10, 40, 80, 0.88); border: 1px solid var(--ice); color: var(--ice); font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: 0.06em; text-transform: uppercase; backdrop-filter: blur(3px); text-shadow: 0 0 16px rgba(127, 212, 255, 0.7); }
.freeze small { font-family: var(--body); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink); text-shadow: none; }

.progress { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.progress li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; }
.progress li.me { background: rgba(255, 255, 255, 0.049); border-color: rgba(255, 255, 255, 0.158); font-weight: 700; }
.progress li.out { opacity: 0.4; text-decoration: line-through; }
.progress .lvl { color: var(--muted); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 13px; max-height: 220px; overflow-y: auto; }
.feed li { padding-bottom: 8px; border-bottom: 1px solid var(--line); color: #d1d1d6; }
.feed li:first-child { color: var(--ink); }
.saved { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border: 1px dashed var(--lime); border-radius: var(--radius); background: var(--lime-dim); font-weight: 600; }

/* ---------- modal & cards ---------- */
.modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(3, 4, 8, 0.75); backdrop-filter: blur(4px); }
.modal-box { width: 100%; max-width: 430px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-bright); border-radius: 18px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 50px rgba(255, 255, 255, 0.07); animation: rise 0.22s ease-out; }
.game-card { text-align: center; padding: 18px 16px; border-radius: 14px; margin-bottom: 16px; border: 1px solid var(--line-bright); background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.122), transparent 70%), var(--midnight); }
.game-card .emoji { font-size: 46px; filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.25)); }
.game-card h2 { font-size: 24px; text-transform: uppercase; letter-spacing: 0.06em; margin: 6px 0 6px; }
.game-card p { margin: 0; color: #d1d1d6; }
.game-card.attack { border-color: var(--danger); background: radial-gradient(circle at 50% 0%, rgba(255, 77, 94, 0.3), transparent 70%), var(--midnight); }
.game-card.good { border-color: var(--lime); background: radial-gradient(circle at 50% 0%, rgba(200, 255, 30, 0.22), transparent 70%), var(--midnight); }
.game-card.bad { border-color: #6e6e73; }
.choices { display: grid; gap: 8px; margin: 10px 0 14px; }
.choice { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line-bright); background: rgba(0, 0, 0, 0.6); cursor: pointer; text-align: left; font-weight: 600; transition: border-color 0.15s, box-shadow 0.15s; }
.choice:hover { border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-glow); }
.choice.on { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255, 77, 94, 0.35); background: rgba(255, 77, 94, 0.1); }

/* ---------- end ---------- */
.end { text-align: center; position: relative; overflow: hidden; }
.end::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--cobalt), var(--lime)); }
.end .trophy { font-size: 66px; filter: drop-shadow(0 0 24px rgba(200, 255, 30, 0.5)); animation: float 3s ease-in-out infinite; }
.end h1 { font-size: clamp(30px, 5vw, 44px); color: var(--lime); text-transform: uppercase; letter-spacing: 0.04em; text-shadow: 0 0 30px rgba(200, 255, 30, 0.35); }
.end .progress { text-align: left; margin-top: 18px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 3000; width: min(380px, calc(100vw - 32px)); }
#toasts .toast:nth-last-child(n+4) { display: none; }
.toast { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-bright); padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); animation: rise 0.2s ease-out; }
.toast.good { border-color: var(--lime); color: var(--lime); box-shadow: 0 0 22px var(--lime-dim), 0 12px 30px rgba(0, 0, 0, 0.5); }
.toast.bad { border-color: var(--danger); color: #ffb3bb; box-shadow: 0 0 22px rgba(255, 77, 94, 0.25), 0 12px 30px rgba(0, 0, 0, 0.5); }

@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- map travel transitions ---------- */
.fx { position: absolute; inset: 0; z-index: 460; pointer-events: none; overflow: hidden; }
.fx:not(.hidden) ~ .map-label { opacity: 0; }
.fx-layer { position: absolute; inset: 0; }
.fx-layer i { position: absolute; display: block; }
.fx-hud {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(420px, calc(100% - 28px));
  padding: 12px 16px 14px; border-radius: 14px; background: rgba(0, 0, 0, 0.82); border: 1px solid var(--line-bright);
  backdrop-filter: blur(8px); box-shadow: 0 0 30px rgba(255, 255, 255, 0.087); animation: rise 0.3s ease-out;
}
.fx-tag { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--lime); }
.fx-title { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin-top: 2px; }
.fx-readout { font-family: var(--mono); font-size: 13px; color: var(--muted); min-height: 1.4em; font-variant-numeric: tabular-nums; }
.fx-bar { height: 4px; margin-top: 10px; border-radius: 4px; background: var(--line); overflow: hidden; }
.fx-bar b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cobalt), var(--lime)); animation: fxbar linear forwards; }
.fx.done .fx-hud { border-color: var(--lime); box-shadow: 0 0 30px var(--lime-glow); }
.fx.done .fx-title { color: var(--lime); }
.fx.done .fx-layer { opacity: 0; transition: opacity 0.6s; }
@keyframes fxbar { to { width: 100%; } }

/* Orbit drop: a tilted orbit ring and a satellite circling the planet */
.fx-orbit .fx-layer { background: radial-gradient(circle at 50% 50%, transparent 30%, rgba(0, 0, 0, 0.55) 80%); }
.fx-orbit .fx-layer i:nth-child(1) { left: 50%; top: 50%; width: 140%; aspect-ratio: 1; transform: translate(-50%, -50%) rotateX(72deg); border: 2px dashed rgba(255, 255, 255, 0.245); border-radius: 50%; animation: orbit 6s linear infinite; }
.fx-orbit .fx-layer i:nth-child(2) { left: 50%; top: 50%; width: 90%; aspect-ratio: 1; transform: translate(-50%, -50%) rotateX(72deg); border: 1px solid rgba(200, 255, 30, 0.45); border-radius: 50%; animation: orbit 4s linear infinite reverse; }
.fx-orbit .fx-layer i:nth-child(3) { inset: 0; background: linear-gradient(180deg, rgba(255, 255, 255, 0.087), transparent 35%, transparent 65%, rgba(255, 255, 255, 0.087)); animation: fadeout 10s linear forwards; }
@keyframes orbit { to { transform: translate(-50%, -50%) rotateX(72deg) rotate(360deg); } }
@keyframes fadeout { 0% { opacity: 1; } 60% { opacity: 1; } 100% { opacity: 0; } }

/* Flight path: plane drawn on the map; light cobalt tint and clouds drifting past */
.fx-flight .fx-layer { background: linear-gradient(180deg, rgba(255, 255, 255, 0.056), transparent 45%); }
.fx-flight .fx-layer i { width: 40%; height: 18%; border-radius: 50%; background: radial-gradient(ellipse, rgba(255, 255, 255, 0.18), transparent 70%); filter: blur(6px); animation: clouds 7s linear infinite; }
.fx-flight .fx-layer i:nth-child(1) { top: 12%; left: 100%; }
.fx-flight .fx-layer i:nth-child(2) { top: 58%; left: 120%; animation-delay: -2.5s; }
.fx-flight .fx-layer i:nth-child(3) { top: 32%; left: 140%; animation-delay: -5s; width: 28%; }
@keyframes clouds { to { transform: translateX(-260%); } }
.fx-plane { --livery: var(--lime); }
.fx-plane span { position: absolute; left: 0; top: 0; width: 60px; height: 60px; display: block; line-height: 0; will-change: transform; }
.fx-plane .body { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45)); }
.fx-plane .shadow { filter: brightness(0) blur(2.5px); opacity: 0.4; }
.fx-plane svg, .fx-car svg { display: block; overflow: visible; }

/* Radar sweep: rotating sweep with range rings; sonar pings once the signal is found */
.fx-radar .fx-layer i:nth-child(1) { left: 50%; top: 50%; width: 130vmax; height: 130vmax; transform: translate(-50%, -50%); border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(200, 255, 30, 0.45), rgba(200, 255, 30, 0.08) 40deg, transparent 70deg); animation: sweep 2.4s linear infinite; }
.fx-radar .fx-layer i:nth-child(2) { inset: 0; background: repeating-radial-gradient(circle at 50% 50%, transparent 0 58px, rgba(200, 255, 30, 0.22) 59px 60px), linear-gradient(rgba(200, 255, 30, 0.18), rgba(200, 255, 30, 0.18)) center / 1px 100% no-repeat, linear-gradient(rgba(200, 255, 30, 0.18), rgba(200, 255, 30, 0.18)) center / 100% 1px no-repeat; }
.fx-radar .fx-layer i:nth-child(3) { left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; border: 2px solid var(--lime); opacity: 0; }
.fx-radar.ping .fx-layer i:nth-child(3) { animation: ping 1.4s ease-out infinite; }
@keyframes sweep { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes ping { 0% { transform: scale(0.5); opacity: 1; } 100% { transform: scale(9); opacity: 0; } }
.fx-lock { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; }
.fx-lock i { position: absolute; width: 16px; height: 16px; border: 3px solid var(--lime); filter: drop-shadow(0 0 6px var(--lime-glow)); transition: transform 0.7s cubic-bezier(.34, 1.56, .64, 1); }
.fx-lock i:nth-child(1) { left: -26px; top: -26px; border-right: 0; border-bottom: 0; transform: translate(-40px, -40px); }
.fx-lock i:nth-child(2) { left: 10px; top: -26px; border-left: 0; border-bottom: 0; transform: translate(40px, -40px); }
.fx-lock i:nth-child(3) { left: -26px; top: 10px; border-right: 0; border-top: 0; transform: translate(-40px, 40px); }
.fx-lock i:nth-child(4) { left: 10px; top: 10px; border-left: 0; border-top: 0; transform: translate(40px, 40px); }
.fx.locked .fx-lock { opacity: 1; transition: opacity 0.2s; } .fx.locked .fx-lock i { transform: none; }
.fx.done .fx-lock { opacity: 0; }
/* arrival stamp: springs in over the map */
.fx-stamp { position: absolute; left: 50%; top: 42%; padding: 10px 20px 12px; border: 3px solid var(--lime); border-radius: 14px; color: var(--lime); text-align: center; background: rgba(0, 0, 0, 0.78);
  box-shadow: 0 0 34px var(--lime-glow); transform: translate(-50%, -50%) rotate(-6deg); animation: stampIn 0.6s cubic-bezier(.34, 1.56, .64, 1) both; }
.fx-stamp b { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; white-space: nowrap; }
.fx-stamp span { display: block; font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--ink); max-width: min(78vw, 420px); margin-top: 2px; line-height: 1.15; text-wrap: balance; }
@keyframes stampIn { from { opacity: 0; transform: translate(-50%, -50%) rotate(-6deg) scale(1.8); } }

/* Road trip: dusk tint and passing street-light glows; car + road are drawn on the map */
.fx-drive .fx-layer { background: linear-gradient(180deg, rgba(255, 255, 255, 0.063), transparent 40%, transparent 70%, rgba(0, 0, 0, 0.45)); }
.fx-drive .fx-layer i { top: -10%; width: 26%; height: 120%; background: radial-gradient(ellipse at center, rgba(255, 214, 120, 0.16), transparent 60%); animation: lights 2.2s linear infinite; }
.fx-drive .fx-layer i:nth-child(1) { left: 100%; }
.fx-drive .fx-layer i:nth-child(2) { left: 100%; animation-delay: -0.75s; }
.fx-drive .fx-layer i:nth-child(3) { left: 100%; animation-delay: -1.5s; }
@keyframes lights { to { transform: translateX(-520%); } }
.fx-car .face { position: absolute; left: 0; top: 0; width: 52px; height: 52px; display: grid; place-items: center; will-change: transform; }
.fx-car .face svg { filter: drop-shadow(2px 4px 2.5px rgba(0, 0, 0, 0.55)); animation: bump 0.35s ease-in-out infinite alternate; }
@keyframes bump { to { translate: 0 -2px; } }

/* Team walk: warm daylight, the team walks together with name tags */
.fx-walk .fx-layer { background: radial-gradient(circle at 50% 40%, transparent 35%, rgba(0, 0, 0, 0.5) 90%), linear-gradient(180deg, rgba(200, 255, 30, 0.08), transparent 40%); }
.fx-walk .walkers { display: flex; justify-content: center; gap: 8px; }
.fx-walk .w { position: relative; display: grid; justify-items: center; animation: walkBob 0.36s ease-in-out infinite alternate; animation-delay: var(--d); }
.fx-walk .walker { display: block; overflow: visible; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.5)); }
.fx-walk .walkers.left .walker { transform: scaleX(-1); }
.fx-walk .limb { transform-box: view-box; }
.fx-walk .leg { transform-origin: 13px 28px; } .fx-walk .arm { transform-origin: 13px 15px; }
.fx-walk .leg.front, .fx-walk .arm.back { animation: swingA 0.72s ease-in-out infinite alternate; animation-delay: var(--d); }
.fx-walk .leg.back, .fx-walk .arm.front { animation: swingB 0.72s ease-in-out infinite alternate; animation-delay: var(--d); }
.fx-walk .w i { margin-top: -1px; font-style: normal; font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--midnight); background: var(--lime); padding: 1px 5px; border-radius: 6px; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes swingA { from { transform: rotate(28deg); } to { transform: rotate(-28deg); } }
@keyframes swingB { from { transform: rotate(-28deg); } to { transform: rotate(28deg); } }
@keyframes walkBob { to { transform: translateY(-2px); } }
@keyframes stride { from { translate: 0 0; rotate: -4deg; } to { translate: 0 -3px; rotate: 4deg; } }

/* ---------- monument photo on arrival ---------- */
.monument { position: absolute; inset: 0; z-index: 455; overflow: hidden; background: var(--midnight); animation: reveal 1.2s ease-out; }
.monument img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: kenburns 18s ease-out forwards; }
.monument::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 30%, transparent 55%, rgba(0, 0, 0, 0.9)); pointer-events: none; }
.monument-cap { position: absolute; left: 20px; bottom: 18px; right: 20px; z-index: 1; display: grid; gap: 2px; }
.monument-cap span { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--lime); }
.monument-cap b { font-family: var(--display); font-size: clamp(26px, 4vw, 40px); line-height: 1.05; letter-spacing: 0.03em; text-transform: uppercase; text-shadow: 0 2px 20px rgba(0, 0, 0, 0.7); }
.monument-cap small { font-size: 11px; color: var(--muted); }
.monument-cap a { color: var(--ink); }
.monument:not(.hidden) ~ .map-label { opacity: 0; }
.monument-toggle { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 470; background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(6px); }
@keyframes kenburns { from { transform: scale(1.12) translate(1.5%, 1%); } to { transform: scale(1) translate(0, 0); } }
@keyframes reveal { from { opacity: 0; filter: blur(8px); } to { opacity: 1; filter: none; } }

/* ---------- 360° treasure search ---------- */
.pano { position: absolute; inset: 0; z-index: 458; background: var(--midnight); }
#panoView { position: absolute; inset: 0; }
.map-wrap.pano-on .leaflet-control-container, .map-wrap.pano-on .monument, .map-wrap.pano-on .monument-toggle, .map-wrap.pano-on .map-label, .map-wrap.pano-on .next-clue { display: none !important; }
.pano-loading { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); color: var(--lime); letter-spacing: 0.1em; text-transform: uppercase; font-size: 13px; }
.pano-credit { position: absolute; left: 12px; bottom: 10px; z-index: 3; font-size: 11px; color: var(--muted); background: rgba(0, 0, 0, 0.7); padding: 3px 8px; border-radius: 6px; }
.pano-credit a { color: var(--ink); }
.s3-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; touch-action: none; }
.s3-loading { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); color: var(--lime); letter-spacing: 0.1em; text-transform: uppercase; font-size: 13px; }
.s3-tip { position: absolute; z-index: 3; display: none; transform: translate(-50%, -160%); pointer-events: none; background: var(--lime); color: var(--midnight); font: 700 12px var(--mono); padding: 3px 9px; border-radius: 6px; white-space: nowrap; }
.pano .pnlm-container { background: var(--midnight); }
.pano .pnlm-load-box { background: rgba(0, 0, 0, 0.85); border: 1px solid var(--line-bright); border-radius: 12px; }
.pano .pnlm-lbar-fill { background: var(--lime); }
.pano .pnlm-controls { background: rgba(0, 0, 0, 0.85); border-color: var(--line-bright); }
/* Items sit on real surfaces: the hotspot point is the item's base; size comes from distance (--s). */
.pano-item { width: calc(var(--s, 40px) * 1.4); height: calc(var(--s, 40px) * 2.4); cursor: pointer; }
.pano-item .pi-wrap { position: absolute; left: 50%; bottom: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.pano-item .pi-emoji { font-size: var(--s, 40px); line-height: 1; display: block; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55)) saturate(0.85) brightness(0.95); transition: transform 0.15s; transform-origin: 50% 100%; }
.pano-item .pi-shadow { width: calc(var(--s, 40px) * 0.9); height: calc(var(--s, 40px) * 0.16); margin-top: calc(var(--s, 40px) * -0.1); border-radius: 50%; background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55), transparent 70%); }
.pano-item .pi-label { position: absolute; top: 100%; margin-top: 4px; font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--midnight); background: var(--lime); padding: 2px 7px; border-radius: 6px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); opacity: 0; transform: translateY(-4px); transition: opacity 0.15s, transform 0.15s; pointer-events: none; }
.pano-item:hover .pi-emoji, .pano-item.sel .pi-emoji { transform: scale(1.15); filter: drop-shadow(0 0 8px rgba(200, 255, 30, 0.9)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55)); }
.pano-item:hover .pi-label, .pano-item.sel .pi-label { opacity: 1; transform: none; }
.pano-item.nope { pointer-events: none; }
.pano-item.nope .pi-emoji { opacity: 0.35; filter: grayscale(1); }
.pano-item.nope .pi-label { opacity: 1; background: var(--danger); color: #fff; text-decoration: line-through; }
.pano.frozen::after { content: attr(data-left); position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(10, 40, 80, 0.72); color: var(--ice); font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; text-shadow: 0 0 16px rgba(127, 212, 255, 0.7); backdrop-filter: blur(2px); }
.pano-help { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line-bright); border-radius: 10px; background: rgba(255, 255, 255, 0.054); font-size: 14px; color: #d1d1d6; margin-bottom: 12px; }
.pano-help b { font-family: var(--display); color: var(--lime); letter-spacing: 0.06em; text-transform: uppercase; }
.pano-open { display: none; }

/* Phone-only controls are hidden on big screens. */
.mobile-tabs, .next-clue { display: none; }

@media (max-width: 900px) {
  .home { grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 2vh; }

  /* One screen at a time: Clue (no map) or Map, switched by the bottom tab bar. */
  #screen-game { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .game { grid-template-columns: minmax(0, 1fr); height: auto; }
  .game[data-view="clue"] .map-wrap { display: none; }
  .game[data-view="map"] .side { display: none; }
  .map-wrap { height: calc(100dvh - 64px - 76px - 40px - env(safe-area-inset-bottom, 0px)); min-height: 320px; }
  .side { overflow: visible; }
  .clue { font-size: 21px; }
  #answerInput { font-size: 17px; padding: 14px; }
  .answer-row .btn, #answerForm .btn { padding: 14px 18px; }
  .slip { width: 30%; max-width: 96px; height: 116px; }

  .fx-hud { bottom: 14px; }
  .pano-open { display: block; }
  .monument-toggle { top: 64px; }
  .next-clue { display: block; position: absolute; z-index: 500; right: 14px; top: 14px; padding: 12px 18px; box-shadow: 0 0 24px var(--lime-glow); }
  .map-label { max-width: calc(100% - 28px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .mobile-tabs {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 950;
    padding: 10px max(16px, env(safe-area-inset-left, 0px)) calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(0, 0, 0, 0.92); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
  }
  .tab-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 10px; border-radius: 12px; border: 1px solid var(--line-bright); background: transparent; color: var(--muted);
    font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
  }
  .tab-btn[aria-pressed="true"] { background: var(--lime); border-color: var(--lime); color: var(--midnight); box-shadow: 0 0 20px var(--lime-glow); }
  .tab-ico { font-size: 14px; }
  #toasts { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}

/* topic + difficulty tag above each clue */
.topic-tag { display: flex; gap: 8px; align-items: center; margin: 6px 0 2px; font-size: 12px; font-weight: 700; }
.topic-tag > span:first-child { color: var(--lime); background: var(--lime-dim); border: 1px solid rgba(200, 255, 30, 0.35); padding: 2px 9px; border-radius: 99px; }
.topic-tag .diff { padding: 2px 8px; border-radius: 99px; color: var(--midnight); }
.diff-easy { background: #30a46c; } .diff-medium { background: #d4a017; } .diff-hard { background: #ff4d5e; }

/* ---------- mini games ---------- */
.mg-help { color: var(--muted); font-size: 14px; margin: 8px 0 10px; }
.mini-game { display: flex; flex-direction: column; align-items: center; gap: 12px; user-select: none; -webkit-user-select: none; }
.mg-row { display: flex; gap: 8px; justify-content: center; }
.mg-jig { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; width: min(100%, 340px); aspect-ratio: 3 / 2; }
.mg-piece { border: 2px solid var(--line-bright); border-radius: 4px; background-repeat: no-repeat; cursor: pointer; padding: 0; }
.mg-piece { position: relative; }
.mg-num { position: absolute; top: 3px; left: 4px; min-width: 22px; padding: 1px 5px; border-radius: 6px; font: 700 15px/1.25 var(--mono, monospace); color: #fff; background: rgba(0, 0, 0, 0.62); text-align: center; pointer-events: none; }
.mg-piece.ok { border-color: #3ddc84; }
.mg-piece.ok .mg-num { background: #1f9d55; }
.mg-piece.sel { border-color: var(--lime); box-shadow: 0 0 12px var(--lime-glow); transform: scale(0.94); }
.mg-word { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; }
.mg-wgroup { display: flex; gap: 4px; }
.mg-word.bad .mg-slot { border-color: var(--danger); color: var(--danger); }
.mg-slot { width: 24px; height: 34px; border-bottom: 3px solid var(--line-bright); display: grid; place-items: center; font-family: var(--display); font-size: 22px; font-weight: 700; }
.mg-gap { width: 14px; }
.mg-tiles { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.mg-tile { width: 40px; height: 44px; border-radius: 8px; border: 1px solid var(--line-bright); background: var(--surface-2); font-family: var(--display); font-size: 20px; font-weight: 700; cursor: pointer; }
.mg-tile:disabled { opacity: 0.2; cursor: default; }
.mg-maze { width: min(100%, 340px); height: auto; border-radius: 8px; border: 1px solid var(--line-bright); touch-action: none; }
.mg-pad { display: grid; grid-template-columns: repeat(3, 48px); gap: 6px; }
.mg-pad .btn { padding: 8px 0; }
.mg-tubes { display: flex; gap: 18px; justify-content: center; padding-top: 14px; }
.mg-tube { width: 46px; padding: 6px 5px; display: flex; flex-direction: column; gap: 4px; border: 2px solid var(--line-bright); border-top: none; border-radius: 0 0 24px 24px; background: rgba(255, 255, 255, 0.04); cursor: pointer; transition: transform 0.12s; }
.mg-tube span { height: 30px; border-radius: 6px; }
.mg-tube span:last-child { border-radius: 6px 6px 18px 18px; }
.mg-tube.sel { transform: translateY(-12px); border-color: var(--lime); }
.film-wait { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.film-wait span { padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line-bright); font-size: 13px; }
.film-wait span.done { border-color: rgba(200, 255, 30, 0.5); color: var(--lime); }
.film-note { font-size: 13px; margin: 6px 0 0; }

/* ---------- song pictionary (city 1) ---------- */
.song-pic { font-size: 54px; line-height: 1.2; text-align: center; letter-spacing: 6px; margin: 10px 0 4px; }
.song-clue { text-align: center; font-size: 17px; }
.song-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.song-choice { font-weight: 600; justify-content: center; text-align: center; }
.song-choice.nope { opacity: 0.35; text-decoration: line-through; }
.found-by { font-size: 18px; margin: 4px 0 2px; color: var(--lime); }
.end-treasures { list-style: none; padding: 0; margin: 8px 0 14px; display: grid; gap: 6px; text-align: left; font-size: 14px; color: var(--muted, inherit); }
.end-treasures li { padding: 8px 12px; border-radius: 10px; background: rgba(127,127,127,.1); }
.s3-reset { position: absolute; z-index: 3; right: 10px; bottom: 10px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line-bright); background: rgba(0, 0, 0, 0.7); color: var(--ink); font: 600 12px var(--mono); cursor: pointer; }
.s3-reset:hover { border-color: var(--lime); }

/* ---------- watching other teams (eliminated players) ---------- */
.watch-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.watch-tab { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--c, var(--line-bright)); background: transparent; color: inherit; font-weight: 600; cursor: pointer; }
.watch-tab.on { background: var(--c); color: #0b0b0c; }
.watch-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.watch-list li { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-bright); background: rgba(0, 0, 0, 0.5); }
.watch-list li div { margin-top: 4px; font-size: 14px; line-height: 1.4; }
.watch-board { margin-top: 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.watch-board .mg-jig, .watch-board .mg-maze { width: min(100%, 220px); }
.watch-board .mg-tube { width: 32px; } .watch-board .mg-tube span { height: 20px; }
.watch-board .mg-tile { width: 30px; height: 34px; font-size: 16px; } .watch-board .mg-slot { width: 18px; height: 26px; font-size: 16px; }
.watch-typing { margin-top: 6px; font-family: var(--mono); color: var(--lime); font-size: 13px; }
.watch-wrong { font-size: 12px; color: var(--danger); font-weight: 600; }
.song-pic.small { font-size: 30px; letter-spacing: 3px; text-align: left; margin: 2px 0; }
.watch-choices { pointer-events: none; } .watch-choices .song-choice { padding: 6px 8px; font-size: 13px; }

/* ---------- sound toggle ---------- */
.mute-btn { margin-left: 10px; background: transparent; border: 1px solid var(--line-bright); border-radius: 8px; padding: 4px 8px; font-size: 16px; cursor: pointer; color: inherit; }

/* ---------- chat ---------- */
#chat.hidden { display: none; }
.chat-fab { position: fixed; right: 16px; bottom: 16px; z-index: 60; width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--line-bright); background: var(--lime); color: #0b0b0c; font-size: 24px; cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); }
.chat-fab.hidden { display: none; }
.chat-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--danger, #ff4d5e); color: #fff; font: 700 12px/20px var(--mono, monospace); }
.chat-badge.hidden { display: none; }
.chat-panel { position: fixed; right: 16px; bottom: 16px; z-index: 60; width: min(360px, calc(100vw - 32px)); height: min(460px, calc(100vh - 120px)); display: flex; flex-direction: column; border-radius: 14px; border: 1px solid var(--line-bright); background: var(--surface, #121214); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); overflow: hidden; }
.chat-panel.hidden { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line-bright); }
.chat-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.chat-tab { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-bright); background: transparent; color: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.chat-tab.on { background: var(--lime); color: #0b0b0c; border-color: var(--lime); }
.chat-x { background: transparent; border: 0; color: inherit; font-size: 18px; cursor: pointer; }
.chat-list { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.chat-msg { font-size: 14px; line-height: 1.35; padding: 6px 9px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); max-width: 90%; word-wrap: break-word; }
.chat-msg.me { align-self: flex-end; background: rgba(200, 255, 30, 0.12); }
.chat-empty { margin: auto; text-align: center; }
.chat-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line-bright); }
.chat-form input { flex: 1; min-width: 0; }

/* ---------- winner-screen stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 14px 0 10px; text-align: left; }
.stat { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-bright); background: rgba(0, 0, 0, 0.5); display: flex; flex-direction: column; gap: 2px; }
.stat span { font-size: 12px; color: var(--muted); }
.stat b { font-size: 16px; }
.stat small { font-size: 12px; color: var(--muted); }
.stat-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 6px; }
.stat-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 4px 6px; border-bottom: 1px solid var(--line-bright); }
.stat-table td { padding: 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.stat-table td:not(:first-child), .stat-table th:not(:first-child) { text-align: center; }
.s3-pad { position: absolute; z-index: 3; left: 10px; bottom: 10px; display: grid; grid-template-columns: repeat(4, 46px); gap: 6px; user-select: none; -webkit-user-select: none; }
.s3-pad button { height: 46px; border-radius: 10px; border: 1px solid var(--line-bright); background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 18px; touch-action: none; }
.s3-pad button:active { background: rgba(200, 255, 30, 0.35); }
body.offline::before { content: 'Connection lost — reconnecting…'; position: fixed; z-index: 1000; top: 0; left: 0; right: 0; padding: 6px 12px; text-align: center; font: 600 13px var(--mono, monospace); background: #b3261e; color: #fff; }

/* ---------- motion & polish (Nov 7) ---------- */
/* living background: two soft glows drift slowly behind everything */
body::after { content: ''; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background: radial-gradient(40% 35% at 30% 30%, rgba(255, 255, 255, 0.045), transparent 70%), radial-gradient(35% 30% at 70% 70%, rgba(200, 255, 30, 0.06), transparent 70%);
  animation: drift 26s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(6%, -4%) rotate(8deg); } }

/* screens slide in */
.screen-in { animation: screenIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px) scale(0.985); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* cards and lists come in one after another */
.screen-in .lobby > *, .screen-in .end > * { animation: rise 0.45s ease-out backwards; }
.screen-in .lobby > *:nth-child(2), .screen-in .end > *:nth-child(2) { animation-delay: 0.06s; }
.screen-in .lobby > *:nth-child(3), .screen-in .end > *:nth-child(3) { animation-delay: 0.12s; }
.screen-in .lobby > *:nth-child(4), .screen-in .end > *:nth-child(4) { animation-delay: 0.18s; }
.screen-in .lobby > *:nth-child(n+5), .screen-in .end > *:nth-child(n+5) { animation-delay: 0.24s; }
.screen-in .end .progress li { animation: slideIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.end .progress li:nth-child(1) { animation-delay: 0.3s; } .end .progress li:nth-child(2) { animation-delay: 0.42s; }
.end .progress li:nth-child(3) { animation-delay: 0.54s; } .end .progress li:nth-child(n+4) { animation-delay: 0.66s; }
.end .progress li:first-child { background: linear-gradient(90deg, rgba(200, 255, 30, 0.14), transparent); border-color: rgba(200, 255, 30, 0.35); }
.screen-in .end .stats > * { animation: pop 0.45s cubic-bezier(0.3, 1.5, 0.5, 1) backwards; animation-delay: 0.8s; }
.end .stats > *:nth-child(2) { animation-delay: 0.9s; } .end .stats > *:nth-child(3) { animation-delay: 1s; } .end .stats > *:nth-child(4) { animation-delay: 1.1s; }
.screen-in .end h1, .screen-in .end h2 { animation: glowIn 0.9s ease-out backwards; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }
@keyframes glowIn { from { opacity: 0; letter-spacing: 0.3em; filter: blur(6px); } to { opacity: 1; filter: none; } }

/* lobby: players pop in, team boxes lift */
.team-box { transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.team-box:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--line-bright); }
.team-box .members > * { animation: pop 0.35s cubic-bezier(0.3, 1.5, 0.5, 1) backwards; }
.lobby-code { animation: codeGlow 3s ease-in-out infinite; }
@keyframes codeGlow { 50% { text-shadow: 0 0 40px var(--lime-glow), 0 0 4px var(--lime); } }

/* buttons: a light sweep on the main button, a springy press */
.btn { position: relative; overflow: hidden; }
/* buttons that float over the map keep their own place (the rule above made every .btn relative and put "Next clue" on the zoom buttons) */
.btn.next-clue, .btn.monument-toggle { position: absolute; }
.btn.primary::after { content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent); transform: skewX(-20deg); animation: sheen 3.6s ease-in-out infinite; pointer-events: none; }
@keyframes sheen { 0%, 70% { left: -60%; } 100% { left: 130%; } }
.btn:active:not(:disabled) { transform: scale(0.96); }

/* clue panel: new clue fades in, slips bob */
.clue-panel .clue, .clue-panel .song-pic, .clue-panel #miniGame { animation: clueIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
@keyframes clueIn { from { opacity: 0; transform: translateY(10px); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }
.slips .slip { animation: bob 2.6s ease-in-out infinite; }
.slips .slip:nth-child(2) { animation-delay: 0.3s; } .slips .slip:nth-child(3) { animation-delay: 0.6s; }
.slips .slip:hover { animation-play-state: paused; }
@keyframes bob { 50% { box-shadow: inset 0 0 0 4px var(--midnight), inset 0 0 0 5px var(--lime-dim), 0 0 22px var(--lime-dim); } }
.stop-bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); overflow: hidden; margin: 6px 0 10px; }
.stop-bar i { display: block; height: 100%; width: var(--to); border-radius: 4px; background: linear-gradient(90deg, var(--cobalt), var(--lime)); box-shadow: 0 0 10px var(--lime-glow); animation: barGrow 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes barGrow { from { width: var(--from); } }

/* team list: the row of my team glows softly */
.progress li.me { animation: meGlow 2.8s ease-in-out infinite; }
@keyframes meGlow { 50% { box-shadow: 0 0 18px rgba(255, 255, 255, 0.122); } }

/* toasts spring in from the side */
.toast { animation: toastIn 0.4s cubic-bezier(0.3, 1.4, 0.5, 1); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px) scale(0.95); } to { opacity: 1; transform: none; } }

/* effects that go with the sounds (fx.js vfx) */
.vfx-edge { position: fixed; inset: 0; z-index: 1500; pointer-events: none; box-shadow: inset 0 0 90px 18px var(--c); animation: edgeFade 0.9s ease-out forwards; }
@keyframes edgeFade { from { opacity: 1; } to { opacity: 0; } }
.vfx-spark { position: fixed; z-index: 1501; width: 8px; height: 8px; margin: -4px; border-radius: 50%; pointer-events: none; background: var(--c); box-shadow: 0 0 10px var(--c); animation: spark 0.9s cubic-bezier(0.1, 0.7, 0.3, 1) forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; } }
.vfx-shake { animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes shake { 15%, 85% { transform: translateX(-3px); } 30%, 70% { transform: translateX(6px); } 45%, 55% { transform: translateX(-8px); } 50% { transform: translateX(8px); } }
.clue-panel { position: relative; }
.vfx-ribbon { position: absolute; left: 0; right: 0; top: 38%; z-index: 30; pointer-events: none; display: flex; justify-content: center; overflow: hidden; }
.vfx-ribbon span { font-family: var(--display); font-weight: 700; letter-spacing: 0.18em; font-size: 20px; color: var(--midnight); background: var(--lime); padding: 8px 22px; border-radius: 8px; box-shadow: 0 0 40px var(--lime-glow); animation: ribbon 1.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
@keyframes ribbon { 0% { transform: translateX(-120%) skewX(-12deg); opacity: 0; } 20% { transform: none; opacity: 1; } 75% { transform: none; opacity: 1; } 100% { transform: translateX(120%) skewX(-12deg); opacity: 0; } }
.vfx-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 1600; pointer-events: none; }
.on-the-way { text-align: center; padding: 18px 6px 8px; animation: clueIn 0.4s ease-out; }
.on-the-way .otw-icon { font-size: 40px; display: inline-block; animation: otwSpin 2.4s ease-in-out infinite; filter: drop-shadow(0 0 12px var(--lime-glow)); }
@keyframes otwSpin { 0% { transform: rotate(-25deg); } 50% { transform: rotate(25deg); } 100% { transform: rotate(-25deg); } }
body.travelling .tab-btn[data-view="clue"] { opacity: 0.4; pointer-events: none; }
body.travelling .next-clue { display: none !important; }

/* ---------- arrival montage (montage.js) ---------- */
.montage { position: fixed; inset: 0; z-index: 1450; background: #000; overflow: hidden; opacity: 0; transition: opacity 0.5s; }
.montage.in { opacity: 1; } .montage.out { opacity: 0; }
.mt-shots, .mt-shot, .mt-plain { position: absolute; inset: 0; }
.mt-shot { width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.18); transition: opacity 0.7s ease, transform 3.2s ease-out; filter: saturate(1.1) contrast(1.05); }
.mt-shot.on { opacity: 1; transform: scale(1.02) translate(calc(var(--i) * 0.6% - 1%), 0); }
.mt-plain { display: grid; place-items: center; font-size: 120px; background: radial-gradient(circle at 50% 40%, #2a2a2e, #05060a 70%); animation: kenburns 9s ease-out forwards; }
.mt-bars { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(#000 0 9%, transparent 9% 91%, #000 91%), radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.65)); }
.mt-text { position: absolute; left: 0; right: 0; bottom: 15%; padding: 0 24px; text-align: center; color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.9), 0 0 2px #000; }
.mt-text small { display: block; font-family: var(--mono); font-size: 13px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--lime); opacity: 0; animation: mtUp 0.7s 0.3s ease-out forwards; }
.mt-text h2 { margin: 6px 0 2px; font-family: var(--display); font-size: clamp(34px, 8vw, 72px); line-height: 1.05; letter-spacing: 0.04em; opacity: 0; animation: mtTitle 1s 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.mt-text p { margin: 0; font-size: clamp(18px, 3.4vw, 26px); font-weight: 600; opacity: 0; animation: mtUp 0.7s 1.1s ease-out forwards; }
.mt-text em { display: inline-block; margin-top: 14px; font-style: normal; font-weight: 700; font-size: clamp(15px, 2.8vw, 20px); color: var(--midnight); background: var(--lime); padding: 6px 16px; border-radius: 999px; box-shadow: 0 0 30px var(--lime-glow); opacity: 0; animation: mtUp 0.7s 1.9s ease-out forwards; text-shadow: none; }
.mt-2 { display: none; }
.montage.part2 .mt-1 { display: none; }
.montage.part2 .mt-2 { display: block; }
.mt-2 h2 { color: var(--lime); }
.mt-2 em { animation-delay: 0.9s; }
.mt-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.12); }
.mt-progress b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cobalt), var(--lime)); animation: fxbar calc(var(--d1) + var(--d2)) linear forwards; }
@keyframes mtUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes mtTitle { from { opacity: 0; transform: scale(1.15); letter-spacing: 0.25em; filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
.mt-text { padding-top: 60px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55) 40%, rgba(0, 0, 0, 0.7)); bottom: 9%; padding-bottom: 26px; }
.mt-text small { font-size: 14px; font-weight: 700; text-shadow: 0 1px 6px #000; }
.mt-stage { position: absolute; inset: 0; }
.mt-stage canvas { display: block; width: 100% !important; height: 100% !important; }
.montage .s3-reset, .montage .s3-tip, .montage .s3-pad, .montage .s3-loading { display: none !important; }
.montage:not(.rolling) .mt-text *, .montage:not(.rolling) .mt-progress b { animation-play-state: paused; }
.montage .mt-plain.hidden { display: none; }

/* ---------- smoothness (Nov 7): nothing repaints or re-lays-out the page while idle ----------
   Looping decorations only animate transform/opacity (done by the GPU, no page work), no live blur behind panels,
   and one-shot entrances don't blur whole screens. */
.btn.primary::after { left: 0; transform: translateX(-160%) skewX(-20deg); animation: sheenX 4.5s ease-in-out infinite; will-change: transform; }
@keyframes sheenX { 0%, 72% { transform: translateX(-160%) skewX(-20deg); } 100% { transform: translateX(360%) skewX(-20deg); } }
.progress li.me { animation: none; position: relative; }
.progress li.me::after { content: ''; position: absolute; inset: -1px; border-radius: 8px; box-shadow: 0 0 18px rgba(255, 255, 255, 0.14); opacity: 0; pointer-events: none; animation: fadePulse 2.8s ease-in-out infinite; will-change: opacity; }
.slips .slip { animation: none; position: relative; }
.slips .slip::after { content: ''; position: absolute; inset: -2px; border-radius: inherit; box-shadow: 0 0 22px var(--lime-dim); opacity: 0; pointer-events: none; animation: fadePulse 2.6s ease-in-out infinite; will-change: opacity; }
.slips .slip:nth-child(2)::after { animation-delay: 0.3s; } .slips .slip:nth-child(3)::after { animation-delay: 0.6s; }
@keyframes fadePulse { 50% { opacity: 1; } }
.lobby-code { animation: none; }
body::after { will-change: transform; }
.topbar { backdrop-filter: none; background: rgba(0, 0, 0, 0.96); }
.fx-hud { backdrop-filter: none !important; background: rgba(0, 0, 0, 0.9) !important; }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes clueIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.fx-flight .fx-layer i { will-change: transform; }
.mobile-tabs { backdrop-filter: none !important; background: rgba(0, 0, 0, 0.97) !important; }
.choice { flex-wrap: wrap; }
.choice-members { flex-basis: 100%; padding-left: 16px; font-size: 12.5px; font-weight: 500; color: var(--muted); }

/* ---------- team pins and visited stamps on the map ---------- */
.team-pin-wrap, .stamp-wrap { background: none; border: 0; }
.team-pin { position: relative; display: grid; place-items: center; width: 100%; height: 100%; box-sizing: border-box; border-radius: 50%; background: var(--c); color: #fff; font: 800 13px/1 var(--display, system-ui); letter-spacing: 0.02em; border: 3px solid #fff; box-shadow: 0 3px 12px rgba(0, 0, 0, 0.6); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45); }
.team-pin.rival { font-size: 10.5px; border-width: 2px; opacity: 0.95; }
.team-pin.me { font-size: 14px; }
.team-pin.me::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 3px solid var(--c); opacity: 0; animation: pinPulse 2.2s ease-out infinite; will-change: transform, opacity; }
@keyframes pinPulse { 0% { transform: scale(0.7); opacity: 0.8; } 100% { transform: scale(1.35); opacity: 0; } }
.pin-tag { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: rgba(0, 0, 0, 0.85); color: #fff; font: 600 11.5px var(--body, system-ui); padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.22); pointer-events: none; }
.stamp { display: grid; place-items: center; width: 20px; height: 20px; box-sizing: border-box; border-radius: 50%; background: rgba(0, 0, 0, 0.8); border: 2px solid var(--c); color: #fff; font: 700 10.5px/1 var(--display, system-ui); box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); }

/* ---------- landing page (Nov 8) ---------- */
#screen-home { position: relative; padding-bottom: 40px; }
.home-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.home-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.12); transition: opacity 1.6s ease, transform 7s ease-out; will-change: opacity, transform; filter: saturate(1.05); }
.home-bg img.on { opacity: 1; transform: scale(1.02); }
.home-bg-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, 0.93) 0%, rgba(0, 0, 0, 0.78) 45%, rgba(0, 0, 0, 0.55) 100%), linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.35) 55%, var(--midnight) 100%); }
#screen-home .home, #screen-home .home-more { position: relative; z-index: 1; }
.home { margin-top: 8vh; min-height: 62vh; }
.home h1 { font-size: clamp(40px, 6.2vw, 76px); line-height: 1.02; letter-spacing: -0.01em; margin: 0 0 18px; }
.home h1 span { background: linear-gradient(90deg, var(--lime), #f3ffb0 60%, var(--lime)); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 0 22px rgba(200, 255, 30, 0.35)); }
.home-copy p { font-size: 17px; color: #d1d1d6; }
.home-steps li { background: rgba(0, 0, 0, 0.55); border-color: rgba(255, 255, 255, 0.16); color: #d1d1d6; }
.home-card { background: rgba(12, 12, 13, 0.86); border-color: rgba(255, 255, 255, 0.14); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); }
.home-more { max-width: 1040px; margin: 30px auto 0; padding: 0 4px; }
.home-h2 { font-family: var(--display); font-size: 22px; letter-spacing: 0.06em; text-transform: uppercase; margin: 46px 0 18px; display: flex; align-items: center; gap: 14px; }
.home-h2::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-bright), transparent); }
.how { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; counter-reset: how; }
.how li { position: relative; padding: 20px 18px 18px; border-radius: 16px; background: rgba(12, 12, 13, 0.82); border: 1px solid rgba(255, 255, 255, 0.1); transition: transform 0.2s, border-color 0.2s; }
.how li:hover { border-color: var(--lime-dim); }
.how-n { position: absolute; top: 14px; right: 16px; font: 700 12px var(--mono); color: var(--muted); }
.how-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; font-size: 24px; background: linear-gradient(135deg, rgba(255, 255, 255, 0.122), rgba(200, 255, 30, 0.12)); margin-bottom: 12px; }
.how b { display: block; font-size: 16px; margin-bottom: 6px; }
.how p { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.dest { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.dest figure { margin: 0; position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 5; border: 1px solid rgba(255, 255, 255, 0.1); background: var(--surface); }
.dest img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.dest figure:hover img { transform: scale(1.07); }
.dest figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 12px 12px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.92)); }
.dest figcaption b { display: block; font-size: 14px; }
.dest figcaption span { font-size: 12px; color: var(--lime); font-family: var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.feat { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.feat li { padding: 9px 16px; border-radius: 999px; background: rgba(12, 12, 13, 0.8); border: 1px solid rgba(255, 255, 255, 0.12); font-size: 13.5px; font-weight: 600; }
@media (max-width: 900px) {
  .home { margin-top: 3vh; min-height: 0; }
  .how { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dest { grid-template-columns: repeat(5, 62%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .dest figure { scroll-snap-align: start; aspect-ratio: 16 / 11; }
  .home-bg-shade { background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.85) 40%, var(--midnight) 100%); }
}
@media (max-width: 520px) { .how { grid-template-columns: 1fr; } }

.dest-all { display: inline-flex; margin-top: 16px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--midnight); background: var(--lime); padding: 11px 18px; border-radius: 999px; text-decoration: none; font-weight: 700; }
.dest-all:hover { filter: brightness(1.08); }

/* Design Session 2: knockout vote + greyed-out shielded teams */
.choice.blocked { opacity: .45; cursor: not-allowed; filter: grayscale(.6); }
.vote-row { display: flex; gap: 10px; margin-top: 10px; }
.vote-row .btn { flex: 1; }
.ko-timer, .card-timer { font-weight: 700; }

/* Design Session 3: own-answer stops + offline teammates */
.logo-q { display: flex; justify-content: center; margin: 6px 0 10px; }
.logo-q img { width: 128px; height: 128px; object-fit: contain; background: #fff; border-radius: 16px; padding: 10px; }
.abbr-q { text-align: center; font: 700 34px/1.1 'Chakra Petch', system-ui, sans-serif; letter-spacing: .06em; color: var(--lime, #c6ff1a); margin: 4px 0 8px; }
.kick-bar { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 170, 40, .12); border: 1px solid rgba(255, 170, 40, .4); font-size: 14px; line-height: 1.4; }
.kick-bar .btn { margin-left: 6px; }
.kick-bar .vote-row { margin-top: 8px; }
.tagline-q { text-align: center; font: 700 24px/1.25 'Chakra Petch', system-ui, sans-serif; font-style: italic; color: var(--lime, #c6ff1a); margin: 6px 0 10px; text-wrap: balance; }
.mg-reset { margin: 4px 0 10px; display: flex; justify-content: flex-end; }

/* Phones / small tablets in a game: the chat button gets its own slot at the right end of the CLUE / MAP tab bar
   (it used to float underneath the tab bar, on top of MAP), and the chat panel opens above the bar. */
@media (max-width: 900px) {
  body:has(#screen-game:not(.hidden)) .mobile-tabs { padding-right: calc(max(16px, env(safe-area-inset-right, 0px)) + 58px); }
  body:has(#screen-game:not(.hidden)) .chat-fab {
    right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 960;
    width: 50px; height: 50px; top: auto; border-radius: 12px; font-size: 22px;
    background: transparent; border: 1px solid var(--line-bright); box-shadow: none;
  }
  body:has(#screen-game:not(.hidden)) .chat-panel {
    bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 970;
    height: min(460px, calc(100dvh - 64px - 100px - env(safe-area-inset-bottom, 0px)));
  }
}

/* iPhone/iPad zoom into any text box under 16px and stay zoomed; touch screens get 16px boxes */
@media (pointer: coarse) { input, select, textarea { font-size: 16px; } }

/* Design Session 4: jigsaw with interlocking pieces, flag pictures, Telugu punchlines */
.mg-jigsaw { display: block; width: min(100%, 480px); height: auto; border-radius: 10px; border: 1px solid var(--line-bright); touch-action: none; cursor: grab; background: #0b0b0c; }
.mg-jigsaw:active { cursor: grabbing; }
.watch-board .mg-jigsaw { width: min(100%, 220px); cursor: default; }
.logo-q.flag-q img { width: 200px; height: 150px; object-fit: contain; background: transparent; padding: 0; border-radius: 6px; box-shadow: 0 2px 14px rgba(0, 0, 0, .45); }
.tagline-q.punch-q { font-family: 'Noto Sans Telugu', 'Nirmala UI', 'Gautami', system-ui, sans-serif; font-style: normal; font-size: 22px; line-height: 1.5; }
.mg-tubes { flex-wrap: wrap; gap: 12px 14px; }

/* Colour sort on iPhones: Safari does not stretch the colour blocks inside a <button>, so they had no width and the
   tubes looked empty. Give the tube and its blocks explicit sizes. */
.mg-tube { align-items: stretch; box-sizing: border-box; -webkit-appearance: none; appearance: none; }
.mg-tube span { display: block; flex: 0 0 30px; width: 100%; min-width: 30px; align-self: stretch; }
.watch-board .mg-tube span { flex-basis: 20px; min-width: 18px; }
.mg-jigsaw { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }

/* ---------- Smooth motion (Nov 16, 2026): Apple-style springs, transform and opacity only ---------- */
:root { --spring: cubic-bezier(.34, 1.56, .64, 1); --ease-out: cubic-bezier(.22, 1, .36, 1); }
.btn, .choice, .song-choice, .slip, .object, .tab-btn, .mg-tube, .mg-pad .btn, .watch-tab {
  transition: transform .5s var(--spring), background-color .25s ease, border-color .25s ease, box-shadow .3s ease, color .25s ease, opacity .3s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled), .choice:active, .song-choice:active:not(:disabled), .slip:active, .object:active, .tab-btn:active, .mg-pad .btn:active { transform: scale(.95); transition-duration: .12s; }
.choice:hover, .song-choice:hover:not(:disabled) { border-color: var(--line-bright); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06); }
.slip:hover { transform: translateY(-4px) rotate(-2deg); }
.song-choice.nope { transition: opacity .35s ease; }
/* each new stop (and the trip / slip) slides in */
.clue-panel.stop-enter { animation: stopEnter .55s var(--ease-out) both; }
@keyframes stopEnter { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
/* frozen: the panel behind blurs; the countdown pops in */
.freeze { -webkit-backdrop-filter: blur(6px) saturate(1.2); backdrop-filter: blur(6px) saturate(1.2); animation: freezeIn .35s ease both; }
@keyframes freezeIn { from { opacity: 0; } }
/* toasts rise with a spring */
.toast { animation: toastSpring .55s var(--spring) both; }
@keyframes toastSpring { from { opacity: 0; transform: translateY(14px) scale(.96); } }
/* phone tabs: one lime pill that slides between Clue and Map */
.mobile-tabs .tab-ind { position: absolute; left: 0; top: 0; z-index: 0; border-radius: 12px; background: var(--lime); box-shadow: 0 0 20px var(--lime-glow); transition: transform .5s cubic-bezier(.3, 1.22, .5, 1), width .3s ease; pointer-events: none; }
.mobile-tabs.has-ind .tab-btn { position: relative; z-index: 1; }
.mobile-tabs .tab-ind.still { transition: none; }
.mobile-tabs.has-ind .tab-btn[aria-pressed="true"] { background: transparent; border-color: transparent; box-shadow: none; }
/* the top bar and phone tabs stay solid black (no live blur, see Nov 7 smoothness) */
/* ---------- Look 2 (Nov 16): more buttery motion ---------- */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
/* picking a slip: the chosen one flips over and glows, the others fall away */
.slips { perspective: 700px; }
.slips .slip { transition: transform .5s var(--spring), opacity .35s ease, filter .35s ease; }
.slips.picking .slip { pointer-events: none; }
.slips.picking .slip:not(.picked) { opacity: 0; transform: translateY(26px) scale(.86); filter: blur(2px); }
.slips.picking .slip.picked { animation: slipFlip .52s cubic-bezier(.3, .7, .3, 1) forwards; border-color: var(--lime); box-shadow: 0 0 34px var(--lime-glow); }
.slips.picking .slip.picked::after { display: none; }
@keyframes slipFlip { 0% { transform: none; } 45% { transform: translateY(-10px) scale(1.12) rotateY(90deg); } 100% { transform: translateY(-4px) scale(1.04) rotateY(180deg); color: transparent; } }
.slips .slip:nth-child(2) { transition-delay: .04s; } .slips .slip:nth-child(3) { transition-delay: .08s; }
/* new stop: its pieces arrive one after another */
.clue-panel.stop-enter .choices > *, .clue-panel.stop-enter .song-choices > *, .clue-panel.stop-enter .slips > * { animation: itemIn .5s var(--ease-out) backwards; }
.clue-panel.stop-enter :is(.choices, .song-choices, .slips) > :nth-child(2) { animation-delay: .05s; }
.clue-panel.stop-enter :is(.choices, .song-choices, .slips) > :nth-child(3) { animation-delay: .1s; }
.clue-panel.stop-enter :is(.choices, .song-choices, .slips) > :nth-child(4) { animation-delay: .15s; }
.clue-panel.stop-enter :is(.choices, .song-choices, .slips) > :nth-child(5) { animation-delay: .2s; }
.clue-panel.stop-enter :is(.choices, .song-choices, .slips) > :nth-child(n+6) { animation-delay: .25s; }
@keyframes itemIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
/* phones: Clue and Map glide in from their side when you switch */
.view-in-r { animation: viewInR .5s var(--ease-out); } .view-in-l { animation: viewInL .5s var(--ease-out); }
@keyframes viewInR { from { opacity: 0; transform: translateX(34px) scale(.985); } }
@keyframes viewInL { from { opacity: 0; transform: translateX(-34px) scale(.985); } }
/* chat opens with a spring from its button */
.chat-panel:not(.hidden) { transform-origin: 100% 100%; animation: chatIn .45s var(--spring); }
@keyframes chatIn { from { opacity: 0; transform: translateY(16px) scale(.9); } }
/* desktop hover: cards lift softly */
@media (hover: hover) {
  .how li, .feat li { transition: translate .45s var(--spring), border-color .3s ease, box-shadow .3s ease; }
  .how li:hover { translate: 0 -6px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); }
  .feat li:hover { translate: 0 -2px; }
  .btn:hover:not(:disabled) { transform: translateY(-2px); }
  .btn:active:not(:disabled) { transform: scale(.95); }
}
/* home page: the "how it works" cards and chips rise in as you scroll (browsers that support it) */
@supports (animation-timeline: view()) {
  .how li, .feat li { animation: scrollRise linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
  @keyframes scrollRise { from { opacity: 0; transform: translateY(40px) scale(.96); } to { opacity: 1; transform: none; } }
}

@media (prefers-reduced-motion: reduce) { .clue-panel.stop-enter, .toast, .freeze, .view-in-r, .view-in-l, .chat-panel, .how li, .feat li { animation: none !important; } .mobile-tabs .tab-ind { transition: none; } }

/* Nov 18 arrival fixes: hide the photo's big caption while the trip card is still on screen (they overlapped) */
.monument-cap { transition: opacity .3s; }
.map-wrap:has(.fx:not(.hidden)) .monument-cap { opacity: 0; }
/* the picked slip shows an open scroll on its back instead of a blank card */
.slips.picking .slip.picked::before { content: '📜'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; transform: rotateY(180deg); opacity: 0; animation: slipBack .52s forwards; pointer-events: none; }
@keyframes slipBack { 0%, 45% { opacity: 0; } 55%, 100% { opacity: 1; } }

/* live count of players on the home page (Nov 18) */
.home-steps .live-now { display: inline-flex; align-items: center; gap: 6px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #2ee86a; box-shadow: 0 0 0 0 rgba(46, 232, 106, 0.6); animation: livePulse 1.8s ease-out infinite; flex: none; }
@keyframes livePulse { 70% { box-shadow: 0 0 0 8px rgba(46, 232, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(46, 232, 106, 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* Home footer with the info pages (Nov 19, 2026): About, How to play, Privacy, Terms, Contact, Photo credits */
.home-foot { position: relative; z-index: 1; max-width: 1040px; margin: 56px auto 0; padding: 22px 4px 34px; border-top: 1px solid var(--line); }
.home-foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.home-foot a { color: var(--muted); text-decoration: none; font-size: 14px; padding: 4px 0; }
.home-foot a:hover, .home-foot a:focus-visible { color: var(--lime); }
.home-foot p { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
