:root {
  --bg: #05080f;
  --panel: rgba(13, 20, 36, 0.78);
  --line: rgba(160, 190, 255, 0.14);
  --text: #e9eefb;
  --muted: #8592ad;
  --lime: #c6ff3d;
  --lime-dim: rgba(198, 255, 61, 0.16);
  --coral: #ff4d6d;
  --sky: #45d4ff;
  --gold: #ffcf4a;
  --display: "Unbounded", system-ui, sans-serif;
  --body: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  background: radial-gradient(1200px 700px at 70% 40%, #0f1d3a 0%, var(--bg) 60%);
  color: var(--text);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
a { color: var(--sky); }
[hidden] { display: none !important; }

#globe { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9000; }

.screen { position: fixed; inset: 0; display: none; z-index: 1; }
.screen.active { display: block; animation: screenIn .4s cubic-bezier(.2,.8,.2,1); }
.screen.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
@keyframes screenIn { from { opacity: 0; } to { opacity: 1; } }

/* ───────────── SHARED BITS ───────────── */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.panel-label {
  font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 12px; display: flex; align-items: center; gap: 10px;
}
summary.panel-label { cursor: pointer; margin: 0; list-style: none; }
summary.panel-label::-webkit-details-marker { display: none; }
summary.panel-label::after { content: "▾"; margin-left: auto; font-size: 14px; transition: transform .2s; }
details[open] summary.panel-label { margin-bottom: 12px; }
details[open] summary.panel-label::after { transform: rotate(180deg); }

.chip { padding: 4px 8px; border-radius: 99px; background: rgba(255,255,255,.08); color: var(--text); letter-spacing: .08em; }
.chip.live { background: var(--lime); color: #0a0f00; }
.chip.bad { background: var(--coral); color: #fff; }

.ghost {
  padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line);
  font: 500 14px var(--body); transition: border-color .15s, background .15s; white-space: nowrap;
}
.ghost:hover { border-color: var(--text); background: rgba(255,255,255,.05); }
.hint { color: var(--muted); font-size: 13px; line-height: 1.5; }
.hint b { color: var(--text); }
.panel .hint { margin-top: 10px; }
.muted { color: var(--muted); line-height: 1.5; }
.small { font-size: 13px; }

input {
  padding: 12px 13px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(0,0,0,.35); color: var(--text); font: 500 16px var(--body); outline: none; min-width: 0;
}
input:focus { border-color: var(--lime); }

.play {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  padding: 18px 24px; border-radius: 14px; background: var(--lime); color: #0a0f00;
  font: 800 15px/1 var(--display); letter-spacing: .04em; overflow: hidden;
  box-shadow: 0 10px 40px rgba(198,255,61,.25), inset 0 -3px 0 rgba(0,0,0,.18);
  transition: transform .15s, box-shadow .15s, opacity .2s;
}
.play i { font-style: normal; font-size: 18px; transition: transform .2s; }
.play:hover { transform: translateY(-2px); }
.play:hover i { transform: translateX(4px); }
.play::before {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  animation: shine 3.2s infinite;
}
@keyframes shine { 60%, 100% { transform: translateX(120%); } }
.play.alt { background: transparent; color: var(--text); border: 2px solid var(--lime); box-shadow: 0 0 30px rgba(198,255,61,.12); }
.play.alt::before { display: none; }
.play.small { padding: 15px 20px; font-size: 13px; }
.play.wide { width: 100%; }
.play:disabled { opacity: .4; pointer-events: none; }

/* ───────────── TITLE ───────────── */
.title-wrap {
  max-width: 560px; margin: 0 0 0 clamp(16px, 8vw, 120px);
  padding: calc(clamp(24px, 6vh, 64px) + var(--safe-t)) 0 calc(48px + var(--safe-b));
  display: flex; flex-direction: column; gap: 16px;
}
.brand-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--lime);
}
.brand-kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px var(--lime); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.logo { font: 900 clamp(52px, 9vw, 96px)/.9 var(--display); letter-spacing: -0.04em; margin: 14px 0 12px; }
.logo span { display: block; color: transparent; -webkit-text-stroke: 2px var(--lime); text-shadow: 0 0 40px rgba(198,255,61,.35); }
.tagline { color: var(--muted); font-size: 16px; line-height: 1.55; max-width: 46ch; }

.play-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.best { font: 500 12px/1.4 var(--mono); color: var(--muted); }
.best b { color: var(--gold); }

.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mode-card {
  text-align: left; padding: 12px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255,255,255,.02);
  transition: border-color .2s, background .2s, transform .15s;
}
.mode-card:hover { transform: translateY(-2px); border-color: rgba(198,255,61,.5); }
.mode-card.on { border-color: var(--lime); background: var(--lime-dim); box-shadow: inset 0 0 0 1px var(--lime); }
.mode-card .emoji { font-size: 22px; display: block; margin-bottom: 8px; }
.mode-card b { display: block; font: 700 13px/1.2 var(--body); }
.mode-card small { color: var(--muted); font-size: 11px; }

.settings { display: grid; gap: 10px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.setting > span { font-weight: 500; font-size: 14px; }
.seg { display: inline-flex; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { padding: 8px 12px; border-radius: 7px; font: 500 13px/1 var(--mono); color: var(--muted); transition: all .15s; }
.seg button.on { background: var(--lime); color: #0a0f00; }
.seg button:disabled { opacity: .3; cursor: not-allowed; }

.key-row { display: flex; gap: 8px; }
.key-row input { flex: 1; }
#api-key { font-family: var(--mono); font-size: 14px; }

/* ───────────── PARTY SETUP ───────────── */
.center-wrap {
  max-width: 520px; margin: 0 auto;
  padding: calc(28px + var(--safe-t)) 16px calc(32px + var(--safe-b));
  display: flex; flex-direction: column; gap: 14px;
}
.back { align-self: flex-start; color: var(--muted); font: 500 14px var(--body); padding: 6px 0; }
.back:hover { color: var(--text); }
.h2 { font: 900 clamp(32px, 7vw, 44px)/1 var(--display); letter-spacing: -.02em; }
.players { list-style: none; display: grid; gap: 6px; }
.players:not(:empty) { margin-bottom: 12px; }
.players li {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 12px;
  background: rgba(255,255,255,.04); font-weight: 500; animation: slideIn .35s cubic-bezier(.2,.8,.2,1);
}
.players li em { flex: 1; font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players li button { width: 36px; height: 36px; border-radius: 9px; color: var(--muted); font-size: 15px; }
.players li button:hover { color: var(--coral); background: rgba(255,77,109,.1); }
@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } }
.swatch { width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); flex: none; }

/* ───────────── GAME ───────────── */
#screen-game { background: #000; }
#pano { position: absolute; inset: 0; }
#pano iframe { width: 100%; height: 100%; border: 0; display: block; }
#nmpz-shield { position: absolute; inset: 0; display: none; cursor: not-allowed; }
#address-cover {
  position: absolute; top: 10px; left: 10px; width: 340px; height: 96px; display: none;
  border-radius: 10px; background: rgba(8, 12, 22, .92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line); align-items: flex-end; padding: 12px 14px;
  font: 500 12px var(--mono); color: var(--muted); letter-spacing: .06em;
}
.keyless #address-cover { display: flex; }
.keyless .hud { top: 118px; }

.hud { position: absolute; top: 16px; left: 16px; display: flex; gap: 8px; pointer-events: none; }
.hud-box {
  background: rgba(5, 8, 15, .8); border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 14px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); min-width: 78px;
}
.hud-box label { display: block; font: 500 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 5px; }
.hud-box b { font: 700 18px/1 var(--display); white-space: nowrap; }
.hud-box.mode b { font-size: 13px; color: var(--lime); }
.player-box { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.player-box b { color: var(--c); font-size: 15px; max-width: 9em; overflow: hidden; text-overflow: ellipsis; display: block; }
.party-only { display: none; }
.party .party-only { display: block; }

.timer { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 76px; height: 76px; display: none; pointer-events: none; z-index: 4; }
.timer.on { display: block; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: rgba(5,8,15,.85); stroke-width: 7; }
.timer .track { stroke: rgba(255,255,255,.1); }
.timer .ring { fill: none; stroke: var(--lime); stroke-linecap: round; stroke-dasharray: 276.46; transition: stroke-dashoffset .25s linear, stroke .3s; }
.timer b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 20px var(--display); }
.timer.warn .ring { stroke: var(--coral); }
.timer.warn { animation: shake .5s infinite; }
@keyframes shake { 25% { transform: translateX(-50%) rotate(-4deg); } 75% { transform: translateX(-50%) rotate(4deg); } }

.tools { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; z-index: 4; }
.tools button {
  width: 44px; height: 44px; border-radius: 12px; font-size: 18px;
  background: rgba(5, 8, 15, .8); border: 1px solid var(--line); backdrop-filter: blur(10px);
  transition: border-color .15s;
}
.tools button:hover { border-color: var(--lime); }

/* Guess map — desktop: corner panel that grows on hover and stays big for a moment after */
#guess-wrap {
  position: absolute; right: 16px; bottom: 16px; width: 380px; z-index: 6;
  display: flex; flex-direction: column; gap: 8px;
  transition: width .25s cubic-bezier(.2,.8,.2,1);
}
#guess-wrap.hover, #guess-wrap.big { width: min(760px, 58vw); }
.guess-head { display: flex; align-items: center; gap: 6px; }
.guess-head span { flex: 1; font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text); text-shadow: 0 1px 4px #000, 0 0 12px #000; }
.guess-head button {
  width: 32px; height: 32px; border-radius: 9px; font-size: 14px;
  background: rgba(5, 8, 15, .85); border: 1px solid var(--line);
}
#guess-wrap.big #btn-size { background: var(--lime); color: #000; }
#btn-close-map { display: none; }
#guess-map {
  height: 250px; border-radius: 14px; overflow: hidden; border: 2px solid rgba(255,255,255,.2);
  box-shadow: 0 20px 60px rgba(0,0,0,.6); transition: height .25s cubic-bezier(.2,.8,.2,1);
}
#guess-map, #guess-map .leaflet-grab, #guess-map .leaflet-interactive { cursor: crosshair; }
#guess-map.leaflet-dragging .leaflet-grab { cursor: grabbing; }
#guess-wrap.hover #guess-map, #guess-wrap.big #guess-map { height: min(540px, 62vh); }
#btn-guess {
  padding: 16px; border-radius: 12px; font: 800 14px/1 var(--display); letter-spacing: .06em;
  background: #1a2235; color: var(--muted); transition: background .2s, color .2s, transform .15s;
}
#btn-guess:not(:disabled) { background: var(--lime); color: #0a0f00; box-shadow: 0 10px 30px rgba(198,255,61,.35); }
#btn-guess:not(:disabled):hover { transform: translateY(-2px); }

.fabs { display: none; }

#handoff {
  position: absolute; inset: 0; z-index: 40; display: none; place-items: center; padding: 24px 16px;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--c, #c6ff3d) 22%, #05080f), #03050a 70%);
}
#handoff.on { display: grid; animation: screenIn .3s; }
.handoff-inner { width: min(420px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.handoff-inner .panel-label { margin: 0; }
.handoff-name {
  font: 900 clamp(40px, 12vw, 72px)/1.05 var(--display); color: var(--c, var(--lime)); word-break: break-word;
  text-shadow: 0 0 40px color-mix(in srgb, var(--c, #c6ff3d) 50%, transparent); margin: 4px 0;
  animation: pop .4s cubic-bezier(.3,1.6,.5,1);
}
#handoff-go { margin-top: 18px; background: var(--c, var(--lime)); }

#loading {
  position: absolute; inset: 0; display: none; place-items: center; align-content: center; gap: 22px;
  background: radial-gradient(circle at center, #0c1730, #03050a 70%); z-index: 50;
}
#loading.on { display: grid; }
#loading p { font: 500 13px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--lime); text-align: center; padding: 0 20px; }
.scanner {
  width: 140px; height: 140px; border-radius: 50%; position: relative;
  border: 1px solid rgba(198,255,61,.35);
  background: repeating-radial-gradient(circle, transparent 0 22px, rgba(198,255,61,.12) 23px 24px);
}
.scanner div {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(198,255,61,.55), transparent 25%);
  animation: spin 1.4s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────────── RESULT & FINAL ───────────── */
#result-map, #final-map { position: absolute; inset: 0; background: var(--bg); }
.result-card, .final-card {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px)); z-index: 500; max-height: calc(100% - 40px); overflow-y: auto;
  background: rgba(7, 11, 20, .93); border: 1px solid var(--line); border-radius: 20px;
  padding: 20px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: cardUp .45s .15s both cubic-bezier(.2,.8,.2,1);
}
@keyframes cardUp { from { opacity: 0; translate: 0 30px; } }
.result-place { font: 700 18px/1.25 var(--display); margin-bottom: 14px; }
.result-place small { display: block; font: 500 12px var(--mono); color: var(--muted); margin-top: 6px; }
.result-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.result-stats label { display: block; font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.result-stats b { font: 900 30px/1 var(--display); }
#result-points { color: var(--lime); }
.bar { height: 10px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.bar div {
  height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--coral), var(--gold), var(--lime));
  transition: width 1.4s cubic-bezier(.2,.8,.2,1);
}
.result-quip { margin: 12px 0 14px; color: var(--muted); font-size: 14px; min-height: 1.4em; }
.party .solo-only { display: none; }
.party .result-quip { margin-top: 0; }

.board { list-style: none; display: grid; gap: 6px; margin-bottom: 14px; }
.board:empty { display: none; }
.board li {
  display: grid; grid-template-columns: 24px 1fr auto auto; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.04); font-size: 14px;
  animation: slideIn .35s both cubic-bezier(.2,.8,.2,1);
}
.board li .who { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; }
.board li .who em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li .pos { font: 700 13px var(--mono); color: var(--muted); }
.board li .d { font: 500 12px var(--mono); color: var(--muted); text-align: right; }
.board li .p { font: 700 14px var(--mono); text-align: right; min-width: 64px; }
.board li .p small { display: block; font-size: 10px; color: var(--lime); }
.board li:first-child { background: rgba(255,207,74,.1); box-shadow: inset 0 0 0 1px rgba(255,207,74,.35); }
.podium li { font-size: 15px; padding: 12px; }

.final-card { bottom: auto; top: 50%; transform: translate(-50%, -50%); max-height: calc(100% - 32px); animation-name: cardPop; }
@keyframes cardPop { from { opacity: 0; scale: .96; } }
.final-total { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.final-total b { font: 900 clamp(40px, 9vw, 64px)/1 var(--display); color: var(--lime); text-shadow: 0 0 40px rgba(198,255,61,.35); word-break: break-word; }
.final-total span { font: 500 16px var(--mono); color: var(--muted); }
.rank { font: 700 18px var(--display); margin: 8px 0 4px; }
.newbest { display: none; font: 700 12px var(--mono); color: var(--gold); letter-spacing: .12em; margin-top: 6px; animation: pulse 1s infinite; }
.newbest.on { display: block; }
.rounds { list-style: none; margin: 16px 0; display: grid; gap: 6px; }
.rounds:empty { display: none; }
.rounds li {
  display: grid; grid-template-columns: 26px 1fr auto auto; gap: 10px; align-items: center;
  padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,.035); font-size: 13px;
}
.rounds li .n { font: 700 11px var(--mono); color: var(--muted); }
.rounds li .d { font: 500 12px var(--mono); color: var(--muted); }
.rounds li .p { font: 700 13px var(--mono); }
.final-card .board { margin-top: 16px; }
.final-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ───────────── MAPS ───────────── */
.leaflet-container { background: #aad3df; font-family: var(--body); }
.leaflet-control-attribution { background: rgba(5,8,15,.7) !important; color: var(--muted) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--sky) !important; }
.leaflet-bar { border: 1px solid var(--line) !important; border-radius: 10px !important; overflow: hidden; box-shadow: 0 6px 20px rgba(0,0,0,.35) !important; }
.leaflet-bar a { background: rgba(5,8,15,.88) !important; color: var(--text) !important; border-color: var(--line) !important; width: 34px !important; height: 34px !important; line-height: 34px !important; }
.layer-toggle {
  display: flex; padding: 3px; border-radius: 10px; background: rgba(5,8,15,.88); border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.layer-toggle button { padding: 8px 11px; border-radius: 7px; font: 700 11px var(--mono); color: var(--muted); letter-spacing: .04em; }
.layer-toggle button.on { background: var(--lime); color: #0a0f00; }

.pin span {
  position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%;
  background: var(--c, var(--lime)); border: 3px solid #0a0f00; display: grid; place-items: center;
  font: 800 10px/1 var(--display); color: #0a0f00;
  box-shadow: 0 0 0 4px rgba(255,255,255,.25), 0 4px 14px rgba(0,0,0,.6);
  animation: drop .35s cubic-bezier(.3,1.6,.5,1);
}
.pin-actual span {
  position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%;
  background: var(--coral); border: 3px solid #fff; display: grid; place-items: center; font-size: 12px; color: #fff;
  box-shadow: 0 0 0 6px rgba(255,77,109,.3), 0 4px 18px rgba(0,0,0,.7);
  animation: drop .5s cubic-bezier(.3,1.6,.5,1);
}
.pin-actual span::after {
  content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--coral);
  animation: ripple 1.6s infinite;
}
@keyframes drop { from { transform: translateY(-40px) scale(.4); opacity: 0; } }
@keyframes ripple { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
@keyframes pop { from { transform: scale(.6); } }
.round-tag {
  background: #0a0f00 !important; color: var(--lime) !important; border: 1px solid var(--lime) !important;
  font: 700 11px var(--mono) !important; padding: 2px 6px !important; border-radius: 6px !important; box-shadow: none !important;
}
.round-tag::before { display: none; }

#toast {
  position: fixed; left: 50%; top: calc(16px + var(--safe-t)); transform: translate(-50%, -160%); z-index: 9999;
  padding: 12px 18px; border-radius: 12px; background: #111a2c; border: 1px solid var(--line);
  font-size: 14px; transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .3s; max-width: calc(100vw - 32px);
  opacity: 0; pointer-events: none; white-space: pre-line; box-shadow: 0 10px 40px rgba(0,0,0,.5); text-align: center;
}
#toast.on { transform: translate(-50%, 0); opacity: 1; }

/* ═══════════════════════ MOBILE / TOUCH ═══════════════════════ */
body.mobile .title-wrap { margin: 0 auto; padding-left: 16px; padding-right: 16px; }
body.mobile .logo { font-size: clamp(48px, 15vw, 72px); margin: 10px 0 8px; }
body.mobile .tagline { font-size: 15px; }
body.mobile .play { padding: 18px 14px; font-size: 14px; }
body.mobile .modes { grid-template-columns: repeat(2, 1fr); }
body.mobile .setting { flex-wrap: wrap; }
body.mobile .setting > span { width: 100%; }
body.mobile .seg { flex: 1; }
body.mobile .seg button { flex: 1; padding: 11px 6px; }

/* Street View screen: one top bar holds HUD + tools and hides the embed's address card */
body.mobile #address-cover {
  top: 0; left: 0; width: 100%; height: calc(76px + var(--safe-t)); border-radius: 0; border: 0;
  border-bottom: 1px solid var(--line); background: rgba(5, 8, 15, .95);
}
body.mobile #address-cover span { display: none; }
body.mobile .hud { top: calc(10px + var(--safe-t)); left: 10px; right: 104px; gap: 6px; overflow: hidden; }
body.mobile .hud-box { padding: 7px 10px; min-width: 0; border-radius: 10px; }
body.mobile .hud-box label { font-size: 9px; margin-bottom: 4px; }
body.mobile .hud-box b { font-size: 15px; }
body.mobile .player-box b { font-size: 13px; max-width: 6.5em; }
body.mobile .hud-box.mode { display: none; }
body.mobile .tools { top: calc(14px + var(--safe-t)); right: 10px; gap: 6px; }
body.mobile .tools button { width: 40px; height: 40px; font-size: 16px; border-radius: 10px; }
body.mobile #btn-return { display: none; }
body.mobile .timer { top: calc(86px + var(--safe-t)); width: 58px; height: 58px; }
body.mobile .timer b { font-size: 16px; }

body.mobile .fabs {
  display: flex; gap: 10px; position: absolute; right: 14px; bottom: calc(18px + var(--safe-b)); z-index: 5;
}
.fab {
  height: 58px; padding: 0 22px; border-radius: 18px; font: 800 14px var(--display); letter-spacing: .04em;
  background: rgba(5, 8, 15, .9); border: 2px solid var(--lime); color: var(--text);
  box-shadow: 0 10px 30px rgba(0,0,0,.5); backdrop-filter: blur(10px);
}
.fab.go { background: var(--lime); color: #0a0f00; animation: pop .3s cubic-bezier(.3,1.6,.5,1); }

/* Map becomes a near-full-screen bottom sheet */
body.mobile #guess-wrap {
  position: fixed; left: 0; right: 0; bottom: 0; width: 100% !important; z-index: 30;
  padding: 10px 10px calc(10px + var(--safe-b)); gap: 10px;
  background: rgba(7, 11, 20, .98); border-top: 1px solid var(--line); border-radius: 20px 20px 0 0;
  box-shadow: 0 -20px 60px rgba(0,0,0,.6);
  transform: translateY(105%); transition: transform .3s cubic-bezier(.2,.8,.2,1); visibility: hidden;
}
body.mobile #guess-wrap.open { transform: none; visibility: visible; }
body.mobile #guess-map { height: calc(100dvh - 190px - var(--safe-t) - var(--safe-b)) !important; min-height: 240px; border-radius: 14px; }
body.mobile .guess-head { padding: 2px 2px 0 6px; }
body.mobile .guess-head span { font-size: 12px; text-shadow: none; }
body.mobile #btn-size { display: none; }
body.mobile #btn-close-map { display: block; width: 40px; height: 40px; font-size: 16px; }
body.mobile #btn-guess { padding: 18px; font-size: 15px; }

body.mobile .result-card {
  left: 0; right: 0; bottom: 0; width: 100%; transform: none; border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(16px + var(--safe-b)); max-height: 58dvh; border-bottom: 0;
}
body.mobile .result-place { font-size: 16px; margin-bottom: 10px; }
body.mobile .result-stats b { font-size: 24px; }
body.mobile .result-quip { margin: 10px 0; font-size: 13px; }
body.mobile .final-card {
  top: auto; bottom: 0; left: 0; width: 100%; transform: none; border-radius: 20px 20px 0 0;
  max-height: 80dvh; padding: 18px 16px calc(18px + var(--safe-b)); animation-name: cardUp;
}
body.mobile .final-actions > * { flex: 1 1 calc(50% - 4px); }
body.mobile .board li { font-size: 13px; gap: 8px; padding: 10px; }
body.mobile .board li .d { font-size: 11px; }
body.mobile #result-map .leaflet-bar, body.mobile #final-map .leaflet-bar { display: none; }
