/* ===== Boxing — game.css =====
   Mirrors arrow-escape/game.css dark-theme + mobile-responsive patterns.
   Adds: blood bars, button row (defend/attack), counter-window glow. */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
body {
  background: #0a0a0c;
  color: #e8e8e8;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang HK', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  user-select: none;
  /* iOS Safari URL bar buffer + safe-area inset */
  padding: calc(env(safe-area-inset-top) + 56px) 0 calc(env(safe-area-inset-bottom) + 16px);
}

/* ponytail: pin .game-ui to a fixed width matching the HUD/canvas so the
   page stops shifting horizontally when the status text wraps (the
   status line used to be the widest child because it had no explicit
   width and its min-content was different from a 92vw block — making
   .game-ui's auto width jump between 405px and ~417px depending on
   whether the telegraph line wrapped). Now .game-ui has the same
   fixed width as #hud / #game / .controls, so all children sit on a
   stable horizontal baseline and only the status text height changes
   when it wraps. */
#gameUI {
  width: min(800px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.hidden { display: none !important; }

/* ===== HUD ===== */
.hud {
  width: min(800px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 4px;
  margin-bottom: 14px;
}
.hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.hud-row-top {
  justify-content: space-between;  /* opponent block left, mute right */
}
.hud-row-bars {
  justify-content: center;          /* blood bars centered */
}

/* Opponent block (top-left in HUD) */
.opponent-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.opponent-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fff;
  text-transform: uppercase;
}
.opponent-difficulty {
  font-size: 9px;
  letter-spacing: 0.3em;
  color: #7ee8b3;
  font-weight: 600;
}
.opponent-difficulty[data-difficulty="medium"] { color: #f0d264; }
.opponent-difficulty[data-difficulty="hard"]   { color: #ff9b6e; }
.opponent-difficulty[data-difficulty="pro"]    { color: #ff4a6b; }
}

.blood-bars {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: #888;
  text-transform: uppercase;
}
.blood-label {
  font-weight: 600;
  color: #aaa;
  letter-spacing: 0.2em;
}
.blood-bar {
  width: clamp(70px, 22vw, 140px);
  height: 14px;
  background: rgba(0,0,0,0.6);
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  position: relative;
}
.blood-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff4a6b 0%, #f0d264 50%, #7ee8b3 100%);
  transition: width 0.35s ease, background 0.35s ease;
  /* width set inline by hud-controller */
}

.round-indicator {
  font-size: 11px;
  letter-spacing: 0.4em;
  color: #555;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Round tally row — YOU dots / ROUND counter / THEM dots */
.round-tally {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 2px;
}
.round-tally-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 64px;
}
.round-tally-label {
  font-size: 8px;
  letter-spacing: 0.3em;
  color: #555;
  text-transform: uppercase;
}
.round-dots {
  display: flex;
  gap: 6px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7ee8b3;
  box-shadow: 0 0 6px rgba(126, 232, 179, 0.4);
  transition: transform 0.3s ease, background 0.3s ease;
}
.round-tally-block:nth-child(3) .dot {
  background: #ff4a6b;
  box-shadow: 0 0 6px rgba(255, 74, 107, 0.4);
}
.dot.empty {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

/* ===== Canvas ===== */
canvas {
  display: block;
  cursor: default;
  border-radius: 14px;
  background: #14141a;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.03);
}
#game {
  width: min(800px, 92vw);
  height: auto;
  aspect-ratio: 800 / 550;
  /* Removed the previous `min(92vw, 60dvh)` cap — on wide / landscape
     browsers 60dvh shrunk the canvas below the 800px HUD width, making
     the blood bars appear to "leak" beyond the canvas edges. The 92vw
     + 800px cap keeps it well-sized on both phone portrait and desktop
     landscape viewports. */
}

/* Status text below canvas */
.status {
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: #aaa;
  text-transform: uppercase;
  text-align: center;
  /* ponytail: reserve space for two-line wraps (e.g. long opponent
     name + telegraph phrase on iPhone) so the controls below don't
     shift when text reflows. = 2 × font-size + 2 × letter-spacing. */
  min-height: calc(1em * 1.8 + 0.3em * 2);
  font-weight: 500;
}
.status.alert { color: #ff4a6b; }
.status.good  { color: #7ee8b3; }
.status.gold  { color: #f0d264; }

/* ===== Zone indicators — 3 circles above opponent =====
   Appears during AI_TELEGRAPH. The matching zone lights up +
   pulses. Default state: all dim. */
.zone-indicators {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 14px;
  width: min(800px, 92vw);
}
.zone-indicator {
  flex: 0 1 110px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(20, 20, 26, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  opacity: 0.4;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.zone-indicator.active {
  opacity: 1;
  transform: translateY(-2px) scale(1.05);
  border-color: #ff4a6b;
  background: rgba(255, 74, 107, 0.18);
  box-shadow: 0 0 24px rgba(255, 74, 107, 0.5);
  animation: zonePulse 0.6s ease-in-out infinite;
}
.zone-indicator.hit {
  background: rgba(126, 232, 179, 0.22);
  border-color: #7ee8b3;
  box-shadow: 0 0 24px rgba(126, 232, 179, 0.55);
  animation: zoneHit 0.35s ease-out;
}
.zone-letter {
  font-family: 'Helvetica Neue', sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: #fff;
}
.zone-label {
  font-size: 8px;
  letter-spacing: 0.3em;
  color: #777;
  text-transform: uppercase;
}
.zone-indicator.active .zone-label,
.zone-indicator.active .zone-letter {
  color: #fff;
}
@keyframes zonePulse {
  0%, 100% { transform: translateY(-2px) scale(1.05); }
  50%      { transform: translateY(-4px) scale(1.08); }
}
@keyframes zoneHit {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* Hit-flash on blood bars: brief bump when blood:changed fires */
.blood-bar.hit {
  animation: bloodHit 0.4s ease-out;
}
@keyframes bloodHit {
  0%   { transform: scaleY(1); }
  35%  { transform: scaleY(1.25); }
  100% { transform: scaleY(1); }
}

/* Body shake — when player gets hit. Triggered by JS adding .shake class.
   Uses side-to-side translation that decays naturally. */
body.shake {
  animation: bodyShake 0.38s ease-out;
}
@keyframes bodyShake {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-7px); }
  40%  { transform: translateX(5px); }
  60%  { transform: translateX(-3px); }
  80%  { transform: translateX(2px); }
  100% { transform: translateX(0); }
}

/* ===== Button rows (Defend + Attack) ===== */
.controls {
  width: min(800px, 92vw);
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.control-row-label {
  font-size: 9px;
  letter-spacing: 0.3em;
  color: #444;
  text-transform: uppercase;
  text-align: center;
}
.control-row {
  display: flex;
  gap: 10px;
  width: 100%;
}
.btn-def, .btn-atk {
  flex: 1;
  min-height: 56px;
  border-radius: 14px;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: clamp(11px, 3vw, 14px);
  border: 1px solid rgba(255,255,255,0.1);
  background: #16161a;
  color: #e8e8e8;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn-def:active, .btn-atk:active {
  transform: scale(0.96);
  background: #1f1f25;
  border-color: #fff;            /* bright border during press */
  box-shadow: 0 0 14px rgba(255,255,255,0.18);
}
.btn-def:disabled, .btn-atk:disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
}

/* Hover highlight — match the btn-move:hover style (border + bright text).
   :hover fires on mouseover on desktop and on first tap-then-release on
   touch devices (no continuous hover state). */
.btn-def:hover, .btn-atk:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.35);
  background: #1c1c22;
}

/* Defend = green tint, Attack = orange tint */
.btn-def { color: #7ee8b3; border-color: rgba(126,232,179,0.18); }
.btn-atk { color: #ff9b6e; border-color: rgba(255,155,110,0.18); }
.btn-def:active { background: rgba(126,232,179,0.12); }
.btn-atk:active { background: rgba(255,155,110,0.12); }

/* Counter window open: attack buttons glow gold */
body.counter-window .btn-atk {
  border-color: #f0d264;
  box-shadow: 0 0 24px rgba(240, 210, 100, 0.4), inset 0 0 12px rgba(240, 210, 100, 0.15);
  background: linear-gradient(135deg, #16161a 0%, #2a2410 100%);
  color: #f0d264;
  animation: counterPulse 0.7s ease-in-out infinite;
}
@keyframes counterPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(240, 210, 100, 0.4), inset 0 0 12px rgba(240, 210, 100, 0.15); }
  50%      { box-shadow: 0 0 36px rgba(240, 210, 100, 0.7), inset 0 0 18px rgba(240, 210, 100, 0.25); }
}

/* Defend buttons greyed during AI attack window (waiting for player); enabled in defend phase */
body.phase-ai-telegraph .btn-def { opacity: 0.4; }
body.phase-counter .btn-def { opacity: 0.4; pointer-events: none; }

/* ===== Home button (mirrors arrow-escape pattern) =====
   Safe-area-aware: the top/left use env(safe-area-inset-*) so the
   button clears the iOS status bar / Dynamic Island. The env() values
   resolve to 0 on desktop browsers and Android, so the desktop
   position is unchanged (top:12px, left:12px). */
/* ===== Home / Main Menu / Career — top-left cluster ===== */
/* ponytail: pill bar replaces 3 hand-offset fixed buttons. Width follows
   content (no ~38px guesses that break under iOS dynamic-type).
   z-index 9999 = the stacking context sits above .start-page (z-index
   100) so the Home pill is visible/tappable on the Ringside start
   page too. Earlier commits tried to raise only the inner #btnHomeGame
   to 9999, but #btnHomeGame lives INSIDE this div which has its own
   stacking context (position:fixed + z-index:50) — a child's z-index
   can't escape its parent's stacking layer in the root. So the parent
   itself has to be raised. This also keeps in-game Menu/Career above
   the start overlay (they're hidden on start page via display:none on
   body:not(.game-active), so the high z-index is harmless there). */
.top-bar-left {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: calc(env(safe-area-inset-left, 0px) + 12px);
  z-index: 9999;
  display: flex;
  gap: 8px;
  align-items: center;
}
.btn-home, .btn-menu, .btn-career {
  background: rgba(22, 22, 26, 0.7);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  color: #aaa;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn-home:hover, .btn-menu:hover, .btn-career:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}
/* Career — amber accent so the new affordance stands out */
.btn-career {
  color: #ffc857;
  border-color: rgba(255, 200, 87, 0.35);
}
.btn-career:hover {
  background: rgba(255, 200, 87, 0.18);
  border-color: rgba(255, 200, 87, 0.55);
  color: #ffd886;
}
.btn-home svg, .btn-menu svg, .btn-career svg {
  width: 11px;
  height: 11px;
  display: inline-block;
  vertical-align: -1px;
}
body:not(.game-active) #btnMenuGame { display: none; }
body:not(.game-active) #btnCareerGame { display: none; }
body.game-active .start-page { display: none; }
body.game-active .top-bar-left { display: flex; }
/* ponytail: Home button is always-on at top-left (matches arrow-escape /
   slot-machine / block-sprint). It sits INSIDE .top-bar-left alongside
   Menu + Career — the whole .top-bar-left div has z-index 9999 (see rule
   above) so the Home pill is visible/tappable on the start page too.
   Menu + Career are display:none on the start page so only Home is
   seen; in-game all three render. */
#btnHomeGame { z-index: 9999; }

/* ===== Pause button (Phase H.2) — top-right, mirrors Home on left =====
   Sits at the same vertical offset as the Home/Main-Menu pair so the
   top bar reads "Home · Menu" on the left and "Pause" on the right.
   Safe-area-aware: respects iOS status bar / Dynamic Island. */
.btn-pause {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: calc(env(safe-area-inset-right, 0px) + 12px);
  z-index: 50;
  background: rgba(22, 22, 26, 0.7);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #aaa;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn-pause:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}
.btn-pause[aria-pressed="true"] {
  /* Highlighted while the pause overlay is up. */
  color: #f0d264;
  border-color: rgba(240, 210, 100, 0.5);
  background: rgba(240, 210, 100, 0.08);
}
.btn-pause svg {
  width: 11px;
  height: 11px;
  display: inline-block;
  vertical-align: -1px;
}
/* Hide pause on start page; the fight hasn't started yet. */
body:not(.game-active) #btnPauseGame { display: none; }
body.game-active #btnPauseStart  { display: none; }

/* ===== Pause overlay (Phase H.2) =====
   Full-screen modal that freezes the match and gives the player three
   exits: Resume (back to the live fight), Main Menu (Ringside start
   page within the same HTML doc), and Home (Vibe-coding main). Frozen
   match means MatchController.pause() cleared all pending timers and
   rejects defense/counter/duck/strafe input until resume() runs. */
.pause-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 12, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 180;     /* below game-over (200) so a match-end race still
                      surfaces the post-match modal on top. */
  padding: 20px;
  animation: fadeIn 0.25s ease;
}
.pause-overlay.hidden { display: none !important; }
.pause-card {
  width: 100%;
  max-width: 340px;
  background: linear-gradient(180deg, #1c1c24 0%, #15151b 100%);
  border: 1px solid #2a2a34;
  border-radius: 18px;
  padding: 32px 26px 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  text-align: center;
  animation: pausePop 0.32s cubic-bezier(.2,1.4,.4,1);
}
@keyframes pausePop {
  0%   { transform: scale(0.78); opacity: 0; }
  100% { transform: scale(1);    opacity: 1; }
}
.pause-card h2 {
  font-weight: 200;
  font-size: 28px;
  margin-bottom: 4px;
  color: #f0d264;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.pause-sub {
  color: #777;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 26px;
}
.pause-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.pause-actions .btn {
  width: 100%;
  padding: 14px 18px;
  font-size: 12px;
  letter-spacing: 0.22em;
}
.pause-hint {
  font-size: 9px;
  letter-spacing: 0.25em;
  color: #555;
  text-transform: uppercase;
  margin-top: 6px;
}
.pause-hint kbd {
  display: inline-block;
  padding: 1px 6px;
  margin: 0 2px;
  border: 1px solid #333;
  border-radius: 4px;
  font-family: inherit;
  font-size: 9px;
  color: #aaa;
  background: rgba(255, 255, 255, 0.04);
}
/* While paused, dim the controls so it's obvious they're inert. */
body.paused .btn-def,
body.paused .btn-atk,
body.paused .btn-move {
  opacity: 0.4;
  pointer-events: none;
}

/* ===== Mute button (mirrors arrow-escape pattern) ===== */
.btn-mute {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  padding: 6px 10px;
  color: #aaa;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  font-family: inherit;
}
.btn-mute:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}
.btn-mute .icon { width: 14px; height: 14px; display: inline; }
.btn-mute .icon-off { display: none; }
.btn-mute[aria-pressed="true"] .icon-on  { display: none; }
.btn-mute[aria-pressed="true"] .icon-off { display: inline; }
.btn-mute[aria-pressed="true"] { color: #ff4a6b; border-color: rgba(255,74,107,0.4); }

/* ===== Start Page ===== */
.start-page {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, #1a1410 0%, #0a0a0c 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  overflow: hidden;
}
.start-content {
  text-align: center;
  z-index: 2;
  position: relative;
}
.start-title {
  font-weight: 100;
  font-size: clamp(64px, 16vw, 124px);
  letter-spacing: 0.06em;
  line-height: 0.95;
  margin-bottom: 18px;
  color: #fff;
}
.start-title span {
  background: linear-gradient(135deg, #ff9b6e 0%, #ff4a6b 50%, #7ee8b3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.start-tagline {
  color: #555;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  margin-bottom: 50px;
}
.start-buttons {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  border: none;
  padding: 16px 42px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  border-radius: 100px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
  font-family: inherit;
}
.btn-primary {
  background: #fff;
  color: #0a0a0c;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255,255,255,0.18);
}
.btn-secondary {
  background: transparent;
  color: #888;
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-secondary:hover {
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}
.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Decorative SVG gloves on start page */
.start-gloves {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
}
.start-glove {
  position: absolute;
  width: min(360px, 70vw);
  height: min(360px, 70vw);
}
.start-glove.glove-1 { top: 5%;   left: 5%;   transform: rotate(-12deg); }
.start-glove.glove-2 { top: 60%;  right: 5%;  transform: rotate(28deg); }

/* Game-over modal (Phase E) */
.game-over {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 12, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.game-over-card {
  background: #16161a;
  padding: 44px 56px;
  border-radius: 18px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: cardPop 0.5s cubic-bezier(.2,1.4,.4,1);
  max-width: calc(100vw - 40px);
}
@keyframes cardPop {
  0%   { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}
.game-over-card h2 {
  font-weight: 200;
  font-size: 32px;
  margin-bottom: 6px;
  color: #ff4a6b;
  letter-spacing: 0.04em;
}
.game-over-card h2.win {
  color: #7ee8b3;
}
.game-over-card h2.win.champion {
  background: linear-gradient(135deg, #f0d264 0%, #ff9b6e 50%, #c39bff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
  font-size: 44px;
  letter-spacing: 0.1em;
}
.game-over-sub {
  color: #777;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 32px;
}

/* Match stats block — KO counts + final blood */
.game-over-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.stat-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #aaa;
}
.stat-value {
  font-family: 'Helvetica Neue', sans-serif;
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* KO tinting — modal background tints red on loss */
.game-over.ko-loss::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 74, 107, 0.18) 0%, transparent 70%);
  pointer-events: none;
}
.game-over {
  position: fixed;
  inset: 0;
  /* (relative for ::before absolute positioning) */
}
.game-over.win-modal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(126, 232, 179, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

/* ===== Audio hint ===== */
.audio-hint {
  position: fixed;
  top: 60px;  /* sits below the top HUD/home button row */
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.6);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 14px;
  z-index: 100;
  animation: pulse 2s ease-in-out infinite;
  pointer-events: none;
}
.audio-hint.hidden { display: none; }
@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1.0; }
}

/* Mobile small-screen tightening */
@media (max-width: 500px) {
  .hud { gap: 4px; padding: 0 2px; }
  .round-indicator { display: none; }
  .blood-label { font-size: 9px; }
}

/* ===== Phase F.4.1: Distance indicator ===== */
.distance-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #888;
}
.distance-label { color: #555; }
.distance-value {
  color: #7ee8b3;
  font-weight: 700;
  letter-spacing: 0.1em;
  min-width: 36px;
  text-align: center;
  transition: color 0.15s ease;
}
.distance-dots {
  display: flex;
  gap: 4px;
}
.distance-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #222;
  border: 1px solid #444;
  transition: all 0.2s ease;
}
.distance-dot.current {
  background: #ff4a6b;
  border-color: #ff4a6b;
  box-shadow: 0 0 6px rgba(255, 74, 107, 0.5);
  transform: scale(1.2);
}

/* ===== Phase F.4.1 / F.4.2: Move controls ===== */
.btn-move {
  flex: 1;
  padding: 10px 4px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #3a3a48;
  border-radius: 6px;
  color: #aaa;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-move:hover { color: #fff; border-color: #7ee8b3; }
.btn-move:active, .btn-move.pressed {
  background: rgba(126, 232, 179, 0.18);
  color: #fff;
  border-color: #7ee8b3;
  transform: scale(0.96);
}
/* Defend / attack pressed — same transient feedback as btn-move but using
   each button's theme color so green/orange semantics stay readable. */
.btn-def.pressed {
  background: rgba(126, 232, 179, 0.22);
  color: #fff;
  border-color: #7ee8b3;
  transform: scale(0.96);
  box-shadow: 0 0 12px rgba(126, 232, 179, 0.3);
}
.btn-atk.pressed {
  background: rgba(255, 155, 110, 0.22);
  color: #fff;
  border-color: #ff9b6e;
  transform: scale(0.96);
  box-shadow: 0 0 12px rgba(255, 155, 110, 0.3);
}
.btn-move:disabled { opacity: 0.4; cursor: not-allowed; }
#btnDuck.active {
  background: rgba(240, 210, 100, 0.25);
  color: #f0d264;
  border-color: #f0d264;
  box-shadow: 0 0 12px rgba(240, 210, 100, 0.3);
}

/* ===== Phase F.2: Career panel ===== */
.career-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 12, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 20px;
}
.career-panel.hidden { display: none; }

.career-panel-card {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(180deg, #1c1c24 0%, #15151b 100%);
  border: 1px solid #2a2a34;
  border-radius: 18px;
  padding: 24px 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.career-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.career-panel-label {
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #888;
}
.career-panel-close {
  background: none;
  border: 0;
  color: #888;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}
.career-panel-close:hover { color: #fff; }

.career-panel-opp {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.career-panel-name {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}
.career-panel-difficulty {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: #ff4a6b;
  padding: 3px 8px;
  border: 1px solid #ff4a6b;
  border-radius: 4px;
}

.career-panel-intro {
  font-size: 13px;
  font-style: italic;
  color: #aaa;
  line-height: 1.4;
  margin-bottom: 18px;
  min-height: 36px;
}

.career-panel-ladder {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 20px;
}
.career-ladder-dot {
  flex: 1;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #444;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  position: relative;
  transition: all 0.2s ease;
}
.career-ladder-dot.cleared {
  background: rgba(126, 232, 179, 0.15);
  border-color: #7ee8b3;
  opacity: 0.6;
}
/* Revist = previously-reached position the cursor moved away from
   (e.g. player beat Ted → was at Bruno cursor → rematched Ted back
   to cursor 0). Distinct from .cleared (beaten) — visually a warm
   amber to say "you've been here, you can return", not "you've
   won this". Clickable for re-encounter. */
.career-ladder-dot.revisit {
  background: rgba(255, 200, 87, 0.16);
  border-color: #ffc857;
  opacity: 0.78;
}
.career-ladder-dot.current {
  background: rgba(255, 74, 107, 0.18);
  border-width: 2px;
  box-shadow: 0 0 16px rgba(255, 74, 107, 0.4);
  transform: scale(1.06);
}
/* Clickable = a previously-beaten opponent (cleared) OR a
   previously-reached opponent the cursor has moved away from
   (revisit). The dot keeps its base tint (green for cleared, amber
   for revisit) but adds cursor + hover lift so it's obviously
   tappable. On touch (no hover), the existing background tint
   already reads as "active / re-enterable". */
.career-ladder-dot.clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.career-ladder-dot.cleared.clickable:hover {
  background: rgba(126, 232, 179, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(126, 232, 179, 0.25);
}
.career-ladder-dot.cleared.clickable:focus-visible {
  outline: 2px solid #7ee8b3;
  outline-offset: 2px;
}
.career-ladder-dot.revisit.clickable:hover {
  background: rgba(255, 200, 87, 0.32);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 200, 87, 0.28);
}
.career-ladder-dot.revisit.clickable:focus-visible {
  outline: 2px solid #ffc857;
  outline-offset: 2px;
}
.career-ladder-tag {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.05em;
}

.career-panel-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.career-panel-stat {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #2a2a34;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.career-panel-stat-label {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: #888;
  text-transform: uppercase;
}
.career-panel-stat-value {
  font-size: 14px;
  color: #fff;
  font-weight: 600;
}
.career-panel-vibrate {
  font-size: 11px;
  font-weight: 400;
  color: #aaa;
  line-height: 1.3;
}

.career-panel-actions {
  display: flex;
  gap: 10px;
}
.career-panel-actions .btn {
  flex: 1;
  padding: 12px;
  font-size: 13px;
  letter-spacing: 0.05em;
}

/* ponytail: lang toggle pill — top-center, always visible. Replaces
   the previous start-page .btn-lang-start + in-game bottom-right
   .btn-lang-game pair with a single canonical pill that sits above
   the top-bar clusters (y=4 vs y=12) so it never collides with
   Home/Menu/Career/Pause. */
.btn-lang-top {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 4px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 24, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #f4f4f5;
  font: 600 11px/1 -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang HK', sans-serif;
  letter-spacing: 0.12em;
  padding: 5px 12px;
  min-height: 28px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn-lang-top:active { transform: translateX(-50%) scale(0.96); }
.btn-lang-top:hover { background: rgba(40, 40, 48, 0.92); }
