/* Layout: two screens. The main menu is four tabs over a bottom bar (play,
   with a clip of the game playing itself; today's quests; the leaderboard;
   the player's profile); the round is the scope view filling the screen with
   the HUD as the scope's own display.
   One dark look by design: the page is the inside of a scope. */
:root {
  color-scheme: dark;
  --void: #0a0c0b;                    /* outside the optics */
  --panel: rgba(13, 16, 14, 0.9);     /* panel glass */
  --line: #2f3731;                    /* rules and borders */
  --heat: #e8ebe7;                    /* primary text, eyeshine */
  --ash: #b3bcb5;                     /* secondary text */
  --reticle: #5dff8f;                 /* scope green */
  --reticle-dim: rgba(93, 255, 143, 0.14);
  --warn: #ffb347;                    /* last seconds, empty magazine */
  --gold: #ffd76a;                    /* the golden rat: the one colour in the scope's picture */
  --harm: #ff6b5e;                    /* points lost: a shot that hit the cat */
  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-osd: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  /* Telegram sets these in fullscreen; elsewhere they are absent. */
  --safe-top: calc(env(safe-area-inset-top, 0px) + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--tg-safe-area-inset-bottom, 0px));
  --gutter-left: max(16px, env(safe-area-inset-left, 0px));
  --gutter-right: max(16px, env(safe-area-inset-right, 0px));
  --nav-h: calc(60px + var(--safe-bottom)); /* the menu's bottom bar */
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--void);
  color: var(--heat);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

.stage { position: relative; height: 100%; overflow: hidden; }
#view {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: pan-y; /* on the menu a finger on the clip still scrolls the page */
  user-select: none; -webkit-user-select: none;
}
.stage.playing #view { touch-action: none; }

@keyframes screen-in { from { opacity: 0; } }
@keyframes blink { 50% { opacity: 0.15; } }

/* ================= main menu ================= */

.menu {
  position: absolute; inset: 0 0 var(--nav-h) 0;
  overflow-x: hidden; overflow-y: auto;
  padding: calc(20px + var(--safe-top)) var(--gutter-right) 0 var(--gutter-left);
  animation: screen-in 0.4s ease-out both;
}
/* a glow breathing at the top, and a slow scan band travelling down the page */
.menu::before, .menu::after { content: ""; position: fixed; left: 0; right: 0; top: 0; pointer-events: none; }
.menu::before {
  height: 70%;
  background: radial-gradient(90% 100% at 50% 0%, rgba(93, 255, 143, 0.13), transparent 70%);
  animation: breathe 6s ease-in-out infinite;
}
.menu::after {
  height: 160px;
  background: linear-gradient(to bottom, transparent, rgba(93, 255, 143, 0.06), transparent);
  animation: sweep 8s linear infinite;
}
@keyframes breathe { 50% { opacity: 0.45; } }
@keyframes sweep { from { transform: translateY(-160px); } to { transform: translateY(100vh); } }

.menu-inner { position: relative; z-index: 1; max-width: 640px; min-height: 100%; margin: 0 auto; display: flex; }
/* one tab's page */
.pane {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 20px;
  padding-bottom: 24px;
  animation: rise 0.35s var(--ease-out) both;
}
#pane-play { padding-bottom: 0; }
.lede { max-width: none; margin-top: -10px; }

/* ---- the bottom bar ---- */
.nav {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  height: var(--nav-h); padding: 0 var(--gutter-right) var(--safe-bottom) var(--gutter-left);
  display: flex; justify-content: center;
  background: rgba(8, 10, 9, 0.96); border-top: 1px solid var(--line);
}
.nav button {
  position: relative; flex: 1 1 0; max-width: 160px; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-family: var(--font-body); font-size: 12px; font-weight: 500;
  color: var(--ash); background: transparent; border: 0; padding: 0 2px; cursor: pointer;
  transition: color 0.15s;
}
.nav button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav button[aria-pressed="true"] { color: var(--reticle); }
/* the open tab is marked on the bar's top edge */
.nav button[aria-pressed="true"]::before {
  content: ""; position: absolute; top: -1px; left: 22%; right: 22%; height: 2px; background: var(--reticle);
  animation: draw 0.3s var(--ease-out) both;
}
/* a quest is still open today */
.nav .pip { position: absolute; top: 9px; left: calc(50% + 9px); width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }

/* ---- hero ---- */
.hero { position: relative; display: flex; flex-direction: column; gap: 12px; }
.topline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.eyebrow {
  font-family: var(--font-osd); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--reticle);
}
h1 {
  position: relative; align-self: flex-start;
  margin: 0; padding-bottom: 14px;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(52px, 15vw, 92px); line-height: 1; letter-spacing: 0.01em;
  text-transform: uppercase; white-space: nowrap;
  text-shadow: 0 0 28px rgba(232, 235, 231, 0.18);
}
/* each letter comes into focus in turn */
h1 .ch {
  display: inline-block;
  animation: focus-in 0.7s var(--ease-out) both;
  animation-delay: calc(var(--i) * 60ms + 100ms);
}
@keyframes focus-in { from { opacity: 0; transform: translateY(0.35em) scale(1.15); filter: blur(10px); } }
/* a scope's range ruler drawn out under the name */
h1::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px;
  background:
    linear-gradient(var(--reticle), var(--reticle)) left bottom / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--reticle) 0 1px, transparent 1px 12px) left bottom / 100% 5px no-repeat,
    repeating-linear-gradient(90deg, var(--reticle) 0 1px, transparent 1px 60px) left bottom / 100% 8px no-repeat;
  transform-origin: left;
  animation: draw 0.9s var(--ease-out) 0.6s both;
}
@keyframes draw { from { transform: scaleX(0); } }
.tagline { animation: rise 0.6s var(--ease-out) 0.7s both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* eyeshine blinking out of the dark beside the title */
.eyes i {
  position: absolute; left: var(--x); top: var(--y);
  width: 20px; height: 5px; opacity: 0;
  animation: peek var(--d) ease-in-out var(--s) infinite;
}
.eyes i::before, .eyes i::after {
  content: ""; position: absolute; top: 0; width: 5px; height: 5px; border-radius: 50%;
  background: var(--heat); box-shadow: 0 0 8px 2px rgba(232, 235, 231, 0.75);
}
.eyes i::before { left: 0; } .eyes i::after { right: 0; }
.eyes i:nth-child(1) { --x: 86%; --y: 42%; --d: 9s; --s: 1.5s; }
.eyes i:nth-child(2) { --x: 92%; --y: 66%; --d: 13s; --s: 5s; scale: 0.7; }
.eyes i:nth-child(3) { --x: 74%; --y: 58%; --d: 17s; --s: 9s; scale: 0.55; }
@keyframes peek {
  0%, 10% { opacity: 0; transform: none; }
  16%, 34% { opacity: 1; transform: none; }
  37% { opacity: 1; transform: scaleY(0.1); }
  40%, 56% { opacity: 1; transform: none; }
  64%, 100% { opacity: 0; transform: none; }
}

/* ---- the clip ---- */
.clip { display: flex; flex-direction: column; gap: 8px; }
.reel-frame { position: relative; animation: lock-on 0.8s var(--ease-out) 0.3s both; }
@keyframes lock-on { from { opacity: 0; transform: scale(1.07); filter: brightness(2.4); } }
/* focus brackets on two corners */
.reel-frame::before, .reel-frame::after {
  content: ""; position: absolute; width: 26px; height: 26px; z-index: 1; pointer-events: none;
  border: 2px solid var(--reticle);
}
.reel-frame::before { left: -5px; top: -5px; border-right: 0; border-bottom: 0; }
.reel-frame::after { right: -5px; bottom: -5px; border-left: 0; border-top: 0; }
/* never so tall that the places and the play button fall off the screen */
.reel { position: relative; width: 100%; aspect-ratio: 16 / 10; max-height: 34vh; background: #000; border: 1px solid var(--line); overflow: hidden; }
.reel-bar {
  display: flex; justify-content: space-between; gap: 12px;
  font-family: var(--font-osd); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ash); font-variant-numeric: tabular-nums;
}
.reel-progress { height: 2px; background: var(--line); }
.reel-progress i { display: block; height: 100%; background: var(--reticle); transform-origin: left; transform: scaleX(0); }

/* ---- play ---- */
/* sticks to the bottom of the screen while the page above it scrolls */
.cta {
  position: sticky; bottom: 0; z-index: 2; margin-top: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px 0 14px;
  background: linear-gradient(to top, var(--void) 78%, transparent);
}
button { -webkit-appearance: none; appearance: none; border-radius: 0; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--heat); outline-offset: 3px; }
.go, .ghost {
  font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 12px 24px; cursor: pointer;
  transition: transform 0.12s ease-out, background-color 0.15s, border-color 0.15s;
}
.go:active, .ghost:active { transform: scale(0.97); }
.go { color: var(--void); background: var(--reticle); border: 1px solid var(--reticle); }
.go:hover { background: var(--heat); border-color: var(--heat); }
.ghost { color: var(--reticle); background: transparent; border: 1px solid currentColor; }
.ghost:hover { background: var(--reticle-dim); }
.go.big {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font-size: 26px; padding: 16px 24px;
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(93, 255, 143, 0.5); }
  70%, 100% { box-shadow: 0 0 0 14px rgba(93, 255, 143, 0); }
}
/* a small reticle turning beside the label */
.aim {
  position: relative; flex: none; width: 22px; height: 22px;
  border: 2px solid currentColor; border-radius: 50%;
  animation: turn 7s linear infinite;
}
.aim::before, .aim::after { content: ""; position: absolute; background: currentColor; }
.aim::before { left: 50%; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; }
.aim::after { top: 50%; left: -6px; right: -6px; height: 2px; margin-top: -1px; }
@keyframes turn { to { transform: rotate(360deg); } }

/* a challenge from a friend, said right under the title */
.duel {
  max-width: none; padding: 10px 14px;
  font-size: 15px; line-height: 1.4;
  color: var(--gold); background: rgba(40, 34, 14, 0.96); border: 1px solid var(--gold);
}

/* today pays double */
.duel.event { color: var(--warn); background: rgba(40, 28, 10, 0.96); border-color: rgba(255, 179, 71, 0.55); }
/* opened from a group chat: this round counts on that group's board */
.duel.group { color: var(--reticle); background: rgba(12, 32, 20, 0.96); border-color: rgba(93, 255, 143, 0.5); }

/* ---- the player: level, experience, days in a row ---- */
.player {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; align-items: center;
  padding: 12px 14px; background: var(--panel); border: 1px solid var(--line);
}
.lvl {
  grid-row: 1 / span 3; width: 54px; height: 54px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1;
  color: var(--reticle); border: 1px solid var(--reticle);
}
.player-top {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px;
  font-family: var(--font-osd); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
}
.player-top b { color: var(--heat); font-weight: 500; }
.streak { color: var(--warn); }
.xp-text { font-family: var(--font-osd); font-size: 12px; letter-spacing: 0.06em; color: var(--ash); font-variant-numeric: tabular-nums; }
.meter { height: 6px; background: var(--line); }
.meter i {
  display: block; height: 100%; background: var(--reticle);
  transform-origin: left; transform: scaleX(0); transition: transform 0.7s var(--ease-out);
}

/* ---- where to hunt ---- */
.tabs.scenes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 4px; padding: 0 0 1px 1px; }
.scenes button { margin: 0 0 -1px -1px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.scenes button small { font-size: 11px; letter-spacing: 0.06em; }
.scenes button:disabled { cursor: default; color: var(--ash); opacity: 0.55; }
/* the nearest locked place says how far it is */
.scenes button.near { position: relative; opacity: 0.85; }
.scenes button.near::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: calc(var(--p, 0) * 100%); background: var(--reticle);
}
@media (min-width: 520px) { .tabs.scenes { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

#mode-hint { margin-top: 2px; }
/* league and freezes, under the experience bar */
.player-meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.chip {
  padding: 4px 8px; border: 1px solid var(--line);
  font-family: var(--font-osd); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ash);
}
.chip.league-0 { color: #d9a47a; border-color: rgba(217, 164, 122, 0.55); }
.chip.league-1 { color: var(--heat); border-color: var(--ash); }
.chip.league-2 { color: var(--gold); border-color: var(--gold); }

/* ---- today's quests ---- */
.quest-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.quest-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: baseline;
  padding: 14px 16px; background: var(--panel); border: 1px solid var(--line);
}
.quest-list .what { color: var(--heat); font-size: 16px; line-height: 1.35; }
.quest-list .xp, .quest-list .count { font-family: var(--font-osd); font-size: 13px; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.quest-list .xp { color: var(--reticle); white-space: nowrap; }
.quest-list .count { color: var(--ash); font-size: 12px; grid-column: 1 / -1; }
.quest-list li.done { border-color: rgba(93, 255, 143, 0.4); }
.quest-list .meter { grid-column: 1 / -1; }
.quest-list li.done .what { color: var(--ash); }
.quest-list .xp.ico-check:empty::before { margin-right: 0; }

/* ---- small pictures before a label: experience, days in a row, record... ----
   Each is a mask, so it takes the colour of the text it stands before. */
.ico::before {
  content: ""; display: inline-block; flex: none; width: 1.15em; height: 1.15em;
  margin-right: 0.45em; vertical-align: -0.2em;
  background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
}
.ico-xp { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2 4 14h7l-1 8 9-12h-7z'/%3E%3C/svg%3E"); }
.ico-streak { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3c1 4 5 5.5 5 10a5 5 0 0 1-10 0c0-2 1-3 2-4 0 2 1 3 2 3 0-3-1-5 1-9z'/%3E%3C/svg%3E"); }
.ico-best { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l2.35 6.26 6.69.3-5.24 4.18 1.78 6.45L12 16.5l-5.58 3.69 1.78-6.45-5.24-4.18 6.69-.3z'/%3E%3C/svg%3E"); }
.ico-rank { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20v-8h5v8M9.5 20V5h5v15M15 20v-6h5v6M3 20h18'/%3E%3C/svg%3E"); }
.ico-gold { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 4h11l4 5L12 20.5 2.5 9zM2.5 9h19'/%3E%3C/svg%3E"); }
.ico-cat { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM5.6 5.6l12.8 12.8'/%3E%3C/svg%3E"); }
.ico-duel { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4l11 11M20 4 9 15M14 18l4-4M6 14l4 4M4 20l3-3M20 20l-3-3'/%3E%3C/svg%3E"); }
.ico-check { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }

/* ---- the result panel: the round at a glance, then a card for each thing it earned ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .best { padding: 7px 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.chips .best.gold { border-color: rgba(255, 215, 106, 0.5); }
.chips .best.harm { border-color: rgba(255, 107, 94, 0.5); }
.final.record { color: var(--gold); text-shadow: 0 0 30px rgba(255, 215, 106, 0.35); }
.gains { display: flex; flex-direction: column; gap: 12px; }
.card {
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
  padding: 14px 16px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
}
.card h3 { display: flex; align-items: center; font-size: 17px; color: var(--ash); }
.card h3 b { margin-left: auto; font-family: var(--font-osd); font-weight: 500; font-size: 15px; letter-spacing: 0.04em; color: var(--reticle); }
.level-row { display: flex; align-items: center; gap: 12px; font-family: var(--font-osd); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.level-row .lvl { width: 38px; height: 38px; font-size: 20px; }
.level-row b { font-weight: 500; color: var(--heat); }
.level-row .tag { margin-left: auto; padding: 3px 8px; color: var(--void); background: var(--gold); animation: blink 0.5s steps(2, jump-none) 3; }
.card .line { font-size: 14px; color: var(--warn); }
.card .quest-list li { padding: 0; background: none; border: 0; }
.card .quest-list .what { font-size: 15px; }
.card .quest-list li.fresh .what { color: var(--heat); }
.card .quest-list li.fresh .xp { color: var(--reticle); }
.card .ach-list { margin: 0; grid-template-columns: minmax(0, 1fr); }

.best { font-family: var(--font-osd); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ash); }
.best b { color: var(--heat); font-weight: 500; }
.best.gold, .best.gold b { color: var(--gold); }
.best.harm, .best.harm b { color: var(--harm); }

/* ---- top 10 ---- */
h2, h3 {
  margin: 0;
  font-family: var(--font-display); font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase;
}
h2 { font-size: 30px; line-height: 1.1; }
h3 { font-size: 20px; }
h3 .count { font-family: var(--font-osd); font-size: 13px; letter-spacing: 0.06em; color: var(--ash); margin-left: 6px; }
/* language switch and leaderboard periods share one segmented control */
.langs, .tabs { display: flex; }
.langs button, .tabs button {
  font-family: var(--font-osd); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ash); background: transparent;
  border: 1px solid var(--line); margin-left: -1px;
  min-height: 44px; padding: 8px 12px; cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.langs button:first-child, .tabs button:first-child { margin-left: 0; }
.tabs button { flex: 1; }
.langs button[aria-pressed="true"], .tabs button[aria-pressed="true"] {
  color: var(--void); background: var(--reticle); border-color: var(--reticle);
  position: relative;
}

.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rows li {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: 2.6em minmax(0, 1fr) auto; gap: 8px; align-items: baseline;
  padding: 11px 8px 11px 6px; border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  animation: row-in 0.45s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
/* a bar behind each row: its score against the leader's */
.rows li::before {
  content: ""; position: absolute; z-index: -1; left: 0; top: 0; bottom: 0; width: var(--w, 0%);
  background: linear-gradient(90deg, rgba(93, 255, 143, 0.16), rgba(93, 255, 143, 0.03));
  transform-origin: left;
  animation: draw 0.8s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 45ms + 180ms);
}
@keyframes row-in { from { opacity: 0; transform: translateX(-14px); } }
.rows .rank { font-family: var(--font-osd); font-size: 13px; color: var(--ash); }
.rows .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .pts { font-family: var(--font-osd); color: var(--heat); }
.rows li.first .rank { color: var(--reticle); }
.rows li.first .who { font-weight: 500; }
.rows li.me .who, .rows li.me .rank { color: var(--reticle); }
.rows li.gap { display: block; padding: 0 6px; color: var(--ash); border-bottom: 0; }
.rows li.gap::before { content: none; }
/* the player's level, a small mark before the name: grey, green from the
   third level, gold from the tenth */
.rows .lv {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-right: 9px; padding: 0 4px;
  font-family: var(--font-osd); font-size: 12px; font-weight: 500; line-height: 1; vertical-align: 1px;
  color: var(--ash); border: 1px solid var(--line);
}
.rows .lv.mid { color: var(--reticle); border-color: rgba(93, 255, 143, 0.5); }
.rows .lv.top { color: var(--gold); border-color: var(--gold); }
.scopes button { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.champions { max-width: none; font-size: 14px; }
.champions b { color: var(--gold); font-weight: 500; }
.note { margin: 0; max-width: none; font-size: 14px; color: var(--ash); }
p { margin: 0; max-width: 46ch; color: var(--ash); }

/* ---- profile: achievements, how to play, sound ---- */
.ach { display: flex; flex-direction: column; gap: 4px; }
.how { min-width: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
/* the collection: every kind of animal and how many of it have been shot */
.kind-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.kind-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); color: var(--ash); font-size: 14px;
}
.kind-list li.seen { color: var(--heat); }
.kind-list b { font-family: var(--font-osd); font-weight: 500; color: var(--reticle); font-variant-numeric: tabular-nums; }
.setting.invite { align-items: center; text-transform: none; font-family: var(--font-body); font-size: 14px; letter-spacing: 0; }
.setting.invite .ghost { flex: none; font-size: 15px; padding: 10px 14px; }
.setting {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-family: var(--font-osd); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ash);
}
.how summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-osd); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--reticle);
  min-height: 48px; padding: 8px 0; width: 100%;
}
.how summary::-webkit-details-marker { display: none; }
.how summary::before { content: "+"; display: inline-block; width: 1em; text-align: center; }
.how[open] summary::before { content: "−"; }
.rules { margin: 4px 0 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.rules dt { font-family: var(--font-osd); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--heat); margin-top: 12px; }
.rules dd { margin: 0; color: var(--ash); }
.ach-list {
  list-style: none; margin: 10px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px;
}
.ach-list li {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 10px 12px; background: var(--panel); border: 1px solid var(--line);
  color: var(--ash); font-size: 14px; line-height: 1.35;
}
.ach-list li b {
  display: block; margin-bottom: 2px; font-weight: 500;
  font-family: var(--font-osd); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
}
/* the picture: a mark seen through the scope's lens. Dim until it is earned. */
.badge {
  position: relative; flex: none; display: grid; place-items: center;
  width: 50px; height: 50px; border-radius: 50%;
  color: var(--ash); border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.07), transparent 68%);
}
/* four ticks around the rim, like a reticle's */
.badge::before {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  background: conic-gradient(currentColor 0 4deg, transparent 0 90deg, currentColor 0 94deg, transparent 0 180deg, currentColor 0 184deg, transparent 0 270deg, currentColor 0 274deg, transparent 0);
  -webkit-mask: radial-gradient(circle, transparent 64%, #000 65%); mask: radial-gradient(circle, transparent 64%, #000 65%);
  rotate: -2deg; opacity: 0.7;
}
.badge svg {
  width: 28px; height: 28px; fill: none; stroke: currentColor;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.badge svg .solid { fill: currentColor; stroke: none; }
.ach-list li:not(.earned) .badge svg { opacity: 0.45; }
.ach-list li:not(.earned) .ach-text { opacity: 0.7; }
.ach-list li.earned { border-color: rgba(255, 215, 106, 0.55); background: linear-gradient(100deg, rgba(255, 215, 106, 0.09), var(--panel) 60%); }
.ach-list li.earned b { color: var(--gold); }
.ach-list li.earned .badge {
  color: var(--gold); border-color: var(--gold);
  background: radial-gradient(circle at 50% 38%, rgba(255, 215, 106, 0.22), rgba(255, 215, 106, 0.03) 70%);
  box-shadow: 0 0 14px rgba(255, 215, 106, 0.28), inset 0 0 10px rgba(255, 215, 106, 0.12);
}
.ach-list li { animation: rise 0.4s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 35ms); }
/* the same picture, small, beside a line on the result panel */

/* ---- said during the round: a quest or an achievement just reached ---- */
.toasts {
  position: absolute; left: var(--gutter-left); top: calc(118px + var(--safe-top)); z-index: 2;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px; max-width: min(330px, 78vw);
  padding: 7px 14px 7px 7px; font-size: 14px; line-height: 1.3; color: var(--heat);
  background: rgba(10, 12, 11, 0.9); border: 1px solid var(--gold);
  animation: toast 3.4s var(--ease-out) both;
}
.toast .badge { width: 34px; height: 34px; color: var(--gold); border-color: var(--gold); }
.toast .badge::before { content: none; }
.toast .badge svg { width: 20px; height: 20px; }
@keyframes toast {
  0% { opacity: 0; transform: translateX(-24px); }
  8%, 86% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateX(-12px); }
}

/* ================= the round ================= */

.field { position: absolute; inset: 0; animation: screen-in 0.35s ease-out both; }
.stage.playing #view { cursor: none; }

/* ---- scope on-screen display ---- */
.osd {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(12px + var(--safe-top)) var(--gutter-right) calc(12px + var(--safe-bottom)) var(--gutter-left);
  pointer-events: none;
  font-family: var(--font-osd);
  font-size: clamp(12px, 3.3vw, 14px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--reticle);
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.95), 0 1px 1px rgba(0, 0, 0, 0.9);
  font-variant-numeric: tabular-nums;
}
.osd-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 12px; }
.osd-bottom { align-items: end; }
.osd-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.osd-right { align-items: flex-end; text-align: right; grid-column: 3; }
.osd b { font-weight: 500; color: var(--heat); }
.rec::before {
  content: ""; display: inline-block; width: 0.6em; height: 0.6em; margin-right: 0.5em;
  border-radius: 50%; background: var(--reticle);
  animation: blink 1.4s steps(2, jump-none) infinite;
}
.osd-time {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(30px, 6vw, 48px); line-height: 1; letter-spacing: 0.02em;
  color: var(--heat);
}
.osd-time.low { color: var(--warn); }
/* the line under the clock: a golden rat is out, or (.bad) the cat was hit */
.osd-alert {
  position: absolute; left: 50%; top: calc(70px + var(--safe-top)); translate: -50% 0;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(18px, 4.5vw, 28px);
  letter-spacing: 0.1em; white-space: nowrap;
  color: var(--gold);
  animation: alert-in 0.35s var(--ease-out) both, blink 0.5s steps(2, jump-none) 0.35s 3;
}
.osd-alert.bad { color: var(--harm); }
.osd-alert.cold { color: var(--heat); }
@keyframes alert-in { from { opacity: 0; transform: scale(1.5); } }
.combo { min-height: 1.5em; color: var(--warn); }
/* survival: three lives, one lost with each miss */
.lives { display: flex; gap: 5px; }
.lives i { width: 14px; height: 14px; border: 1px solid var(--harm); border-radius: 50%; }
.lives i.full { background: var(--harm); }

.mag { display: flex; gap: 4px; height: 20px; align-items: flex-end; }
.mag i { width: 7px; height: 100%; border: 1px solid var(--reticle); background: transparent; box-shadow: 0 0 4px rgba(0, 0, 0, 0.8); }
.mag i.full { background: var(--reticle); }
.mag.loading i { border-color: var(--warn); animation: blink 0.5s steps(2, jump-none) infinite; }

.osd-btn {
  pointer-events: auto;
  font-family: var(--font-osd); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--reticle);
  background: rgba(10, 12, 11, 0.55);
  border: 1px solid currentColor;
  min-height: 44px; padding: 8px 12px;
  cursor: pointer;
  align-self: flex-start;
}
.osd .osd-btn { font-size: inherit; }
.osd-right .osd-btn { align-self: flex-end; }
.osd-btn:hover { background: var(--reticle-dim); }
.osd-btn kbd { font: inherit; opacity: 0.7; margin-left: 0.6em; }
/* sound: a speaker icon, greyed with a cross when muted */
.mute { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; }
.mute svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mute[aria-pressed="true"] { color: var(--ash); }
@media (hover: none) { .osd-btn kbd { display: none; } } /* no keyboard on a phone */

/* ---- result ---- */
.overlay {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  overflow-y: auto;
  padding: calc(24px + var(--safe-top)) var(--gutter-right) calc(24px + var(--safe-bottom)) var(--gutter-left);
  background: rgba(8, 10, 9, 0.55);
  animation: screen-in 0.3s ease-out both;
}
.panel {
  width: 100%; max-width: 520px; min-width: 0;
  display: flex; flex-direction: column; gap: 16px;
  padding: clamp(20px, 5vw, 36px);
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(3px);
  animation: rise 0.45s var(--ease-out) both;
}
.final {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(72px, 20vw, 128px); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stats { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.stats div { display: flex; flex-direction: column; border-top: 1px solid var(--line); padding-top: 8px; }
.stats dt { font-family: var(--font-osd); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ash); }
.stats dd { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 28px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---- before the first round: three cards ---- */
.coach {
  position: absolute; inset: 0; z-index: 5;
  display: grid; place-items: center; overflow-y: auto;
  padding: calc(16px + var(--safe-top)) var(--gutter-right) calc(16px + var(--safe-bottom)) var(--gutter-left);
  background: rgba(5, 7, 6, 0.86);
  animation: screen-in 0.25s ease-out both;
}
.coach .panel { max-width: 420px; background: #0d100e; border: 1px solid var(--line); animation: rise 0.35s var(--ease-out) both; }
.coach-art { aspect-ratio: 200 / 110; background: #171a18; border: 1px solid var(--line); }
.coach-art svg { display: block; width: 100%; height: 100%; }
.coach-dots { display: flex; gap: 6px; }
.coach-dots i { width: 22px; height: 3px; background: var(--line); transition: background-color 0.2s; }
.coach-dots i.on { background: var(--reticle); }
.coach p { max-width: none; font-size: 16px; color: var(--heat); min-height: 4.5em; }
.coach .actions { flex-wrap: nowrap; }
.coach .go { flex: 1; }
.coach .ghost { font-size: 15px; padding: 12px 14px; border-color: var(--line); color: var(--ash); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
