/* Gloomhunt in-game UI — HTML overlay layer (canvas = world only) */
@import url('leaderboard.css');
@import url('leaderboard-ingame.css');

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:root {
  --gh-accent: #44cc44;
  --gh-accent-dim: #2a6a2a;
  --gh-accent-glow: rgba(68, 204, 68, 0.45);
  --gh-bg-panel: rgba(8, 14, 10, 0.92);
  --gh-border: rgba(68, 204, 68, 0.35);
  --gh-text: #ccddcc;
  --gh-text-muted: #6a8a72;
  --gh-danger: #cc4444;
  --gh-gold: #e3a520;
  --gh-font: ui-monospace, 'Cascadia Mono', 'Consolas', monospace;
  --gh-font-display: 'Rajdhani', sans-serif;
  --gh-screen-title: clamp(2.5rem, 8vw, 7.5rem);
  --gh-screen-subtitle: clamp(0.875rem, 2vw, 1.75rem);
  --gh-screen-body: clamp(0.8rem, 1.5vw, 1.25rem);
  --gh-scale: 1;
  --gh-width: 100vw;
  --gh-height: 100vh;

  /* HUD scale — auto (viewport) × user (slider) × desktop boost (fine pointer).
     Base sizes target a chunky desktop default; mobile caps stay in .touch-layout. */
  --hud-desktop-boost: 1;
  --user-hud-scale: 1;

  /* Mobile action-button size multiplier (user setting, separate from HUD
     scale). Drives the bottom-right action cluster and the radial picker. */
  --mobile-btn-scale: 1;
  --hud-scale-raw: calc(
    var(--gh-hud-auto-scale, 1) * var(--user-hud-scale, 1) * var(--hud-desktop-boost, 1)
  );
  --hud-scale: clamp(0.75, var(--hud-scale-raw), 2.4);

  /* HUD layout tokens */
  --hud-bar-h: calc(28px * var(--hud-scale));
  --hud-bar-w: clamp(200px, calc(340px * var(--hud-scale)), 480px);
  --hud-cell-h: calc(42px * var(--hud-scale));
  --hud-cell-min-w: calc(42px * var(--hud-scale));
  --hud-ammo-h: var(--hud-bar-h);
  --hud-tl-max-w: min(58vw, calc(420px * var(--hud-scale)));

  /* HUD typography tokens */
  --hud-font-xs: calc(0.8rem * var(--hud-scale));
  --hud-font-sm: calc(0.95rem * var(--hud-scale));
  --hud-font-md: calc(1.1rem * var(--hud-scale));
  --hud-font-lg: calc(1.35rem * var(--hud-scale));
  --hud-font-timer: calc(2.2rem * var(--hud-scale));

  /*
   * Responsive breakpoint policy (canonical values — do not invent new ones):
   *   - width  600px  : single phone breakpoint (reflow to single column).
   *   - width  768px  : tablet breakpoint (wider HUD, bigger buttons on touch).
   *   - height 720px  : medium-short (tighten table rows / leaderboard).
   *   - height 560px  : short (scale down padding / title / button heights).
   *   - height 420px  : extreme short tier (further scale-down).
   * Anything narrower / shorter falls into the next tier down. New rules
   * should reuse one of these exact values; CSS @media cannot read CSS
   * variables, so the constants are documented here instead.
   */

  /* Transition timing tokens.
   *   --gh-transition-fast    : hover/focus state changes (color, border,
   *                             background, box-shadow). The bread-and-butter
   *                             "the cursor moved over this thing" timing.
   *   --gh-transition-press   : snappy press/transform interactions; faster
   *                             than --gh-transition-fast so the button feels
   *                             responsive on click.
   *   --gh-transition-overlay : screen fade in/out (gh-screen-fade keyframe).
   */
  --gh-transition-fast: 0.15s;
  --gh-transition-press: 0.1s;
  --gh-transition-overlay: 200ms;

  /* Unified screen layout tokens */
  --screen-pad-y: clamp(1.5dvh, 2.5dvh, 3dvh);
  --screen-pad-x: max(4vw, var(--safe-right, 0px));
  --screen-content-max: min(960px, 88vw);
  --screen-title-size: clamp(1.75rem, 5vw, 3.25rem);
  --screen-tagline-size: clamp(0.78rem, 1.8vw, 0.95rem);
  --screen-section-gap: clamp(0.5rem, 1.5vh, 1rem);
  --screen-btn-gap: clamp(0.75rem, 2vh, 1.25rem);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

#game-root {
  position: fixed;
  top: 0;
  left: 0;
  overflow: hidden;
  touch-action: none;
}

#game-root canvas#game {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  z-index: 0;
}

#hud-layer,
#screen-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  font-family: var(--gh-font);
  color: var(--gh-text);
}

#screen-layer {
  z-index: 2;
}

#hud-layer.touch-layout .hud-mobile-actions {
  display: grid;
}

#hud-layer:not(.touch-layout) .hud-mobile-actions {
  display: none;
}

/* Screen panels */
.screen-panel {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  padding: max(12px, var(--safe-top)) max(12px, var(--safe-right)) max(12px, var(--safe-bottom))
    max(12px, var(--safe-left));
  background: rgba(6, 10, 8, 0.88);
  overflow: hidden;
}

.screen-panel.active {
  display: flex;
}

#screen-layer ::-webkit-scrollbar {
  width: 4px;
}

#screen-layer ::-webkit-scrollbar-track {
  background: rgba(8, 14, 10, 0.4);
  border-radius: 3px;
}

#screen-layer ::-webkit-scrollbar-thumb {
  background: var(--gh-accent-dim);
  border-radius: 3px;
}

#screen-layer ::-webkit-scrollbar-thumb:hover {
  background: var(--gh-accent);
}

#screen-layer {
  scrollbar-color: var(--gh-accent-dim) rgba(8, 14, 10, 0.4);
  scrollbar-width: thin;
}

.screen-panel--menu-bg {
  overflow: hidden;
  padding: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(10, 26, 16, 0.72) 0%,
    rgba(5, 10, 8, 0.88) 55%,
    rgba(3, 6, 8, 0.92) 100%
  );
  cursor: default;
}

/* Screens that sit over the live game canvas need a fully opaque base so the
   frozen game world never bleeds through, while keeping the menu look. Any
   screen that opts in via this modifier inherits the opaque variant; no
   per-screen ID needs to be listed here. */
.screen-panel--opaque-bg.screen-panel--menu-bg {
  background:
    radial-gradient(
      ellipse at center,
      rgba(10, 26, 16, 0.92) 0%,
      rgba(5, 10, 8, 0.97) 55%,
      rgba(3, 6, 8, 1) 100%
    ),
    #050a08;
}

.menu-crosshair {
  top: 50%;
  width: min(58vw, 58vh);
  height: min(58vw, 58vh);
  opacity: 0.9;
}

/* Every screen's content wrapper carries `.screen-stack` for the shared
   flex column / 100dvh / padding layout. Screen-specific tweaks (e.g.
   `.menu-stack { justify-content: center }`) live in narrower rules
   below; a new screen inherits this rule by class membership and never
   needs to be appended to a selector list. */
.screen-stack {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  box-sizing: border-box;
  pointer-events: auto;
  padding: max(var(--screen-pad-y), var(--safe-top, 0px)) var(--screen-pad-x)
    max(var(--screen-pad-y), var(--safe-bottom, 0px)) var(--screen-pad-x);
}

/* Only How-to-Play needs full-page scroll */
.guide-stack {
  overflow-y: auto;
}

.menu-stack {
  justify-content: center;
}

.screen-title {
  font-family: var(--gh-font-display);
  font-size: var(--screen-title-size);
  font-weight: 700;
  color: var(--gh-accent);
  text-shadow: 0 0 12px var(--gh-accent-glow);
  letter-spacing: 0.15em;
  margin: 0 0 var(--screen-section-gap);
  flex-shrink: 0;
  text-align: center;
}

.screen-tagline {
  color: var(--gh-text-muted);
  font-size: var(--screen-tagline-size);
  margin: 0 0 var(--screen-section-gap);
  flex-shrink: 0;
  text-align: center;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-destructive {
  font-family: var(--gh-font);
  cursor: pointer;
  border-radius: 6px;
  border: 1.5px solid var(--gh-border);
  min-height: 44px;
  padding: 0.55rem 1.4em;
  font-size: clamp(0.85rem, calc(1rem * var(--gh-scale)), 1.05rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition:
    box-shadow var(--gh-transition-fast),
    transform var(--gh-transition-press),
    background var(--gh-transition-fast);
}

.btn-primary {
  background: linear-gradient(180deg, #3a8a3a 0%, #2a6a2a 100%);
  color: #e8ffe8;
  border-color: var(--gh-accent);
  box-shadow: 0 0 16px var(--gh-accent-glow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes gh-pulse {
  0%,
  100% {
    box-shadow: 0 0 12px var(--gh-accent-glow);
  }
  50% {
    box-shadow: 0 0 24px rgba(68, 204, 68, 0.7);
  }
}

.btn-secondary {
  background: var(--gh-bg-panel);
  color: var(--gh-text);
}

.btn-destructive {
  background: rgba(80, 20, 20, 0.9);
  border-color: var(--gh-danger);
  color: #ffcccc;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-destructive:hover {
  filter: brightness(1.1);
}

.btn-primary:active,
.btn-secondary:active,
.btn-destructive:active {
  transform: scale(0.98);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-destructive:focus-visible {
  outline: 2px solid var(--gh-accent);
  outline-offset: 3px;
}

/* Unified back button used on all overlay screens */
.screen-back-btn {
  display: block;
  width: 100%;
  max-width: min(400px, 100%);
  min-height: 44px;
  margin-top: var(--screen-section-gap);
  margin-inline: auto;
  padding: 0.55rem 1.15rem;
  font-family: var(--gh-font-display);
  font-size: clamp(0.85rem, 1.8vw, 1rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  flex-shrink: 0;
}

/* Shared action-row footer for overlay screens. Used by How To Play,
   Run Stats, Leaderboard, and Game Over. Settings and Credits do not
   currently use it — Settings places its back button as a direct stack
   child, and the `.credits-footer` block is actually a meta-info area
   (link / version / copyright), not an action row. */
.screen-footer {
  flex-shrink: 0;
  width: 100%;
  max-width: var(--screen-content-max);
  margin: var(--screen-section-gap) auto 0;
  display: flex;
  gap: clamp(0.6rem, 1.5vw, 1rem);
  justify-content: center;
  align-items: stretch;
}

/* Leaderboard sits inside a wider content area. */
.screen-footer--wide {
  max-width: min(1200px, 92vw);
}

/* Game Over wraps when there's not enough room for Retry / Leaderboards /
   Menu side by side. */
.screen-footer--wrap {
  flex-wrap: wrap;
}

/* When the footer contains multiple primary action buttons that should
   share width (e.g. How To Play's Play + Back). */
.screen-footer--stretch > .btn-primary,
.screen-footer--stretch > .btn-secondary,
.screen-footer--stretch > .btn-destructive {
  flex: 1;
  height: 44px;
  min-height: 44px;
  margin-top: 0;
  padding: 0.55rem 1.15rem;
  font-size: clamp(0.85rem, 1.8vw, 1rem);
}

/* Inside a `.screen-footer`, the back button must not stack its own
   default `margin-top` on top of the footer's `margin-top`. */
.screen-footer > .screen-back-btn {
  margin-top: 0;
}

/* Splash — fully CSS loading gate (no canvas) */
.screen-panel--splash {
  background: radial-gradient(ellipse at center, #0a1a10 0%, #050a08 50%, #030608 100%);
  cursor: pointer;
  overflow: hidden;
  min-height: 100dvh;
}

.screen-panel--splash.active {
  display: flex;
}

.splash-crosshair {
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(50vw, 50vh);
  height: min(50vw, 50vh);
  transform: translate(-50%, -50%);
  color: var(--gh-accent);
  z-index: 0;
  pointer-events: none;
  animation: gh-crosshair-spin 20s linear infinite;
}

@keyframes gh-crosshair-spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.splash-title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--gh-font-display);
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--gh-accent);
  text-shadow:
    0 0 20px var(--gh-accent-glow),
    0 0 40px rgba(68, 204, 68, 0.25);
  animation: gh-splash-rise 0.8s ease-out both;
  animation-delay: 0.1s;
}

.splash-tagline {
  position: relative;
  z-index: 1;
  margin: 0.75rem 0 0;
  font-size: var(--gh-screen-subtitle);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gh-text-muted);
  animation: gh-splash-rise 0.8s ease-out both;
  animation-delay: 0.4s;
}

.splash-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 0.35em;
  border-radius: 50%;
  background: var(--gh-accent);
  vertical-align: middle;
  opacity: 0.7;
}

.splash-loading {
  position: relative;
  z-index: 1;
  width: min(240px, 70vw);
  height: 2px;
  margin-top: 2rem;
  background: rgba(68, 204, 68, 0.15);
  border-radius: 2px;
  overflow: hidden;
  animation: gh-splash-rise 0.8s ease-out both;
  animation-delay: 0.6s;
}

.splash-loading-track {
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--gh-accent), transparent);
  animation: gh-splash-shimmer 1.2s ease-in-out infinite;
}

@keyframes gh-splash-shimmer {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

.splash-enter {
  position: relative;
  z-index: 1;
  margin: 1.5rem 0 0;
  font-size: var(--gh-screen-body);
  color: #99bbaa;
  letter-spacing: 0.08em;
  animation: gh-breathe 1.4s ease-in-out infinite;
}

#screen-splash.splash-ready .splash-enter {
  animation:
    gh-breathe 1.4s ease-in-out infinite,
    gh-splash-rise 0.6s ease-out both;
}

.splash-ring-outer {
  animation: gh-ring-pulse 4s ease-in-out infinite;
}

@keyframes gh-ring-pulse {
  0%,
  100% {
    opacity: 0.05;
  }
  50% {
    opacity: 0.12;
  }
}

.splash-error[hidden] {
  display: none !important;
}

.splash-error {
  position: relative;
  z-index: 1;
  margin: 1.5rem 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  animation: gh-splash-rise 0.4s ease-out both;
}

.splash-error-msg {
  font-family: var(--gh-font);
  font-size: var(--gh-screen-body);
  color: rgba(160, 200, 180, 0.5);
  letter-spacing: 0.04em;
}

.splash-error-action {
  font-family: var(--gh-font);
  font-size: var(--gh-screen-body);
  color: #99bbaa;
  letter-spacing: 0.08em;
  animation: gh-breathe 1.4s ease-in-out infinite;
  cursor: pointer;
}

@keyframes gh-breathe {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

@keyframes gh-splash-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#screen-splash.fading-out {
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

/* Main menu — layout shell at .menu-stack (above); controls below */
.menu-brand {
  flex-shrink: 0;
  width: 100%;
  text-align: center;
}

.menu-brand .screen-tagline {
  margin-bottom: clamp(1rem, 3vh, 2rem);
}

#screen-menu .menu-title {
  font-size: clamp(2.5rem, 9vw, 6rem);
  letter-spacing: 0.2em;
  margin-bottom: 0.35rem;
  text-shadow:
    0 0 20px var(--gh-accent-glow),
    0 0 40px rgba(68, 204, 68, 0.2);
}

#screen-menu .menu-tagline {
  font-size: clamp(0.9rem, 2.2vw, 1.5rem);
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.menu-actions {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: clamp(0.85rem, 2.4vh, 1.35rem);
  width: 100%;
  max-width: min(400px, 100%);
  margin-inline: auto;
  align-self: center;
}

.menu-play-error {
  margin: 0;
  padding: 0.65rem 0.85rem;
  width: 100%;
  text-align: center;
  font-size: clamp(0.78rem, 1.6vw, 0.92rem);
  line-height: 1.4;
  color: #ffb4b4;
  background: rgba(180, 40, 40, 0.22);
  border: 1px solid rgba(255, 120, 120, 0.45);
  border-radius: 6px;
}

.menu-bounty-start-error {
  width: 100%;
  padding: clamp(1rem, 2.5vh, 1.35rem);
  text-align: center;
  background: rgba(8, 18, 12, 0.92);
  border: 1px solid rgba(255, 120, 120, 0.45);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.menu-actions-primary {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(0.85rem, 2.4vh, 1.35rem);
  width: 100%;
}

.menu-actions--bounty-blocked .menu-actions-primary {
  display: none;
}

.menu-bounty-start-error-title {
  margin: 0 0 0.5rem;
  font-family: var(--gh-font-display, var(--gh-font));
  font-size: clamp(0.88rem, 1.8vw, 1rem);
  font-weight: 700;
  color: #ffb4b4;
}

.menu-bounty-start-error-msg {
  margin: 0 0 0.85rem;
  font-size: clamp(0.78rem, 1.6vw, 0.92rem);
  line-height: 1.45;
  color: rgba(255, 220, 220, 0.95);
}

.menu-bounty-start-error-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
}

.bounty-staging-stack {
  width: 100%;
  max-width: min(580px, 100%);
  height: 100%;
  max-height: 100%;
  justify-content: center;
  overflow: hidden;
  padding-top: clamp(10px, 2dvh, 20px);
  padding-bottom: clamp(10px, 2dvh, 20px);
  box-sizing: border-box;
}

@media (min-width: 721px) {
  .bounty-staging-stack {
    max-width: min(820px, calc(100vw - 48px));
    padding-top: clamp(12px, 1.8dvh, 20px);
    padding-bottom: clamp(12px, 1.8dvh, 20px);
  }

  .bounty-staging-scene {
    align-items: center;
    align-self: stretch;
  }

  .bounty-staging-glow {
    width: min(880px, 125%);
    height: min(620px, 112%);
  }

  #screen-bounty-staging .bounty-staging-crosshair {
    width: clamp(620px, 82vw, 820px);
    height: clamp(620px, 82vw, 820px);
    opacity: 0.16;
  }

  .bounty-staging-frame {
    align-self: center;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: calc(100dvh - 32px);
    gap: 0;
    padding: clamp(1.25rem, 2.4dvh, 1.75rem) clamp(1.35rem, 2.5vw, 2rem);
    border-radius: 14px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .bounty-staging-header {
    flex-shrink: 0;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(85, 221, 119, 0.16);
  }

  .bounty-staging-title {
    font-size: clamp(1.5rem, 2.8vw, 1.85rem);
  }

  .bounty-staging-eyebrow {
    font-size: 0.78rem;
    margin-bottom: 0.4rem;
  }

  .bounty-staging-chips {
    margin-top: clamp(0.55rem, 1.2dvh, 0.85rem);
    gap: 0.5rem;
  }

  .bounty-staging-chip {
    padding: 0.28rem 0.75rem;
    font-size: 0.76rem;
  }

  .bounty-staging-main {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0;
  }

  .bounty-staging-block {
    padding: clamp(0.85rem, 1.8dvh, 1.15rem) clamp(0.95rem, 1.6vw, 1.15rem);
    border-radius: 10px;
  }

  .bounty-staging-block--warning {
    padding: clamp(0.85rem, 1.8dvh, 1.1rem) clamp(0.95rem, 1.6vw, 1.15rem);
  }

  .bounty-staging-section-label {
    margin-bottom: clamp(0.45rem, 1dvh, 0.65rem);
    font-size: 0.72rem;
  }

  .bounty-staging-objectives,
  .bounty-staging-warning {
    font-size: clamp(0.95rem, 1.5vw, 1.02rem);
    line-height: 1.55;
  }

  .bounty-staging-objectives li + li {
    margin-top: clamp(0.35rem, 0.8dvh, 0.5rem);
  }

  .bounty-staging-footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(85, 221, 119, 0.16);
  }

  .bounty-staging-check {
    padding: clamp(0.75rem, 1.6dvh, 0.95rem) clamp(0.85rem, 1.5vw, 1rem);
    min-height: 48px;
  }

  .bounty-staging-check-text {
    font-size: clamp(0.92rem, 1.4vw, 0.98rem);
  }

  .bounty-staging-actions {
    margin-top: 0;
    gap: clamp(0.55rem, 1.2dvh, 0.75rem);
  }

  .bounty-staging-actions .menu-btn--play {
    padding: clamp(0.68em, 1.5dvh, 0.82em) 1.2em;
    font-size: clamp(1.08rem, 2vw, 1.25rem);
  }

  .bounty-staging-actions .menu-btn--secondary {
    min-height: 46px;
  }
}

#screen-bounty-staging .screen-stack.bounty-staging-stack {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

#screen-bounty-staging .bounty-staging-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.bounty-staging-scene {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.bounty-staging-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(680px, 118%);
  height: min(560px, 105%);
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(68, 204, 68, 0.13) 0%,
    rgba(34, 120, 68, 0.06) 38%,
    transparent 68%
  );
}

#screen-bounty-staging .bounty-staging-crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(520px, 72vw, 680px);
  height: clamp(520px, 72vw, 680px);
  transform: translate(-50%, -50%);
  color: var(--gh-accent);
  opacity: 0.15;
  z-index: 0;
  pointer-events: none;
  animation: gh-crosshair-spin 24s linear infinite;
}

.bounty-staging-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(0.45rem, 1.2dvh, 0.85rem);
  padding: clamp(0.75rem, 1.8dvh, 1.15rem) clamp(0.85rem, 2vw, 1.15rem);
  background: linear-gradient(
    165deg,
    rgba(10, 24, 16, 0.94) 0%,
    rgba(6, 14, 10, 0.97) 55%,
    rgba(4, 10, 8, 0.98) 100%
  );
  border: 1px solid rgba(85, 221, 119, 0.32);
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(85, 221, 119, 0.08) inset,
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(34, 120, 68, 0.12);
  overflow: hidden;
}

.bounty-staging-header {
  text-align: center;
}

.bounty-staging-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(170, 255, 190, 0.78);
}

.bounty-staging-title {
  margin: 0;
  font-family: var(--gh-font-display, var(--gh-font));
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.15;
  color: var(--gh-text, #e8ffe8);
}

.bounty-staging-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: clamp(0.35rem, 0.9dvh, 0.55rem);
}

.bounty-staging-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(210, 236, 214, 0.92);
  background: rgba(18, 40, 26, 0.85);
  border: 1px solid rgba(85, 221, 119, 0.22);
  white-space: nowrap;
}

.bounty-staging-chip--reward {
  color: var(--gh-gold, #ffd56a);
  border-color: rgba(255, 213, 106, 0.35);
  background: rgba(48, 38, 12, 0.55);
}

.bounty-staging-chip--diff.bounty-staging-chip--easy {
  color: #7dff7d;
  border-color: rgba(68, 204, 68, 0.35);
}

.bounty-staging-chip--diff.bounty-staging-chip--medium {
  color: var(--gh-gold, #ffd56a);
  border-color: rgba(227, 165, 32, 0.35);
}

.bounty-staging-chip--diff.bounty-staging-chip--hard {
  color: #ff9966;
  border-color: rgba(255, 120, 60, 0.35);
}

.bounty-staging-chip--diff.bounty-staging-chip--elite {
  color: #cc88ff;
  border-color: rgba(136, 85, 204, 0.4);
}

.bounty-staging-block {
  margin: 0;
  padding: clamp(0.65rem, 1.4dvh, 0.85rem) clamp(0.75rem, 1.5vw, 0.85rem);
  border-radius: 8px;
  background: rgba(6, 14, 10, 0.55);
  border: 1px solid rgba(85, 221, 119, 0.16);
}

.bounty-staging-block--warning {
  background: rgba(10, 14, 10, 0.5);
  border-color: rgba(255, 153, 102, 0.16);
}

.bounty-staging-section-label {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(170, 255, 190, 0.72);
  font-weight: 700;
}

.bounty-staging-block--warning .bounty-staging-section-label {
  color: rgba(255, 180, 140, 0.85);
}

.bounty-staging-objectives {
  margin: 0;
  padding-left: 1.1rem;
  color: rgba(232, 255, 232, 0.92);
  font-size: clamp(0.86rem, 1.6vw, 0.92rem);
  line-height: 1.4;
}

.bounty-staging-objectives li + li {
  margin-top: 0.25rem;
}

.bounty-staging-warning {
  margin: 0;
  color: rgba(232, 220, 210, 0.9);
  font-size: clamp(0.82rem, 1.55vw, 0.88rem);
  line-height: 1.45;
}

.bounty-staging-warning--mobile {
  display: none;
}

.bounty-staging-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: clamp(0.5rem, 1.2dvh, 0.65rem) clamp(0.65rem, 1.5vw, 0.75rem);
  min-height: clamp(40px, 5.5dvh, 44px);
  background: rgba(8, 18, 12, 0.72);
  border: 1px solid rgba(85, 221, 119, 0.24);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}

.bounty-staging-check:hover {
  border-color: rgba(85, 221, 119, 0.4);
  background: rgba(12, 28, 18, 0.78);
}

.bounty-staging-checkbox {
  flex-shrink: 0;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0.05rem 0 0;
  accent-color: var(--gh-green, #55dd77);
  cursor: pointer;
}

.bounty-staging-check-text {
  color: rgba(232, 255, 232, 0.92);
  font-size: clamp(0.86rem, 1.6vw, 0.92rem);
  line-height: 1.4;
}

.bounty-staging-footer {
  display: flex;
  flex-direction: column;
  gap: clamp(0.4rem, 1dvh, 0.55rem);
  width: 100%;
}

.bounty-staging-actions {
  display: flex;
  flex-direction: column;
  gap: clamp(0.4rem, 1dvh, 0.55rem);
  width: 100%;
}

.bounty-staging-actions .menu-btn {
  width: 100%;
}

.bounty-staging-actions .menu-btn--play {
  padding: clamp(0.55em, 1.2dvh, 0.7em) 1.15em;
  font-size: clamp(1rem, 2.4vw, 1.15rem);
}

.bounty-staging-actions--blocked .menu-btn--play#bounty-staging-start {
  display: none;
}

#bounty-staging-start:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.35);
  animation: none;
  box-shadow: none;
}

#bounty-staging-start:not(:disabled) {
  background: linear-gradient(180deg, #3a8a3a 0%, #2a6a2a 100%);
  color: #e8ffe8;
  border-color: var(--gh-accent);
  opacity: 1;
  filter: none;
  box-shadow: 0 0 16px var(--gh-accent-glow);
  animation: gh-pulse 2s ease-in-out infinite;
}

@media (max-height: 720px) {
  #screen-bounty-staging .bounty-staging-stack {
    padding-top: max(8px, var(--safe-top, 0px));
    padding-bottom: max(8px, var(--safe-bottom, 0px));
  }

  #screen-bounty-staging .bounty-staging-crosshair {
    width: clamp(460px, 68vw, 580px);
    height: clamp(460px, 68vw, 580px);
    opacity: 0.13;
  }

  .bounty-staging-glow {
    width: min(600px, 112%);
    height: min(480px, 98%);
  }

  .bounty-staging-frame {
    height: auto;
    min-height: 0;
    max-height: 100%;
    gap: clamp(0.35rem, 0.9dvh, 0.5rem);
    padding: clamp(0.6rem, 1.4dvh, 0.75rem) clamp(0.7rem, 1.8vw, 0.85rem);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .bounty-staging-main {
    flex: none;
    gap: clamp(0.5rem, 1dvh, 0.65rem);
    padding: 0;
  }

  .bounty-staging-block {
    padding: 0.55rem 0.65rem;
  }

  .bounty-staging-header {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
  }

  .bounty-staging-footer {
    padding-top: 0;
    margin-top: 0;
    border-top: none;
  }

  .bounty-staging-actions {
    margin-top: 0;
  }

  .bounty-staging-title {
    font-size: 1.15rem;
  }

  .bounty-staging-chips {
    margin-top: 0.3rem;
  }

  .bounty-staging-objectives,
  .bounty-staging-warning,
  .bounty-staging-check-text {
    font-size: 0.84rem;
  }

  .bounty-staging-check {
    padding: 0.45rem 0.6rem;
    min-height: 38px;
  }

  .bounty-staging-actions .menu-btn--play {
    padding: 0.5em 1em;
    font-size: 1rem;
  }

  .bounty-staging-actions .menu-btn--secondary {
    padding: 0.45em 1em;
    min-height: 40px;
  }
}

@media (max-width: 720px) {
  #screen-bounty-staging .bounty-staging-stack {
    --screen-pad-x: max(18px, var(--safe-left, 0px), var(--safe-right, 0px));
    --screen-pad-y: max(16px, var(--safe-top, 0px), var(--safe-bottom, 0px));
    max-width: 100%;
  }

  #screen-bounty-staging .bounty-staging-crosshair {
    width: min(92vw, 420px);
    height: min(92vw, 420px);
    opacity: 0.11;
  }

  .bounty-staging-glow {
    width: 108%;
    height: 102%;
    background: radial-gradient(
      ellipse at center,
      rgba(68, 204, 68, 0.1) 0%,
      rgba(34, 120, 68, 0.04) 40%,
      transparent 70%
    );
  }

  .bounty-staging-header {
    text-align: left;
  }

  .bounty-staging-chips {
    justify-content: flex-start;
  }

  .bounty-staging-warning--desktop {
    display: none;
  }

  .bounty-staging-warning--mobile {
    display: block;
  }

  .bounty-staging-checkbox {
    width: 1.35rem;
    height: 1.35rem;
  }

  .bounty-staging-objectives,
  .bounty-staging-warning,
  .bounty-staging-check-text {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .bounty-staging-frame {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
}

.menu-suspended-panel {
  width: 100%;
  max-width: min(440px, 100%);
  margin-inline: auto;
  align-self: center;
}

.menu-suspended-card {
  padding: clamp(1.25rem, 3vh, 1.75rem);
  background: rgba(8, 18, 12, 0.82);
  border: 1.5px solid rgba(85, 221, 119, 0.35);
  border-radius: 10px;
  box-shadow: 0 0 24px rgba(68, 204, 68, 0.08);
}

.menu-suspended-title {
  margin: 0 0 0.85rem;
  font-family: var(--gh-font-display, var(--gh-font));
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffb4b4;
  text-align: center;
}

.menu-suspended-body {
  margin: 0 0 0.65rem;
  font-size: clamp(0.82rem, 1.7vw, 0.98rem);
  line-height: 1.5;
  color: var(--gh-text-muted, #9cb8a8);
  text-align: center;
}

.menu-suspended-since {
  margin: 0.25rem 0 1rem;
  font-size: clamp(0.75rem, 1.5vw, 0.88rem);
  color: var(--gh-text-dim, #6a8578);
  text-align: center;
  letter-spacing: 0.04em;
}

.menu-suspended-actions {
  display: flex;
  flex-direction: column;
  gap: clamp(0.65rem, 1.5vh, 0.9rem);
  margin-top: 1rem;
}

.menu-normal-panel {
  width: 100%;
}

.menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: clamp(44px, 6vh, 56px);
  padding: clamp(0.6em, 1.2vh, 0.9em) 1.15em;
  font-family: var(--gh-font);
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 8px;
  border: 1.5px solid var(--gh-border);
  cursor: pointer;
  transition:
    box-shadow var(--gh-transition-fast),
    transform var(--gh-transition-press),
    background var(--gh-transition-fast),
    filter var(--gh-transition-fast);
  box-sizing: border-box;
}

.menu-btn:hover {
  filter: brightness(1.15);
}

.menu-btn:active {
  transform: scale(0.97);
}

.menu-btn:focus-visible {
  outline: 2px solid var(--gh-accent);
  outline-offset: 3px;
}

.menu-btn[hidden] {
  display: none !important;
}

.menu-btn--play {
  font-family: var(--gh-font-display);
  font-size: clamp(1.15rem, 3.2vw, 1.75rem);
  padding: clamp(0.7em, 1.5vh, 1em) 1.15em;
  background: linear-gradient(180deg, #3a8a3a 0%, #2a6a2a 100%);
  color: #e8ffe8;
  border-color: var(--gh-accent);
  box-shadow: 0 0 16px var(--gh-accent-glow);
  animation: gh-pulse 2s ease-in-out infinite;
}

.menu-btn--secondary {
  background: var(--gh-bg-panel);
  color: var(--gh-text);
}

.menu-btn--tertiary {
  background: rgba(8, 14, 10, 0.45);
  color: var(--gh-text-muted);
  border-color: rgba(68, 204, 68, 0.25);
}

.menu-btn--tertiary:hover {
  color: var(--gh-accent);
  border-color: var(--gh-border);
  background: rgba(20, 40, 28, 0.4);
}

.menu-account-link {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--gh-text-muted);
  text-decoration: none;
  text-align: center;
  opacity: 0.85;
}

.menu-account-link:hover {
  color: var(--gh-accent);
  opacity: 1;
}

/* Credits */
.credits-stack .screen-title {
  margin-bottom: var(--screen-section-gap);
}

.credits-content {
  width: 100%;
  max-width: var(--screen-content-max);
  text-align: center;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
}

.credits-section {
  margin-bottom: clamp(0.4rem, 1vh, 0.75rem);
}

.credits-section--hero {
  margin-bottom: clamp(0.5rem, 1.5vh, 1rem);
}

.credits-role {
  font-size: clamp(0.7rem, 1.6vw, 0.82rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gh-accent);
  margin: 0 0 0.3rem;
}

.credits-name {
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  color: var(--gh-text);
  margin: 0;
}

.credits-name--primary {
  font-family: var(--gh-font-display);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--gh-text);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.08);
}

.credits-detail {
  font-size: clamp(0.82rem, 2vw, 0.95rem);
  color: var(--gh-text-muted);
  margin: 0.35rem 0 0;
}

.credits-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: clamp(0.78rem, 1.8vw, 0.88rem);
  color: var(--gh-accent);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity var(--gh-transition-fast);
}

.credits-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.credits-divider {
  width: 60px;
  height: 1px;
  background: var(--gh-accent);
  opacity: 0.2;
  margin: 0 auto clamp(0.4rem, 1vh, 0.75rem);
}

.credits-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.4rem, 1vh, 0.75rem) clamp(6rem, 20vw, 16rem);
  margin-bottom: clamp(0.75rem, 2vh, 1.25rem);
  width: 100%;
}

@media (max-width: 600px) {
  .credits-columns {
    grid-template-columns: 1fr;
    gap: clamp(0.6rem, 1.5vh, 1rem);
  }
}

.credits-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.credits-tool {
  font-size: clamp(0.72rem, 1.6vw, 0.82rem);
  padding: 0.25rem 0.65rem;
  border: 1px solid rgba(68, 204, 68, 0.2);
  border-radius: 4px;
  color: var(--gh-text-muted);
  background: rgba(34, 170, 34, 0.05);
}

.credits-thanks {
  font-size: clamp(0.88rem, 2.2vw, 1.05rem);
  color: var(--gh-text-muted);
  font-style: italic;
  margin: 0.25rem 0 0;
}

.credits-footer {
  margin-top: var(--screen-section-gap);
}

.credits-version {
  font-size: clamp(0.68rem, 1.5vw, 0.75rem);
  color: var(--gh-accent);
  opacity: 0.5;
  margin: 0.5rem 0 0.4rem;
  font-family: var(--gh-font);
}

.credits-copyright {
  font-size: clamp(0.68rem, 1.5vw, 0.78rem);
  color: var(--gh-text-muted);
  opacity: 0.6;
  margin: 0;
}

/* How to Play overlay shell */
.guide-stack {
  -webkit-overflow-scrolling: touch;
}

.guide-title {
  flex-shrink: 0;
  margin: auto 0 0.25rem;
  font-size: var(--screen-title-size);
  letter-spacing: 0.15em;
  width: 100%;
  text-align: center;
}

.guide-panel {
  width: 100%;
  max-width: var(--screen-content-max);
  box-sizing: border-box;
}

/* Footer pins to the bottom of the (scrolling) guide stack. */
.guide-stack > .screen-footer {
  margin-bottom: auto;
  padding-bottom: 1rem;
}

/* Pause — mirrors the main-menu shell (stack + menu-actions + menu-btn) */
.pause-stack {
  justify-content: center;
}

.pause-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.pause-title {
  font-size: clamp(2rem, 7vw, 4.5rem);
  letter-spacing: 0.2em;
  text-align: center;
  margin: 0 0 clamp(0.75rem, 2vh, 1.5rem);
  text-shadow:
    0 0 20px var(--gh-accent-glow),
    0 0 40px rgba(68, 204, 68, 0.2);
}

/* Survival time — cinematic centerpiece */
.pause-time-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-bottom: clamp(1.5rem, 4vh, 2.5rem);
}

.pause-time-number {
  font-family: var(--gh-font-display);
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 900;
  color: var(--gh-accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  text-shadow:
    0 0 30px rgba(68, 204, 68, 0.35),
    0 0 60px rgba(68, 204, 68, 0.15);
}

.pause-time-label {
  font-family: var(--gh-font-display);
  font-size: clamp(0.85rem, 2vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(68, 204, 68, 0.55);
  margin-top: 0.4em;
}

/* Actions reuse .menu-actions / .menu-btn */
.pause-actions {
  flex: 0 0 auto;
}

.pause-resume-btn {
  animation: none !important;
  font-size: clamp(1rem, 2.5vw, 1.3rem) !important;
  padding: clamp(0.6em, 1.2vh, 0.8em) 1.1em !important;
}

.pause-danger-btn {
  min-height: 46px !important;
  font-size: clamp(0.78rem, 1.5vw, 0.92rem) !important;
  opacity: 0.85;
}

.pause-danger-btn:hover {
  color: #ff7676 !important;
  border-color: rgba(232, 85, 85, 0.45) !important;
  background: rgba(40, 12, 12, 0.45) !important;
  filter: none;
}

.menu-btn.pause-focused {
  outline: 2px solid var(--gh-accent);
  outline-offset: 3px;
}

/* Run Stats — standalone screen */
.runstats-stack .screen-title {
  margin-bottom: clamp(0.25rem, 0.75vh, 0.5rem);
}

.runstats-tagline {
  text-align: center;
  font-size: var(--screen-tagline-size);
  color: var(--gh-text-muted);
  letter-spacing: 0.04em;
  margin: 0 0 var(--screen-section-gap);
}

.runstats-content {
  width: 100%;
  max-width: var(--screen-content-max);
  margin: 0 auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.runstats-table-wrap {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border: 1px solid rgba(68, 204, 68, 0.12);
  border-radius: 10px;
  background: rgba(8, 16, 11, 0.45);
}

.runstats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(0.9rem, 1.9vw, 1.05rem);
}

.runstats-table tr {
  border-bottom: 1px solid rgba(68, 204, 68, 0.1);
}

.runstats-table tr:last-child {
  border-bottom: none;
}

.runstats-table tr.runstats-section {
  border-bottom: 1px solid rgba(68, 204, 68, 0.25);
  background: rgba(68, 204, 68, 0.06);
}

.runstats-table tr.runstats-section th {
  text-align: left;
  padding: clamp(0.45rem, 1vh, 0.65rem) clamp(1.25rem, 3vw, 2rem);
  font-family: var(--gh-font);
  font-size: clamp(0.7rem, 1.4vw, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gh-accent);
}

.runstats-table td {
  font-family: var(--gh-font);
  padding: clamp(0.55rem, 1.2vh, 0.8rem) clamp(1.25rem, 3vw, 2rem);
}

.runstats-table td:first-child {
  color: var(--gh-text-muted);
}

.runstats-table td:last-child {
  text-align: right;
  color: var(--gh-accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Quit confirmation dialog */
.pause-quit-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  border: 1px solid rgba(68, 204, 68, 0.2);
  border-radius: 12px;
  background: rgba(6, 12, 8, 0.97);
  padding: clamp(1.5rem, 4vh, 2.5rem) clamp(2rem, 5vw, 3rem);
  width: min(400px, 88vw);
  max-width: min(400px, 88vw);
  max-height: fit-content;
  color: var(--gh-text);
  text-align: center;
}

.pause-quit-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.pause-dialog-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin: 0 0 clamp(0.75rem, 2vh, 1.25rem);
}

.pause-dialog-warning {
  font-family: var(--gh-font);
  font-size: clamp(0.88rem, 1.8vw, 1.05rem);
  color: var(--gh-text-muted);
  margin: 0 0 clamp(1.5rem, 3.5vh, 2.25rem);
}

.pause-dialog-actions {
  display: flex;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  justify-content: center;
}

.pause-dialog-actions button {
  flex: 1;
  max-width: 160px;
  min-height: 48px;
}

/* Short viewports (landscape phones). Pause-specific tightening lives
   here so it cascades with the global short-height scale-down below
   (also at max-height: 560px) instead of needing its own breakpoint. */
@media (max-height: 560px) {
  .pause-stack {
    justify-content: flex-start;
  }

  .pause-title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 0.4rem;
  }

  .pause-time-number {
    font-size: clamp(2rem, 7vw, 4rem);
  }

  .pause-time-display {
    margin-bottom: clamp(0.75rem, 2vh, 1.25rem);
  }

  .menu-actions.pause-actions {
    gap: 0.45rem;
  }

  .pause-danger-btn {
    min-height: 38px !important;
  }

  .menu-btn {
    min-height: 38px;
  }
}

/* Settings */
#screen-settings {
  --settings-panel-max: min(720px, 92vw);
}

#screen-settings .settings-stack {
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#screen-settings .settings-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--settings-panel-max);
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}

#screen-settings .screen-title {
  margin-bottom: clamp(0.45rem, 1.2vh, 0.65rem);
}

#screen-settings .settings-tabs {
  margin-bottom: clamp(0.45rem, 1.2vh, 0.65rem);
}

#screen-settings .settings-panels {
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
}

#screen-settings .settings-tab-panel.active {
  display: block;
  flex: none;
  min-height: 0;
  overflow: visible;
  padding: 0.15rem 0 0.25rem;
}

#screen-settings .settings-section-label {
  margin-bottom: 0.4rem;
}

#screen-settings .settings-section-label--spaced {
  margin-top: 0.65rem;
}

#screen-settings .settings-audio-channel {
  padding: 0.35rem 0;
}

#screen-settings .settings-audio-channel-header {
  margin-bottom: 0.4rem;
}

#screen-settings .settings-control-row {
  padding: 0.4rem 0;
}

#screen-settings .settings-control-row label {
  margin-bottom: 0.32rem;
}

#screen-settings .settings-toggle-row {
  padding: 0.48rem 0.2rem;
  gap: 0.4rem 0.75rem;
}

#screen-settings .settings-slider-wrap {
  gap: 0.65rem;
  max-width: 100%;
}

#screen-settings .settings-slider-wrap input[type='range'] {
  flex: 1 1 auto;
  max-width: none;
}

#screen-settings .settings-slider-value {
  min-width: 2.85em;
  font-size: clamp(0.84rem, 1.9vw, 0.95rem);
}

#screen-settings .settings-segmented {
  width: 100%;
  max-width: none;
  gap: 0;
}

#screen-settings .settings-seg-btn {
  padding: 0.42rem 0.35rem;
  font-size: clamp(0.76rem, 1.7vw, 0.86rem);
}

#screen-settings .settings-control-row .settings-hint {
  margin-top: 0.35rem;
  margin-bottom: 0;
}

#screen-settings .settings-hint {
  margin-top: 0.25rem;
}

#screen-settings .settings-keybind-grid {
  gap: 0.28rem 0.65rem;
}

#screen-settings .keybind-row {
  padding: 0.28rem 0.5rem;
  gap: 0.45rem;
}

#screen-settings .keybind-label {
  font-size: clamp(0.76rem, 1.7vw, 0.88rem);
  flex: 1 1 auto;
  min-width: 0;
}

#screen-settings .keybind-chip {
  min-width: 2.85rem;
  padding: 0.26rem 0.55rem;
  font-size: clamp(0.74rem, 1.7vw, 0.86rem);
}

#screen-settings .settings-footer {
  flex: 0 0 auto;
  width: 100%;
  margin-top: 1.75rem;
  padding-top: 0;
  border-top: none;
}

#screen-settings .settings-footer-feedback {
  min-height: 1.05em;
  margin: 0 0 0.35rem;
  text-align: center;
  font-size: clamp(0.68rem, 1.5vw, 0.78rem);
  letter-spacing: 0.04em;
}

#screen-settings .settings-footer-feedback--saving {
  color: rgba(201, 255, 211, 0.72);
}

#screen-settings .settings-footer-feedback--saved {
  color: var(--gh-accent);
}

#screen-settings .settings-footer-feedback--error {
  color: #ff8888;
}

#screen-settings .settings-footer-actions {
  display: flex;
  gap: 0.55rem;
  width: 100%;
}

#screen-settings .settings-footer-actions .btn-secondary {
  flex: 1 1 0;
  min-height: 44px;
  margin: 0;
  max-width: none;
  width: auto;
  padding: 0.5rem 0.85rem;
  font-size: clamp(0.8rem, 1.75vw, 0.9rem);
}

#screen-settings .settings-footer-actions .screen-back-btn {
  margin-top: 0;
  margin-inline: 0;
  max-width: none;
}

#screen-settings .settings-footer-actions #settings-close {
  flex: 1.1 1 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#screen-settings .settings-footer-actions #settings-reset {
  flex: 1 1 0;
  text-transform: none;
  letter-spacing: 0.02em;
  opacity: 0.92;
}

@media (max-width: 380px) {
  #screen-settings .settings-footer-actions {
    flex-direction: column;
  }
}

@media (pointer: coarse) {
  #screen-settings {
    --settings-panel-max: min(100%, calc(100vw - 1.5rem));
  }

  #screen-settings .settings-seg-btn {
    min-height: 2.75rem;
    padding: 0.5rem 0.25rem;
    font-size: clamp(0.78rem, 3.4vw, 0.88rem);
  }
}

.settings-stack {
  justify-content: center;
}

.settings-stack .screen-title {
  margin-bottom: var(--screen-section-gap);
}

.settings-content {
  width: 100%;
  max-width: var(--screen-content-max);
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.settings-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: var(--screen-section-gap);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 4px;
  flex-shrink: 0;
}

.settings-tabs button {
  flex: 1;
  font-family: var(--gh-font);
  padding: 0.55rem 0.5rem;
  background: transparent;
  border: 1.5px solid transparent;
  color: var(--gh-text-muted);
  cursor: pointer;
  border-radius: 6px;
  font-size: clamp(0.82rem, 2.2vw, 0.95rem);
  transition:
    color var(--gh-transition-fast),
    border-color var(--gh-transition-fast),
    background var(--gh-transition-fast);
}

.settings-tabs button:hover {
  color: var(--gh-text);
}

.settings-tabs button.active {
  color: var(--gh-accent);
  border-color: var(--gh-accent);
  background: rgba(34, 170, 34, 0.08);
}

.settings-tab-panel {
  display: none;
}

.settings-tab-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: clamp(0.25rem, 0.75vh, 0.5rem) 0;
}

/* Audio channel rows — compact inline layout */
.settings-audio-channel {
  padding: clamp(0.4rem, 1vh, 0.7rem) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.settings-audio-channel:last-child {
  border-bottom: none;
}

.settings-audio-channel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.settings-audio-label {
  font-size: clamp(0.92rem, 2.2vw, 1.05rem);
  color: var(--gh-text);
  font-weight: 500;
}

.settings-mute-btn {
  width: 50px;
  height: 28px;
  border-radius: 14px;
  border: 1.5px solid var(--gh-border);
  background: #2a6a2a;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background var(--gh-transition-fast),
    border-color var(--gh-transition-fast);
}

.settings-mute-btn[aria-checked='true'] {
  background: #1a2a1a;
  border-color: var(--gh-border);
}

.settings-mute-btn::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e8ffe8;
  top: 2px;
  left: 24px;
  transition:
    transform var(--gh-transition-fast),
    background var(--gh-transition-fast),
    left var(--gh-transition-fast);
}

.settings-mute-btn[aria-checked='true']::after {
  left: 2px;
  background: #888;
}

/* Slider styling */
.settings-slider-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.settings-slider-wrap input[type='range'] {
  flex: 1;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  margin: 0;
}

.settings-slider-wrap input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gh-accent);
  border: 2px solid rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 6px rgba(34, 170, 34, 0.4);
  cursor: pointer;
  margin-top: -6px;
  transition: box-shadow var(--gh-transition-fast);
}

.settings-slider-wrap input[type='range']::-webkit-slider-thumb:hover {
  box-shadow: 0 0 12px rgba(34, 170, 34, 0.7);
}

.settings-slider-wrap input[type='range']::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gh-accent);
  border: 2px solid rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 6px rgba(34, 170, 34, 0.4);
  cursor: pointer;
}

.settings-slider-wrap input[type='range']::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    var(--gh-accent-dim) 0%,
    var(--gh-accent-dim) var(--slider-pct, 50%),
    rgba(255, 255, 255, 0.08) var(--slider-pct, 50%)
  );
}

.settings-slider-wrap input[type='range']::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.settings-slider-wrap input[type='range']::-moz-range-progress {
  height: 8px;
  border-radius: 4px;
  background: var(--gh-accent-dim);
}

.settings-slider-value {
  min-width: 3.5em;
  text-align: right;
  font-size: clamp(0.88rem, 2vw, 1rem);
  color: var(--gh-accent);
  font-family: var(--gh-font);
  font-variant-numeric: tabular-nums;
}

/* Toggle rows — used in Gameplay + Mobile controls */
.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  padding: clamp(0.65rem, 1.5vh, 1rem) clamp(0.5rem, 1.5vw, 0.75rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.settings-toggle-row:last-child {
  border-bottom: none;
}

.settings-toggle-row span {
  font-size: clamp(0.92rem, 2.2vw, 1.05rem);
  color: var(--gh-text);
}

.settings-toggle-row button[role='switch'] {
  width: 50px;
  height: 28px;
  border-radius: 14px;
  border: 1.5px solid var(--gh-border);
  background: #1a2a1a;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background var(--gh-transition-fast),
    border-color var(--gh-transition-fast);
}

.settings-toggle-row button[role='switch'][aria-checked='true'] {
  background: #2a6a2a;
  border-color: var(--gh-accent-dim);
}

.settings-toggle-row button[role='switch']::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #888;
  top: 2px;
  left: 2px;
  transition:
    transform var(--gh-transition-fast),
    background var(--gh-transition-fast);
}

.settings-toggle-row button[role='switch'][aria-checked='true']::after {
  transform: translateX(22px);
  background: #e8ffe8;
}

/* Control row (label + slider inline) for mobile */
.settings-control-row {
  padding: clamp(0.5rem, 1.2vh, 0.85rem) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.settings-control-row:last-child {
  border-bottom: none;
}

.settings-control-row label {
  display: block;
  font-size: clamp(0.88rem, 2.2vw, 1rem);
  color: var(--gh-text);
  margin-bottom: 0.4rem;
}

/* Segmented control (e.g. Graphics Quality) */
.settings-segmented {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  gap: 0;
  border: 1.5px solid var(--gh-border);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.22);
}

.settings-seg-btn {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: 0.45rem 0.35rem;
  font-family: var(--gh-font);
  font-size: clamp(0.78rem, 1.8vw, 0.9rem);
  background: transparent;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  color: rgba(168, 188, 168, 0.62);
  cursor: pointer;
  text-align: center;
  transition:
    background var(--gh-transition-fast),
    color var(--gh-transition-fast),
    box-shadow var(--gh-transition-fast);
}

.settings-seg-btn:last-child {
  border-right: none;
}

.settings-seg-btn:hover {
  color: var(--gh-text);
  background: rgba(255, 255, 255, 0.04);
}

.settings-seg-btn.active {
  background: rgba(34, 170, 34, 0.24);
  box-shadow: inset 0 0 0 1px rgba(68, 204, 68, 0.65);
  color: var(--gh-accent);
  font-weight: 600;
}

.settings-hint {
  margin: 0.3rem 0 0;
  font-size: clamp(0.72rem, 1.7vw, 0.82rem);
  color: var(--gh-text-muted);
}

.settings-hint--inline {
  margin-top: 0.25rem;
}

#screen-settings .menu-crosshair {
  opacity: 0.45;
}

/* Keybinding grid */
.settings-section-label {
  font-size: clamp(0.8rem, 2vw, 0.92rem);
  color: var(--gh-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 var(--screen-section-gap);
}

.settings-section-label--spaced {
  margin-top: clamp(0.75rem, 2vh, 1.25rem);
}

.settings-keybind-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.25rem, 0.8vh, 0.5rem) clamp(0.6rem, 2vw, 1.25rem);
}

@media (max-width: 600px) {
  .settings-keybind-grid {
    grid-template-columns: 1fr;
  }
}

.keybind-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: clamp(0.3rem, 0.75vh, 0.5rem) clamp(0.5rem, 1.5vw, 0.85rem);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.keybind-keycol {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-left: auto;
}

.keybind-cancel {
  padding: 0.3rem 0.65rem;
  min-height: 0;
  font-size: clamp(0.72rem, 1.6vw, 0.82rem);
  letter-spacing: 0.02em;
  text-transform: none;
  white-space: nowrap;
}

.keybind-chip--listening {
  min-width: 0;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
  font-size: clamp(0.72rem, 1.6vw, 0.82rem);
  animation: keybind-pulse 0.8s ease-in-out infinite;
  border-color: var(--gh-accent);
  background: rgba(34, 170, 34, 0.25);
  box-shadow: 0 0 10px rgba(34, 170, 34, 0.5);
  color: #fff;
}

.settings-row-feedback {
  flex: 0 0 100%;
  width: 100%;
  font-size: clamp(0.68rem, 1.5vw, 0.78rem);
  letter-spacing: 0.04em;
  text-align: right;
}

.settings-control-row .settings-row-feedback,
.settings-audio-channel .settings-row-feedback,
.settings-toggle-row .settings-row-feedback {
  flex: 0 0 100%;
  width: 100%;
  margin-top: 0.15rem;
  text-align: right;
}

.settings-keybind-actions .settings-row-feedback {
  flex: 1 1 100%;
  text-align: center;
  margin-top: 0.35rem;
}

.settings-row-feedback--saving {
  color: rgba(201, 255, 211, 0.72);
}

.settings-row-feedback--saved {
  color: var(--gh-accent);
}

.settings-row-feedback--error {
  color: #ff8888;
}

.settings-row-feedback--warn {
  color: #ffcc66;
}

.keybind-chip--saving {
  opacity: 0.75;
}

.keybind-label {
  font-size: clamp(0.78rem, 1.8vw, 0.9rem);
  color: var(--gh-text-muted);
}

.keybind-chip {
  min-width: clamp(3rem, 6vw, 4rem);
  padding: 0.3rem 0.65rem;
  font-family: var(--gh-font);
  font-size: clamp(0.78rem, 1.8vw, 0.88rem);
  background: rgba(34, 170, 34, 0.1);
  border: 1.5px solid var(--gh-accent-dim);
  color: var(--gh-accent);
  border-radius: 5px;
  cursor: pointer;
  text-align: center;
  transition:
    background var(--gh-transition-fast),
    border-color var(--gh-transition-fast),
    box-shadow var(--gh-transition-fast);
}

.keybind-chip:hover {
  background: rgba(34, 170, 34, 0.18);
  border-color: var(--gh-accent);
}

@keyframes keybind-pulse {
  0%,
  100% {
    box-shadow: 0 0 6px rgba(34, 170, 34, 0.4);
  }
  50% {
    box-shadow: 0 0 14px rgba(34, 170, 34, 0.8);
  }
}

.settings-keybind-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: var(--screen-section-gap);
  flex-shrink: 0;
}

.settings-keybind-actions button {
  flex: 1;
}

.btn-accent {
  font-family: var(--gh-font);
  background: rgba(34, 170, 34, 0.15);
  border: 1.5px solid var(--gh-accent);
  color: var(--gh-accent);
  border-radius: 6px;
  min-height: 44px;
  padding: 0.55rem 1.4em;
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  cursor: pointer;
  transition:
    background var(--gh-transition-fast),
    box-shadow var(--gh-transition-fast);
}

.btn-accent:hover:not(:disabled) {
  background: rgba(34, 170, 34, 0.28);
  box-shadow: 0 0 8px rgba(34, 170, 34, 0.4);
}

.btn-accent:disabled,
.btn-accent.btn-accent--disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
  background: rgba(34, 170, 34, 0.06);
  border-color: rgba(34, 170, 34, 0.28);
  color: rgba(34, 170, 34, 0.55);
}

.btn-accent--flash {
  background: rgba(34, 170, 34, 0.35) !important;
  box-shadow: 0 0 12px rgba(34, 170, 34, 0.6) !important;
}

.settings-keybinds-section {
  padding-bottom: 0;
}

/* ---------------------------------------------------------------------------
   Result screens — shared layout utilities
   --------------------------------------------------------------------------- */
.result-screen-stack {
  justify-content: safe center;
  gap: clamp(0.55rem, 1.6vh, 1rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.result-card {
  width: min(100%, 420px);
  padding: clamp(1rem, 2.5vh, 1.35rem) clamp(1rem, 3vw, 1.5rem);
  border: 1.5px solid rgba(85, 221, 119, 0.28);
  border-radius: 12px;
  background: rgba(8, 18, 12, 0.82);
  box-shadow:
    0 0 24px rgba(68, 204, 68, 0.08),
    inset 0 1px 0 rgba(120, 200, 140, 0.06);
  flex-shrink: 0;
}

.result-card--success {
  border-color: rgba(85, 221, 119, 0.38);
}

.result-card--fail,
.result-card--loss {
  border-color: rgba(204, 68, 68, 0.35);
  box-shadow:
    0 0 20px rgba(204, 68, 68, 0.08),
    inset 0 1px 0 rgba(200, 120, 120, 0.06);
}

.result-card--warn {
  border-color: rgba(255, 180, 80, 0.35);
  background: rgba(20, 18, 14, 0.92);
}

.result-card--blocked {
  text-align: center;
  border-color: rgba(204, 136, 68, 0.35);
}

.result-actions-stack {
  width: min(100%, 420px);
  flex-shrink: 0;
  margin-top: clamp(0.15rem, 0.6vh, 0.35rem);
}

.result-proof-list .pass {
  color: var(--gh-accent);
}

.result-proof-list .fail {
  color: var(--gh-danger);
}

@media (max-height: 720px) {
  .result-screen-stack {
    justify-content: flex-start;
    padding-top: max(0.65rem, var(--safe-top, 0px));
    padding-bottom: max(0.65rem, var(--safe-bottom, 0px));
  }

  .death-title,
  .bounty-recap-headline__text,
  .bounty-forfeit-headline {
    font-size: clamp(1.05rem, 4.5vw, 1.45rem);
    letter-spacing: 0.08em;
  }
}

/* ---------------------------------------------------------------------------
   Game Over screen
   --------------------------------------------------------------------------- */
.death-stack {
  justify-content: center;
  gap: clamp(0.75rem, 2vh, 1.25rem);
}

.death-title {
  animation: gh-shake-once 0.65s ease-in-out 1;
  color: var(--gh-danger);
  font-size: clamp(1.35rem, 4.8vw, 2.75rem);
  letter-spacing: clamp(0.08em, 1.2vw, 0.15em);
  text-shadow:
    0 0 20px rgba(248, 81, 73, 0.4),
    0 0 40px rgba(248, 81, 73, 0.15);
  margin: 0;
  flex-shrink: 0;
  max-width: 100%;
  text-align: center;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

@keyframes gh-shake-once {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-4px);
  }
  40% {
    transform: translateX(4px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

.death-score-card {
  width: min(100%, 420px);
  flex-shrink: 0;
}

.death-score-card.result-card {
  /* inherits .result-card base */
}

.death-score-card .death-xp-section {
  width: 100%;
  margin: clamp(0.75rem, 1.8vh, 1rem) 0 0;
  padding-top: clamp(0.65rem, 1.5vh, 0.85rem);
  border-top: 1px solid rgba(120, 160, 130, 0.14);
}

.death-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  margin-bottom: clamp(0.85rem, 2vh, 1.15rem);
  padding-bottom: clamp(0.75rem, 1.8vh, 1rem);
  border-bottom: 1px solid rgba(120, 160, 130, 0.14);
}

.death-hero__time {
  font-family: var(--gh-font-display);
  font-size: clamp(2.75rem, 9vw, 4.5rem);
  font-weight: 700;
  color: var(--gh-accent);
  letter-spacing: 0.05em;
  line-height: 1;
  text-shadow: 0 0 20px var(--gh-accent-glow);
  font-variant-numeric: tabular-nums;
}

.death-hero__label {
  font-size: clamp(0.7rem, 1.5vw, 0.85rem);
  color: var(--gh-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-top: clamp(0.25rem, 0.6vh, 0.45rem);
}

.death-hero.new-best .death-hero__time {
  color: var(--gh-gold);
  text-shadow: 0 0 16px rgba(255, 215, 0, 0.5);
}

.death-hero.new-best .death-hero__label::after {
  content: ' NEW BEST';
  color: var(--gh-gold);
  font-weight: 700;
}

.death-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.5rem, 1.2vh, 0.75rem);
}

.death-stat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: clamp(0.55rem, 1.2vh, 0.7rem) 0.4rem;
  border-radius: 8px;
  background: rgba(4, 10, 6, 0.55);
  border: 1px solid rgba(120, 160, 130, 0.1);
}

.death-stat-tile__label {
  font-size: clamp(0.62rem, 1.2vw, 0.72rem);
  color: var(--gh-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.death-stat-tile__value {
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 700;
  color: var(--gh-text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.death-stat-tile--best .death-stat-tile__value {
  color: var(--gh-gold);
}

.death-stat-extra {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: clamp(0.65rem, 1.5vh, 0.85rem);
}

.death-stat-chip {
  font-size: clamp(0.68rem, 1.3vw, 0.78rem);
  color: var(--gh-text-muted);
  letter-spacing: 0.06em;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(4, 10, 6, 0.45);
  border: 1px solid rgba(120, 160, 130, 0.12);
}

.death-stat-chip__val {
  color: var(--gh-text);
  font-weight: 700;
  margin-right: 0.25em;
}

/* Death recap — XP progression + share */
.death-xp-section {
  width: min(100%, 420px);
  text-align: center;
  flex-shrink: 0;
}

.death-xp-numbers {
  margin-top: 0.35rem;
  font-size: clamp(0.68rem, 1.4vw, 0.78rem);
  color: var(--gh-text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.death-xp-earned {
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 800;
  color: #e3a520;
  letter-spacing: 0.04em;
  animation: death-xp-fade-in 0.6s ease both;
}

.death-xp-breakdown {
  margin: 0.2rem 0 0;
  font-size: clamp(0.68rem, 1.4vw, 0.78rem);
  color: var(--gh-text-muted);
  letter-spacing: 0.03em;
}

.death-xp-rankup-name {
  margin: 0.15rem 0 0.35rem;
  font-size: clamp(0.78rem, 1.6vw, 0.92rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rank-color, #44cc44);
}

.death-xp-rank-sublabel {
  margin: 0.15rem 0 0;
  font-size: clamp(0.65rem, 1.3vw, 0.75rem);
  color: var(--gh-text-muted);
  letter-spacing: 0.06em;
}

.death-xp-hint {
  margin: 0.55rem 0 0;
  font-size: clamp(0.62rem, 1.25vw, 0.72rem);
  line-height: 1.45;
  color: var(--gh-text-muted);
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}

.death-xp-section--pending .death-xp-earned {
  font-size: clamp(1rem, 3vw, 1.35rem);
  color: var(--gh-text-muted);
  animation: none;
}

.death-xp-section--pending .death-xp-hint {
  display: block;
}

@keyframes death-xp-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.death-xp-rankup {
  display: inline-block;
  margin: 0.35rem 0;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fff;
  background: var(--rank-color, #44cc44);
  animation: death-xp-rankup-pulse 1.2s ease-in-out infinite;
}

@keyframes death-xp-rankup-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.04);
    opacity: 0.92;
  }
}

.death-xp-bar {
  width: 100%;
  height: 12px;
  margin: 0.55rem 0 0.4rem;
  border-radius: 999px;
  background: #1a1a1a;
  overflow: hidden;
}

.death-xp-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--rank-color, #44cc44);
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.death-xp-section--pending .death-xp-bar {
  background: rgba(26, 26, 26, 0.95);
}

.death-xp-bar-fill--pending {
  width: 38% !important;
  background: linear-gradient(
    90deg,
    rgba(68, 204, 68, 0.15) 0%,
    rgba(68, 204, 68, 0.55) 50%,
    rgba(68, 204, 68, 0.15) 100%
  ) !important;
  background-size: 220% 100% !important;
  animation: death-xp-bar-scan 1.1s ease-in-out infinite;
}

@keyframes death-xp-bar-scan {
  0% {
    background-position: 120% 0;
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
  100% {
    background-position: -120% 0;
    opacity: 0.55;
  }
}

.death-xp-earned--counting {
  font-variant-numeric: tabular-nums;
}

.death-xp-section--revealed .death-xp-rankup {
  animation: death-xp-rankup-pop 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes death-xp-rankup-pop {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.death-xp-rank {
  font-size: clamp(0.72rem, 1.5vw, 0.85rem);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.death-xp-achievements {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.death-achievement {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.45rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(68, 204, 68, 0.35);
  border-radius: 8px;
  background: rgba(8, 18, 12, 0.82);
  font-size: 0.72rem;
  text-align: left;
  animation: death-achievement-slide 0.45s ease both;
}

.death-achievement__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.death-achievement__name {
  font-weight: 700;
  color: var(--gh-gold);
  line-height: 1.25;
}

.death-achievement__desc {
  color: var(--gh-text-muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

@keyframes death-achievement-slide {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.death-achievement-more {
  margin: 0;
  font-size: 0.72rem;
  color: var(--gh-text-muted);
}

/* Run reward alerts — fixed top-right of viewport (not inside score card) */
.run-reward-toasts {
  position: fixed;
  top: max(0.85rem, env(safe-area-inset-top, 0px));
  right: max(0.85rem, env(safe-area-inset-right, 0px));
  left: auto;
  z-index: 1400;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
  width: min(22rem, calc(100vw - 1.75rem));
  pointer-events: none;
}

.run-reward-toast {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 0.85rem 0.95rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(120, 160, 130, 0.28);
  background:
    linear-gradient(145deg, rgba(14, 22, 16, 0.97) 0%, rgba(8, 12, 10, 0.94) 100%);
  backdrop-filter: blur(10px);
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  opacity: 0;
  transform: translateX(18px) scale(0.97);
  transition:
    opacity 0.32s ease,
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.run-reward-toast__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.07) 0%,
    transparent 42%,
    transparent 100%
  );
  pointer-events: none;
}

.run-reward-toast--in {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.run-reward-toast--out {
  opacity: 0;
  transform: translateX(14px) scale(0.98);
}

.run-reward-toast--level {
  border-color: rgba(227, 165, 32, 0.42);
  box-shadow:
    0 10px 34px rgba(0, 0, 0, 0.48),
    0 0 24px rgba(227, 165, 32, 0.12),
    0 0 0 1px rgba(227, 165, 32, 0.08) inset;
}

.run-reward-toast--achievement {
  border-color: rgba(68, 204, 68, 0.38);
  box-shadow:
    0 10px 34px rgba(0, 0, 0, 0.48),
    0 0 22px rgba(68, 204, 68, 0.1),
    0 0 0 1px rgba(68, 204, 68, 0.07) inset;
}

.run-reward-toast__icon-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.run-reward-toast--level .run-reward-toast__icon-wrap {
  color: #f0c050;
  background: radial-gradient(circle at 30% 25%, rgba(240, 192, 80, 0.35), rgba(227, 165, 32, 0.12) 55%, rgba(0, 0, 0, 0.15) 100%);
  box-shadow: 0 0 16px rgba(227, 165, 32, 0.25);
}

.run-reward-toast--achievement .run-reward-toast__icon-wrap {
  color: #6fdf88;
  background: radial-gradient(circle at 30% 25%, rgba(111, 223, 136, 0.32), rgba(68, 204, 68, 0.1) 55%, rgba(0, 0, 0, 0.15) 100%);
  box-shadow: 0 0 16px rgba(68, 204, 68, 0.22);
}

.run-reward-toast__svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.run-reward-toast__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.run-reward-toast__kicker {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(170, 190, 175, 0.92);
}

.run-reward-toast--level .run-reward-toast__kicker {
  color: rgba(227, 165, 32, 0.88);
}

.run-reward-toast--achievement .run-reward-toast__kicker {
  color: rgba(111, 223, 136, 0.88);
}

.run-reward-toast__title {
  font-family: var(--gh-font-display);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.25;
  color: var(--gh-text);
}

.run-reward-toast__meta {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #e3a520;
  font-variant-numeric: tabular-nums;
}

.run-reward-toast__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.run-reward-toast__progress::after {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(68, 204, 68, 0.85), rgba(68, 204, 68, 0.35));
  animation: run-reward-toast-progress var(--toast-duration, 4s) linear forwards;
}

.run-reward-toast--level .run-reward-toast__progress::after {
  background: linear-gradient(90deg, rgba(227, 165, 32, 0.9), rgba(227, 165, 32, 0.35));
}

@keyframes run-reward-toast-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

@media (max-width: 480px) {
  .run-reward-toasts {
    top: max(0.65rem, env(safe-area-inset-top, 0px));
    right: max(0.65rem, env(safe-area-inset-right, 0px));
    width: min(19rem, calc(100vw - 1.25rem));
  }

  .run-reward-toast__title {
    font-size: 0.96rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .run-reward-toast__progress::after {
    animation: none;
    transform: scaleX(0);
  }
}

.bounty-recap-near-miss {
  margin: 0.35rem 0 0;
  font-size: clamp(0.85rem, 1.8vw, 1rem);
  font-weight: 700;
  color: #e3a520;
  text-align: center;
}

.bounty-recap-so-close {
  color: #e3a520;
  font-weight: 700;
  font-size: 0.85em;
}

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.share-modal[hidden] {
  display: none !important;
}

.share-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.share-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  max-height: 90vh;
  overflow: auto;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(120, 160, 130, 0.25);
  background: #0a100c;
}

.share-modal__title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.share-modal__status {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--gh-text-muted);
}

.share-modal__preview {
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.share-modal__img {
  width: 100%;
  max-width: 360px;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(120, 160, 130, 0.2);
}

.share-modal__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.death-actions {
  flex: 0 0 auto;
  margin-top: clamp(0.25rem, 0.8vh, 0.5rem);
}

.death-actions .menu-btn--play {
  animation: none;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  padding: clamp(0.65em, 1.3vh, 0.85em) 1.1em;
}

.death-signin-btn {
  flex-direction: column;
  gap: 0.2rem;
  min-height: clamp(48px, 6.5vh, 58px);
  padding: clamp(0.55em, 1.1vh, 0.75em) 1em;
  background: linear-gradient(180deg, rgba(18, 32, 22, 0.92) 0%, rgba(10, 18, 12, 0.88) 100%);
  color: var(--gh-text);
  border-color: rgba(68, 204, 68, 0.45);
  box-shadow: 0 0 12px rgba(68, 204, 68, 0.12);
  letter-spacing: 0.08em;
  text-transform: none;
}

.death-signin-btn:hover,
.death-signin-btn:focus-visible {
  border-color: var(--gh-accent);
  box-shadow: 0 0 16px var(--gh-accent-glow);
  color: #e8ffe8;
}

.death-signin-btn__title {
  font-size: clamp(0.82rem, 1.7vw, 0.98rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.death-signin-btn__sub {
  font-size: clamp(0.68rem, 1.35vw, 0.78rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--gh-text-muted);
  opacity: 0.9;
}

.death-signin-btn:hover .death-signin-btn__sub,
.death-signin-btn:focus-visible .death-signin-btn__sub {
  color: rgba(232, 255, 232, 0.82);
}

.death-signin-btn[hidden] {
  display: none !important;
}

/* Tutorial arena overlay */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  pointer-events: none;
}

.tutorial-overlay[hidden] {
  display: none !important;
}

.tutorial-exit {
  position: absolute;
  top: max(0.65rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  pointer-events: auto;
  z-index: 3;
}

.tutorial-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(4, 8, 6, 0.62);
  pointer-events: auto;
  backdrop-filter: blur(2px);
}

.tutorial-modal-backdrop[hidden] {
  display: none !important;
}

.tutorial-exit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.4rem 0.9rem;
  font-family: Rajdhani, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(232, 255, 232, 0.9);
  background: linear-gradient(180deg, rgba(24, 42, 28, 0.95) 0%, rgba(8, 14, 10, 0.92) 100%);
  border: 1px solid rgba(68, 204, 68, 0.38);
  border-radius: 8px;
  cursor: pointer;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.tutorial-exit-btn__label {
  line-height: 1;
}

.tutorial-exit-btn:hover {
  color: #fff;
  border-color: rgba(104, 228, 104, 0.65);
  box-shadow:
    0 2px 14px rgba(68, 204, 68, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.tutorial-exit-btn:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 6px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tutorial-exit-btn:focus-visible {
  outline: 2px solid rgba(68, 204, 68, 0.75);
  outline-offset: 2px;
}

.tutorial-instruction {
  position: fixed;
  left: 50%;
  bottom: max(28%, calc(env(safe-area-inset-bottom) + 7rem));
  transform: translateX(-50%);
  max-width: min(420px, 92vw);
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #f8fff8;
  font-family: Rajdhani, sans-serif;
  font-size: clamp(1.05rem, 2.8vw, 1.28rem);
  font-weight: 700;
  text-align: center;
  line-height: 1.35;
  letter-spacing: 0.03em;
  pointer-events: none;
  text-shadow:
    0 0 14px rgba(130, 255, 130, 0.65),
    0 0 28px rgba(68, 204, 68, 0.35),
    0 1px 4px rgba(0, 0, 0, 0.95);
  animation: tutorial-instruction-heartbeat 0.95s ease-in-out infinite;
}

.tutorial-pickup-glossary {
  position: fixed;
  left: 50%;
  bottom: max(12%, calc(env(safe-area-inset-bottom) + 4.5rem));
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem 0.65rem;
  max-width: min(520px, 94vw);
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(68, 204, 68, 0.35);
  background: rgba(4, 8, 6, 0.82);
  pointer-events: none;
}

.tutorial-pickup-glossary__item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: Rajdhani, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(232, 240, 234, 0.92);
}

.tutorial-pickup-glossary__icon {
  width: 18px;
  height: 18px;
}

#hud-layer.touch-layout.tutorial-active #hud-btn-pause {
  display: none !important;
}

#hud-layer.touch-layout ~ .tutorial-overlay .tutorial-instruction,
.touch-layout .tutorial-overlay .tutorial-instruction {
  top: max(9%, calc(env(safe-area-inset-top) + 2.85rem));
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  width: fit-content;
  max-width: min(220px, 68vw);
  font-size: clamp(0.68rem, 2.2vw, 0.82rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.03em;
  z-index: 4;
}

.hud-top-center .tutorial-instruction--hud-slot {
  position: static;
  top: auto;
  bottom: auto;
  left: auto;
  transform: none;
  width: auto;
  max-width: min(260px, 78vw);
  margin-top: 0.08rem;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-family: Rajdhani, sans-serif;
  font-size: calc(var(--hud-font-sm) * 1.02);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.03em;
  text-align: center;
  color: #f8fff8;
  text-shadow:
    0 0 14px rgba(130, 255, 130, 0.65),
    0 0 28px rgba(68, 204, 68, 0.35),
    0 1px 4px rgba(0, 0, 0, 0.95);
  animation: tutorial-instruction-heartbeat-hud 0.95s ease-in-out infinite;
}

.tutorial-instruction--hud-slot::before {
  display: none !important;
}

@keyframes tutorial-instruction-heartbeat {
  0%,
  100% {
    opacity: 0.96;
    color: #f4fff4;
    transform: translateX(-50%) scale(1);
    text-shadow:
      0 0 14px rgba(120, 255, 120, 0.75),
      0 0 28px rgba(68, 204, 68, 0.4),
      0 1px 4px rgba(0, 0, 0, 0.95);
  }
  50% {
    opacity: 1;
    color: #ffffff;
    transform: translateX(-50%) scale(1.06);
    text-shadow:
      0 0 24px rgba(160, 255, 160, 1),
      0 0 42px rgba(68, 204, 68, 0.65),
      0 0 60px rgba(68, 204, 68, 0.28),
      0 1px 4px rgba(0, 0, 0, 0.95);
  }
}

@keyframes tutorial-instruction-heartbeat-hud {
  0%,
  100% {
    opacity: 0.96;
    color: #f4fff4;
    transform: scale(1);
    text-shadow:
      0 0 14px rgba(120, 255, 120, 0.75),
      0 0 28px rgba(68, 204, 68, 0.4),
      0 1px 4px rgba(0, 0, 0, 0.95);
  }
  50% {
    opacity: 1;
    color: #ffffff;
    transform: scale(1.06);
    text-shadow:
      0 0 24px rgba(160, 255, 160, 1),
      0 0 42px rgba(68, 204, 68, 0.65),
      0 0 60px rgba(68, 204, 68, 0.28),
      0 1px 4px rgba(0, 0, 0, 0.95);
  }
}

#hud-layer.touch-layout ~ .tutorial-overlay .tutorial-instruction::before,
.touch-layout .tutorial-overlay .tutorial-instruction::before {
  display: none;
}

@keyframes tutorial-instruction-callout {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) scale(1);
    border-color: rgba(68, 204, 68, 0.7);
    box-shadow:
      0 0 6px rgba(68, 204, 68, 0.12),
      0 2px 10px rgba(0, 0, 0, 0.38);
    opacity: 0.94;
  }
  15% {
    transform: translateX(-50%) translateY(-3px) scale(1.03);
    border-color: #8dff8d;
    box-shadow:
      0 0 18px 4px rgba(68, 204, 68, 0.42),
      0 4px 14px rgba(0, 0, 0, 0.42);
    opacity: 1;
  }
  30%,
  70% {
    transform: translateX(-50%) translateY(0) scale(1);
    border-color: rgba(104, 228, 104, 0.9);
    box-shadow:
      0 0 10px 2px rgba(68, 204, 68, 0.28),
      0 3px 12px rgba(0, 0, 0, 0.4);
    opacity: 1;
  }
  85% {
    transform: translateX(-50%) translateY(-2px) scale(1.02);
    border-color: #7dff7d;
    box-shadow:
      0 0 14px 3px rgba(68, 204, 68, 0.36),
      0 3px 12px rgba(0, 0, 0, 0.4);
    opacity: 1;
  }
}

@keyframes tutorial-instruction-attention {
  0%,
  100% {
    border-color: rgba(68, 204, 68, 0.85);
    box-shadow:
      0 0 0 0 rgba(68, 204, 68, 0.2),
      0 4px 16px rgba(0, 0, 0, 0.35);
  }
  50% {
    border-color: #7dff7d;
    box-shadow:
      0 0 12px 2px rgba(68, 204, 68, 0.35),
      0 4px 18px rgba(0, 0, 0, 0.4);
  }
}

#hud-layer.touch-layout ~ .tutorial-overlay .tutorial-pickup-glossary,
.touch-layout .tutorial-overlay .tutorial-pickup-glossary {
  bottom: max(0.25rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  max-width: min(460px, 97vw);
  padding: 0.42rem 0.55rem;
  gap: 0.28rem 0.45rem;
  border-radius: 9px;
  border-color: rgba(68, 204, 68, 0.42);
  background: rgba(4, 8, 6, 0.84);
}

#hud-layer.touch-layout ~ .tutorial-overlay .tutorial-pickup-glossary__item,
.touch-layout .tutorial-overlay .tutorial-pickup-glossary__item {
  font-size: 0.64rem;
  gap: 0.24rem;
  letter-spacing: 0.045em;
}

#hud-layer.touch-layout ~ .tutorial-overlay .tutorial-pickup-glossary__icon,
.touch-layout .tutorial-overlay .tutorial-pickup-glossary__icon {
  width: 15px;
  height: 15px;
}

#hud-layer.touch-layout ~ .tutorial-overlay .tutorial-instruction .tutorial-key,
.touch-layout .tutorial-overlay .tutorial-instruction .tutorial-key {
  font-size: 0.92em;
}

#hud-layer.touch-layout ~ .tutorial-overlay .tutorial-hint-visual,
.touch-layout .tutorial-overlay .tutorial-hint-visual {
  width: 64px;
  height: 64px;
  bottom: max(34%, calc(env(safe-area-inset-bottom) + 8rem));
}

#hud-layer.touch-layout ~ .tutorial-overlay .tutorial-hint-visual--move,
.touch-layout .tutorial-overlay .tutorial-hint-visual--move {
  left: 11%;
  right: auto;
}

#hud-layer.touch-layout ~ .tutorial-overlay .tutorial-hint-visual--aim,
.touch-layout .tutorial-overlay .tutorial-hint-visual--aim {
  right: 11%;
  left: auto;
}

#hud-layer.touch-layout.left-hand ~ .tutorial-overlay .tutorial-hint-visual--move,
.touch-layout.left-hand .tutorial-overlay .tutorial-hint-visual--move {
  left: auto;
  right: 11%;
}

#hud-layer.touch-layout.left-hand ~ .tutorial-overlay .tutorial-hint-visual--aim,
.touch-layout.left-hand .tutorial-overlay .tutorial-hint-visual--aim {
  right: auto;
  left: 11%;
}

#hud-layer.touch-layout ~ .tutorial-overlay .tutorial-hint-visual::after,
.touch-layout .tutorial-overlay .tutorial-hint-visual::after {
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
}

#hud-layer.touch-layout ~ .tutorial-overlay .tutorial-confirmation,
.touch-layout .tutorial-overlay .tutorial-confirmation {
  top: max(20%, calc(env(safe-area-inset-top) + 5rem));
  transform: translateX(-50%);
}

#hud-layer.touch-layout ~ .tutorial-overlay .tutorial-confirm-text,
.touch-layout .tutorial-overlay .tutorial-confirm-text {
  font-size: clamp(1rem, 3.2vw, 1.2rem);
}

#hud-layer.touch-layout ~ .tutorial-overlay .tutorial-complete,
.touch-layout .tutorial-overlay .tutorial-complete {
  width: min(92vw, 340px);
  padding: 1rem 1.1rem;
}

#hud-layer.touch-layout ~ .tutorial-overlay .tutorial-complete-title,
.touch-layout .tutorial-overlay .tutorial-complete-title {
  font-size: clamp(1.05rem, 3.4vw, 1.3rem);
}

#hud-layer.touch-layout ~ .tutorial-overlay .tutorial-complete-actions .menu-btn,
.touch-layout .tutorial-overlay .tutorial-complete-actions .menu-btn {
  font-size: 0.88rem;
  padding: 0.55em 0.85em;
}

#hud-layer.touch-layout .hud-mobile-btn.hud-tutorial-highlight[data-tutorial-tap]::after {
  font-size: 0.56rem;
  padding: 3px 7px;
  bottom: calc(100% + 6px);
  letter-spacing: 0.08em;
}

.tutorial-instruction .tutorial-key {
  display: inline-block;
  color: #44cc44;
  font-weight: 800;
  animation: tutorial-key-pulse 1.4s ease-in-out infinite;
}

@keyframes tutorial-key-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.04);
  }
}

.tutorial-hint-visual {
  position: fixed;
  bottom: max(22%, calc(env(safe-area-inset-bottom) + 5rem));
  width: 88px;
  height: 88px;
  pointer-events: none;
  z-index: 2;
}

.tutorial-hint-visual[hidden] {
  display: none !important;
}

.tutorial-hint-visual--move {
  left: 18%;
  right: auto;
}

.tutorial-hint-visual--aim {
  right: 18%;
  left: auto;
}

#hud-layer.left-hand ~ .tutorial-overlay .tutorial-hint-visual--move {
  left: auto;
  right: 18%;
}

#hud-layer.left-hand ~ .tutorial-overlay .tutorial-hint-visual--aim {
  right: auto;
  left: 18%;
}

.tutorial-hint-visual::before,
.tutorial-hint-visual::after {
  content: '';
  position: absolute;
  border-radius: 50%;
}

.tutorial-hint-visual::before {
  inset: 0;
  border: 2px solid rgba(68, 204, 68, 0.35);
}

.tutorial-hint-visual::after {
  width: 28px;
  height: 28px;
  left: 50%;
  top: 50%;
  margin: -14px 0 0 -14px;
  background: rgba(68, 204, 68, 0.55);
  will-change: transform;
}

.tutorial-hint-visual--move::after {
  animation: tutorial-joystick-move 2.2s ease-in-out infinite;
}

.tutorial-hint-visual--aim::after {
  animation: tutorial-joystick-aim 2.4s ease-in-out infinite;
}

@keyframes tutorial-joystick-move {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(14px, -8px);
  }
  50% {
    transform: translate(-10px, 12px);
  }
  75% {
    transform: translate(8px, 10px);
  }
}

@keyframes tutorial-joystick-aim {
  0%,
  12% {
    transform: translate(0, 0);
  }
  38%,
  62% {
    transform: translate(18px, -14px);
  }
  88%,
  100% {
    transform: translate(0, 0);
  }
}

.tutorial-confirmation {
  display: none !important;
}

.tutorial-complete {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(100%, 420px);
  padding: 1.25rem 1.5rem;
  border-radius: 14px;
  border: 1px solid rgba(68, 204, 68, 0.35);
  background: rgba(6, 12, 8, 0.94);
  text-align: center;
  pointer-events: auto;
  z-index: 2;
}

.tutorial-complete[hidden] {
  display: none !important;
}

.tutorial-complete-title {
  margin: 0 0 0.5rem;
  font-family: Rajdhani, sans-serif;
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  color: #fff;
}

.tutorial-complete-sub {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.45;
}

.tutorial-complete-sub[hidden] {
  display: none !important;
}

.tutorial-complete-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tutorial-complete-actions .tutorial-btn-retry {
  font-size: 0.88rem;
  opacity: 0.85;
}

.tutorial-complete-actions .tutorial-btn-quit {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.72);
  border-color: rgba(120, 160, 130, 0.22);
}

.tutorial-complete-actions .tutorial-btn-quit:hover {
  color: #fff;
  border-color: rgba(120, 160, 130, 0.4);
}

.tutorial-complete-roam-hint {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

.hud-tutorial-highlight {
  outline: 2px solid #44cc44 !important;
  outline-offset: 3px;
  box-shadow: 0 0 14px rgba(68, 204, 68, 0.55);
  animation: hud-tutorial-highlight-pulse 1.2s ease-in-out infinite;
}

@keyframes hud-tutorial-highlight-pulse {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(68, 204, 68, 0.45);
  }
  50% {
    box-shadow: 0 0 18px rgba(68, 204, 68, 0.75);
  }
}

#hud-layer.touch-layout .hud-tutorial-highlight {
  outline-width: 3px;
  outline-offset: 4px;
}

/* Mobile action buttons — tutorial callout (pulse + TAP label) */
.hud-mobile-btn.hud-tutorial-highlight {
  outline: none !important;
  z-index: 6;
  animation: hud-mobile-tutorial-callout 2s ease-in-out infinite;
}

.hud-mobile-btn.hud-tutorial-highlight[data-tutorial-tap]::after {
  content: attr(data-tutorial-tap);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #f0fff0;
  background: rgba(20, 80, 30, 0.96);
  border: 2px solid rgba(120, 255, 120, 0.85);
  box-shadow:
    0 0 16px rgba(68, 204, 68, 0.65),
    0 4px 12px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  white-space: nowrap;
  animation: hud-mobile-tutorial-tap-label 2s ease-in-out infinite;
}

@keyframes hud-mobile-tutorial-callout {
  0%,
  100% {
    transform: scale(1);
    border-color: rgba(100, 220, 100, 0.75);
    background: var(--gh-bg-panel);
    box-shadow:
      0 0 10px rgba(68, 204, 68, 0.45),
      0 0 0 2px rgba(68, 204, 68, 0.5);
  }
  50% {
    transform: scale(1.2);
    border-color: rgba(160, 255, 160, 1);
    background: rgba(35, 95, 45, 0.98);
    box-shadow:
      0 0 28px rgba(68, 204, 68, 0.9),
      0 0 52px rgba(68, 204, 68, 0.45),
      0 0 0 4px rgba(140, 255, 140, 0.95);
  }
}

@keyframes hud-mobile-tutorial-tap-label {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
  }
  50% {
    transform: translateX(-50%) translateY(-8px) scale(1.08);
    opacity: 1;
  }
}

.hud-mobile-btn.hud-tutorial-highlight.hud-mobile-btn--held {
  animation: none;
}

.hud-mobile-btn--held {
  transform: scale(0.92);
  background: rgba(50, 110, 70, 0.58) !important;
  border-color: rgba(120, 230, 120, 0.85) !important;
  box-shadow:
    0 0 18px rgba(68, 204, 68, 0.5),
    inset 0 0 12px rgba(68, 204, 68, 0.2) !important;
}

.hud-mobile-btn--held .hud-mobile-btn-icon {
  transform: scale(0.94);
}

/* Legacy selectors kept for tests / older references */
.death-content {
  display: none;
}

.death-primary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(0.35rem, 1.2vh, 0.7rem) clamp(2rem, 8vw, 5rem);
  width: min(480px, 78vw);
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  margin: 0;
}

.death-primary--2x2 {
  grid-template-columns: 1fr auto 1fr auto;
  width: min(520px, 88vw);
  gap: clamp(0.5rem, 1.4vh, 0.85rem) clamp(1.25rem, 5vw, 2.5rem);
}

.death-secondary--compact {
  gap: clamp(1rem, 4vw, 2.5rem);
}

.death-primary dt {
  color: var(--gh-text-muted);
}

.death-primary dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
  color: var(--gh-text);
  font-variant-numeric: tabular-nums;
}

.death-primary dd.new-best {
  color: var(--gh-gold);
  font-weight: bold;
}

.death-secondary {
  display: flex;
  gap: clamp(0.75rem, 3vw, 2rem);
  justify-content: center;
  flex-wrap: wrap;
}

.death-sec-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.death-sec-item.new-best .death-sec-val {
  color: var(--gh-gold);
}

.death-sec-val {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  font-weight: 700;
  color: var(--gh-text);
}

.death-sec-label {
  font-size: clamp(0.6rem, 1.2vw, 0.75rem);
  color: var(--gh-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Highlight — top weapon (1 line) / top killer + top damage (2 lines stacked) */
.death-highlight {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.2rem, 0.6vh, 0.4rem);
  font-size: clamp(0.75rem, 1.5vw, 0.9rem);
  color: var(--gh-text-muted);
  margin: 0;
  text-align: center;
}

.death-highlight__line {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.death-highlight__label {
  opacity: 0.7;
}

.death-highlight__value {
  color: var(--gh-accent);
  font-weight: 600;
}

.death-highlight__detail {
  opacity: 0.65;
  font-size: 0.85em;
}

/* Error status */
.death-status {
  margin: 0;
  font-size: clamp(0.75rem, 1.4vw, 0.85rem);
  color: var(--gh-danger);
  min-height: 1em;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
}

.death-status__text {
  line-height: 1.3;
}

.death-status__text--muted {
  color: var(--gh-text-muted);
}

.death-status__text--fail {
  color: var(--gh-danger);
}

/* Bounty game over */
.bounty-recap-stack {
  justify-content: center;
  gap: clamp(0.75rem, 2vh, 1.25rem);
  text-align: center;
}

.bounty-recap-outcome {
  margin: 0 0 0.65rem;
  font-size: clamp(0.82rem, 1.7vw, 0.95rem);
  color: var(--gh-text-muted);
  line-height: 1.45;
}

.bounty-recap-card.result-card {
  width: min(100%, 480px);
  text-align: left;
}

.bounty-recap-card--loss.result-card--fail {
  border-color: rgba(204, 68, 68, 0.35);
}

.bounty-recap-card {
  width: min(100%, 480px);
  padding: clamp(1rem, 2.5vh, 1.35rem) clamp(1rem, 3vw, 1.5rem);
  border: 1.5px solid rgba(85, 221, 119, 0.28);
  border-radius: 12px;
  background: rgba(8, 18, 12, 0.82);
  box-shadow:
    0 0 24px rgba(68, 204, 68, 0.08),
    inset 0 1px 0 rgba(120, 200, 140, 0.06);
  flex-shrink: 0;
  text-align: left;
  transition:
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

.bounty-recap-card--win {
  border-color: rgba(85, 221, 119, 0.38);
}

.bounty-recap-card--confirming {
  animation: bounty-recap-card-pulse 2.2s ease-in-out infinite;
}

.bounty-recap-card--paid {
  border-color: rgba(85, 221, 119, 0.55);
  box-shadow:
    0 0 32px rgba(68, 204, 68, 0.18),
    inset 0 1px 0 rgba(120, 200, 140, 0.1);
}

@keyframes bounty-recap-card-pulse {
  0%,
  100% {
    box-shadow:
      0 0 24px rgba(68, 204, 68, 0.08),
      inset 0 1px 0 rgba(120, 200, 140, 0.06);
  }
  50% {
    box-shadow:
      0 0 36px rgba(68, 204, 68, 0.16),
      inset 0 1px 0 rgba(120, 200, 140, 0.1);
  }
}

.bounty-recap-hero {
  flex-shrink: 0;
  text-align: center;
  margin-bottom: clamp(0.75rem, 1.8vh, 1rem);
  padding-bottom: clamp(0.65rem, 1.5vh, 0.85rem);
  border-bottom: 1px solid rgba(120, 160, 130, 0.14);
}

.bounty-recap-headline {
  margin: 0 0 0.35rem;
  font-family: var(--gh-font-display);
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.bounty-recap-headline__row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.bounty-recap-headline-icon {
  flex-shrink: 0;
}

.bounty-recap-headline-icon--win {
  color: var(--gh-gold);
  filter: drop-shadow(0 0 6px rgba(232, 197, 71, 0.45));
}

.bounty-recap-headline-icon--lose {
  color: var(--gh-danger);
  filter: drop-shadow(0 0 6px rgba(255, 100, 100, 0.35));
}

.bounty-recap-headline__text {
  line-height: 1.1;
}

.bounty-recap-hero--win .bounty-recap-headline {
  color: var(--gh-accent);
  text-shadow: 0 0 16px var(--gh-accent-glow);
}

.bounty-recap-hero--lose .bounty-recap-headline {
  color: var(--gh-gold);
}

.bounty-recap-name {
  margin: 0 0 0.5rem;
  font-family: var(--gh-font-display);
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  color: var(--gh-text);
  letter-spacing: 0.06em;
  font-weight: 600;
}

.bounty-recap-reward {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem 0.75rem;
  margin: 0.35rem 0 0;
  font-size: clamp(1.15rem, 2.8vw, 1.55rem);
  font-weight: 700;
  color: var(--gh-gold);
  text-shadow: 0 0 14px rgba(255, 215, 0, 0.4);
}

.bounty-recap-reward__amount {
  line-height: 1.2;
}

.bounty-recap-reward-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.48em;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-shadow: none;
  vertical-align: middle;
}

.bounty-recap-reward-badge--confirmed {
  color: #9ef0b8;
  background: rgba(40, 140, 80, 0.28);
  border: 1px solid rgba(85, 221, 119, 0.55);
}

.bounty-recap-reward-badge--awaiting {
  color: #f6d38b;
  background: rgba(180, 120, 20, 0.22);
  border: 1px solid rgba(232, 180, 60, 0.45);
}

.bounty-recap-note {
  margin: 0.65rem 0 0;
  font-size: clamp(0.72rem, 1.4vw, 0.82rem);
  color: var(--gh-text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.bounty-recap-note__line--sub {
  opacity: 0.92;
}

.bounty-recap-confirming {
  margin: 0.65rem 0 0;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  background: rgba(12, 28, 18, 0.65);
  border: 1px solid rgba(85, 221, 119, 0.22);
  text-align: left;
}

.bounty-recap-confirming__row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.bounty-recap-spinner {
  width: 1.65rem;
  height: 1.65rem;
  flex-shrink: 0;
  color: var(--gh-accent);
  animation:
    bounty-recap-spinner-spin 3s linear infinite,
    gh-loading-pulse 2.4s ease-in-out infinite;
  filter: drop-shadow(0 0 6px var(--gh-accent-glow));
}

@keyframes bounty-recap-spinner-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.bounty-recap-confirming__title {
  font-family: var(--gh-font-display);
  font-size: clamp(0.82rem, 1.6vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--gh-accent);
}

.bounty-recap-confirming__sub {
  margin: 0.45rem 0 0.55rem 2.3rem;
  font-size: clamp(0.7rem, 1.35vw, 0.8rem);
  line-height: 1.45;
  color: var(--gh-text-muted);
}

.bounty-recap-confirming__bar {
  margin-left: 2.3rem;
  height: 3px;
  border-radius: 999px;
  background: rgba(85, 221, 119, 0.12);
  overflow: hidden;
}

.bounty-recap-confirming__bar-fill {
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--gh-accent), transparent);
  animation: bounty-recap-bar-scan 1.6s ease-in-out infinite;
}

@keyframes bounty-recap-bar-scan {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

.bounty-recap-timeout {
  margin: 0.65rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: rgba(12, 22, 16, 0.55);
  border: 1px solid rgba(120, 160, 130, 0.18);
  text-align: center;
}

.bounty-recap-timeout__title {
  margin: 0;
  font-family: var(--gh-font-display);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gh-text);
}

.bounty-recap-timeout__line {
  margin: 0.4rem 0 0;
  font-size: clamp(0.72rem, 1.4vw, 0.82rem);
  color: var(--gh-text-muted);
  line-height: 1.45;
}

.bounty-recap-timeout__line--sub {
  margin-top: 0.2rem;
  opacity: 0.9;
}

.bounty-recap-discrepancy {
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.7rem;
  font-size: clamp(0.72rem, 1.4vw, 0.85rem);
  line-height: 1.45;
  color: #ffb4b4;
  background: rgba(180, 40, 40, 0.2);
  border: 1px solid rgba(255, 120, 120, 0.35);
  border-radius: 6px;
}

.bounty-recap-conditions {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: clamp(0.78rem, 1.5vw, 0.92rem);
  line-height: 1.45;
}

.bounty-recap-conditions li {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(120, 160, 130, 0.12);
}

.bounty-recap-conditions li:last-child {
  border-bottom: none;
}

.bounty-recap-conditions .pass {
  color: var(--gh-accent);
}

.bounty-recap-conditions .fail {
  color: var(--gh-danger);
}

.bounty-recap-stats {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.35rem 2rem;
  margin: 0;
  font-size: clamp(0.8rem, 1.6vw, 0.95rem);
  justify-content: center;
}

.bounty-recap-stats dt {
  color: var(--gh-text-muted);
  text-align: right;
}

.bounty-recap-stats dd {
  margin: 0;
  font-weight: 600;
  color: var(--gh-text);
  font-variant-numeric: tabular-nums;
}

.hud-cool-btn--quit-bounty {
  border-color: rgba(204, 136, 68, 0.45);
  color: #e8c070;
}

.hud-cool-btn--quit-bounty .hud-cool-btn-icon {
  opacity: 0.95;
}

.bounty-staging-blocked {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: min(100%, 520px);
  margin: 0 auto;
  padding: var(--screen-pad-y) var(--screen-pad-x);
}

.bounty-staging-blocked-card {
  width: 100%;
}

.bounty-staging-blocked-headline {
  margin: 0 0 0.75rem;
  font-family: var(--gh-font-display);
  font-size: clamp(1.15rem, 3.5vw, 1.65rem);
  letter-spacing: 0.08em;
  color: var(--gh-gold);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.bounty-staging-blocked-body {
  margin-bottom: 1rem;
}

.bounty-staging-blocked-line {
  margin: 0 0 0.45rem;
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  color: var(--gh-text);
  line-height: 1.45;
}

.bounty-staging-blocked-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: stretch;
}

.bounty-recap-actions {
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}

.bounty-recap-actions .menu-btn--secondary {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Game Over action row uses `.screen-footer .screen-footer--wrap` —
   the buttons (Retry / Leaderboards / Menu) wrap on narrow viewports. */

/* HUD layout */
#hud-layer.playing {
  pointer-events: none;
}

#hud-layer.playing .hud-interactive {
  pointer-events: auto;
}

.hud-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-areas:
    'topleft topcenter topright'
    '. . .'
    'bottomleft . bottomright';
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto 1fr auto;
  padding: max(8px, var(--safe-top)) max(8px, var(--safe-right)) max(8px, var(--safe-bottom))
    max(8px, var(--safe-left));
  pointer-events: none;
}

.hud-top-left {
  grid-area: topleft;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  width: var(--hud-bar-w);
  max-width: var(--hud-bar-w);
}

@media (min-width: 1024px) and (pointer: fine) {
  :root {
    /* Desktop has room — modest boost keeps HUD readable without being oversized. */
    --hud-desktop-boost: 1.1;
  }
}

#hud-layer.touch-layout {
  --hud-desktop-boost: 1;
  /* Cap auto-scale at 1.0 on touch — mobile shouldn't go above design size */
  --hud-scale-raw: calc(min(var(--gh-hud-auto-scale, 1), 1) * var(--user-hud-scale, 1));
  --hud-scale: clamp(0.55, var(--hud-scale-raw), 1.1);

  /* Touch-target floor for tappable cells */
  --hud-cell-h: max(38px, calc(28px * var(--hud-scale)));
  --hud-cell-min-w: max(38px, calc(28px * var(--hud-scale)));

  /* Tighter on phones — bars ~160px and column capped at ~30vw frees the
     left third of the canvas for the move-joystick gesture zone. */
  --hud-bar-w: clamp(120px, calc(160px * var(--hud-scale)), 200px);
  --hud-tl-max-w: min(32vw, calc(200px * var(--hud-scale)));
}

/* Tablet touch tier — wider bars, higher scale ceiling, bigger buttons.
   iPad Mini landscape ≈ 1024×768, iPad Pro ≈ 1194×834 CSS px.
   768px is the canonical tablet breakpoint for touch devices. */
@media (pointer: coarse) and (min-width: 768px) {
  #hud-layer.touch-layout {
    --hud-scale-raw: calc(min(var(--gh-hud-auto-scale, 1), 1.25) * var(--user-hud-scale, 1));
    --hud-scale: clamp(0.7, var(--hud-scale-raw), 1.4);
    --hud-bar-w: clamp(180px, calc(240px * var(--hud-scale)), 320px);
    --hud-tl-max-w: min(38vw, calc(320px * var(--hud-scale)));
    --hud-cell-h: max(42px, calc(34px * var(--hud-scale)));
    --hud-cell-min-w: max(42px, calc(34px * var(--hud-scale)));
  }
}

/* Top-left column: every row shares the same width as HP / shield / ammo bars. */
#hud-layer.touch-layout .hud-top-left {
  width: var(--hud-bar-w);
  max-width: var(--hud-bar-w);
}

#hud-layer.touch-layout .hud-vital-row,
#hud-layer.touch-layout .hud-weapon-cluster,
#hud-layer.touch-layout .hud-ammo-row,
#hud-layer.touch-layout .hud-perks {
  width: var(--hud-bar-w);
  max-width: var(--hud-bar-w);
}

.hud-top-center {
  grid-area: topcenter;
  text-align: center;
  align-self: start;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.hud-pickup-toast {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem 0.35rem 0.45rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--toast-accent, #44cc44) 65%, #ffffff 10%);
  background: rgba(6, 10, 8, 0.88);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.hud-pickup-toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.hud-pickup-toast--fade {
  opacity: 0;
  transform: translateY(-4px);
}

.hud-pickup-toast-icon .hud-icon-mask {
  width: 22px;
  height: 22px;
}

.hud-pickup-toast-label {
  font-family: Rajdhani, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f2fff4;
}

/* Fixed-positioned top-right. Using consistent max() pattern for edge padding.
   The --vv-top var adjusts for iOS Safari URL bar appearance/disappearance. */
.hud-top-right {
  position: fixed;
  top: calc(var(--vv-top, 0px) + max(12px, env(safe-area-inset-top, 12px)));
  right: max(12px, env(safe-area-inset-right, 12px));
  max-width: 45vw;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  z-index: 3;
}

.hud-fps {
  font-family: var(--gh-font);
  font-size: clamp(0.7rem, 1.4vw, 0.85rem);
  color: var(--gh-text-muted);
  letter-spacing: 0.04em;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(8, 14, 10, 0.65);
  border: 1px solid rgba(68, 204, 68, 0.2);
}

/* Fixed-positioned bottom-right action cluster (Throw/Helper/Swap/Dash).
   Industry-standard pattern: max(MIN_PADDING, safe-area-inset) guarantees
   a minimum 16px padding on all devices while respecting safe areas when
   they exist (notch, home indicator). Simple and consistent. */
.hud-bottom-right {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom, 16px));
  right: max(16px, env(safe-area-inset-right, 16px));
  z-index: 3;
}

#hud-layer.left-hand .hud-bottom-right {
  right: auto;
  left: max(16px, env(safe-area-inset-left, 16px));
}

#hud-layer.left-hand .hud-top-right {
  right: auto;
  left: max(12px, env(safe-area-inset-left, 12px));
  align-items: flex-start;
}

#hud-layer.left-hand .hud-mobile-actions {
  grid-template-areas:
    'throw helper'
    'dash swap';
}

.hud-bar-wrap {
  width: var(--hud-bar-w);
  background: rgba(20, 20, 20, 0.7);
  border-radius: 4px;
  height: var(--hud-bar-h);
  overflow: hidden;
  border: 1px solid var(--gh-border);
  position: relative;
}

.hud-vital-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: var(--hud-bar-w);
}

.hud-vital-row .hud-bar-wrap {
  flex: 1;
  min-width: 0;
}

.hud-vital-row[hidden] {
  display: none !important;
}

.hud-vital-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--hud-bar-h) * 0.85);
  height: calc(var(--hud-bar-h) * 0.85);
  color: var(--gh-accent);
}

.hud-vital-icon .hud-icon-mask {
  width: 100%;
  height: 100%;
  display: block;
}

.hud-vital-row--labeled {
  gap: 5px;
}

.hud-vital-label {
  flex-shrink: 0;
  width: 4.35rem;
  font-size: calc(var(--hud-font-xs) * 0.88);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0.01em;
  color: rgba(230, 240, 232, 0.92);
  text-align: left;
}

.hud-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width var(--gh-transition-press) linear;
}

.hud-bar-fill.hp-high {
  background: linear-gradient(90deg, #2a8a2a, #44cc44);
}
.hud-bar-fill.hp-mid {
  background: linear-gradient(90deg, #8a8a2a, #cccc44);
}
.hud-bar-fill.hp-low {
  background: linear-gradient(90deg, #8a2a2a, #cc4444);
}
.hud-bar-fill.shield {
  background: linear-gradient(90deg, #2a4a8a, #4488cc);
  animation: gh-shield-pulse 1s ease-in-out infinite;
}

.hud-bar-fill.hits-safe {
  background: linear-gradient(90deg, #2a6a3a, #44aa55);
}
.hud-bar-fill.hits-warn {
  background: linear-gradient(90deg, #8a6a1a, #ccaa33);
}
.hud-bar-fill.hits-danger {
  background: linear-gradient(90deg, #8a4a1a, #cc7722);
}
.hud-bar-fill.hits-failed {
  background: linear-gradient(90deg, #8a2a2a, #cc4444);
  animation: gh-hits-failed-pulse 0.65s ease-in-out infinite;
}

.hud-hits-info {
  margin: 0;
  padding: 0;
  width: var(--hud-bar-w);
  font-size: var(--hud-font-lg);
  color: rgba(230, 240, 232, 0.88);
  line-height: 1.3;
}

.hud-hits-info-value {
  font-variant-numeric: tabular-nums;
}

.hud-hits-info.hud-hits-flash .hud-hits-info-value,
.hud-hits-row.hud-hits-flash .hud-bar-text {
  animation: gh-hits-flash 0.22s ease-out;
}

.hud-bar-fill.hud-hits-hit-flash {
  filter: brightness(1.35);
  transition: width 0.12s ease-out;
}

@keyframes gh-hits-flash {
  0% {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.85);
  }
  100% {
    color: inherit;
    text-shadow: none;
  }
}

@keyframes gh-hits-failed-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* Ammo row — slim horizontal strip below the shield/HP bars.
   Three children in a single flex line so the row never wraps:
     [gun icon] [segmented mag cells + count overlay] [gun name / RELOADING]
   The gun icon (16-20px SVG, coloured by --gh-gun-color) is the primary
   identifier; the right-side label echoes the gun name in text and
   becomes "RELOADING" mid-reload. The count ("17/30 +120") overlays the
   segmented bar itself, mirroring HP-bar styling. */
.hud-ammo-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: var(--hud-bar-w);
}

.hud-ammo-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--hud-bar-h) * 0.85);
  height: calc(var(--hud-bar-h) * 0.85);
  color: var(--gh-gun-color, var(--gh-accent));
}

.hud-ammo-icon[hidden] {
  display: none;
}

.hud-ammo-icon .hud-icon-svg,
.hud-ammo-icon .hud-icon-mask {
  width: 100%;
  height: 100%;
  display: block;
}

.hud-icon-mask {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--icon-color, currentColor);
  mask-image: var(--icon-url);
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: var(--icon-url);
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

/* Wrapper so the count text can absolute-position over the segmented
   cells (the cells container gets innerHTML-replaced on every ammo
   update, so the overlay can't live inside it). */
.hud-ammo-bar {
  position: relative;
  flex: 1 1 0;
  display: flex;
  min-width: 0;
}

.hud-ammo-count {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--hud-font-xs) * 0.95);
  font-weight: 600;
  color: #fff;
  text-shadow:
    0 0 2px #000,
    0 0 4px #000,
    0 1px 1px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.04em;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
}

.hud-ammo-text {
  flex-shrink: 0;
  max-width: calc(var(--hud-bar-w) * 0.32);
  font-size: var(--hud-font-xs);
  font-weight: 600;
  color: var(--gh-gun-color, var(--gh-text-muted));
  white-space: nowrap;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hud-ammo-text.multiline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  white-space: normal;
  font-size: calc(var(--hud-font-xs) * 0.82);
  line-height: 1.05;
  max-width: calc(var(--hud-bar-w) * 0.28);
}

.hud-ammo-name-line {
  display: block;
  white-space: nowrap;
}

.hud-ammo-count--infinite {
  color: #88ffaa;
  letter-spacing: 0.04em;
}

.hud-ammo-auto-tag {
  display: block;
  margin-top: 0.12em;
  font-size: 0.62em;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(136, 255, 170, 0.85);
}

.hud-ammo-text--infinite .hud-ammo-auto-tag {
  display: inline;
  margin-top: 0;
  margin-left: 0.35em;
}

.hud-ammo-text.reloading {
  color: var(--gh-gold);
  animation: gh-shield-pulse 0.6s ease-in-out infinite;
}

@keyframes gh-shield-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.75;
  }
}

.hud-bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--hud-font-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow:
    0 0 4px #000,
    0 1px 2px #000;
  pointer-events: none;
}

.hud-timer {
  font-size: var(--hud-font-timer);
  color: var(--gh-accent);
  text-shadow: 0 0 10px var(--gh-accent-glow);
  font-weight: bold;
}

.hud-kills {
  font-size: var(--hud-font-lg);
  color: var(--gh-text-muted);
}

.hud-combo-wrap {
  position: relative;
  display: none;
  width: 104px;
  height: 104px;
  margin: 0.15rem auto 0;
  flex-shrink: 0;
}

.hud-combo-wrap.active {
  display: block;
}

.hud-combo-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}

.hud-combo-ring__track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 3.5;
}

.hud-combo-ring__fill {
  fill: none;
  stroke: var(--gh-gold);
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.08s linear;
  filter: drop-shadow(0 0 4px rgba(255, 200, 60, 0.55));
}

.hud-combo {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gh-gold);
  font-weight: bold;
  font-size: 0.72rem;
  line-height: 1.05;
  text-align: center;
  padding: 0 14px;
  pointer-events: none;
  text-shadow: 0 0 8px rgba(255, 200, 60, 0.45);
}

.hud-combo-wrap.active .hud-combo {
  animation: gh-combo-pulse 0.8s ease-in-out infinite;
}

.hud-weapon-cluster {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: var(--hud-bar-w);
  max-width: var(--hud-bar-w);
}

.hud-weapons-strip {
  --weapon-count: 2;
  display: flex;
  align-items: stretch;
  gap: 6px;
  width: 100%;
}

/* Many carried guns: compact icon picker; ammo lives on the row below. */
.hud-weapons-strip--many {
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}

.hud-weapons-strip--many::-webkit-scrollbar {
  display: none;
}

.hud-weapons-strip--many .hud-weapon-slot {
  flex: 0 0 auto;
  width: calc(var(--hud-bar-h) + 4px);
  max-width: 40px;
  justify-content: center;
  padding: 0 2px;
}

.hud-weapons-strip--many .hud-weapon-slot-icon {
  max-width: 100%;
  flex: 0 0 auto;
  width: calc(var(--hud-bar-h) - 6px);
  height: calc(var(--hud-bar-h) - 6px);
}

.hud-weapons-strip--many .hud-weapon-slot-icon .hud-icon-svg,
.hud-weapons-strip--many .hud-weapon-slot-icon .hud-icon-mask {
  transform: scale(1.15);
}

.hud-weapon-slot {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: var(--hud-bar-h);
  min-height: var(--hud-bar-h);
  max-height: var(--hud-bar-h);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.32);
  opacity: 0.75;
  overflow: visible;
  transition:
    opacity 0.2s ease,
    border-color 0.22s ease,
    background 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.28s cubic-bezier(0.34, 1.25, 0.64, 1);
}

.hud-weapon-slot--active {
  opacity: 1;
  border-color: var(--slot-color, var(--gh-accent));
  background: color-mix(in srgb, var(--slot-color, var(--gh-accent)) 12%, rgba(0, 0, 0, 0.32));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--slot-color, var(--gh-accent)) 35%, transparent),
    0 0 12px color-mix(in srgb, var(--slot-color, var(--gh-accent)) 40%, transparent);
}

.hud-weapons-strip--swap .hud-weapon-slot--active {
  transform: scale(1.06);
}

.hud-weapon-slot-icon {
  flex: 1 1 0;
  min-width: 0;
  height: calc(var(--hud-bar-h) - 4px);
  max-width: 72%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  color: var(--slot-color, var(--gh-accent));
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.65));
}

.hud-weapon-slot-icon .hud-icon-svg,
.hud-weapon-slot-icon .hud-icon-mask {
  width: 100%;
  height: 100%;
  transform: scale(1.55);
  transform-origin: center center;
}

.hud-weapon-slot-ammo {
  flex-shrink: 0;
  font-size: var(--hud-font-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #fff;
  letter-spacing: 0.02em;
  line-height: 1;
  text-shadow:
    0 0 4px #000,
    0 1px 2px #000;
}

.hud-weapon-slot-ammo--reload {
  color: #ffcc66;
  animation: hud-ammo-low-pulse 0.8s ease-in-out infinite;
}

.hud-weapon-slot-swap {
  position: absolute;
  bottom: 1px;
  right: 2px;
  width: 10px;
  height: 10px;
  opacity: 0.5;
  pointer-events: none;
}

.hud-weapon-slot-swap .hud-icon-mask {
  width: 100%;
  height: 100%;
}

.hud-weapon-slot--active .hud-weapon-slot-swap {
  display: none;
}

/* Mobile weapon cluster: same bar height as HP / shield / ammo rows. */

#hud-layer.touch-layout .hud-weapon-slot-swap {
  bottom: auto;
  top: 2px;
  right: 2px;
}

#hud-layer.touch-layout .hud-top-left {
  gap: 3px;
}

.hud-cell--status .hud-cell-badge {
  border-color: rgba(255, 180, 120, 0.55);
}

.hud-cell--status img,
.hud-cell--status svg {
  filter: drop-shadow(0 0 4px rgba(255, 140, 80, 0.45));
}
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  max-width: min(90vw, 420px);
  width: 100%;
}

.bounty-progress-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.bp-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(80, 200, 120, 0.45);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1.2;
  text-align: center;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.bp-pill-label {
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.75);
}

.bp-pill-value {
  font-weight: 600;
}

.bp-pill--complete {
  animation: bp-pill-flash 0.5s ease-out;
}

.bp-pill--complete:not(.bp-pill--hidden) {
  animation: bp-pill-flash 0.5s ease-out;
  transition: opacity 1.5s ease 0.5s;
  opacity: 0;
}

@keyframes bp-pill-flash {
  0% {
    background: rgba(60, 180, 100, 0.9);
    border-color: rgba(120, 255, 160, 0.9);
  }
  100% {
    background: rgba(0, 0, 0, 0.55);
    border-color: rgba(80, 200, 120, 0.45);
  }
}

.bp-pill--hidden {
  display: none;
}

.bounty-progress-banner {
  width: 100%;
  text-align: center;
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--gh-gold, #e8c547);
  text-shadow: 0 0 8px rgba(232, 197, 71, 0.5);
  animation: bp-banner-pulse 1.2s ease-in-out infinite;
  letter-spacing: 0.06em;
}

@keyframes bp-banner-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.65;
  }
}

#hud-layer.touch-layout .bounty-progress-pills {
  gap: 5px;
}

#hud-layer.touch-layout .bp-pill {
  font-size: 0.75rem;
  padding: 3px 8px;
  flex: 0 1 calc(33.333% - 5px);
  max-width: calc(33.333% - 5px);
}

@keyframes gh-combo-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes comboPop {
  from {
    transform: scale(1.12);
  }
  to {
    transform: scale(1);
  }
}

.hud-combo.combo-pulse {
  animation: comboPop 200ms ease-out, gh-combo-pulse 0.8s ease-in-out 200ms infinite;
}

.hud-cells {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hud-cells--loadout {
  width: auto;
  max-width: none;
  display: grid;
  grid-template-columns: repeat(var(--hud-loadout-cols, 3), var(--hud-cell-h));
  gap: calc(4px * var(--hud-scale, 1));
}

.hud-cells--effects {
  width: auto;
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  gap: calc(4px * var(--hud-scale, 1));
}

.hud-cells--loadout .hud-cell,
.hud-cells--effects .hud-cell {
  box-sizing: border-box;
  width: var(--hud-cell-h);
  height: var(--hud-cell-h);
  min-width: var(--hud-cell-h);
  max-width: var(--hud-cell-h);
  padding: 0;
}

.hud-cells--loadout .hud-cell-label,
.hud-cells--effects .hud-cell-label {
  display: none;
}

@media (pointer: coarse) and (min-width: 768px) {
  .hud-cells--loadout,
  .hud-cells--effects {
    gap: calc(6px * var(--hud-scale, 1));
  }
}

.hud-cells--effects:empty {
  display: none;
}

.hud-cell--empty {
  border-style: dashed;
  border-color: rgba(120, 180, 120, 0.45);
  background: rgba(18, 28, 22, 0.92);
  box-shadow: inset 0 0 0 1px rgba(120, 180, 120, 0.08);
}

.hud-cell--empty .hud-icon-mask,
.hud-cell--empty .hud-icon-svg {
  width: calc(var(--hud-cell-h) * 0.58);
  height: calc(var(--hud-cell-h) * 0.58);
  opacity: 0.82;
}

.hud-cell-badge--empty {
  color: rgba(158, 196, 158, 0.85);
  border-color: rgba(120, 160, 120, 0.5);
  background: rgba(12, 20, 14, 0.9);
}

.hud-cell {
  min-width: var(--hud-cell-min-w);
  width: auto;
  height: var(--hud-cell-h);
  border-radius: 4px;
  border: 1px solid var(--gh-border);
  background: var(--gh-bg-panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px 6px;
  font-size: var(--hud-font-xs);
  position: relative;
  overflow: visible;
  color: var(--cell-color, var(--gh-accent));
}

.hud-cell .hud-icon-svg,
.hud-cell .hud-icon-mask {
  display: block;
  flex-shrink: 0;
  width: calc(var(--hud-cell-h) * 0.52);
  height: calc(var(--hud-cell-h) * 0.52);
}

.hud-cell-label {
  display: none;
}

.hud-cell.active-slot {
  box-shadow: 0 0 8px var(--gh-accent-glow);
  border-color: var(--gh-accent);
}

/* Vertical fill — colored overlay that rises bottom-to-top as ability recharges.
   --fill-pct: 0 = empty (on cooldown), 100 = fully charged (ready). */
.hud-cell-fill-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    color-mix(in srgb, var(--cell-color, var(--gh-accent)) 40%, transparent),
    color-mix(in srgb, var(--cell-color, var(--gh-accent)) 20%, transparent)
  );
  clip-path: inset(calc((100 - var(--fill-pct, 0)) * 1%) 0 0 0);
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
  transition: clip-path 0.15s linear;
}

/* Drain variant — same bottom-to-top fill, shrinks as effect depletes */
.hud-cell-fill-overlay--drain {
  clip-path: inset(calc((100 - var(--fill-pct, 100)) * 1%) 0 0 0);
}

.hud-cell--cooling {
  opacity: 0.75;
}

.hud-cell--cooling .hud-icon-mask,
.hud-cell--cooling .hud-icon-svg {
  filter: saturate(0.3);
}

/* Expiring pulse — last 25% of an effect's duration */
.hud-cell--expiring {
  animation: cell-expire-pulse 0.6s ease-in-out infinite alternate;
}

@keyframes cell-expire-pulse {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.45;
  }
}

.hud-cell-badge {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(35%, -35%);
  min-width: calc(var(--hud-font-xs) * 1.15);
  height: calc(var(--hud-font-xs) * 1.35);
  padding: 0 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--hud-font-xs) * 0.72);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
  background: rgba(12, 18, 14, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  z-index: 2;
}

/* Segmented mag-cells — each cell = one round (or block of rounds for
   large mags). Filled cells show remaining ammo in the current magazine.
   The last 1-2 cells pulse when ammo is critically low. During reload the
   bar refills cell-by-cell as the timer progresses (driven from JS). */
.hud-ammo-cells {
  flex: 1 1 0;
  display: flex;
  gap: 1px;
  height: var(--hud-ammo-h);
}

.hud-ammo-cell {
  flex: 1 1 0;
  min-width: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  transition: background var(--gh-transition-press);
}

.hud-ammo-cell.filled {
  background: var(--gh-gun-color, var(--gh-accent));
}

.hud-ammo-cell.pulse {
  animation: hud-ammo-low-pulse 1s ease-in-out infinite;
}

@keyframes hud-ammo-low-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* Two separate cell rows — effects use the same column grid as loadout
   so each buff cell matches one throwable/helper slot width. */

/* Hot-zone action cluster — bottom-right 2×2 (touch only).
     helper  throw
     swap    dash
   Left column = support (helper, swap). Right column = combat (throw, dash).
   Dash bottom-right cell = primary reflex action. Throw hold opens radial.
   48px touch-target floor (above Material/WCAG 44px). */
.hud-mobile-actions {
  /* Mobile buttons use ONLY --mobile-btn-scale (independent of HUD scale).
     User slider ranges 60%-140%, so we allow 28px to 100px for full range. */
  --mobile-action-size: clamp(28px, calc(46px * var(--mobile-btn-scale, 1)), 100px);
  display: none;
  grid-template-columns: repeat(2, var(--mobile-action-size));
  grid-template-rows: repeat(2, var(--mobile-action-size));
  grid-template-areas:
    'helper throw'
    'swap   dash';
  gap: calc(6px * var(--mobile-btn-scale, 1));
  pointer-events: auto;
}

#hud-btn-help {
  grid-area: helper;
}
#hud-layer.mp-arena-active #hud-btn-help {
  display: none !important;
}
#hud-btn-throw {
  grid-area: throw;
}
#hud-btn-swap {
  grid-area: swap;
}
#hud-btn-dash {
  grid-area: dash;
}

.hud-mobile-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--gh-font);
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0;
  border: 1.5px solid var(--gh-border);
  background: var(--gh-bg-panel);
  color: var(--btn-color, var(--gh-text));
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  overflow: visible;
  padding: 0;
  opacity: var(--mobile-btn-opacity, 1);
}

#hud-layer.touch-layout .hud-mobile-btn,
#hud-layer.touch-layout .hud-mobile-btn-fill {
  border-radius: 0;
}

/* Tablet-specific: larger buttons (72px) and more edge padding (24px).
   Tablets have more screen real estate; bigger touch targets improve UX. */
@media (pointer: coarse) and (min-width: 768px) {
  .hud-bottom-right {
    bottom: max(24px, env(safe-area-inset-bottom, 24px));
    right: max(24px, env(safe-area-inset-right, 24px));
  }

  #hud-layer.left-hand .hud-bottom-right {
    right: auto;
    left: max(24px, env(safe-area-inset-left, 24px));
  }
}

/* Real tablets (iPad-class, ≥1024px landscape) get a larger base — phones in
   landscape (≤~960px) stay at the phone default and rely on the user slider. */
@media (pointer: coarse) and (min-width: 1024px) {
  .hud-mobile-actions {
    --mobile-action-size: clamp(38px, calc(56px * var(--mobile-btn-scale, 1)), 120px);
    gap: calc(10px * var(--mobile-btn-scale, 1));
  }
}

.hud-mobile-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56%;
  height: 56%;
  pointer-events: none;
}

.hud-mobile-btn-icon .hud-icon-mask,
.hud-mobile-btn-icon .hud-icon-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hud-mobile-btn-empty-icon {
  display: none;
}

.hud-mobile-btn-badge {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(20%, -20%);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: rgba(8, 14, 10, 0.95);
  border: 1px solid rgba(68, 204, 68, 0.55);
  color: var(--gh-text);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  pointer-events: none;
  z-index: 2;
}

.hud-mobile-btn-recharge {
  display: none;
}

.hud-mobile-btn--empty {
  border-style: dashed;
  border-color: rgba(120, 180, 120, 0.45);
  background: rgba(18, 28, 22, 0.92);
  box-shadow: inset 0 0 0 1px rgba(120, 180, 120, 0.08);
}

.hud-mobile-btn--empty .hud-icon-mask,
.hud-mobile-btn--empty .hud-icon-svg {
  opacity: 0.82;
}

.hud-mobile-btn-badge--empty {
  color: rgba(158, 196, 158, 0.85);
  border-color: rgba(120, 160, 120, 0.5);
  background: rgba(12, 20, 14, 0.9);
}

.hud-mobile-btn--cooling {
  opacity: 0.75;
}

.hud-mobile-btn--cooling .hud-mobile-btn-icon .hud-icon-mask,
.hud-mobile-btn--cooling .hud-mobile-btn-icon .hud-icon-svg {
  filter: saturate(0.3);
}

/* Registered so the conic sweep angle can tween smoothly between the stepped
   percentages JS feeds it (plain custom properties can't be transitioned). */
@property --cool-pct {
  syntax: '<number>';
  inherits: false;
  initial-value: 0;
}

/* Square cooldown sweep for mobile button recharge. */
.hud-mobile-btn-fill {
  position: absolute;
  inset: 0;
  border-radius: 0;
  pointer-events: none;
  z-index: 1;
  background: conic-gradient(
    from -90deg,
    color-mix(in srgb, var(--btn-color, #00ccff) 60%, transparent) 0deg,
    color-mix(in srgb, var(--btn-color, #00ccff) 30%, transparent) calc(var(--cool-pct, 0) * 3.6deg),
    rgba(0, 0, 0, 0.5) calc(var(--cool-pct, 0) * 3.6deg)
  );
  transition: --cool-pct 0.18s linear;
}

.hud-mobile-btn:active {
  background: rgba(40, 80, 40, 0.95);
  transform: scale(0.94);
}

/* Cool-zone buttons (Stats, Pause, Swap, Reload) — top-right strip.
   Strategic actions used between combat moments, not in the thumb-reflex arc.
   Visible only on touch — desktop has Q/R/Esc keys.
   Fixed `width` (not just `min-width`) so every label renders at the
   same size — keeps the column visually aligned regardless of text length. */
.hud-cool-btn {
  display: none;
  font-family: var(--gh-font);
  font-size: var(--hud-font-sm);
  font-weight: 600;
  padding: 6px 8px;
  width: 78px;
  min-height: 36px;
  background: var(--gh-bg-panel);
  border: 1.5px solid var(--gh-border);
  color: var(--gh-text);
  border-radius: 6px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
  opacity: var(--mobile-btn-opacity, 1);
}

.hud-cool-btn:active {
  background: rgba(40, 80, 40, 0.95);
  transform: scale(0.96);
}

.hud-cool-btn--icon {
  width: 44px;
  padding: 6px;
}

.hud-cool-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.hud-cool-btn-icon .hud-icon-mask,
.hud-cool-btn-icon .hud-icon-svg {
  width: 100%;
  height: 100%;
  display: block;
}

#hud-layer.touch-layout .hud-cool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (pointer: coarse) and (min-width: 768px) {
  .hud-cool-btn {
    width: 92px;
    min-height: 44px;
    font-size: calc(var(--hud-font-sm) * 1.05);
    padding: 8px 10px;
  }

  .hud-cool-btn--icon {
    width: 52px;
    min-height: 44px;
    padding: 8px;
  }

  .hud-cool-btn-icon {
    width: 26px;
    height: 26px;
  }

  .hud-top-right {
    gap: 0.5rem;
  }
}

/* Radial picker (HTML) — tap the throw/helper button to open. The game keeps
   running and the overlay never blocks input: only the option buttons are
   tappable, so the player can still move/aim with the other thumb. Pick by
   tapping an option or dragging onto it; re-tap the action button or wait to
   dismiss. No dim/blur — it must read as live, not paused. */
#hud-radial {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: transparent;
}

#hud-radial.open {
  display: block;
  animation: radial-fade-in 0.1s ease-out;
}

@keyframes radial-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* The wheel is a full-overlay layer; children are placed in viewport pixels. */
#hud-radial .radial-wheel {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#hud-radial .radial-option {
  --radial-option-size: clamp(24px, calc(36px * var(--mobile-btn-scale, 1)), 72px);
  position: absolute;
  width: var(--radial-option-size);
  height: var(--radial-option-size);
  border-radius: 50%;
  background: rgba(8, 14, 10, 0.95);
  border: 2px solid var(--btn-color, var(--gh-accent));
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--btn-color, var(--gh-text));
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  transform: translate(-50%, -50%);
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease,
    background 0.08s ease;
}

/* No text label any more — the icon is the whole button, so let it fill ~58%. */
#hud-radial .radial-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58%;
  height: 58%;
}

#hud-radial .radial-option-icon .hud-icon-mask,
#hud-radial .radial-option-icon .hud-icon-svg {
  width: 100%;
  height: 100%;
  display: block;
}

#hud-radial .radial-option-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: rgba(8, 14, 10, 0.95);
  border: 1px solid rgba(68, 204, 68, 0.55);
  color: var(--gh-text);
  font-size: 0.5rem;
  font-weight: 700;
  line-height: 12px;
  text-align: center;
}

#hud-radial .radial-option.selected {
  transform: translate(-50%, -50%) scale(1.18);
  background: rgba(30, 70, 45, 0.95);
  box-shadow: 0 0 18px var(--btn-color, var(--gh-accent-glow));
}

@media (pointer: coarse) and (min-width: 1024px) {
  #hud-radial .radial-option {
    --radial-option-size: clamp(30px, calc(42px * var(--mobile-btn-scale, 1)), 84px);
  }
}

/* Screen fade */
#screen-layer.fading::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 8, 0.85);
  pointer-events: none;
  z-index: 100;
  animation: gh-screen-fade var(--gh-transition-overlay) linear forwards;
}

@keyframes gh-screen-fade {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

#screen-layer[hidden] {
  display: none !important;
}

/* ===== Global short-viewport scale-down (all screens except guide) ===== */
@media (max-height: 560px) {
  :root {
    --screen-pad-y: clamp(0.75dvh, 1.25dvh, 1.5dvh);
    --screen-title-size: clamp(1.35rem, 4vw, 2.25rem);
    --screen-tagline-size: clamp(0.7rem, 1.5vw, 0.85rem);
    --screen-section-gap: clamp(0.3rem, 0.8vh, 0.6rem);
  }

  .btn-primary,
  .btn-secondary,
  .btn-destructive,
  .btn-accent,
  .screen-back-btn {
    min-height: 38px;
  }

  .menu-btn {
    min-height: 36px;
    padding: 0.45em 0.9em;
  }

  .menu-btn--play {
    font-size: clamp(1rem, 2.8vw, 1.35rem);
    padding: 0.5em 0.9em;
  }

  #screen-menu .menu-title {
    font-size: clamp(2rem, 7vw, 4rem);
  }

  .credits-name--primary {
    font-size: clamp(1.2rem, 3.5vw, 1.75rem);
  }

  .settings-keybind-grid {
    gap: 0.15rem 0.5rem;
  }

  .keybind-row {
    padding: 0.2rem 0.4rem;
  }

  .keybind-label {
    font-size: 0.72rem;
  }

  .keybind-chip {
    min-width: 2.8rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.72rem;
  }

  .settings-keybind-actions button {
    padding: 0.35rem 0.6rem;
  }
}

@media (max-height: 420px) {
  :root {
    --screen-pad-y: 0.5dvh;
    --screen-title-size: clamp(1.1rem, 3.5vw, 1.75rem);
    --screen-section-gap: 0.25rem;
  }

  .btn-primary,
  .btn-secondary,
  .btn-destructive,
  .btn-accent,
  .screen-back-btn {
    min-height: 32px;
  }

  .menu-btn {
    min-height: 32px;
    padding: 0.35em 0.8em;
    font-size: clamp(0.75rem, 1.6vw, 0.9rem);
  }

  .pause-time-number {
    font-size: clamp(1.8rem, 6vw, 3rem);
  }

  .pause-time-display {
    margin-bottom: 0.5rem;
  }
}

/* ---------------------------------------------------------------------------
   Orientation Gate — shown when mobile device is in portrait during gameplay.
   Phone rotates portrait → landscape; large text for all screen sizes.
   --------------------------------------------------------------------------- */
.orientation-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0e12;
  color: var(--gh-text, #ccddcc);
  font-family: 'Rajdhani', sans-serif;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.orientation-gate[aria-hidden='false'] {
  opacity: 1;
  pointer-events: auto;
}

.orientation-gate__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.5rem, 5vh, 3rem);
  padding: clamp(1.5rem, 5vw, 3rem);
  text-align: center;
  max-width: min(420px, 92vw);
}

.orientation-gate__phone {
  width: clamp(120px, 32vw, 200px);
  height: auto;
  color: #55dd77;
  animation: gate-phone-rotate 3s ease-in-out infinite;
  transform-origin: center center;
  filter: drop-shadow(0 0 12px rgba(85, 221, 119, 0.25));
}

@keyframes gate-phone-rotate {
  0%,
  15% {
    transform: rotate(0deg);
  }
  45%,
  65% {
    transform: rotate(-90deg);
  }
  85%,
  100% {
    transform: rotate(0deg);
  }
}

.orientation-gate__text {
  font-size: clamp(1.75rem, 7vw, 2.75rem);
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: 0.03em;
  line-height: 1.15;
}

.orientation-gate__subtext {
  font-size: clamp(1.1rem, 4.5vw, 1.5rem);
  font-weight: 600;
  color: rgba(204, 221, 204, 0.75);
  margin: 0;
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------------------
   Game loading overlay — shown during beginPlay() transitions
   --------------------------------------------------------------------------- */
.game-loading {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 3vh, 2rem);
  background: radial-gradient(ellipse at center, #0a1a10 0%, #050a08 50%, #030608 100%);
  pointer-events: auto;
}

.game-loading[hidden] {
  display: none !important;
}

.game-loading-crosshair {
  position: relative;
  width: min(40vw, 40vh);
  height: min(40vw, 40vh);
  color: var(--gh-accent);
  pointer-events: none;
  animation:
    gh-loading-crosshair-spin 20s linear infinite,
    gh-loading-pulse 2.4s ease-in-out infinite;
  filter: drop-shadow(0 0 12px var(--gh-accent-glow));
}

@keyframes gh-loading-crosshair-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes gh-loading-pulse {
  0%,
  100% {
    opacity: 0.75;
  }
  50% {
    opacity: 1;
  }
}

.game-loading-msg {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--gh-font-display);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gh-accent);
  text-shadow: 0 0 12px var(--gh-accent-glow);
}

.game-loading-bar {
  position: absolute;
  bottom: clamp(1.5rem, 5vh, 3rem);
  left: 50%;
  transform: translateX(-50%);
  width: min(320px, 80vw);
  height: 2px;
  background: rgba(68, 204, 68, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

.game-loading-bar-track {
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--gh-accent), transparent);
  animation: gh-splash-shimmer 1.2s ease-in-out infinite;
}

/* ---------------------------------------------------------------------------
   Game dialog — in-game confirm / alert / bounty prompts
   --------------------------------------------------------------------------- */
#game-dialog-root {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

#game-dialog-root:empty {
  display: none;
}

.game-dialog {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 200ms ease-out;
}

.game-dialog--in {
  opacity: 1;
}

.game-dialog--out {
  opacity: 0;
  transition: opacity 150ms ease;
}

.game-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.game-dialog--bounty-quit .game-dialog-backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.game-dialog--bounty-quit .game-dialog-message {
  color: var(--gh-text-muted, #c8c8c8);
}

.game-dialog--bounty-quit .game-dialog-btn--secondary {
  color: #ff8888;
  border-color: rgba(255, 100, 100, 0.45);
}

.game-dialog-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 92vw);
  max-height: min(85vh, 520px);
  overflow: auto;
  padding: clamp(1.25rem, 3.5vh, 2rem) clamp(1.5rem, 4vw, 2.25rem);
  border: 1px solid var(--gh-border);
  border-radius: 12px;
  background: var(--gh-bg-panel);
  box-shadow:
    0 0 24px rgba(68, 204, 68, 0.12),
    inset 0 0 0 1px rgba(68, 204, 68, 0.08);
  text-align: center;
  transform: scale(0.96);
  transition: transform 200ms ease-out;
}

.game-dialog--in .game-dialog-panel {
  transform: scale(1);
}

.game-dialog--out .game-dialog-panel {
  transform: scale(0.98);
}

.game-dialog-title {
  margin: 0 0 clamp(0.75rem, 2vh, 1rem);
  font-family: var(--gh-font-display);
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gh-accent);
  text-shadow: 0 0 10px var(--gh-accent-glow);
}

.game-dialog-message {
  margin: 0;
  font-family: var(--gh-font);
  font-size: clamp(0.88rem, 1.8vw, 1.05rem);
  line-height: 1.5;
  color: var(--gh-text-muted);
}

.game-dialog-bounty-name {
  margin: 0 0 0.75rem;
  font-family: var(--gh-font-display);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 600;
  color: var(--gh-text);
}

.game-dialog-bounty-details {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
  font-family: var(--gh-font);
  font-size: clamp(0.88rem, 1.8vw, 1rem);
  color: var(--gh-text-muted);
}

.game-dialog-bounty-details li + li {
  margin-top: 0.35rem;
}

.game-dialog-bounty-label {
  color: var(--gh-text);
}

.game-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.75rem, 2vw, 1rem);
  justify-content: center;
  margin-top: clamp(1.25rem, 3vh, 1.75rem);
}

.game-dialog-btn {
  flex: 1 1 120px;
  min-height: 48px;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-family: var(--gh-font-display);
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    box-shadow var(--gh-transition-fast),
    transform var(--gh-transition-press),
    background var(--gh-transition-fast),
    border-color var(--gh-transition-fast);
}

.game-dialog-btn--primary {
  border: 1.5px solid var(--gh-accent);
  background: rgba(68, 204, 68, 0.12);
  color: var(--gh-accent);
  box-shadow: 0 0 12px rgba(68, 204, 68, 0.2);
}

.game-dialog-btn--primary:hover,
.game-dialog-btn--primary:focus-visible {
  box-shadow: 0 0 16px var(--gh-accent-glow);
}

.game-dialog-btn--secondary {
  border: 1.5px solid rgba(106, 138, 114, 0.5);
  background: transparent;
  color: var(--gh-text-muted);
}

.game-dialog-btn--secondary:hover,
.game-dialog-btn--secondary:focus-visible {
  border-color: var(--gh-text-muted);
  color: var(--gh-text);
}

@media (max-width: 480px) {
  .game-dialog-actions {
    flex-direction: column;
  }

  .game-dialog-btn {
    flex: 1 1 auto;
    width: 100%;
    min-height: 52px;
  }
}

/* ---------------------------------------------------------------------------
   Bounty forfeit screen
   --------------------------------------------------------------------------- */
.bounty-forfeit-stack {
  gap: clamp(1rem, 3vh, 1.5rem);
}

.bounty-forfeit-card {
  width: min(480px, 92vw);
  text-align: center;
}

.bounty-forfeit-headline {
  margin: 0 0 0.75rem;
  font-family: var(--gh-font-display);
  font-size: clamp(1.15rem, 3.5vw, 1.65rem);
  letter-spacing: 0.08em;
  color: var(--gh-danger);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.bounty-forfeit-lead,
.bounty-forfeit-sub {
  margin: 0 0 0.5rem;
  color: var(--gh-text);
  line-height: 1.45;
}

.bounty-forfeit-sub {
  color: var(--gh-text-muted);
  margin-bottom: 1.25rem;
}

.bounty-forfeit-run {
  margin: 0 0 1.25rem;
  text-align: left;
}

.bounty-forfeit-run-title {
  margin: 0 0 0.5rem;
  font-weight: 600;
  color: var(--gh-text);
}

.bounty-forfeit-stats {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
}

.bounty-forfeit-stats dt {
  color: var(--gh-text-muted);
  font-size: 0.9rem;
}

.bounty-forfeit-stats dd {
  margin: 0;
  font-weight: 600;
}

.bounty-forfeit-rules {
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 180, 80, 0.25);
  border-radius: 8px;
  background: rgba(255, 180, 80, 0.06);
  text-align: left;
}

.bounty-forfeit-rules-title {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffb84d;
}

.bounty-forfeit-rules-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--gh-text-muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.bounty-forfeit-actions {
  justify-content: center;
}
