:root {
  --paper: #E8EDE6;
  --card: #F6F8F4;
  --ink: #14231D;
  --muted: #56665E;
  --line: #C6D0C8;
  --blaze: #FF5B14;      /* seekers: hunter's safety orange */
  --blaze-ink: #FFFFFF;
  --cobalt: #2D5BFF;     /* hiders */
  --cobalt-ink: #FFFFFF;
  --signal: #FFD000;     /* exposed / warnings */
  --danger: #D7263D;
  --radius-s: 6px;
  --radius-l: 14px;
  --display: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', system-ui, sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F1915;
    --card: #17241E;
    --ink: #E6EEE8;
    --muted: #93A59B;
    --line: #2B3B33;
    --cobalt: #5A80FF;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }
h1, h2 { font-family: var(--display); font-weight: 700; margin: 0; letter-spacing: 0.01em; }
h2 { font-size: 22px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.error { color: var(--danger); min-height: 1.4em; margin: 8px 0 0; font-weight: 500; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer;
  font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: 0.02em;
  min-height: 54px; padding: 0 22px; border-radius: var(--radius-s);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.08s ease, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn-block { width: 100%; }
.btn-primary { background: var(--blaze); color: var(--blaze-ink); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-hider { background: var(--cobalt); color: var(--cobalt-ink); }
.btn-quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); font-size: 18px; min-height: 46px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-link { appearance: none; background: none; border: 0; padding: 0; color: var(--cobalt); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.sheet p b { color: var(--ink); }
.btn-text { appearance: none; background: none; border: 0; padding: 8px 0; color: var(--muted); font-weight: 600; cursor: pointer; }

/* ---------- boot ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; }
.boot-msg { font-family: var(--display); font-size: 22px; color: var(--muted); text-align: center; max-width: 34ch; }
.boot-msg code { font-size: 15px; background: var(--card); padding: 1px 5px; border-radius: 4px; }

/* ---------- home ---------- */
.screen { min-height: 100%; }
.home { display: flex; flex-direction: column; }
.home-hero { color: var(--line); height: 24vh; min-height: 150px; position: relative; overflow: hidden; }
.contours { position: absolute; inset: 0; width: 100%; height: 100%; }
.contours .zone { stroke: var(--blaze); }
.contours .dot-h { fill: var(--cobalt); }
.contours .dot-s { fill: var(--blaze); }
.home-body { padding: 0 20px calc(28px + var(--safe-bottom)); max-width: 460px; width: 100%; margin: -36px auto 0; position: relative; }
.wordmark { font-size: clamp(64px, 21vw, 104px); line-height: 0.86; font-weight: 700; letter-spacing: -0.01em; }
.tagline { margin: 10px 0 26px; color: var(--muted); max-width: 34ch; }
.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.field input {
  width: 100%; height: 52px; padding: 0 14px; border-radius: var(--radius-s);
  border: 2px solid var(--line); background: var(--card); color: var(--ink);
  font: 500 18px var(--body); outline: none;
}
.field input:focus { border-color: var(--ink); }
#code { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: 0.2em; text-transform: uppercase; }
.colours { display: flex; gap: 10px; flex-wrap: wrap; }
.colour { width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 3px rgba(0,0,0,0.12); }
.colour[aria-checked="true"] { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink); }
.join { display: flex; gap: 10px; align-items: flex-end; margin-top: 26px; }
.join .field { margin: 0; }
.grow { flex: 1; }

/* ---------- panels / lobby ---------- */
.lobby { padding: calc(10px + var(--safe-top)) 16px calc(24px + var(--safe-bottom)); max-width: 560px; margin: 0 auto; }
.lobby-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.code-block { text-align: right; }
.code-label { display: block; font-size: 14px; color: var(--muted); font-weight: 600; }
.code-big {
  appearance: none; border: 0; background: none; cursor: pointer; padding: 0;
  font-family: var(--display); font-weight: 700; font-size: 58px; line-height: 1; letter-spacing: 0.12em; color: var(--ink);
}
.panel { background: var(--card); border-radius: var(--radius-l); padding: 16px; margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 12px; }
.row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.players { list-style: none; margin: 4px 0 0; padding: 0; }
.player { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.player:first-child { border-top: 0; }
.player-dot { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-family: var(--display); font-weight: 700; color: #fff; font-size: 16px; }
.player-name { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-name small { font-weight: 400; color: var(--muted); }
.role-chip {
  appearance: none; border: 0; border-radius: 999px; padding: 6px 14px; font-family: var(--display); font-weight: 700; font-size: 17px;
  min-width: 86px; cursor: default;
}
.role-chip.seeker { background: var(--blaze); color: var(--blaze-ink); }
.role-chip.hider { background: var(--cobalt); color: var(--cobalt-ink); }
.is-host .role-chip { cursor: pointer; }
.lobby-map { height: 230px; border-radius: var(--radius-s); overflow: hidden; background: var(--line); }
.setting { padding: 10px 0; border-top: 1px solid var(--line); }
.setting:first-child { border-top: 0; padding-top: 0; }
.setting-label { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; margin-bottom: 8px; }
.setting-label .muted { font-weight: 400; font-size: 14px; text-align: right; }
.seg { display: flex; background: var(--paper); border-radius: var(--radius-s); padding: 3px; gap: 3px; }
.seg button {
  flex: 1; appearance: none; border: 0; background: transparent; border-radius: 4px; padding: 8px 2px; cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: 17px; color: var(--muted);
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg[aria-disabled="true"] button { cursor: default; }
.seg[aria-disabled="true"] button[aria-pressed="false"] { opacity: 0.5; }
.lobby-foot { position: sticky; bottom: 0; margin: 0 -16px; padding: 10px 16px calc(10px + var(--safe-bottom)); background: var(--paper); box-shadow: 0 -1px 0 var(--line); z-index: 5; }
.lobby-foot p { margin: 0 0 10px; }
body:not(.is-host) .host-only { display: none !important; }
body.is-host .guest-only { display: none !important; }

/* ---------- game ---------- */
.game { position: fixed; inset: 0; display: flex; flex-direction: column; }
.clock {
  display: flex; align-items: center; gap: 14px; padding: calc(6px + var(--safe-top)) 16px 8px;
  background: var(--ink); color: var(--paper); z-index: 500;
}
.clock.team-seeker { background: var(--blaze); color: var(--blaze-ink); }
.clock.team-hider { background: var(--cobalt); color: var(--cobalt-ink); }
.clock-time { font-family: var(--display); font-weight: 700; font-size: 62px; line-height: 0.95; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.clock-meta { min-width: 0; }
.clock-phase { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.1; }
.clock-sub { font-size: 14px; opacity: 0.9; }
.banner { padding: 10px 16px; font-weight: 600; z-index: 499; background: var(--signal); color: #1A1400; }
.banner.danger { background: var(--danger); color: #fff; }
.map-wrap { flex: 1; min-height: 0; position: relative; }
.map-wrap > .game-map { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: var(--line); }
/* Leaflet controls use z-index up to 1000; keep them inside the map. */
.game-map, .lobby-map, .end-map { z-index: 0; }
.lobby-map, .end-map { position: relative; }
.map-tools { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 450; }
.tool {
  appearance: none; border: 0; width: 46px; height: 46px; border-radius: 50%; background: var(--card); color: var(--ink);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3); font-size: 20px; font-weight: 700; cursor: pointer; font-family: var(--display);
}
.dock { background: var(--card); padding: 12px 16px calc(12px + var(--safe-bottom)); z-index: 500; box-shadow: 0 -1px 0 var(--line); }
.dock-status { font-size: 15px; margin-bottom: 10px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dock-status b { font-weight: 600; }
.dock-actions { display: flex; gap: 10px; }
.dock-actions .btn { flex: 1; }
.hold {
  position: absolute; inset: 0; z-index: 600; display: grid; place-items: center; padding: 24px;
  background: rgba(20, 35, 29, 0.84); color: #fff; text-align: center;
}
.hold h2 { font-size: 40px; margin-bottom: 8px; }
.hold p { max-width: 32ch; margin: 0 auto 6px; }
.hold .big { font-family: var(--display); font-size: 96px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; margin: 10px 0; }

/* map markers: the wrapper sits exactly on the coordinate */
.pin-wrap { width: 0; height: 0; position: relative; background: none; border: 0; pointer-events: none; }
.leaflet-div-icon.pin-wrap { background: none; border: 0; }
.pin { position: absolute; left: 0; top: 0; transform: translate(-50%, -17px); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pin-dot {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font: 700 17px/1 var(--display); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.35);
  border: 3px solid #fff; box-shadow: 0 0 0 3px var(--team, #888), 0 2px 6px rgba(0,0,0,0.35);
}
.pin-label {
  padding: 2px 8px; border-radius: 999px; white-space: nowrap; font: 600 13px/1.25 var(--body);
  background: rgba(20, 35, 29, 0.86); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.pin.seeker { --team: var(--blaze); }
.pin.hider { --team: var(--cobalt); }
.pin.exposed { --team: var(--signal); }
.pin.exposed .pin-dot { animation: ping 1.4s ease-out infinite; }
.pin.exposed .pin-label { background: var(--signal); color: #1A1400; }
.pin.stale { opacity: 0.55; }
.pin.me { transform: translate(-50%, -50%); }
.me-dot {
  display: block; width: 20px; height: 20px; border-radius: 50%; background: #2D7BFF; border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4), 0 0 0 0 rgba(45,123,255,0.5); animation: halo 2s ease-out infinite;
}
.pin.me.seeker .me-dot { background: var(--blaze); box-shadow: 0 1px 4px rgba(0,0,0,0.4), 0 0 0 0 rgba(255,91,20,0.5); }
@keyframes halo { to { box-shadow: 0 1px 4px rgba(0,0,0,0.4), 0 0 0 16px rgba(45,123,255,0); } }
@keyframes ping { 0% { box-shadow: 0 0 0 3px var(--team), 0 0 0 3px rgba(255,208,0,0.8); } 100% { box-shadow: 0 0 0 3px var(--team), 0 0 0 18px rgba(255,208,0,0); } }
.circle-label {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); white-space: nowrap;
  font: 700 15px var(--display); color: #fff; background: var(--blaze); padding: 2px 9px; border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.leaflet-container { font-family: var(--body); background: var(--line); }
.maplibregl-map { font-family: var(--body); }
.maplibregl-ctrl-attrib.maplibregl-compact { margin: 0 6px 6px 0; }
.tool[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.tool svg { display: block; margin: auto; }

/* ---------- sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 900; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 901; background: var(--card); color: var(--ink);
  border-radius: var(--radius-l) var(--radius-l) 0 0; padding: 18px 16px calc(18px + var(--safe-bottom));
  max-height: 82vh; overflow: auto; animation: rise 0.18s ease-out;
}
@keyframes rise { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet h2 { font-size: 30px; margin-bottom: 4px; }
.sheet p { margin: 0 0 14px; color: var(--muted); }
.sheet .pick { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.sheet .pick .btn { justify-content: flex-start; }
.sheet .pick .player-dot { width: 26px; height: 26px; font-size: 15px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 12px; right: 12px; bottom: calc(140px + var(--safe-bottom)); z-index: 950; display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none; align-items: center; }
.toast {
  background: var(--ink); color: var(--paper); padding: 11px 16px; border-radius: var(--radius-s); font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3); max-width: 420px; animation: rise 0.2s ease-out;
}
.toast.seeker { background: var(--blaze); color: #fff; }
.toast.hider { background: var(--cobalt); color: #fff; }
.toast.warn { background: var(--signal); color: #1A1400; }
.toast.bad { background: var(--danger); color: #fff; }

/* ---------- end ---------- */
.end { padding: 0 0 calc(20px + var(--safe-bottom)); }
.end-head { padding: calc(22px + var(--safe-top)) 20px 22px; color: #fff; background: var(--ink); }
.end-head.seeker { background: var(--blaze); }
.end-head.hider { background: var(--cobalt); }
.end-head h1 { font-size: clamp(48px, 14vw, 84px); line-height: 0.9; }
.end-head p { margin: 10px 0 0; font-weight: 500; max-width: 40ch; }
.end-map { height: 42vh; min-height: 220px; }
.end .panel { margin: 14px 16px; }
.end-foot { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; max-width: 560px; margin: 0 auto; }
.log { margin: 8px 0 0; padding: 0; list-style: none; }
.log li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; gap: 12px; }
.log li:first-child { border-top: 0; }
.log time { font-family: var(--display); font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 44px; }

@media (prefers-reduced-motion: reduce) {
  .sheet, .toast, .me-dot, .pin.exposed .pin-dot { animation: none; }
  .btn { transition: none; }
}

/* Leaflet fallback has no dark tiles without an API key, so dim and invert the street map. */
.map-dark .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9); }

/* profile */
.lobby-head-left { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.profile-btn, .me-btn {
  appearance: none; border: 0; background: var(--card); color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px;
  font: 600 15px var(--body); max-width: 60vw;
}
.profile-btn span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-btn { background: transparent; padding: 0; gap: 6px; font-size: 15px; }
.me-btn .player-dot, .profile-btn .player-dot { width: 26px; height: 26px; font-size: 15px; }
.dock-status { align-items: center; }
.colours .colour { display: grid; place-items: center; color: #fff; font: 700 16px var(--display); }
.colour:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }

/* power-ups */
.dock-powers { display: flex; gap: 8px; overflow-x: auto; margin: -2px 0 10px; padding-bottom: 2px; scrollbar-width: none; }
.power {
  appearance: none; border: 0; cursor: pointer; flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px; font: 700 16px var(--display); color: #fff; background: #7B3FE4;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.18);
}
.power span { font-size: 17px; }
.power.dead { background: var(--line); color: var(--muted); box-shadow: none; }
.fx-chip {
  flex: none; display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 999px;
  font: 600 14px var(--body); background: var(--paper); box-shadow: inset 0 0 0 2px #7B3FE4; color: var(--ink);
}
.pin.drop { transform: translate(-50%, -14px); }
.drop-gem {
  width: 22px; height: 22px; background: #7B3FE4; border: 3px solid #fff; transform: rotate(45deg); border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35); margin: 3px;
}
.pin.drop.near .drop-gem { animation: gem 1.2s ease-in-out infinite; }
@keyframes gem { 50% { transform: rotate(45deg) scale(1.2); } }
.pin.drop .pin-label { background: #7B3FE4; margin-top: 4px; }
.circle-label.freeze { background: #2FA8E0; }
.hold.freeze { background: rgba(23, 92, 130, 0.88); }
@media (prefers-reduced-motion: reduce) { .pin.drop.near .drop-gem { animation: none; } }

/* ---------- home: invite vs. normal ---------- */
.home-actions { display: flex; flex-direction: column; }
.home-actions .join { margin-top: 0; }
body:not(.has-invite) #create { order: -2; }
body:not(.has-invite) .or { order: -1; }
body:not(.has-invite) .invite-only, body.has-invite .no-invite { display: none; }
.has-invite #join-form .btn { background: var(--blaze); color: var(--blaze-ink); }
.has-invite #create { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); min-height: 48px; font-size: 18px; }
.has-invite .tagline strong { font-family: var(--display); font-size: 1.25em; letter-spacing: 0.08em; color: var(--ink); }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; margin: 14px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.home-help { display: block; margin: 18px auto 0; }
.home-actions .error { order: 0; margin-top: 6px; }

/* ---------- lobby: invite ---------- */
.code-block { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.invite-btn { min-height: 38px; font-size: 17px; padding: 0 14px; gap: 6px; }
.qr { background: #fff; border-radius: var(--radius-l); padding: 10px; width: min(78vw, 300px); margin: 4px auto 10px; }
.qr svg { display: block; width: 100%; height: auto; }
.invite-code { text-align: center; font: 700 52px/1 var(--display); letter-spacing: 0.16em; margin: 4px 0 16px; padding-left: 0.16em; }

/* ---------- players ---------- */
.player .tag, .tag {
  display: inline-flex; align-items: center; white-space: nowrap; border-radius: 999px; padding: 3px 9px;
  font: 600 13px/1.2 var(--body); background: var(--paper); color: var(--ink);
}
.tag.seeker { background: var(--blaze); color: #fff; }
.tag.hider { background: var(--cobalt); color: #fff; }
.tag.caught { background: var(--line); color: var(--ink); }
.tag.warn { background: var(--signal); color: #1A1400; }
.player { flex-wrap: nowrap; }
.player > .tag + .tag, .player > .tag + .role-chip { margin-left: -4px; }
.player-dot.away { opacity: 0.4; }
.crown { margin-right: 4px; font-size: 14px; }
.more-btn {
  appearance: none; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; margin-left: -6px;
}
.more-btn:active { background: var(--paper); }
.sheet .players { margin: 0 0 14px; }
.rules-summary { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.rules-summary div { min-width: 0; }
.rules-summary dt { font-size: 13px; color: var(--muted); }
.rules-summary dd { margin: 0; font: 700 19px var(--display); }
.panel-head .btn-link { font-size: 15px; }

/* ---------- game header ---------- */
.clock-meta { flex: 1; }
.clock-sub { appearance: none; border: 0; background: none; color: inherit; padding: 0; font: inherit; font-size: 14px; opacity: 0.9; text-align: left; cursor: pointer; }
.menu-btn { appearance: none; border: 0; background: rgba(255,255,255,0.18); color: inherit; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none; }
.banner { padding: 8px 16px; font-size: 15px; }
.hold[data-tone="seeker"] { background: rgba(255, 91, 20, 0.92); }
.hold[data-tone="hider"] { background: rgba(45, 91, 255, 0.92); }
.help p { margin: 0 0 12px; color: var(--ink); }
.help b { font-weight: 600; }

/* While a sheet is open, toasts move to the top so they don't cover its buttons. */
body.sheet-open .toasts { top: calc(12px + var(--safe-top)); bottom: auto; flex-direction: column; }
.clock-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- Hide Tag mechanics ---------- */
.dock-actions .btn-cd { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; gap: 1px; padding-inline: 6px; }
.dock-actions .btn-cd small { font: 600 13px var(--body); font-variant-numeric: tabular-nums; opacity: 0.85; }
.dock-actions .btn-cd:disabled { opacity: 0.55; }
.btn-freeze-q:not(:disabled) { box-shadow: inset 0 0 0 2px #2FA8E0; color: #1679A8; }
@media (prefers-color-scheme: dark) { .btn-freeze-q:not(:disabled) { color: #7CCBF0; } }
.btn-freeze { background: #2FA8E0; color: #fff; }

.stamina { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font: 600 14px var(--body); }
.stamina-track { flex: 1; height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.stamina-fill { height: 100%; width: 100%; background: #43A047; border-radius: inherit; transition: width 0.6s linear, background 0.3s; }
.stamina.low .stamina-fill { background: var(--danger); }
.stamina.low { color: var(--danger); }
.stamina span { min-width: 9.5em; text-align: right; font-variant-numeric: tabular-nums; }

.dock-mission { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 10px; padding: 8px 12px; border-radius: var(--radius-s); background: rgba(249, 168, 37, 0.18); box-shadow: inset 0 0 0 2px #F9A825; font: 600 15px var(--body); }
.dock-mission b { font: 700 20px var(--display); font-variant-numeric: tabular-nums; }

.power.hider { background: var(--cobalt); }
.power.seeker { background: var(--blaze); }
.power i { font-style: normal; font-size: 13px; background: rgba(0,0,0,0.22); border-radius: 999px; padding: 1px 6px; }

.hold[data-tone="warn"] { background: rgba(215, 38, 61, 0.93); }
.hold[data-tone="freeze"] { background: rgba(23, 92, 130, 0.93); }
.hold[data-tone="warn"] .big { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }

.pin.print { font-size: 15px; transform: translate(-50%, -50%); filter: drop-shadow(0 1px 1px rgba(0,0,0,0.4)); pointer-events: none; }
.pin.flare .pin-dot { box-shadow: 0 0 0 4px #FFD000, 0 2px 6px rgba(0,0,0,0.35); }
.circle-label.mission { background: #F9A825; color: #1A1400; }
.circle-label.burn { background: #D84315; }

.set-group { border-top: 1px solid var(--line); padding: 10px 0; }
.set-group:first-of-type { border-top: 0; }
.set-group summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; list-style: none; font: 700 20px var(--display); padding: 4px 0; }
.set-group summary::-webkit-details-marker { display: none; }
.set-group summary::before { content: '▸'; color: var(--muted); }
.set-group[open] summary::before { content: '▾'; }
.set-group summary .muted { font: 500 13px var(--body); }
.set-group .setting { margin-top: 12px; }
.rules-more { margin-top: 12px; }
.rules-more summary { cursor: pointer; font-weight: 600; }
.rules-more h4 { margin: 14px 0 6px; font: 700 17px var(--display); }
.pool { display: flex; flex-wrap: wrap; gap: 6px; }
.pool button { appearance: none; border: 0; cursor: pointer; padding: 6px 10px; border-radius: 999px; font: 600 14px var(--body); color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 2px var(--line); }
.pool button[aria-pressed="true"].hider { background: var(--cobalt); color: #fff; box-shadow: none; }
.pool button[aria-pressed="true"].seeker { background: var(--blaze); color: #fff; box-shadow: none; }
.pool button[aria-pressed="true"].both { background: #7B3FE4; color: #fff; box-shadow: none; }
.pool button[aria-pressed="false"] { text-decoration: line-through; opacity: 0.6; }

.toggle { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toggle span { display: flex; flex-direction: column; gap: 2px; }
.toggle small { color: var(--muted); font-size: 13px; }
.toggle input { width: 24px; height: 24px; accent-color: var(--blaze); flex: none; }
input[type="range"] { width: 100%; accent-color: var(--blaze); }
.power-list { padding-left: 1.1em; margin: 4px 0 10px; }
.power-list li { margin-bottom: 4px; }
.seg.power-range { margin: 6px 0 14px; }
@media (prefers-reduced-motion: reduce) { .hold[data-tone="warn"] .big { animation: none; } }

/* ---------- minimisable bottom panel ---------- */
.dock { position: relative; transition: transform 0.2s ease; touch-action: pan-x; }
.dock-grab { appearance: none; border: 0; background: none; cursor: pointer; display: block; width: 100%; height: 18px; margin: -8px 0 4px; padding: 0; }
.dock-grab span { display: block; width: 44px; height: 5px; border-radius: 999px; background: var(--line); margin: 0 auto; }
.dock-x {
  appearance: none; border: 0; cursor: pointer; position: absolute; top: 6px; right: 10px; width: 34px; height: 34px;
  display: grid; place-items: center; border-radius: 999px; background: var(--paper); color: var(--muted); z-index: 1;
}
.dock-status { padding-right: 40px; }
.dock.min { padding-top: 10px; padding-bottom: calc(10px + var(--safe-bottom)); }
.dock.min > :not(.dock-grab):not(.dock-mini) { display: none !important; }
.dock.min .dock-grab { margin: -6px 0 2px; }
.dock-mini { display: flex; align-items: center; gap: 10px; }
.dock-mini[hidden] { display: none; }
.mini-open {
  appearance: none; border: 0; background: none; color: var(--ink); cursor: pointer; flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 10px; padding: 4px 0; text-align: left; font: 600 15px var(--body);
}
.mini-open .player-dot { width: 26px; height: 26px; font-size: 15px; flex: none; }
.mini-bits { display: flex; flex-wrap: wrap; gap: 4px 14px; flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.mini-bits b { color: var(--blaze); }
.mini-low { color: var(--danger); }
.mini-chev { color: var(--muted); font-size: 13px; flex: none; }
.mini-catch { flex: none; min-height: 44px; padding: 0 20px; }
@media (prefers-reduced-motion: reduce) { .dock { transition: none; } }
