/* ==========================================================================
   Hide & Seek — design system
   Graphite surfaces, a single chartreuse accent, warm seekers / cool hiders.
   ========================================================================== */
:root {
  --bg: #0A0C0F;
  --s1: #121519;
  --s2: #181C21;
  --s3: #1F242A;
  --line: #22272D;
  --line-2: #2E343B;
  --text: #F3F5F7;
  --muted: #9AA3AD;
  --faint: #636B75;

  --accent: #D4FF3A;
  --accent-ink: #0D1003;
  --accent-soft: rgba(212, 255, 58, 0.12);
  --seeker: #FF6A3D;
  --seeker-soft: rgba(255, 106, 61, 0.14);
  --hider: #3FB8FF;
  --hider-soft: rgba(63, 184, 255, 0.14);
  --ok: #3DDC84;
  --warn: #FFB020;
  --warn-soft: rgba(255, 176, 32, 0.12);
  --danger: #FF4D5E;
  --danger-soft: rgba(255, 77, 94, 0.12);

  --role: var(--accent);
  --role-soft: var(--accent-soft);

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --font: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(900px 500px at 50% -260px, rgba(212, 255, 58, 0.07), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}
input { -webkit-user-select: text; user-select: text; }
h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.grow { flex: 1; }
.center { text-align: center; }
.mono { font-family: var(--mono); }

.i { width: 20px; height: 20px; flex: none; display: block; }
.label {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint);
}
.section-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 26px 2px 10px; }
.section-label .hint { font-size: 12px; color: var(--muted); }

#app { max-width: 480px; margin: 0 auto; min-height: 100%; }
.screen { display: none; padding: calc(20px + var(--safe-t)) 18px calc(110px + var(--safe-b)); min-height: 100dvh; }
.screen.active { display: block; animation: fade .25s var(--ease); }
.screen.game.active { display: flex; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 18px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--s2); color: var(--text);
  font-size: 15px; font-weight: 700; letter-spacing: -.005em; cursor: pointer;
  transition: transform .12s var(--ease), background .15s, border-color .15s, opacity .15s;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn .i { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.soft-danger { background: var(--danger-soft); border-color: rgba(255, 77, 94, .35); color: #FF8C98; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn.icon { width: 50px; padding: 0; }
.btn.icon.sm { width: 36px; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--accent); font-size: 12px; font-weight: 700; padding: 4px 2px; cursor: pointer; }

/* ---------- Inputs ---------- */
.field { display: block; }
.field .label { display: block; margin: 0 0 8px 2px; }
.input {
  width: 100%; height: 52px; padding: 0 16px; border-radius: var(--r);
  background: var(--s1); border: 1px solid var(--line); color: var(--text);
  font: 600 17px var(--font); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--faint); font-weight: 500; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.panel .input { background: var(--bg); }

/* ---------- Avatars ---------- */
.av {
  --av: #9AA3AD; display: inline-flex; align-items: center; justify-content: center; flex: none;
  border-radius: 50%; background: var(--av); color: #0B0D10;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.av .i { stroke-width: 2.1; }
.av-sm { width: 30px; height: 30px; } .av-sm .i { width: 15px; height: 15px; }
.av-md { width: 40px; height: 40px; } .av-md .i { width: 19px; height: 19px; }
.av-lg { width: 52px; height: 52px; } .av-lg .i { width: 25px; height: 25px; }
.av-xl { width: 84px; height: 84px; } .av-xl .i { width: 38px; height: 38px; }

/* ---------- Home ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); }
.brand-mark .i { width: 18px; height: 18px; stroke-width: 2.2; }
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: -.02em; }

.hero { margin: 28px 0 26px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; }
.hero h1 { font-size: 36px; line-height: 1.02; letter-spacing: -.045em; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { margin-top: 12px; color: var(--muted); font-size: 14px; line-height: 1.5; max-width: 230px; }
.scope {
  width: 116px; height: 116px; border-radius: 50%; position: relative; overflow: hidden;
  background: radial-gradient(circle, #161B14 0%, #0E110D 70%);
  border: 1px solid var(--line-2);
  box-shadow: 0 0 0 6px rgba(212, 255, 58, .03), 0 20px 50px -20px rgba(212, 255, 58, .3);
}
.scope::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 32%, rgba(255,255,255,.07) 32.5% 33%, transparent 33.5% 65%, rgba(255,255,255,.07) 65.5% 66%, transparent 66.5%),
    linear-gradient(rgba(255,255,255,.06), rgba(255,255,255,.06)) center / 1px 100% no-repeat,
    linear-gradient(rgba(255,255,255,.06), rgba(255,255,255,.06)) center / 100% 1px no-repeat;
}
.scope .sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 290deg, rgba(212, 255, 58, .5) 360deg);
  animation: spin 3s linear infinite;
}
.scope .blip { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--hider); box-shadow: 0 0 10px var(--hider); animation: blip 3s infinite; }
.scope .blip.b2 { background: var(--seeker); box-shadow: 0 0 10px var(--seeker); animation-delay: 1.4s; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blip { 0%, 100% { opacity: .12; } 40% { opacity: 1; } }

.panel { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.panel + .panel { margin-top: 12px; }
.profile-row { display: flex; gap: 14px; align-items: flex-end; }
.profile-row .field { flex: 1; }

.icon-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-top: 18px; }
.icon-grid button {
  aspect-ratio: 1; border-radius: 11px; border: 1px solid var(--line); background: var(--bg);
  color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-grid button .i { width: 18px; height: 18px; }
.icon-grid button.sel { background: var(--text); color: var(--bg); border-color: var(--text); }
.swatches { display: flex; justify-content: space-between; gap: 6px; margin-top: 16px; }
.swatches button {
  width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--c); cursor: pointer; padding: 0;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); transition: transform .15s var(--ease), box-shadow .15s;
}
.swatches button.sel { box-shadow: 0 0 0 3px var(--s1), 0 0 0 5px var(--c); }

.join-row { display: flex; gap: 10px; }
.code-input { width: 128px; flex: none; text-align: center; font-family: var(--mono); font-weight: 700; font-size: 20px; letter-spacing: .3em; text-transform: uppercase; padding: 0 0 0 18px; }
.join-row .btn { flex: 1; }
.divider { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--faint); font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.fine { font-size: 12px; color: var(--faint); text-align: center; line-height: 1.55; margin-top: 18px; padding: 0 10px; }

/* ---------- Lobby ---------- */
.room-card {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 18px;
  background: linear-gradient(135deg, #1A1F12 0%, var(--s1) 60%); border: 1px solid #2B331C;
}
.room-card::after {
  content: ''; position: absolute; right: -70px; top: -70px; width: 200px; height: 200px; border-radius: 50%;
  border: 1px solid rgba(212,255,58,.14); box-shadow: 0 0 0 32px rgba(212,255,58,.035), 0 0 0 64px rgba(212,255,58,.02);
  pointer-events: none;
}
.room-top { display: flex; align-items: flex-start; justify-content: space-between; position: relative; z-index: 1; }
.code { font-family: var(--mono); font-size: 46px; font-weight: 700; letter-spacing: .12em; color: var(--accent); line-height: 1; margin-top: 10px; }
.room-meta { display: flex; gap: 8px; margin-top: 18px; position: relative; z-index: 1; flex-wrap: wrap; }

.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: 999px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 650; color: var(--muted);
}
.pill .i { width: 14px; height: 14px; }
.pill.bad { background: var(--danger-soft); border-color: rgba(255,77,94,.4); color: #FF9AA4; }
.pill.ok { color: var(--text); }
.pill .btn { margin-right: -8px; height: 24px; min-height: 24px; padding: 0 8px; font-size: 11px; border-radius: 99px; }

.list { list-style: none; padding: 0; margin: 0; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.list li { display: flex; align-items: center; gap: 12px; padding: 11px 14px; min-height: 62px; position: relative; }
.list li + li { border-top: 1px solid var(--line); }
.list li.tappable { cursor: pointer; transition: background .12s; }
.list li.tappable:active { background: var(--s2); }
.list li.is-seeker { background: linear-gradient(90deg, var(--seeker-soft), transparent 70%); }
.list li.is-seeker::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--seeker); }
.list li.is-out { opacity: .45; }
.list.compact li { min-height: 54px; padding: 8px 12px; }
.list .empty { color: var(--faint); justify-content: center; font-size: 13px; }
.p-main { flex: 1; min-width: 0; }
.p-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.p-name .you { color: var(--faint); font-weight: 600; font-size: 12px; margin-left: 4px; }
.p-sub { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.p-sub.bad { color: #FF8C98; }
.p-actions { display: flex; gap: 6px; flex: none; }
.p-actions .btn.icon.sm { min-height: 34px; width: 34px; border-color: transparent; background: transparent; color: var(--faint); }
.p-stat { font-family: var(--mono); font-weight: 700; font-size: 18px; flex: none; text-align: right; line-height: 1.1; }
.p-stat small { display: block; font-size: 9.5px; color: var(--faint); letter-spacing: .12em; font-weight: 600; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; flex: none; height: 22px; padding: 0 8px; border-radius: 6px;
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.tag .i { width: 12px; height: 12px; stroke-width: 2.2; }
.tag.seeker { background: var(--seeker-soft); color: var(--seeker); }
.tag.hider { background: var(--hider-soft); color: var(--hider); }
.tag.leader { background: var(--accent-soft); color: var(--accent); }
.tag.found { background: rgba(255,255,255,.06); color: var(--faint); }

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--faint); }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(61,220,132,.15); }
.dot.pending { background: var(--warn); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px rgba(255,77,94,.18); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-width: 480px; margin: 0 auto;
  display: flex; gap: 10px; align-items: center; padding: 18px 18px calc(14px + var(--safe-b));
  background: linear-gradient(to top, var(--bg) 60%, rgba(10,12,15,0));
}
.wait-note { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .9s linear infinite; }

/* ---------- Settings ---------- */
.set-group { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.set-group + .set-group { margin-top: 12px; }
.set-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 6px; }
.set-head .i { width: 16px; height: 16px; color: var(--muted); }
.set-head h4 { font-size: 13px; font-weight: 800; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; min-height: 58px; }
.set-row + .set-row, .pu-row + .pu-row { border-top: 1px solid var(--line); }
.set-row .t { font-size: 14px; font-weight: 650; }
.set-row .hint { display: block; font-size: 12px; color: var(--faint); font-weight: 500; margin-top: 2px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--bg); border: 1px solid var(--line); flex: none; }
.seg button { border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; padding: 0 12px; height: 32px; border-radius: 8px; cursor: pointer; transition: background .15s, color .15s; }
.seg button.on { background: var(--s3); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 2px 6px rgba(0,0,0,.3); }

.stepper { display: inline-flex; align-items: center; flex: none; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); padding: 3px; }
.stepper button { width: 32px; height: 32px; border: 0; border-radius: 8px; background: var(--s3); color: var(--text); font-size: 18px; font-weight: 600; cursor: pointer; line-height: 1; }
.stepper span { min-width: 38px; text-align: center; font-family: var(--mono); font-weight: 700; font-size: 15px; }

.num { display: inline-flex; align-items: center; height: 38px; flex: none; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 0 10px 0 4px; transition: border-color .15s; }
.num:focus-within { border-color: var(--accent); }
.num input { width: 48px; border: 0; background: transparent; color: var(--text); font: 700 15px var(--mono); text-align: right; outline: none; padding: 0 4px; -moz-appearance: textfield; }
.num input::-webkit-outer-spin-button, .num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num .unit { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.num-l { display: flex; flex-direction: column; gap: 5px; }
.num-l > span { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }

.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--s3); border: 1px solid var(--line-2); cursor: pointer; transition: background .2s, border-color .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .2s var(--ease), background .2s; }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--accent-ink); }

.pu-row { padding: 14px 16px; }
.pu-head { display: flex; align-items: center; gap: 12px; }
.pu-tile { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--tile-bg); color: var(--tile); transition: opacity .2s; }
.pu-tile .i { width: 19px; height: 19px; }
.pu-t { flex: 1; min-width: 0; }
.pu-t b { display: block; font-size: 14px; font-weight: 750; }
.pu-t small { display: block; font-size: 12px; color: var(--faint); margin-top: 1px; }
.pu-params { display: flex; gap: 10px; margin: 12px 0 0 50px; flex-wrap: wrap; }
.pu-row.off .pu-params { display: none; }
.pu-row.off .pu-tile { opacity: .35; }
.t-seeker { --tile: var(--seeker); --tile-bg: var(--seeker-soft); }
.t-hider { --tile: var(--hider); --tile-bg: var(--hider-soft); }

.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.summary > div { background: var(--s1); padding: 14px 16px; }
.summary .v { font-weight: 750; font-size: 15px; margin-top: 6px; }
.summary .wide { grid-column: 1 / -1; }
.summary .pu-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--tile-bg); color: var(--tile); font-size: 12px; font-weight: 700; }
.chip .i { width: 14px; height: 14px; }
.chip small { font-family: var(--mono); font-size: 10px; opacity: .7; }

/* ---------- Game ---------- */
.screen.game { flex-direction: column; gap: 10px; height: 100dvh; min-height: 0; padding: calc(12px + var(--safe-t)) 14px calc(12px + var(--safe-b)); }
.screen.game.role-seeker { --role: var(--seeker); --role-soft: var(--seeker-soft); }
.screen.game.role-hider { --role: var(--hider); --role-soft: var(--hider-soft); }

.hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 14px 10px 10px; }
.role-pill {
  justify-self: start; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px 0 10px; border-radius: 11px;
  background: var(--role-soft); color: var(--role); font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: .12em;
}
.role-pill .i { width: 16px; height: 16px; stroke-width: 2.1; }
.role-pill.neutral { background: rgba(255,255,255,.06); color: var(--muted); }
.hud-timer { text-align: center; }
.hud-timer .label { display: block; }
.timer { font-family: var(--mono); font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.timer.urgent { color: var(--warn); }
.hud-left { justify-self: end; text-align: right; }
.hud-left .num-big { font-family: var(--mono); font-size: 22px; font-weight: 700; line-height: 1.15; }
.hud-left .num-big small { font-size: 13px; color: var(--faint); font-weight: 600; }

.banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: var(--r);
  background: var(--danger-soft); border: 1px solid rgba(255,77,94,.35); color: #FFC2C8; font-size: 13px; line-height: 1.35;
}
.banner .i { color: var(--danger); width: 18px; height: 18px; }
.banner b { color: #fff; font-weight: 750; }
.banner.warn { background: var(--warn-soft); border-color: rgba(255,176,32,.35); color: #FFE2A8; }
.banner.warn .i { color: var(--warn); }
.banner .btn { margin-left: auto; flex: none; }

.radar-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.radar-box { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
#radar { display: block; touch-action: none; }
.radar-chips { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; pointer-events: none; z-index: 2; }
.rchip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px;
  background: rgba(10,12,15,.85); border: 1px solid var(--line-2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-family: var(--mono); font-size: 11.5px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums;
}
.rchip .i { width: 13px; height: 13px; color: var(--accent); }
.rchip.alert { color: var(--role); border-color: color-mix(in srgb, var(--role) 40%, transparent); }
.rchip.alert .i { color: var(--role); }

.radar-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; pointer-events: none; z-index: 3; }
.ov-card {
  pointer-events: auto; text-align: center; max-width: 270px; padding: 22px 22px 20px; border-radius: var(--r-lg);
  background: rgba(14,17,21,.88); border: 1px solid var(--line-2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.8);
}
.ov-icon { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 14px; display: grid; place-items: center; background: var(--ov-bg, var(--role-soft)); color: var(--ov, var(--role)); }
.ov-icon .i { width: 24px; height: 24px; }
.ov-t { font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.ov-big { font-family: var(--mono); font-size: 44px; font-weight: 700; letter-spacing: -.03em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.ov-s { color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.45; }
.ov-card .btn { margin-top: 16px; }

.heat {
  position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); width: min(88%, 320px); z-index: 2;
  padding: 10px 14px 9px; border-radius: var(--r);
  background: rgba(14,17,21,.9); border: 1px solid var(--line-2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.heat-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; gap: 10px; }
.heat-label { font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.heat-delta { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--muted); }
.heat-bar { position: relative; height: 8px; border-radius: 99px; background: linear-gradient(90deg, #2F7BFF, #79C6FF 30%, #3A4048 50%, #FFA24C 70%, #FF4430); }
.heat-needle { position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; border: 3px solid var(--bg); box-shadow: 0 0 0 1px rgba(255,255,255,.4), 0 2px 8px rgba(0,0,0,.5); transition: left .7s var(--ease); }
.heat-ends { display: flex; justify-content: space-between; margin-top: 7px; }

.radar-meta { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 24px; font-size: 11.5px; color: var(--faint); font-weight: 600; white-space: nowrap; }
.radar-meta .m { display: inline-flex; align-items: center; gap: 5px; }
.radar-meta .i { width: 13px; height: 13px; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pcard {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start;
  min-height: 118px; padding: 12px 11px 11px; border-radius: var(--r-lg); text-align: left; cursor: pointer;
  background: var(--s1); border: 1px solid var(--line); color: var(--text);
  transition: transform .12s var(--ease), border-color .2s, background .2s;
}
.pcard:active { transform: scale(.97); }
.pc-tile { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--role-soft); color: var(--role); margin-bottom: 10px; transition: background .2s, color .2s; }
.pc-tile .i { width: 18px; height: 18px; }
.pc-name { font-weight: 800; font-size: 13.5px; letter-spacing: -.01em; }
.pc-desc { font-size: 11px; color: var(--faint); line-height: 1.3; margin-top: 2px; }
.pc-state { margin-top: auto; padding-top: 8px; font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--muted); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 5px; }
.pc-state .i { width: 12px; height: 12px; }
.pc-bar { position: absolute; left: 11px; right: 11px; bottom: 8px; height: 3px; border-radius: 3px; background: var(--line-2); overflow: hidden; display: none; }
.pc-fill { height: 100%; width: 0; background: var(--muted); border-radius: 3px; }
.pcard.ready { border-color: color-mix(in srgb, var(--role) 50%, transparent); background: linear-gradient(180deg, var(--role-soft), var(--s1) 75%); }
.pcard.ready .pc-tile { background: var(--role); color: var(--bg); }
.pcard.ready .pc-state { color: var(--role); }
.pcard.active { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--s1) 75%); }
.pcard.active .pc-tile { background: var(--accent); color: var(--accent-ink); }
.pcard.active .pc-state { color: var(--accent); }
.pcard.active .pc-bar, .pcard.cooling .pc-bar { display: block; }
.pcard.active .pc-fill { background: var(--accent); }
.pcard.active .pc-state, .pcard.cooling .pc-state { padding-bottom: 8px; }
.pcard.cooling .pc-tile, .pcard.locked .pc-tile { background: var(--s3); color: var(--faint); }
.pcard.cooling .pc-name, .pcard.locked .pc-name { color: var(--muted); }
.cards-empty { grid-column: 1 / -1; text-align: center; color: var(--faint); font-size: 13px; padding: 18px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); }

.game-foot { display: flex; gap: 8px; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--danger); color: #fff; font: 700 11px var(--mono); display: inline-grid; place-items: center; }

/* ---------- End ---------- */
.end-hero { text-align: center; padding: 22px 0 6px; }
.end-badge { width: 84px; height: 84px; margin: 0 auto; border-radius: 26px; display: grid; place-items: center; background: var(--eb-bg, var(--accent-soft)); color: var(--eb, var(--accent)); box-shadow: 0 0 0 8px color-mix(in srgb, var(--eb, var(--accent)) 7%, transparent), 0 0 0 16px color-mix(in srgb, var(--eb, var(--accent)) 3%, transparent); }
.end-badge .i { width: 38px; height: 38px; stroke-width: 1.6; }
.end-hero h1 { font-size: 32px; font-weight: 800; letter-spacing: -.035em; margin-top: 24px; }
.end-hero p { color: var(--muted); margin-top: 6px; font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 22px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.stats > div { background: var(--s1); padding: 14px 10px; text-align: center; }
.stats .v { font-family: var(--mono); font-size: 22px; font-weight: 700; margin-top: 4px; }

/* ---------- Map ---------- */
.map-view { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; }
.map-top { position: absolute; top: 0; left: 0; right: 0; z-index: 700; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: calc(10px + var(--safe-t)) 12px 10px; pointer-events: none; }
.map-top > * { pointer-events: auto; }
.map-top > :first-child { justify-self: start; }
.map-top > :last-child { justify-self: end; }
.glass { background: rgba(14,17,21,.86); border: 1px solid var(--line-2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.map-title { text-align: center; padding: 6px 14px; border-radius: 12px; min-width: 96px; }
.map-title .timer { font-size: 17px; }
.map-counts { display: flex; gap: 6px; }
.map-counts .cnt { display: inline-flex; align-items: center; gap: 5px; height: 40px; padding: 0 10px; border-radius: 12px; font: 700 13px var(--mono); }
.map-counts .cnt .i { width: 14px; height: 14px; }
.map-counts .cnt.s { color: var(--seeker); }
.map-counts .cnt.h { color: var(--hider); }
.map-counts .cnt.bad { color: var(--danger); }
.map-top .btn.icon { width: 44px; min-height: 44px; border-radius: 12px; }
#map { flex: 1; background: #0E1013; }
.map-fab { position: absolute; right: 12px; top: calc(66px + var(--safe-t)); z-index: 700; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--text); cursor: pointer; padding: 0; }
.map-fab .i { width: 18px; height: 18px; }
.map-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 800; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; max-height: 46dvh; padding-bottom: var(--safe-b); background: rgba(18,21,25,.96); border: 1px solid var(--line-2); border-bottom: 0; border-radius: 22px 22px 0 0; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 -20px 40px rgba(0,0,0,.45); }
.sheet-handle { display: flex; align-items: center; gap: 10px; width: 100%; padding: 16px 18px; background: none; border: 0; color: var(--text); cursor: pointer; text-align: left; }
.sheet-handle .t { font-weight: 800; font-size: 14px; }
.sheet-handle .s { flex: 1; font-size: 12px; color: var(--muted); font-weight: 600; }
.sheet-handle .s.bad { color: #FF8C98; }
.sheet-handle .i { color: var(--faint); transition: transform .2s var(--ease); }
.map-sheet:not(.collapsed) .sheet-handle .i { transform: rotate(180deg); }
.sheet-body { overflow-y: auto; padding: 0 12px 12px; }
.map-sheet.collapsed .sheet-body { display: none; }
.map-actions { display: flex; gap: 8px; margin-top: 10px; }
.map-actions .btn { flex: 1; }

.leaflet-container { font-family: var(--font); background: #0E1013; }
/* Dark map: invert the light OSM tiles, keep markers untouched */
.leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.82) contrast(.92) saturate(.35); }
.leaflet-top.leaflet-left { top: calc(56px + var(--safe-t)); }
.leaflet-control-zoom { border: 0 !important; box-shadow: none !important; }
.leaflet-control-zoom a { background: rgba(14,17,21,.9) !important; color: var(--text) !important; border: 1px solid var(--line-2) !important; width: 44px !important; height: 40px !important; line-height: 38px !important; font-weight: 500; }
.leaflet-control-zoom a:first-child { border-radius: 12px 12px 0 0 !important; }
.leaflet-control-zoom a:last-child { border-radius: 0 0 12px 12px !important; border-top: 0 !important; }
.leaflet-control-attribution { background: rgba(10,12,15,.7) !important; color: var(--faint) !important; font-size: 9px !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-div-icon.pm-wrap { background: none; border: 0; }
.pm { position: absolute; left: 0; top: 0; transform: translate(-50%, -19px); display: flex; flex-direction: column; align-items: center; }
.pm .av { width: 38px; height: 38px; box-shadow: 0 0 0 3px var(--ring, #0A0C0F), 0 6px 14px rgba(0,0,0,.6); position: relative; }
.pm .av .i { width: 18px; height: 18px; }
.pm.seeker { --ring: var(--seeker); }
.pm.hider { --ring: var(--hider); }
.pm.found .av { filter: grayscale(1) brightness(.6); --ring: #3A4048; }
.pm.stale .av { opacity: .5; }
.pm.warn .av::after { content: '!'; position: absolute; top: -7px; right: -7px; width: 17px; height: 17px; border-radius: 50%; background: var(--danger); color: #fff; font: 800 11px var(--mono); display: grid; place-items: center; border: 2px solid var(--bg); }
.pm-name { display: none; margin-top: 7px; padding: 2px 7px; border-radius: 6px; background: rgba(10,12,15,.9); border: 1px solid var(--line-2); font-size: 11px; font-weight: 700; color: var(--text); white-space: nowrap; }
.show-names .pm-name { display: block; }
.leaflet-popup-content-wrapper { background: var(--s1); color: var(--text); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.leaflet-popup-tip { background: var(--s1); border: 1px solid var(--line-2); }
.leaflet-popup-content { margin: 14px; min-width: 200px; font-size: 13px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--faint); top: 6px; right: 6px; }
.pop-head { display: flex; align-items: center; gap: 10px; }
.pop-name { font-weight: 800; font-size: 15px; }
.pop-rows { margin: 12px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; }
.pop-rows dt { color: var(--faint); font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; padding-top: 2px; }
.pop-rows dd { margin: 0; color: var(--text); font-weight: 600; font-size: 12.5px; }
.pop-btn { margin-top: 14px; width: 100%; }

/* ---------- Modal & toasts ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(4,5,7,.7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; } }
.modal-card { width: 100%; max-width: 480px; max-height: 88dvh; overflow-y: auto; padding: 10px 18px calc(18px + var(--safe-b)); background: var(--s1); border: 1px solid var(--line-2); border-bottom: 0; border-radius: 26px 26px 0 0; animation: up .28s var(--ease); }
.modal-card::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 0 auto 18px; }
@keyframes up { from { transform: translateY(60px); opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 12px; }
.modal-head .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.modal-card h2 { font-size: 21px; font-weight: 800; letter-spacing: -.025em; }
.modal-card p { color: var(--muted); margin: 8px 0 4px; line-height: 1.5; font-size: 14px; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.menu-list { display: flex; flex-direction: column; margin-top: 18px; background: var(--s2); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.menu-list button { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 16px; background: none; border: 0; color: var(--text); font-size: 15px; font-weight: 650; cursor: pointer; text-align: left; }
.menu-list button + button { border-top: 1px solid var(--line); }
.menu-list button .i { color: var(--muted); width: 18px; height: 18px; }
.menu-list button.danger, .menu-list button.danger .i { color: #FF8C98; }
.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.pick-grid button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px 12px; border-radius: var(--r); background: var(--s2); border: 1px solid var(--line); color: var(--text); font-size: 12.5px; font-weight: 700; cursor: pointer; overflow: hidden; transition: border-color .15s, background .15s; }
.pick-grid button .n { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-grid button.sel { border-color: var(--seeker); background: var(--seeker-soft); }

.toasts { position: fixed; top: calc(84px + var(--safe-t)); left: 0; right: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 14px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 440px; width: fit-content; padding: 10px 14px 10px 10px; border-radius: 14px;
  background: rgba(24,28,33,.95); border: 1px solid var(--line-2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: var(--text); font-size: 13.5px; font-weight: 650; box-shadow: 0 12px 30px rgba(0,0,0,.5); animation: tin .3s var(--ease);
}
.toast .ti { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: rgba(255,255,255,.08); color: var(--muted); }
.toast .ti .i { width: 14px; height: 14px; stroke-width: 2.2; }
.toast.good .ti { background: var(--accent-soft); color: var(--accent); }
.toast.warn .ti { background: var(--warn-soft); color: var(--warn); }
.toast.bad { border-color: rgba(255,77,94,.4); }
.toast.bad .ti { background: var(--danger-soft); color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(-8px); transition: .3s; }
@keyframes tin { from { opacity: 0; transform: translateY(-12px) scale(.98); } }

@media (max-height: 700px) {
  .pcard { min-height: 98px; padding: 10px 9px 9px; }
  .pc-desc { display: none; }
  .pc-tile { margin-bottom: 8px; }
  .timer { font-size: 24px; }
  .hud { padding: 8px 12px 8px 8px; }
}
@media (max-width: 360px) {
  .icon-grid { grid-template-columns: repeat(6, 1fr); }
  .hero h1 { font-size: 32px; }
  .scope { width: 96px; height: 96px; }
}
