* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #0b0e0a;
  --accent: #c8a24a;
  --head: #ff4444;
  --body: #44ff44;
  --legs: #4488ff;
}

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #eee; user-select: none; -webkit-user-select: none;
  touch-action: none;
}

#game { position: fixed; inset: 0; }
/* The world canvas is a plain in-flow block filling #game (like the pool game). The
   screens are positioned overlays ABOVE it; transparent ones let the world show through.
   Taps on the (pointer-none) game screen fall through to the canvas for aiming/firing. */
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.screen { position: absolute; inset: 0; z-index: 1; pointer-events: auto; }
#game-screen.active { pointer-events: none; } /* let taps fall through to the world for shooting */
.zoom-ctrl { pointer-events: auto; }

.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: block; }

/* Menu screens: center their content inside the safe area, scroll only if it overflows. */
#title-screen.active, #round-screen.active, #gameover-screen.active {
  display: flex; align-items: center; justify-content: center; overflow-y: auto;
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
}

/* Menu background — menu-bg (the poster's marsh + flock) at 60%, full-bleed past the safe area. */
#round-screen::before, #gameover-screen::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url('../menu-bg.webp') center / cover no-repeat; opacity: 0.6;
}
/* Title shows the LIVE 3D demo behind it — only a light readability scrim over the canvas. */
#title-screen::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(8,12,8,0.05), rgba(8,12,8,0.35));
}
#title-screen > *, #round-screen > *, #gameover-screen > * { position: relative; z-index: 1; }

/* Headshot token bonus flash (+1 token) — pops near the top-centre then fades up */
.hs-bonus {
  position: absolute; top: calc(120px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  z-index: 12; display: flex; align-items: center; gap: 5px; pointer-events: none;
  font-size: 20px; font-weight: 900; color: #22C55E; text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  opacity: 0;
}
.hs-bonus.show { animation: hsPop 0.9s ease-out forwards; }
@keyframes hsPop {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(0.7); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  60% { opacity: 1; transform: translate(-50%, -8px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -28px) scale(1); }
}

/* Exit-to-arcade button — under the 4 menu buttons, back-arrow icon */
.exit-row-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 10px auto 0; padding: 11px 22px; border-radius: 12px; cursor: pointer;
  background: rgba(0,0,0,0.4); border: 1px solid rgba(200,160,70,0.3); color: #d8cdb0;
  font-size: 14px; font-weight: 700; letter-spacing: 1px;
}
.exit-row-btn .svg-ico { width: 18px; height: 18px; }

/* Copyright footer */
.copyright { margin-top: 12px; font-size: 11px; color: rgba(220,210,180,0.5); letter-spacing: 0.3px; }

/* ---------- Title ---------- */
#title-screen, #round-screen, #gameover-screen {
  display: none;
  align-items: center; justify-content: center;
}
/* Round/Game-over keep an opaque backdrop; the TITLE is transparent so the live 3D
   world demo shows behind it (only the light scrim ::before sits over the canvas). */
#round-screen, #gameover-screen {
  background:
    radial-gradient(circle at 50% 30%, rgba(40,60,30,0.6), transparent 60%),
    linear-gradient(160deg, #10160d, #060806);
}
#title-screen { background: transparent; }
#title-screen.active, #round-screen.active, #gameover-screen.active { display: flex; }

.title-content, .round-content, .gameover-content {
  text-align: center; padding: 14px 22px; max-width: 380px; width: 100%; margin: auto;
}
.title-logo { position: relative; margin-bottom: 8px; }
.title-poster { display: block; width: auto; height: auto; max-width: 300px; max-height: min(34vh, 320px);
  margin: 0 auto; border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.55); border: 1px solid rgba(200,160,70,0.25); }
.title-logo h1 {
  font-size: 46px; font-weight: 900; letter-spacing: 4px; line-height: 0.95;
  background: linear-gradient(180deg, #f3e3b0, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 20px rgba(200,160,70,0.25);
}
.title-logo .threed {
  display: inline-block; font-size: 22px; vertical-align: super; margin-left: 6px;
  color: #7ec850; -webkit-text-fill-color: #7ec850;
}
.crosshair-icon {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
  border: 2px solid var(--accent); position: relative;
}
.crosshair-icon::before, .crosshair-icon::after {
  content: ''; position: absolute; background: var(--accent);
}
.crosshair-icon::before { left: 50%; top: 8px; bottom: 8px; width: 2px; transform: translateX(-50%); }
.crosshair-icon::after { top: 50%; left: 8px; right: 8px; height: 2px; transform: translateY(-50%); }

.tagline { color: #9fb088; letter-spacing: 3px; font-size: 13px; margin-bottom: 10px; text-transform: uppercase; }
.howto-btn { display: inline-flex; align-items: center; gap: 7px; margin: 0 auto 14px; padding: 8px 16px;
  background: rgba(14,20,12,0.8); border: 1px solid rgba(200,160,70,0.4); border-radius: 999px;
  color: #e8dcc0; font-weight: 700; font-size: 13px; cursor: pointer; }
.howto-btn .svg-ico { width: 16px; height: 16px; }
.howto-btn:active { transform: scale(0.96); }
/* How-to-Play modal content */
.howto { text-align: left; color: #cfe0bf; }
.howto h3 { color: var(--accent); font-size: 13px; letter-spacing: 1.5px; margin: 14px 0 6px; text-transform: uppercase; }
.howto h3:first-child { margin-top: 0; }
.howto ul { margin: 0; padding-left: 18px; }
.howto li { font-size: 13px; line-height: 1.5; margin-bottom: 4px; }
.howto-scores { background: rgba(0,0,0,0.3); border-radius: 10px; padding: 6px 12px; }

.title-scores { background: rgba(0,0,0,0.35); border: 1px solid rgba(200,160,70,0.18); border-radius: 12px; padding: 12px 16px; margin-bottom: 22px; }
.score-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; }
.score-row .pts { margin-left: auto; font-weight: 700; color: var(--accent); }
.score-row.penalty .pts { color: #ff66cc; }
.score-row.bonus .pts { color: #ffd700; }
.zone-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }

.start-btn {
  width: 100%; padding: 16px; font-size: 18px; font-weight: 800; letter-spacing: 2px;
  color: #161109; background: linear-gradient(180deg, #f3e3b0, var(--accent));
  border: none; border-radius: 12px; cursor: pointer; text-transform: uppercase;
  box-shadow: 0 6px 20px rgba(200,160,70,0.3);
}
.start-btn:active { transform: translateY(1px); }
.start-btn:disabled { opacity: 0.5; filter: grayscale(0.6); cursor: default; }

.svg-ico { display: inline-block; vertical-align: middle; }
.ico-slot { display: inline-flex; vertical-align: middle; }

.token-chip {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; padding: 5px 14px; border-radius: 999px;
  background: rgba(14,20,12,0.8); border: 1px solid rgba(200,160,70,0.4);
  color: #f3e3b0; font-size: 14px; font-weight: 700;
}
.token-chip .ico-slot { color: #f3e3b0; }

/* Mode selector */
.mode-select { margin-bottom: 16px; }
.mode-row { display: flex; gap: 8px; justify-content: center; }
.mode-chip {
  flex: 1; max-width: 76px; aspect-ratio: 1; border-radius: 12px; cursor: pointer;
  background: rgba(14,20,12,0.8); border: 1px solid rgba(200,160,70,0.3);
  color: #9fb088; display: flex; align-items: center; justify-content: center;
}
.mode-chip.sel { border-color: var(--accent); color: #f3e3b0; background: rgba(200,160,70,0.14); }
.mode-name { margin-top: 10px; font-size: 16px; font-weight: 800; color: #fff; letter-spacing: 1px; }
.mode-desc { font-size: 11px; color: #8a9a78; margin-top: 2px; min-height: 26px; line-height: 1.4; }
.menu-row { display: flex; gap: 10px; margin-top: 12px; }
.menu-btn {
  flex: 1; padding: 12px 6px; border-radius: 12px; cursor: pointer;
  background: rgba(14,20,12,0.8); border: 1px solid rgba(200,160,70,0.35);
  color: #e8e0c8; font-size: 22px; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.menu-btn span { font-size: 11px; letter-spacing: 1px; color: #9fb088; text-transform: uppercase; }
.menu-btn:active { transform: translateY(1px); }

/* ---------- Modal ---------- */
.modal {
  position: absolute; inset: 0; z-index: 50; display: none;
  align-items: center; justify-content: center; padding: 18px;
  background: rgba(0,0,0,0.72); backdrop-filter: blur(3px);
}
.modal.open { display: flex; }
.modal-card {
  width: 100%; max-width: 420px; max-height: 88%; display: flex; flex-direction: column;
  /* Glassmorphism */
  background: rgba(22, 29, 16, 0.55);
  backdrop-filter: blur(18px) saturate(1.25); -webkit-backdrop-filter: blur(18px) saturate(1.25);
  border: 1px solid rgba(200,160,70,0.35); border-radius: 20px; overflow: hidden;
  box-shadow: 0 12px 50px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.modal-head h2 { font-size: 24px; font-weight: 900; letter-spacing: 2px; color: var(--accent); }
.modal-close {
  background: rgba(0,0,0,0.4); border: 1.5px solid rgba(200,160,70,0.5); color: #f3e3b0;
  font-size: 22px; line-height: 1; cursor: pointer; flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.modal-close:active { transform: scale(0.92); }
.modal-tokens { padding: 0 18px 10px; color: #f3e3b0; font-weight: 700; font-size: 15px; }
.modal-body { overflow-y: auto; padding: 4px 18px 18px; -webkit-overflow-scrolling: touch; }

.card-row {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border-radius: 12px; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07); margin-bottom: 10px;
}
.card-row .ico { font-size: 30px; width: 52px; text-align: center; flex-shrink: 0; }
.card-row .ico .gun-img { width: 52px; height: 40px; object-fit: contain; }
.card-row .info .name .kind { opacity: 0.55; font-size: 11px; font-weight: 400; }

/* Weapon shop card: vertical — full-width gun banner above the name. */
.weapon-card { flex-direction: column; align-items: stretch; gap: 8px; }
.weapon-card .gun-banner {
  width: 100%; height: 132px; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.20); border-radius: 8px; overflow: hidden; padding: 8px 12px;
  box-sizing: border-box;
}
/* Fit the whole gun inside the banner — large, but never clipped/cropped. The art is
   trimmed to the gun's bbox, so it fills most of the width; max-* + auto preserves aspect. */
.weapon-card .gun-banner .gun-img { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; }
.weapon-card .info .name { font-size: 17px; }
.weapon-card .info .sub { font-size: 12.5px; }
.weapon-card .stats { font-size: 11.5px; }
.weapon-card .card-actions .card-btn { font-size: 13px; padding: 11px 10px; }

/* Scope skins */
/* Functional scope-mode purchase section (top of the Scopes modal) */
.modes-head { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: #c8a24a; margin: 4px 0 8px; }
.modes-head + .skin-grid, .mode-buy-grid + .modes-head { margin-top: 14px; }
.mode-buy-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.mode-buy-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; }
.mode-buy-card.is-owned { border-color: #2bd96b; }
.mode-buy-ico { flex: 0 0 auto; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  color: #2bd96b; border-radius: 10px; background: rgba(8,40,20,0.5); }
.mode-buy-text { flex: 1; min-width: 0; }
.mode-buy-name { font-size: 14px; font-weight: 800; color: #e8dcc0; }
.mode-buy-desc { font-size: 11px; color: #9aa0a6; line-height: 1.3; margin-top: 2px; }
.mode-buy-card .card-btn { flex: 0 0 auto; width: auto; white-space: nowrap; }

.skin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.skin-card { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px;
  padding: 12px 10px; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.skin-card.is-equipped { border-color: #7ec850; }
.skin-swatch { position: relative; width: 76px; height: 76px; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 46%, #0b0b0b 0 38%, var(--skin) 41% 100%);
  border: 2px solid rgba(255,255,255,0.18); box-shadow: inset 0 0 10px rgba(0,0,0,0.7); }
.skin-swatch.has-img { background: #0b0b0b; }
.skin-swatch.has-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.skin-name { font-size: 13px; font-weight: 700; color: #e8dcc0; }
.skin-card .card-btn { width: 100%; font-size: 13px; }
.weapon-card .gun-banner .gun-svg { color: var(--accent); }
.weapon-card .card-actions { display: flex; gap: 8px; width: 100%; }
.weapon-card .card-actions .card-btn { flex: 1; width: auto; min-width: 0; }
.card-btn.upgrade { background: linear-gradient(180deg, #bfe39a, #7ec850); color: #10160d; }
.weapon-card.is-locked .gun-banner { filter: grayscale(0.7) brightness(0.7); }
.weapon-card .ch-list { width: 100%; margin-top: 2px; }
.wallet-ico { vertical-align: middle; }
.card-btn .wallet-ico { margin-right: 2px; }
.card-row .info { flex: 1; min-width: 0; }
.card-row .info .name { font-weight: 800; font-size: 15px; color: #fff; }
.card-row .info .sub { font-size: 11px; color: #9fb088; line-height: 1.4; margin-top: 2px; }
.card-row .stats { font-size: 10px; color: #c8a24a; margin-top: 3px; letter-spacing: 0.5px; }
.card-btn {
  flex-shrink: 0; padding: 9px 14px; border-radius: 10px; border: none; cursor: pointer;
  font-weight: 800; font-size: 12px; letter-spacing: 1px; text-transform: uppercase;
  background: linear-gradient(180deg, #f3e3b0, var(--accent)); color: #161109; min-width: 78px;
}
.card-btn.owned { background: rgba(120,200,80,0.18); color: #8fe06a; border: 1px solid rgba(120,200,80,0.35); }
.card-btn.equipped { background: #7ec850; color: #10160d; }
.card-btn.locked { background: rgba(255,255,255,0.06); color: #888; border: 1px solid rgba(255,255,255,0.12); }
.card-btn:disabled { cursor: default; }
.card-row.is-locked { opacity: 0.65; }
.trophy-block { margin-bottom: 14px; }
.trophy-block .card-row { margin-bottom: 0; border-radius: 12px 12px 0 0; }
.trophy-block.is-locked .card-row { opacity: 0.72; }
.ch-list {
  background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.07); border-top: none;
  border-radius: 0 0 12px 12px; padding: 8px 12px;
}
.ch { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #9aa888; padding: 3px 0; }
.ch.is-done { color: #cfe6b6; }
.ch .ch-done { color: #7ec850; display: inline-flex; }
.ch .ch-lock { color: #6a6a6a; display: inline-flex; }
.ch .ch-prog { margin-left: auto; color: #c8a24a; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Scores screen tabs (Your Stats / Top Hunters) */
.score-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.score-tab { flex: 1; padding: 10px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 800;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(200,160,70,0.2); color: #b8ad90; }
.score-tab.active { background: rgba(200,160,70,0.18); border-color: #c8a24a; color: #f0e6c8; }
.stat-sub { text-align: center; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: #c8a24a; margin: 14px 0 6px; }
.lb-empty { text-align: center; color: #b8ad90; padding: 40px 16px; font-size: 14px; }

.big-stat { text-align: center; padding: 18px 0; }
.big-stat .v { font-size: 48px; font-weight: 900; color: #fff; }
.big-stat .l { font-size: 11px; letter-spacing: 2px; color: #8a9a78; text-transform: uppercase; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-cell { background: rgba(255,255,255,0.05); border-radius: 10px; padding: 12px; text-align: center; }
.stat-cell .v { font-size: 26px; font-weight: 800; color: var(--accent); }
.stat-cell .l { font-size: 10px; letter-spacing: 1px; color: #8a9a78; text-transform: uppercase; }

.hint { color: #6f7d63; font-size: 11px; margin-top: 14px; line-height: 1.6; }
.hint.loading { color: var(--accent); }
.hint.loading.done { display: none; }

/* ---------- Game ---------- */
#game-screen { display: none; flex-direction: column; }
#game-screen.active { display: flex; }

.hud {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between;
  /* Keep the HUD clear of the notch / camera (iOS safe area). */
  padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,0.55), transparent);
}
.hud-left, .hud-right { display: flex; gap: 18px; }
.hud-item { display: flex; flex-direction: column; }
.hud-right .hud-item { align-items: flex-end; }
.hud-btn {
  pointer-events: auto; width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; cursor: pointer; color: #e8e0c8;
  background: rgba(0,0,0,0.4); border: 1px solid rgba(200,160,70,0.25);
}
.hud-btn:active { transform: scale(0.94); }

.hud-label { font-size: 9px; letter-spacing: 2px; color: #8a9a78; }
.hud-value { font-size: 22px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
#hud-timer.low { color: #ff5050; }

/* Stylized look-coordinates (top-centre): yaw = LON, pitch = LAT */
.coords {
  position: absolute; top: calc(44px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  z-index: 10; pointer-events: none;
  display: flex; flex-direction: column; gap: 4px;
  font-variant-numeric: tabular-nums;
  background: rgba(0,0,0,0.7); border: 1px solid rgba(200,160,70,0.22);
  border-radius: 8px; padding: 6px 10px; backdrop-filter: blur(2px);
}
.coord-row { display: flex; align-items: center; gap: 8px; }
.coord-tag { font-size: 9px; letter-spacing: 2px; color: #c8a24a; width: 24px; }
.coord-track {
  position: relative; width: 110px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0.08), rgba(255,255,255,0.22), rgba(255,255,255,0.08));
}
.coord-track::before { /* centre tick (0°) */
  content: ''; position: absolute; left: 50%; top: -2px; width: 1px; height: 8px;
  background: rgba(255,255,255,0.35); transform: translateX(-50%);
}
.coord-mark {
  position: absolute; top: 50%; left: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px;
  border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 6px rgba(255,59,59,0.7);
  transition: left 0.05s linear;
}
.coord-val { font-size: 11px; font-weight: 700; color: #eee; width: 52px; text-align: right; }

/* Ducks-bagged tally — left, under the menu button */
.kill-tally {
  position: absolute; top: calc(58px + env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left)); z-index: 10; pointer-events: none;
  display: flex; align-items: center; gap: 5px;
  background: rgba(0,0,0,0.7); border: 1px solid rgba(200,160,70,0.22);
  border-radius: 8px; padding: 4px 8px; color: #e8dcc0; font-weight: 800; font-size: 14px;
  font-variant-numeric: tabular-nums; backdrop-filter: blur(2px);
}
.kill-tally .svg-ico { width: 18px; height: 18px; }

/* Equipped weapon — BOTTOM-LEFT, vertical (muzzle up), clear of the shot pips.
 *
 * It used to sit top-right under the pause button, rotated 90° so a long gun fitted a narrow
 * vertical strip. That put the one thing telling you WHAT YOU ARE SHOOTING WITH in the corner
 * furthest from where you aim and fire.
 *
 * The bottom half was the only free real estate: `.zoom-ctrl` holds the right edge from
 * `bottom: 74px` up, `.bottom-bar` spans the full width at `bottom: 0` with the shot pips
 * centred in it, and `.gyro-hint` is transient and centred. Bottom-LEFT is unoccupied — only
 * `.gyro-debug`, which is `display: none` — so the weapon mirrors the zoom control across the
 * screen and sits at the SAME vertical anchor, clearing the pips.
 *
 * VERTICAL, MUZZLE UP (owner, 2026-09-26). The gun stands upright, pointing toward where you aim.
 * The old `rotate(90deg)` here was dropped because it stood some guns on their muzzles — the art
 * faces BOTH ways (see `muzzle` in items.js), so one fixed angle is right for four guns and upside
 * down for three. The rotation is therefore set per gun from JS (`weaponHudTransform`), not here.
 * The box stays 98×98: a contained long gun rotated 90° fills its height and ~55px of its width.
 */
.weapon-hud {
  position: absolute; bottom: calc(74px + env(safe-area-inset-bottom)); left: max(2px, env(safe-area-inset-left)); z-index: 10; pointer-events: none;
  width: 98px; height: 98px; display: flex; align-items: center; justify-content: center;
}
.weapon-hud img {
  width: 98px; height: 98px; object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.7)); opacity: 0.92;
}

/* Zoom slider — right edge, BELOW the crosshair (doesn't overlay it). Tick-mark
   track but still a smooth/continuous slider. */
.zoom-ctrl {
  position: absolute; right: 8px; bottom: 74px; top: auto; transform: none;
  z-index: 11; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.7); border: 1px solid rgba(200,160,70,0.25);
  border-radius: 16px; padding: 7px 5px;
}

/* Functional scope-mode toggle buttons — under the LON/LAT coords box */
.scope-modes {
  position: absolute; top: calc(126px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  z-index: 10; display: flex; gap: 8px; pointer-events: auto;
}
.scope-modes:empty { display: none; }
.scope-mode-btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: rgba(0,0,0,0.7); border: 1px solid rgba(200,160,70,0.3);
  color: #9aa0a6; cursor: pointer; padding: 0; backdrop-filter: blur(2px);
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.scope-mode-btn .svg-ico { width: 22px; height: 22px; }
.scope-mode-btn.on {
  color: #2bd96b; border-color: #2bd96b; background: rgba(8,40,20,0.78);
  box-shadow: 0 0 8px rgba(43,217,107,0.45);
}

/* Functional-scope vision tints — fill the scope, sit under the crosshairs, never block taps */
.vision-overlay {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; display: none;
}
.vision-overlay.on { display: block; }
/* Night vision: green phosphor wash + scanlines + vignette (the canvas gets the brightness gain) */
.nv-overlay {
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.22) 0 1px, transparent 1px 3px),
    radial-gradient(circle at 50% 50%, rgba(40,255,90,0.06) 40%, rgba(0,30,8,0.55) 100%);
  mix-blend-mode: screen;
}
/* Heat vision: cold blue rim so the glowing thermal animals read as the hot signatures */
.heat-overlay {
  background: radial-gradient(circle at 50% 48%, rgba(10,20,60,0) 38%, rgba(4,8,30,0.6) 100%);
}
.zoom-ctrl .zoom-end { color: #c8a24a; font-weight: 800; font-size: 14px; line-height: 1; }
.zoom-slider {
  -webkit-appearance: none; appearance: none; background: transparent;
  writing-mode: vertical-lr; direction: rtl;   /* up = zoom in */
  width: 24px; height: 116px; cursor: pointer; touch-action: none;
}
.zoom-slider::-webkit-slider-runnable-track {
  width: 6px; height: 116px; border-radius: 3px;
  background: repeating-linear-gradient(to bottom, rgba(200,160,70,0.9) 0 2px, transparent 2px 11px);
}
.zoom-slider::-moz-range-track {
  width: 6px; height: 116px; border-radius: 3px;
  background: repeating-linear-gradient(to bottom, rgba(200,160,70,0.9) 0 2px, transparent 2px 11px);
}
.zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 12px; border-radius: 4px;
  background: #f3e3b0; border: 1px solid #8a6d1f; margin-left: -7px;
}
.zoom-slider::-moz-range-thumb {
  width: 20px; height: 12px; border-radius: 4px; background: #f3e3b0; border: 1px solid #8a6d1f;
}

/* Tilt-to-look hint (fades in/out when gyro turns on) */
.gyro-hint {
  position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%);
  z-index: 12; pointer-events: none; white-space: nowrap;
  background: rgba(0,0,0,0.5); color: #e8dcc0; border: 1px solid rgba(200,160,70,0.3);
  border-radius: 999px; padding: 7px 14px; font-size: 12px; font-weight: 700; letter-spacing: 0.3px;
  opacity: 0; transition: opacity 0.4s ease;
}
.gyro-hint.show { opacity: 1; }

/* BAGGED / quota this round — amber so the target number reads at a glance */
.hud-tag .hud-value { color: var(--accent); font-size: 18px; letter-spacing: 0.5px; }

/* Live yardage to the animal under the crosshair — just below the reticle */
.yardage {
  position: absolute; left: 50%; top: calc(50% + 42px); transform: translateX(-50%);
  z-index: 9; pointer-events: none; white-space: nowrap; min-height: 16px;
  color: #e8dcc0; font-size: 13px; font-weight: 800; letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  opacity: 0; transition: opacity 0.15s ease;
}
.yardage.show { opacity: 0.95; }
.yardage.far { color: #ff9a4a; }       /* past the safe range — the shot gets dicey */


/* Gyro debug overlay (only when ?debug=1) */
.gyro-debug { position: absolute; left: 8px; bottom: 8px; z-index: 30; display: none; flex-direction: column; gap: 4px; align-items: flex-start; }
.gyro-debug.show { display: flex; }
.gyro-debug pre {
  margin: 0; font-family: ui-monospace, Menlo, monospace; font-size: 10px; line-height: 1.45;
  color: #9effa0; background: rgba(0,0,0,0.62); border: 1px solid rgba(120,255,120,0.25);
  border-radius: 8px; padding: 7px 9px; white-space: pre;
}
.gyro-debug .dbg-btn {
  font-size: 10px; font-weight: 700; color: #cfe0bf; background: rgba(0,0,0,0.55);
  border: 1px solid rgba(200,160,70,0.3); border-radius: 7px; padding: 4px 9px; cursor: pointer;
}

.scope-viewport {
  position: absolute; inset: 0; overflow: hidden; background: transparent;
  pointer-events: none; touch-action: none;
}
.scope-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.scope-svg { width: 100%; height: 100%; }

.hit-marker {
  position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border: 2px solid #fff; border-radius: 50%; z-index: 8; pointer-events: none;
  animation: hitpop 0.4s ease-out forwards;
}
.hit-marker.miss { border-color: #888; }
@keyframes hitpop { 0% { transform: scale(0.3); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }

.hit-text {
  position: absolute; left: 50%; top: 38%; transform: translateX(-50%);
  font-size: 30px; font-weight: 900; letter-spacing: 1px; z-index: 9;
  pointer-events: none; text-shadow: 0 2px 12px rgba(0,0,0,0.8);
  animation: hittext 1s ease-out forwards;
}
@keyframes hittext { 0% { opacity: 0; transform: translate(-50%, 10px) scale(0.8);} 20%{opacity:1; transform: translate(-50%,0) scale(1.1);} 80%{opacity:1;} 100% { opacity: 0; transform: translate(-50%, -16px) scale(1);} }

.muzzle-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(255,230,150,0.9), transparent 38%); z-index: 7; pointer-events: none; }

.hidden { display: none !important; }

/* Pause overlay */
.pause-overlay {
  position: absolute; inset: 0; z-index: 40; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(0,0,0,0.78); backdrop-filter: blur(3px);
}
.pause-overlay.open { display: flex; }
.pause-card { width: 100%; max-width: 320px; text-align: center; }
.pause-card h2 { font-size: 28px; font-weight: 900; letter-spacing: 4px; color: var(--accent); margin-bottom: 22px; }
.pause-card .start-btn { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; }
.wide-btn {
  width: 100%; padding: 14px; margin-bottom: 10px; border-radius: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(200,160,70,0.22);
  color: #e8e0c8; font-size: 15px; font-weight: 700; letter-spacing: 1px;
}
.wide-btn:active { transform: translateY(1px); }

.bottom-bar {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: center; padding: 12px;
  pointer-events: none; background: linear-gradient(0deg, rgba(0,0,0,0.55), transparent);
}
.shot-indicators { display: flex; gap: 5px; align-items: flex-end; flex-wrap: wrap; max-width: 220px; }
.shot-dot { display: flex; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.6)); transition: opacity 0.15s, transform 0.15s; }
.shot-dot .bullet-ico { display: block; }
.shot-dot.used { opacity: 0.28; transform: translateY(2px); }            /* fired, missed — spent & dimmed */
.shot-dot.hit { opacity: 0.4; transform: translateY(2px); }              /* fired, connected */
.shot-dot.hit .bullet-ico { filter: drop-shadow(0 0 3px var(--accent)); }

/* ---------- Round / Game over ---------- */
.round-content h2, .gameover-content h2 {
  font-size: 30px; font-weight: 900; letter-spacing: 2px; margin-bottom: 18px; color: var(--accent);
}
/* Round tally: one duck per bird — bright = bagged, dim = got away */
.round-hitmap { width: 100%; max-width: 300px; margin: 2px auto 12px; }
.duck-tally { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.tally-duck { display: inline-flex; padding: 3px; border-radius: 6px; }
.tally-duck.down { color: #ffd24a; background: rgba(255,210,74,0.12); }
.tally-duck.away { color: rgba(220,220,220,0.28); }
.hm-label { text-align: center; font-size: 12px; color: #c8a24a; margin-top: 2px; font-weight: 700; }

.round-shots { display: flex; gap: 10px; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }
.round-shot { padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 700; background: rgba(255,255,255,0.08); }
.round-score, .final-score { margin-bottom: 22px; }
.round-score-label, .final-label { display: block; font-size: 11px; letter-spacing: 2px; color: #8a9a78; }
.round-score-value, .final-value { font-size: 44px; font-weight: 900; color: #fff; }
.final-grade { font-size: 26px; font-weight: 900; margin-bottom: 16px; color: var(--accent); letter-spacing: 2px; }

/* End-of-hunt score report */
.gameover-report {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  width: 100%; max-width: 330px; margin: 0 auto 22px;
}
.gameover-report .ro-cell {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(200,160,70,0.18);
  border-radius: 10px; padding: 9px 4px;
}
.gameover-report .ro-v { font-size: 18px; font-weight: 800; color: #fff; }
.gameover-report .ro-l { font-size: 9.5px; letter-spacing: 1px; color: #9fb088; margin-top: 3px; text-transform: uppercase; }
.gameover-msg { min-height: 14px; margin: 8px 0 0; font-size: 12.5px; font-weight: 700; color: #ff7a7a; letter-spacing: .3px; opacity: 0; }
.gameover-msg.show { opacity: 1; animation: gameoverMsgPop 0.25s ease both; }
@keyframes gameoverMsgPop {
  0% { opacity: 0; transform: scale(0.85); }
  60% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

/* ---- Start-of-hunt "hold phone upright" calibration overlay ---- */
.calibrate-overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(6, 12, 8, 0.92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.calibrate-overlay.show { opacity: 1; pointer-events: auto; }
.calibrate-card { text-align: center; padding: 24px; max-width: 340px; }
.calibrate-figure { position: relative; width: 150px; height: 170px; margin: 0 auto 20px; color: #cfe0bd; }
.calib-svg { width: 100%; height: 100%; display: block; }
.calib-svg .calib-body { fill: currentColor; }
.calib-svg .calib-arm { fill: currentColor; opacity: 0.82; }
.calib-phone-body { fill: #2a3a24; stroke: currentColor; stroke-width: 3; }
.calib-phone-scr { fill: #6f8a55; }
/* phone wobbles while you're not upright yet, pivoting at its centre */
.calib-phone-g { transform-box: fill-box; transform-origin: center; animation: calibWobble 1.6s ease-in-out infinite; }
@keyframes calibWobble { 0%,100% { transform: rotate(-11deg); } 50% { transform: rotate(11deg); } }
/* upright detected → everything snaps green + steady, checkmark pops */
.calibrate-figure.upright { color: #7CFF6B; }
.calibrate-figure.upright .calib-phone-body { fill: #143a0f; }
.calibrate-figure.upright .calib-phone-scr { fill: #7CFF6B; }
.calibrate-figure.upright .calib-phone-g { animation: none; transform: rotate(0deg); }
.calib-check {
  position: absolute; right: 6px; bottom: 6px; width: 40px; height: 40px; color: #7CFF6B;
  background: rgba(10,20,10,0.85); border-radius: 50%; padding: 6px; box-sizing: border-box;
  opacity: 0; transform: scale(0.5); transition: opacity 0.2s ease, transform 0.2s ease;
}
.calibrate-figure.upright .calib-check { opacity: 1; transform: scale(1); }
.calibrate-title { font-size: 21px; font-weight: 800; color: #fff; letter-spacing: 0.5px; margin: 0 0 8px; }
.calibrate-sub { font-size: 13px; line-height: 1.45; color: #9fb088; margin: 0 0 20px; }
.calibrate-bar { width: 200px; max-width: 80%; height: 7px; margin: 0 auto; border-radius: 999px;
  background: rgba(255,255,255,0.12); overflow: hidden; }
.calibrate-bar-fill { height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #5a8a3c, #7CFF6B); transition: width 0.12s linear; }

/* ---- Pre-round rules gate (shown before the upright calibration each round) ---- */
.rules-overlay {
  position: fixed; inset: 0; z-index: 62; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(6, 12, 8, 0.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.rules-overlay.show { opacity: 1; pointer-events: auto; }
.rules-card {
  width: 100%; max-width: 360px; max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  text-align: center; padding: 22px 20px; border-radius: 16px;
  background: rgba(10,15,9,0.9); border: 1px solid rgba(200,160,70,0.4);
}
.rules-season {
  display: inline-block; font-size: 19px; font-weight: 900; letter-spacing: 2px; color: #161109;
  background: linear-gradient(180deg, #f3e3b0, var(--accent)); border-radius: 999px; padding: 5px 18px;
}
.rules-round { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: #8a9a78; margin: 8px 0 14px; }
.rules-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; text-align: left; }
.rules-col { border-radius: 12px; padding: 10px 12px; border: 1px solid transparent; }
.rules-col.shoot { background: rgba(68,255,68,0.08); border-color: rgba(120,200,80,0.35); }
.rules-col.avoid { background: rgba(255,68,68,0.08); border-color: rgba(255,90,90,0.32); }
.rules-col h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.rules-col.shoot h4 { color: #8fe06a; }
.rules-col.avoid h4 { color: #ff7a7a; }
.rules-chip { display: flex; align-items: center; gap: 7px; padding: 4px 0; font-size: 13px; font-weight: 700; color: #e8dcc0; }
.rules-chip .svg-ico { flex: 0 0 auto; color: #cfe0bd; }
.rules-chip.tagged { color: #8fe06a; }
.rules-chip .tag-badge { margin-left: auto; font-size: 9px; font-weight: 800; letter-spacing: .5px; color: #161109;
  background: #7ec850; border-radius: 999px; padding: 1px 6px; }
.rules-ethics { list-style: none; margin: 0 0 16px; padding: 0; text-align: left; }
.rules-ethics li { font-size: 12px; color: #b9c4aa; padding: 3px 0 3px 16px; position: relative; }
.rules-ethics li::before { content: '›'; position: absolute; left: 2px; color: var(--accent); font-weight: 900; }
.rules-ethics li b { color: #f3e3b0; }


/* ---- Average shot placement (Your Stats history) ---- */
.avg-placement { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.avg-placement .ap-sil { flex: 0 0 44%; max-width: 150px; }
.ap-bars { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.ap-row { display: grid; grid-template-columns: 52px 1fr 34px; align-items: center; gap: 8px; font-size: 11px; }
.ap-row .ap-l { color: #b9c4aa; font-weight: 700; letter-spacing: .5px; }
.ap-row .ap-track { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.ap-row .ap-fill { height: 100%; border-radius: 999px; }
.ap-row .ap-pct { text-align: right; color: #e8dcc0; font-weight: 800; }
.ap-most { text-align: center; font-size: 12px; color: #c8a24a; font-weight: 700; margin-top: 8px; }
.ap-empty { text-align: center; font-size: 12px; color: #8a9a78; padding: 10px; }

/* ---------- Progression: trophy cabinet, daily challenge, results awards (PROGRESSION.md) ---------- */
.mode-buy-earn { font-size: 10px; color: #c8a24a; margin-top: 3px; }
.daily-card { border: 1px solid rgba(200,162,74,0.5); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px;
  background: linear-gradient(180deg, rgba(200,162,74,0.14), rgba(200,162,74,0.04)); }
.daily-card.is-done { border-color: #2bd96b; }
.daily-k { font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #c8a24a; display: flex; align-items: center; gap: 4px; }
.daily-name { font-size: 15px; font-weight: 800; color: #f3e3b0; margin-top: 3px; }
.daily-prog { font-size: 12px; color: #9aa0a6; margin-top: 2px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.badge-cell { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 4px;
  border-radius: 12px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); opacity: 0.6; }
.badge-cell.earned { opacity: 1; border-color: rgba(200,162,74,0.35); }
.badge-name { font-size: 11px; font-weight: 800; color: #e8dcc0; margin-top: 4px; }
.badge-tier { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #6b7280; }
.badge-tier.tier-1 { color: #e7a56a; } .badge-tier.tier-2 { color: #d9dee5; } .badge-tier.tier-3 { color: #ffd84a; } .badge-tier.tier-4 { color: #9be8f8; }
.badge-sub { font-size: 10px; color: #8a9097; line-height: 1.25; margin-top: 2px; }
.ms-list { display: flex; flex-direction: column; gap: 4px; }
.ms-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #9aa0a6; padding: 4px 6px; border-radius: 8px; }
.ms-row.ms-paid { color: #cfe9d4; } .ms-row.ms-paid .ms-mark { color: #2bd96b; }
.ms-row.ms-pending { color: #f3e3b0; background: rgba(200,162,74,0.08); } .ms-row.ms-pending .ms-mark { color: #c8a24a; }
.ms-desc { flex: 1; min-width: 0; }
.ms-amt { display: flex; align-items: center; gap: 3px; font-weight: 800; color: #c8a24a; }
.gameover-awards { width: 100%; margin: 8px 0; }
.award-title { font-size: 12px; font-weight: 900; letter-spacing: 1.5px; text-transform: uppercase; color: #ffd84a; text-align: center; margin: 6px 0 4px; }
.award-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.award-badge { display: flex; flex-direction: column; align-items: center; width: 84px; }
.gameover-awards.celebrate .award-badge { animation: awardPop 0.6s cubic-bezier(.2,1.6,.4,1) both; }
.award-name { font-size: 10px; font-weight: 800; color: #f3e3b0; text-align: center; text-transform: capitalize; }
.award-ms { font-size: 12px; color: #f3e3b0; display: flex; align-items: center; justify-content: center; gap: 5px; }
.award-ms span { display: inline-flex; align-items: center; gap: 2px; color: #c8a24a; font-weight: 800; }
.award-daily { font-size: 12px; color: #9aa0a6; text-align: center; margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.award-daily.is-done { color: #2bd96b; font-weight: 800; }
@keyframes awardPop { 0% { transform: scale(0.2) rotate(-20deg); opacity: 0; } 70% { transform: scale(1.15) rotate(4deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
/* Lead-Assist ticks: faint, so they aid the swing without shouting */
.lead-ticks { position: absolute; inset: 0; pointer-events: none; }
.lead-tick { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  border: 1.5px solid rgba(120,255,160,0.55); box-shadow: 0 0 4px rgba(120,255,160,0.35); }
