/* ATLAS — dark + orange design system. Mobile-first. No framework. */
:root {
  --orange: #ff6a00;
  --orange-2: #ff8a2e;
  --orange-rgb: 255, 106, 0;
  --bg: #000000;
  --bg-1: #0a0a0a;
  --bg-2: #101012;
  --bg-3: #17171a;
  --fg: #ffffff;
  --muted: #9a9aa2;
  --muted-2: #c8c8d0;
  --line: rgba(255, 255, 255, 0.10);
  --line-2: rgba(255, 255, 255, 0.18);
  --green: #22c55e;
  --red: #ef4444;
  --gold: #ffc400;
  /* category colors */
  --cat-delivery: #ff5e00;
  --cat-heavy: #ef4444;
  --cat-repair: #3b82f6;
  --cat-grocery: #22c55e;
  --cat-urgent: #f97316;
  --cat-home: #a855f7;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--fg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45; -webkit-font-smoothing: antialiased; overflow: hidden;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
.app { position: fixed; inset: 0; display: flex; flex-direction: column; }

/* --- buttons --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 18px; border-radius: 12px; font-weight: 700; background: var(--bg-3);
  transition: transform .12s ease, background .18s ease, opacity .18s; }
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--orange); color: #1a0f00; }
.btn--primary:active { background: var(--orange-2); }
.btn--ghost { background: transparent; border: 1px solid var(--line-2); }
.btn--danger { background: transparent; border: 1px solid var(--red); color: #ff8a8a; }
.btn--block { width: 100%; }
.btn--lg { padding: 16px 22px; font-size: 1.05rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  border-radius: 999px; font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; background: var(--bg-3); }
.chip--cat { color: #fff; }

/* --- auth / onboarding (full-screen flows) --- */
.flow { position: absolute; inset: 0; z-index: 50; display: flex; flex-direction: column;
  background: radial-gradient(120% 80% at 70% -10%, #2a1400 0%, var(--bg) 55%);
  padding: 28px 22px calc(28px + var(--safe-b)); }
.flow--center { justify-content: center; align-items: center; text-align: center; }
.brand { font-weight: 900; font-size: 2.6rem; letter-spacing: -.04em; }
.brand small { display: block; font-size: .82rem; font-weight: 600; color: var(--muted);
  letter-spacing: .12em; text-transform: uppercase; margin-top: 6px; }
.flow .sub { color: var(--muted-2); max-width: 320px; margin: 14px auto 0; }
.flow .actions { width: 100%; max-width: 360px; margin-top: 34px; display: grid; gap: 12px; }
.auth-form { width: 100%; max-width: 360px; display: grid; gap: 10px; margin-top: 26px; }
.auth-toggle { margin-top: 14px; background: none; color: var(--muted-2); font-size: .88rem; text-decoration: underline; padding: 6px; }
.loader-bar { width: 180px; height: 6px; border-radius: 6px; background: var(--bg-3); overflow: hidden; margin: 22px auto 0; }
.loader-bar i { display: block; height: 100%; width: 40%; background: var(--orange); border-radius: 6px; animation: load 1.1s ease-in-out infinite; }
@keyframes load { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* story-style onboarding */
.onb { position: absolute; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; }
.onb-progress { display: flex; gap: 6px; padding: 14px 16px calc(14px + var(--safe-b)) 16px; }
.onb-progress i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.25); overflow: hidden; }
.onb-progress i b { display: block; height: 100%; width: 0; background: #fff; }
.onb-progress i.done b { width: 100%; }
.onb-progress i.active b { animation: onbfill 4s linear forwards; }
@keyframes onbfill { to { width: 100%; } }
.onb-slide { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 24px 28px; gap: 16px; }
.onb-slide .ico { font-size: 4rem; }
.onb-slide h2 { font-size: 1.8rem; }
.onb-slide p { color: var(--muted-2); max-width: 320px; }
.onb-foot { padding: 18px 22px calc(22px + var(--safe-b)); display: flex; justify-content: space-between; align-items: center; }

/* mode select cards */
.mode-grid { display: grid; gap: 14px; width: 100%; max-width: 380px; margin-top: 26px; }
.mode-card { text-align: left; padding: 20px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--bg-1); transition: border-color .18s, transform .12s; }
.mode-card:active { transform: scale(.98); }
.mode-card.sel { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.mode-card h3 { font-size: 1.15rem; }
.mode-card p { color: var(--muted); margin: 6px 0 0; font-size: .9rem; }

/* --- map + overlays --- */
#map { position: absolute; inset: 0; background: var(--bg); z-index: 0; }
.leaflet-container { background: #000; font-family: inherit; }
.topbar { position: absolute; top: calc(12px + env(safe-area-inset-top,0px)); left: 12px; z-index: 400;
  display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px;
  background: rgba(18,18,18,.86); border: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar .ava { width: 42px; height: 52px; border-radius: 12px; position: relative;
  background: transparent; box-shadow: 0 0 0 2px var(--acc, var(--orange)); flex: none; }
.topbar .ava svg { width: 100%; height: 100%; border-radius: 12px; display: block; }
.topbar .ava .lv { position: absolute; bottom: -4px; right: -4px; background: #fff; color: #000;
  font-size: .6rem; font-weight: 900; padding: 1px 5px; border-radius: 8px; }
.topbar .meta b { font-size: .9rem; }
.topbar .xpbar { width: 110px; height: 5px; border-radius: 5px; background: var(--bg-3); margin-top: 4px; overflow: hidden; }
.topbar .xpbar i { display: block; height: 100%; background: var(--orange); border-radius: 5px; transition: width .4s; }

.toggle-view { position: absolute; top: calc(14px + env(safe-area-inset-top,0px)); left: 50%; transform: translateX(-50%);
  z-index: 400; padding: 9px 16px; border-radius: 999px; font-weight: 800; font-size: .82rem;
  background: rgba(18,18,18,.86); border: 1px solid var(--line-2); backdrop-filter: blur(12px); }
.toggle-view.on { background: var(--orange); color: #1a0f00; border-color: var(--orange); }

/* city picker pill (top-right) */
.citybar { position: absolute; top: calc(14px + env(safe-area-inset-top,0px)); right: 12px; z-index: 400;
  display: inline-flex; align-items: center; gap: 6px; max-width: 46vw; white-space: nowrap; overflow: hidden;
  padding: 9px 14px; border-radius: 999px; font-weight: 700; font-size: .82rem; text-overflow: ellipsis;
  background: rgba(18,18,18,.86); border: 1px solid var(--line-2); backdrop-filter: blur(12px); }
.citybar b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; }
.locbar { cursor: default; }
.cluster { display: flex; align-items: center; justify-content: center; border-radius: 50%; box-sizing: border-box;
  background: rgba(255,106,0,.92); color: #1a0f00; font-weight: 900; font-size: .82rem;
  border: 2px solid rgba(255,255,255,.9); box-shadow: 0 2px 10px rgba(0,0,0,.55); }
.city-list { max-height: 52vh; overflow-y: auto; margin-top: 10px; display: grid; gap: 4px; }
.city-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  text-align: left; padding: 11px 14px; border-radius: 10px; background: var(--bg-3); }
.city-opt.sel { box-shadow: inset 0 0 0 1px var(--orange); }
.city-opt .muted { font-size: .8rem; }

.fab { position: absolute; right: 18px; bottom: calc(88px + var(--safe-b)); z-index: 410;
  width: 64px; height: 64px; border-radius: 50%; background: var(--orange); color: #1a0f00;
  display: grid; place-items: center; padding: 0; line-height: 0;
  box-shadow: 0 10px 28px rgba(var(--orange-rgb), .5), 0 0 0 1px rgba(255,255,255,.06);
  transition: transform .15s; }
.fab svg { width: 30px; height: 30px; display: block; }
.fab:active { transform: scale(.9) rotate(90deg); }
.fab--locked { opacity: .45; }

/* bottom nav */
.nav { position: absolute; left: 0; right: 0; bottom: 0; z-index: 500; display: flex; justify-content: space-around;
  padding: 8px 6px calc(8px + var(--safe-b)); background: rgba(12,12,12,.92); border-top: 1px solid var(--line);
  backdrop-filter: blur(14px); }
.nav button { display: grid; justify-items: center; gap: 2px; padding: 6px 14px; border-radius: 12px;
  color: var(--muted); font-size: .62rem; font-weight: 700; }
.nav button svg { width: 22px; height: 22px; }
.nav button.sel { color: var(--orange); }

/* map pins (divIcon) */
.pin { position: relative; display: grid; place-items: center; }
.pin .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 4px rgba(255,255,255,.08), 0 0 12px 2px currentColor; }
.pin .price { position: absolute; bottom: 20px; white-space: nowrap; background: rgba(10,10,10,.9);
  border: 1px solid var(--line-2); color: #fff; font-weight: 800; font-size: .72rem; padding: 2px 7px; border-radius: 999px; }
.pin--inprogress .dot { animation: pulse 1.4s ease-out infinite; }
.pin--completed .dot { background: var(--green) !important; border-color: #eafff3; color: var(--green);
  display: grid; place-items: center; }
.pin--completed .dot::after { content: "✓"; color: #00160c; font-size: 11px; font-weight: 900; line-height: 1; }
.pin--high::after { content: "!"; position: absolute; top: -8px; right: -8px; background: var(--red);
  color: #fff; font-size: .6rem; font-weight: 900; width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(var(--orange-rgb),.6); } 100% { box-shadow: 0 0 0 18px rgba(var(--orange-rgb),0); } }

/* you-are-here + moderators */
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #2e9bff; border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(46,155,255,.25), 0 0 14px 2px #2e9bff; animation: mepulse 1.8s ease-out infinite; }
@keyframes mepulse { 0% { box-shadow: 0 0 0 0 rgba(46,155,255,.5), 0 0 14px 2px #2e9bff; } 100% { box-shadow: 0 0 0 16px rgba(46,155,255,0), 0 0 14px 2px #2e9bff; } }
.mod-dot { width: 16px; height: 16px; border-radius: 50%; background: #a855f7; border: 2px solid #eaddff;
  box-shadow: 0 0 10px 2px #a855f7; display: grid; place-items: center; transition: none; }
.mod-dot::after { content: "🛡"; font-size: 9px; }

/* --- bottom sheet --- */
.sheet-scrim { position: absolute; inset: 0; z-index: 600; background: rgba(0,0,0,.55); opacity: 0; animation: fade .2s forwards; }
@keyframes fade { to { opacity: 1; } }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 610; max-height: 88%; overflow-y: auto;
  background: var(--bg-1); border-radius: 22px 22px 0 0; border-top: 1px solid var(--line-2);
  padding: 8px 20px calc(24px + var(--safe-b)); box-shadow: var(--shadow); animation: sheetup .26s cubic-bezier(.22,1,.36,1); }
@keyframes sheetup { from { transform: translateY(100%); } }
.sheet .handle { width: 42px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 8px auto 14px; }
.sheet h2 { font-size: 1.4rem; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
/* admin backoffice list item */
.adm-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.adm-item .btn { padding: 8px 12px; }
.doc-thumb { flex: none; width: 38px; height: 38px; border-radius: 8px; background: #1b1b1b; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 20px; }
.muted { color: var(--muted); }
.reward { color: var(--orange); font-weight: 900; font-size: 1.6rem; }
.xp { color: var(--gold); font-weight: 800; }
.sheet .actions { display: grid; gap: 10px; margin-top: 18px; }
.field { display: grid; gap: 6px; margin-top: 14px; }
.field label { font-size: .8rem; color: var(--muted); font-weight: 700; }
.input { background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; width: 100%; }
.cats { display: flex; flex-wrap: wrap; gap: 8px; }
.cats .chip { cursor: pointer; border: 1px solid transparent; }
.cats .chip.sel { outline: 2px solid #fff; }
.econ { display: flex; justify-content: space-between; background: var(--bg-2); border-radius: 12px; padding: 12px 14px; margin-top: 12px; }

/* --- panels (wallet / profile / history / leaderboard) --- */
.panel { position: absolute; inset: 0; bottom: 0; z-index: 420; overflow-y: auto;
  background: var(--bg); padding: calc(20px + env(safe-area-inset-top,0px)) 18px calc(96px + var(--safe-b)); }
.panel h1 { font-size: 1.6rem; margin-bottom: 14px; }
.card { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 12px; }
.balance { font-size: 2.6rem; font-weight: 900; }
.tx { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tx:last-child { border-bottom: 0; }
.tx .amt.pos { color: var(--green); font-weight: 800; }
.tx .amt.neg { color: var(--muted-2); font-weight: 800; }

.prof-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }

/* avatar (image preset + accent ring + optional premium frame) */
/* avatar = corpo intero Mii in un riquadro ritratto (h = 1.25 * larghezza) */
.avatar { width: var(--sz, 40px); height: calc(var(--sz, 40px) * 1.25); border-radius: 16%; display: inline-block;
  background: transparent; box-shadow: 0 0 0 2.5px var(--acc, transparent); flex: none; position: relative; }
.avatar svg { width: 100%; height: 100%; border-radius: 16%; display: block; }
.avatar.frame { box-shadow: 0 0 0 3px var(--gold), 0 0 20px var(--gold); }
/* idle: SOLO la figura oscilla (bob + tilt), la card resta ferma. Pivot ai piedi. */
@keyframes avidle {
  0%,100% { transform: translateY(0) rotate(0deg); }
  25%     { transform: translateY(-1.5%) rotate(-2deg); }
  50%     { transform: translateY(-3.5%) rotate(0deg); }
  75%     { transform: translateY(-1.5%) rotate(2deg); }
}
.avatar svg .mii-fig, .ava svg .mii-fig { animation: avidle 3.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 98%; }
.av-opt .avatar svg .mii-fig { animation: none; }   /* picker minis stay calm */
.leaflet-marker-icon .mii-fig { animation: none; }  /* avatar sui pin mappa: fermi */
@media (prefers-reduced-motion: reduce) { .avatar svg .mii-fig, .ava svg .mii-fig { animation: none; } }
.opt-label { font-size: .8rem; color: var(--muted); font-weight: 700; margin: 16px 0 8px; }
.prof-ava { --sz: 120px; }
.prof-ava .lv { position: absolute; bottom: 2px; right: 2px; background: var(--orange); color: #1a0f00;
  font-size: .7rem; font-weight: 900; padding: 2px 8px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.av-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 6px; justify-items: center; align-items: start; }
.av-opt { padding: 4px; background: none; border-radius: 14px; box-shadow: 0 0 0 2px transparent; transition: box-shadow .15s, transform .12s; }
.av-opt .avatar { display: block; pointer-events: none; }
.av-opt.sel { box-shadow: 0 0 0 3px var(--orange); transform: scale(1.06); }
.sw-row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.sw { width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.15); flex: none; }
.sw.sel { box-shadow: 0 0 0 3px #fff; transform: scale(1.08); }
.sw-custom { position: relative; overflow: hidden; padding: 0;
  background: conic-gradient(from 0deg, #ff3b30, #ff9500, #ffcc00, #34c759, #00c7be, #007aff, #af52de, #ff2d55, #ff3b30); }
.sw-custom input { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); opacity: 0; cursor: pointer; border: 0; padding: 0; }
.stats3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 16px; text-align: center; }
.stats3 b { font-size: 1.4rem; display: block; }
.stats3 span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.badges { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 12px; }
.badge { background: var(--bg-2); border-radius: 12px; padding: 12px; text-align: center; font-size: .72rem; }
.badge .ico { font-size: 1.5rem; }
.tierbar { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--bg-2); font-weight: 800; }

.seg { display: flex; gap: 6px; background: var(--bg-2); padding: 4px; border-radius: 12px; margin-bottom: 12px; }
.seg button { flex: 1; padding: 10px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.seg button.sel { background: var(--orange); color: #1a0f00; }

.lb-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lb-row .pos { width: 36px; font-weight: 900; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.crest { display: block; filter: drop-shadow(0 2px 5px rgba(0,0,0,.5)); }
.lb-row.emperor { background: linear-gradient(90deg, rgba(255,196,0,.14), transparent); border-radius: 12px; padding: 12px; }
.lb-row .pos.gold { color: var(--gold); }

/* zone legend (game view) */
.zone-legend { position: absolute; left: 12px; bottom: calc(96px + var(--safe-b)); z-index: 410;
  background: rgba(18,18,18,.86); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  font-size: .74rem; backdrop-filter: blur(12px); display: grid; gap: 5px; }
.zone-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.zl-scope { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.zl-scope button { flex: 1 1 40%; padding: 4px 6px; border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 8px; font-size: .7rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.zl-scope button.on { background: var(--orange); color: #1a0f00; border-color: var(--orange); }
.zl-cur { font-size: .68rem; color: var(--muted); font-weight: 700; margin-bottom: 4px; text-transform: capitalize; }

/* --- modal / reward overlay / toast --- */
.modal-scrim { position: absolute; inset: 0; z-index: 700; background: rgba(0,0,0,.7); display: grid; place-items: center; padding: 24px; animation: fade .2s forwards; }
.modal { width: 100%; max-width: 380px; background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 22px; padding: 24px; text-align: center; animation: pop .3s cubic-bezier(.22,1.4,.4,1); }
@keyframes pop { from { transform: scale(.8); opacity: 0; } }
.unlock { display: flex; align-items: center; gap: 12px; background: var(--bg-2); border-radius: 14px; padding: 14px; margin-top: 10px; text-align: left; opacity: 0; transform: translateY(10px); animation: rise .4s forwards; }
.unlock .ico { font-size: 1.8rem; }
@keyframes rise { to { opacity: 1; transform: none; } }

.reward-overlay { position: absolute; inset: 0; z-index: 750; display: grid; place-items: center; background: rgba(0,0,0,.6); animation: fade .2s forwards; }
.reward-card { text-align: center; }
.reward-card .big { font-size: 3.4rem; font-weight: 900; color: var(--green); animation: pop .4s cubic-bezier(.22,1.4,.4,1); }
.reward-card .coins { font-size: 2.6rem; animation: coinpop .5s ease; }
@keyframes coinpop { 0% { transform: scale(0) rotate(-20deg); } 70% { transform: scale(1.3); } 100% { transform: scale(1); } }
.levelup { color: var(--gold); font-weight: 900; font-size: 1.4rem; margin-top: 10px; animation: burst .5s ease; }
@keyframes burst { 0% { transform: scale(.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.confirm-checks { display: flex; gap: 22px; justify-content: center; margin: 16px 0; }
.check { width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--green); display: grid; place-items: center;
  font-size: 1.6rem; color: var(--green); opacity: .3; }
.check.on { opacity: 1; animation: pop .3s; }

.toasts { position: absolute; top: calc(70px + env(safe-area-inset-top,0px)); left: 0; right: 0; z-index: 800; display: grid; gap: 8px; padding: 0 14px; pointer-events: none; }
.toast { background: rgba(24,24,27,.96); border: 1px solid var(--line-2); border-left: 3px solid var(--orange);
  border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); animation: toastin .3s; }
.toast b { display: block; font-size: .9rem; }
.toast span { font-size: .82rem; color: var(--muted-2); }
@keyframes toastin { from { transform: translateY(-16px); opacity: 0; } }

/* icon-only view toggle */
.toggle-view { padding: 10px 13px; font-size: 1.2rem; line-height: 1; }

/* create: pick-on-map mode (sheet slides away, map becomes tappable) */
.sheet.picking { transform: translateY(72%); opacity: .12; pointer-events: none; }
.pick-banner { position: absolute; top: calc(16px + env(safe-area-inset-top,0px)); left: 12px; right: 12px; z-index: 620;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--orange); color: #1a0f00; font-weight: 800; padding: 12px 14px; border-radius: 14px;
  box-shadow: var(--shadow); animation: toastin .25s; }
.pick-banner button { background: rgba(0,0,0,.18); border-radius: 10px; padding: 8px 12px; font-weight: 800; }
.pos-set { color: var(--green); font-weight: 800; }

/* game view entrance */
.game-scan { position: absolute; inset: 0; z-index: 300; pointer-events: none;
  background: radial-gradient(circle at 50% 45%, rgba(var(--orange-rgb),.35), rgba(var(--orange-rgb),0) 60%);
  animation: scan .7s ease-out forwards; }
@keyframes scan { 0% { transform: scale(.2); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(2.4); opacity: 0; } }
.game-anim .leaflet-overlay-pane, .game-anim .leaflet-marker-pane { animation: zonein .55s ease-out; }
@keyframes zonein { from { opacity: 0; } to { opacity: 1; } }

/* --- richer completion animation --- */
.app.shake { animation: appshake .45s cubic-bezier(.36,.07,.19,.97); }
@keyframes appshake { 10%,90% { transform: translate(-1px,0); } 20%,80% { transform: translate(3px,0); }
  30%,50%,70% { transform: translate(-7px,1px); } 40%,60% { transform: translate(7px,-1px); } }

.reward-overlay { background: radial-gradient(circle at 50% 42%, rgba(0,0,0,.35), rgba(0,0,0,.72)); }
.reward-flash { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 42%, rgba(var(--orange-rgb),.6), transparent 65%); animation: rflash .55s ease-out forwards; }
@keyframes rflash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }

.shockwave { position: absolute; left: 50%; top: 42%; width: 40px; height: 40px; border-radius: 50%;
  border: 4px solid rgba(var(--orange-rgb),.9); transform: translate(-50%,-50%) scale(0); animation: shock .75s ease-out forwards; }
.shockwave.sw2 { border-color: rgba(255,196,0,.8); animation-delay: .12s; }
@keyframes shock { 0% { transform: translate(-50%,-50%) scale(0); opacity: .9; } 100% { transform: translate(-50%,-50%) scale(15); opacity: 0; } }

.burst { position: absolute; left: 50%; top: 42%; font-size: 1.6rem; will-change: transform, opacity;
  animation: fly 1s cubic-bezier(.15,.7,.3,1) forwards; }
@keyframes fly { 0% { transform: translate(-50%,-50%) scale(.3) rotate(0); opacity: 1; }
  60% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1.1) rotate(var(--rot,180deg)); opacity: 0; } }

.coinfly { position: absolute; left: 50%; top: 42%; font-size: 1.6rem; will-change: transform, opacity;
  transform: translate(-50%,-50%); animation: coinfly .85s cubic-bezier(.55,0,.9,.35) forwards; }
@keyframes coinfly { 0% { transform: translate(-50%,-50%) scale(1); opacity: 1; }
  70% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(.35); opacity: 0; } }
.nav button.bump { animation: navbump .42s cubic-bezier(.2,1.6,.4,1); }
.nav button.bump svg { color: var(--orange); }
@keyframes navbump { 0%,100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-8px) scale(1.35); } }

.confetti { position: absolute; top: -16px; width: 9px; height: 14px; border-radius: 2px; will-change: transform; }
.confetti.streamer { width: 5px; height: 26px; border-radius: 3px; opacity: .9; }
@keyframes drop { to { transform: translateY(118vh) rotate(760deg); } }

.reward-card .big { text-shadow: 0 0 20px rgba(34,197,94,.55); }
.reward-card .big.counting { animation: countpulse .32s ease-in-out infinite alternate; }
@keyframes countpulse { to { transform: scale(1.07); } }
.reward-card .big.pop { animation: bigpop .5s cubic-bezier(.2,1.7,.4,1); }
@keyframes bigpop { 0% { transform: scale(1); } 40% { transform: scale(1.4); } 100% { transform: scale(1); } }

.big-lvl { position: relative; margin-top: 14px; font-size: 1.7rem; font-weight: 900; color: var(--gold);
  display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lvl-rays { position: absolute; left: 50%; top: 50%; width: 380px; height: 380px; transform: translate(-50%,-50%); z-index: -1;
  background: conic-gradient(from 0deg, transparent 0 8deg, rgba(255,196,0,.5) 8deg 12deg, transparent 12deg 24deg);
  animation: rays 3s linear infinite; }
@keyframes rays { to { transform: translate(-50%,-50%) rotate(360deg); } }
.lvl-badge { font-size: 2.6rem; animation: badgeslam .55s cubic-bezier(.2,1.7,.4,1); }
@keyframes badgeslam { 0% { transform: scale(0) rotate(-40deg); opacity: 0; } 60% { transform: scale(1.35) rotate(10deg); } 100% { transform: scale(1) rotate(0); } }

/* leaflet divIcon: kill default white box + focus outline (showed as a square around avatars) */
.leaflet-div-icon { background: transparent; border: 0; }
.leaflet-marker-icon:focus, .leaflet-interactive:focus { outline: none; }

/* --- chat (mission sheet) --- */
.chat { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.chat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.chat-thread { display: flex; flex-direction: column; gap: 6px; max-height: 38vh; overflow-y: auto; padding: 2px; }
.chat-empty { text-align: center; font-size: .8rem; margin: 12px 0; }
.msg { max-width: 80%; padding: 8px 12px; border-radius: 14px; font-size: .92rem; display: flex; align-items: flex-end; gap: 8px; }
.msg span { min-width: 0; overflow-wrap: anywhere; }
.msg time { font-size: .62rem; flex: none; opacity: .7; }
.msg.mine { align-self: flex-end; background: var(--orange); color: #1a0f00; border-bottom-right-radius: 4px; }
.msg.them { align-self: flex-start; background: var(--bg-3); border-bottom-left-radius: 4px; }
.msg-report { flex: none; padding: 0 2px; font-size: .8rem; line-height: 1; opacity: .55; background: none; }
.msg-report:hover { opacity: 1; }
.msg-report.done { opacity: .8; color: var(--green); cursor: default; }
.msg.mine .msg-report { display: none; }
.chat-input { display: flex; gap: 8px; margin-top: 12px; }
.chat-input .input { flex: 1; }
.chat-input .btn { padding: 13px 16px; }

.hidden { display: none !important; }
