/* ================================================================
   1v1 ARENA — Full match experience
   Sits BELOW the site header (top: 56px) matching site column layout
   ================================================================ */

/* ── Overlay shell ─────────────────────────────────────────────── */
#arena-overlay {
  position: fixed;
  top: 56px;           /* clears the sticky site-header exactly */
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;         /* below header's z-index:100 so logo stays visible */
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
#arena-overlay.arena-open {
  opacity: 1;
  pointer-events: all;
}

/* ── Screen container ──────────────────────────────────────────── */
.arena-screen {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* Pad bottom for bottom-nav */
  padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px));
}
.arena-screen.arena-active {
  display: flex;
}

/* ── Centered column — matches .v1-wrap on all other pages ──────── */
.arena-col {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Back / close button ────────────────────────────────────────── */
.arena-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  margin-bottom: 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.arena-back:hover { color: var(--green); }
.arena-back svg { display: block; flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════════
   SCREEN 1 — MODE SELECT
   ════════════════════════════════════════════════════════════════ */
#scr-mode {
  background: var(--bg);
}
.mode-inner {
  display: flex;
  flex-direction: column;
  padding: 20px 0 0;
}

.arena-logo-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  background: rgba(0,200,83,0.08);
  border: 1px solid rgba(0,200,83,0.18);
  border-radius: 20px;
  padding: 5px 12px;
  margin-bottom: 20px;
  align-self: flex-start;
}
.arena-live-pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(0,200,83,0.6);
  animation: arena-pip 1.5s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes arena-pip {
  0%   { box-shadow: 0 0 0 0   rgba(0,200,83,0.6); }
  70%  { box-shadow: 0 0 0 7px rgba(0,200,83,0); }
  100% { box-shadow: 0 0 0 0   rgba(0,200,83,0); }
}

.arena-mode-title {
  font-size: clamp(1.75rem, 5vw, 2.4rem);
  font-weight: 900;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.arena-mode-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-weight: 600;
}

.arena-mode-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.arena-mode-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), border-color var(--transition), transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.arena-mode-btn:active { transform: scale(0.98); }
.arena-mode-btn:hover:not(:disabled) {
  background: var(--bg-card2);
  border-color: rgba(255,255,255,0.15);
}
.arena-mode-btn--quick  { border-left: 3px solid var(--green); }
.arena-mode-btn--ranked { border-left: 3px solid #f5a623; }
.arena-mode-btn--soon   { opacity: 0.42; cursor: default; }

.arena-mode-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.arena-mode-btn--quick  .arena-mode-icon { background: rgba(0,200,83,0.12); }
.arena-mode-btn--ranked .arena-mode-icon { background: rgba(245,166,35,0.12); }
.arena-mode-btn--soon   .arena-mode-icon { background: rgba(255,255,255,0.05); }

.arena-mode-icon svg { display: block; }

.arena-mode-text { flex: 1; min-width: 0; }
.arena-mode-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}
.arena-mode-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
}
.arena-mode-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}
.arena-soon-chip {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: rgba(255,255,255,0.07);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}

/* ════════════════════════════════════════════════════════════════
   SCREEN 2 — MATCHMAKING
   ════════════════════════════════════════════════════════════════ */
#scr-matchmaking {
  background: var(--bg);
}
.mm-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 0 0;
}

.mm-vs-row {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 36px;
  width: 100%;
  justify-content: center;
}
.mm-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 130px;
}
.mm-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
}
.mm-avatar--you   { border-color: rgba(0,200,83,0.45); background: rgba(0,200,83,0.08); }
.mm-avatar--opp   { border-color: var(--border); }
.mm-avatar-inner  { font-size: 1.6rem; line-height: 1; }
.mm-avatar-search-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--green);
  animation: arena-spin 0.85s linear infinite;
  display: none;
}
.mm-avatar--searching .mm-avatar-inner  { opacity: 0.28; }
.mm-avatar--searching .mm-avatar-search-ring { display: block; }
@keyframes arena-spin { to { transform: rotate(360deg); } }

.mm-player-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text);
}
.mm-player-elo {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: -6px;
}
.mm-vs-divider {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text-muted);
  flex-shrink: 0;
}

.mm-status-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.mm-status-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 24px;
}
.mm-dots { margin-bottom: 24px; }
.mm-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin: 0 3px;
  animation: mm-bounce 1.2s ease-in-out infinite;
}
.mm-dots span:nth-child(2) { animation-delay: 0.2s; }
.mm-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes mm-bounce {
  0%, 80%, 100% { transform: scale(0.55); opacity: 0.35; }
  40%            { transform: scale(1);    opacity: 1; }
}
.mm-cancel-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 28px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  -webkit-tap-highlight-color: transparent;
  width: 100%;
}
.mm-cancel-btn:hover { background: var(--bg-card2); color: var(--text); }

/* ════════════════════════════════════════════════════════════════
   SCREEN 3 — PRE-MATCH
   ════════════════════════════════════════════════════════════════ */
#scr-prematch {
  background: var(--bg);
}
.pm-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 0 0;
}
#scr-prematch .arena-back,
#scr-matchmaking .arena-back {
  align-self: flex-start;
  margin-bottom: 8px;
}

.pm-found-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  background: rgba(0,200,83,0.08);
  border: 1px solid rgba(0,200,83,0.2);
  border-radius: 20px;
  padding: 5px 12px;
  margin-bottom: 22px;
}

.pm-vs-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  width: 100%;
  justify-content: center;
}
.pm-player {
  flex: 1;
  max-width: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.pm-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.pm-avatar--you {
  background: rgba(0,200,83,0.1);
  border: 2px solid rgba(0,200,83,0.4);
}
.pm-avatar--opp {
  background: rgba(255,90,90,0.08);
  border: 2px solid rgba(255,90,90,0.3);
}
.pm-player-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text);
}
.pm-player-elo {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: -4px;
}
.pm-vs-text {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Prize */
.pm-prize {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(245,166,35,0.08);
  border: 1px solid rgba(245,166,35,0.2);
  border-radius: var(--radius);
  padding: 10px 18px;
  margin-bottom: 22px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #f5a623;
  width: 100%;
  justify-content: center;
}
.pm-prize svg { flex-shrink: 0; }

/* Category roulette */
.pm-roulette-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  align-self: flex-start;
}
.pm-roulette-stage {
  width: 100%;
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  overflow: hidden;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}
.pm-roulette-stage.pm-roulette--locked {
  border-color: rgba(0,200,83,0.55);
  box-shadow: 0 0 0 3px rgba(0,200,83,0.10), inset 0 0 24px rgba(0,200,83,0.05);
}
.pm-roulette-cur {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
  text-align: center;
  will-change: transform, opacity;
}
.pm-roulette--locked .pm-roulette-cur {
  color: var(--green);
}
@keyframes pm-reel-flip {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}
.pm-roulette-flip {
  animation: pm-reel-flip 0.13s ease-out forwards;
}

.pm-start-btn {
  background: var(--green);
  color: #000;
  border: none;
  border-radius: var(--radius);
  padding: 15px;
  font-size: 0.95rem;
  font-weight: 900;
  cursor: pointer;
  width: 100%;
  transition: opacity var(--transition), transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.02em;
}
.pm-start-btn:hover  { opacity: 0.88; }
.pm-start-btn:active { transform: scale(0.98); }

/* Countdown */
.pm-countdown { display: none; flex-direction: column; align-items: center; }
.pm-countdown.pm-show { display: flex; }
.pm-cd-number {
  font-size: clamp(4.5rem, 20vw, 7rem);
  font-weight: 900;
  color: var(--green);
  line-height: 1;
  letter-spacing: -0.03em;
  animation: pm-cd-pop 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.pm-cd-kickoff {
  font-size: clamp(1.6rem, 5.5vw, 2.4rem);
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.04em;
  animation: pm-cd-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes pm-cd-pop {
  from { transform: scale(1.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ════════════════════════════════════════════════════════════════
   SCREEN 4 — LIVE MATCH
   ════════════════════════════════════════════════════════════════ */
#scr-match {
  background: var(--bg);
  padding-bottom: 0; /* scoreboard is sticky, inner scrolls */
}

/* ── Scoreboard ─────────────────────────────────────────────────── */
.match-scoreboard {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
}
.match-scoreboard::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(0,200,83,0.35) 50%, transparent 100%);
}
.match-sb-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sb-player { flex: 1; min-width: 0; }
.sb-player--you { text-align: left; }
.sb-player--opp { text-align: right; }
.sb-name {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-status {
  font-size: 0.65rem;
  font-weight: 700;
  display: block;
  min-height: 1em;
  color: var(--text-muted);
}
.sb-status--answered { color: var(--green); }

.sb-score-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
}
.sb-scoreline {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sb-goal {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  min-width: 22px;
  text-align: center;
}
.sb-divider {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text-muted);
}
.sb-q-info {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Timer bar ──────────────────────────────────────────────────── */
.match-timer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.match-timer-inner {
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 16px 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.match-timer-track {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
}
.match-timer-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 1s linear, background 0.3s;
}
.match-timer-fill--warn { background: #f5a623; }
.match-timer-fill--crit { background: #e0324a; }
.match-timer-num {
  font-size: 0.88rem;
  font-weight: 900;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 16px;
  text-align: right;
}

/* ── Question body ──────────────────────────────────────────────── */
.match-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
}
.match-body-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 16px 0;
}

.match-q-type-tag {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.match-q-text {
  font-size: clamp(1rem, 3.2vw, 1.15rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 18px;
}

/* ── Options ────────────────────────────────────────────────────── */
.match-options {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 14px;
}
.match-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  transition: background var(--transition), border-color var(--transition), transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  min-height: 48px;
}
.match-opt:active { transform: scale(0.98); }
.match-opt:hover:not(:disabled) {
  background: var(--bg-card2);
  border-color: rgba(255,255,255,0.16);
}
.match-opt:disabled { cursor: default; }
.match-opt--selected {
  background: rgba(0,200,83,0.08);
  border-color: rgba(0,200,83,0.4);
}
.match-opt--correct {
  background: rgba(0,200,83,0.1);
  border-color: var(--green);
  color: var(--green);
}
.match-opt--wrong {
  background: rgba(224,50,74,0.07);
  border-color: rgba(224,50,74,0.3);
  color: var(--text-muted);
}
.match-opt-key {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
  color: var(--text-muted);
}
.match-opt--selected .match-opt-key,
.match-opt--correct  .match-opt-key { background: rgba(0,200,83,0.15); border-color: rgba(0,200,83,0.35); color: var(--green); }
.match-opt--wrong    .match-opt-key { background: rgba(224,50,74,0.1); border-color: transparent; }

/* ── Number input ───────────────────────────────────────────────── */
.match-number-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.match-number-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 15px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  font-family: inherit;
  transition: border-color var(--transition);
  -webkit-appearance: none;
}
.match-number-input:focus {
  outline: none;
  border-color: rgba(0,200,83,0.45);
}
.match-number-submit {
  background: var(--green);
  color: #000;
  border: none;
  border-radius: var(--radius);
  padding: 0 22px;
  font-size: 0.88rem;
  font-weight: 900;
  cursor: pointer;
  font-family: inherit;
  transition: opacity var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.match-number-submit:hover { opacity: 0.88; }

/* ── Events feed ────────────────────────────────────────────────── */
.match-events {
  margin-top: 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.match-events-title {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.match-event {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  animation: ev-slide 0.28s ease-out both;
}
@keyframes ev-slide {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.match-event--goal  { color: var(--green); }
.match-event--miss  { color: var(--text-muted); }
.match-event-icon   { font-size: 0.85rem; flex-shrink: 0; }
.match-event-min    { font-size: 0.68rem; color: var(--text-muted); min-width: 26px; }

/* ════════════════════════════════════════════════════════════════
   SCREEN 5 — ROUND RESULT
   ════════════════════════════════════════════════════════════════ */
#scr-round {
  background: var(--bg);
}
.round-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 0 0;
}

.round-anim-text {
  font-size: clamp(2.4rem, 9vw, 3.8rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  animation: round-pop 0.42s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
.round-anim-text--goal  { color: var(--green); }
.round-anim-text--miss  { color: var(--text-muted); }
.round-anim-text--save  { color: #4d9fff; }
@keyframes round-pop {
  from { transform: scale(0.5) rotate(-2deg); opacity: 0; }
  to   { transform: scale(1)   rotate(0deg);  opacity: 1; }
}
.round-anim-sub {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.round-result-row {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  width: 100%;
}
.round-player-result {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
}
.round-player-result--correct {
  background: rgba(0,200,83,0.07);
  border-color: rgba(0,200,83,0.25);
}
.round-player-result--wrong {
  background: rgba(224,50,74,0.05);
  border-color: rgba(224,50,74,0.18);
}
.round-pr-icon { font-size: 1.2rem; margin-bottom: 4px; display: block; }
.round-pr-name { font-size: 0.68rem; font-weight: 800; color: var(--text-muted); display: block; margin-bottom: 2px; }
.round-pr-ans  { font-size: 0.8rem;  font-weight: 700; color: var(--text);       display: block; }

.round-score-display {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.round-score-num {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.round-score-sep { font-size: 1.1rem; font-weight: 900; color: var(--text-muted); }

.round-fact {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  max-width: 340px;
  line-height: 1.55;
}

/* Progress bar auto-continue */
.round-continue-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--bg-card);
}
.round-continue-fill {
  height: 100%;
  background: var(--green);
  width: 100%;
  animation: round-countdown 2.2s linear forwards;
}
@keyframes round-countdown {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ════════════════════════════════════════════════════════════════
   SCREEN 6 — FULL TIME
   ════════════════════════════════════════════════════════════════ */
#scr-fulltime {
  background: var(--bg);
}
.ft-inner {
  display: flex;
  flex-direction: column;
  padding: 16px 0 0;
  gap: 0;
}

/* ── Top action bar ──────────────────────────────────────────────── */
.ft-top-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}
.ft-top-btn {
  padding: 11px 6px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: opacity var(--transition), transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}
.ft-top-btn:active { transform: scale(0.97); }
.ft-top-btn--play {
  background: var(--green);
  color: #000;
}
.ft-top-btn--play:hover { opacity: 0.88; }
.ft-top-btn--quit {
  background: rgba(224,50,74,0.1);
  border: 1px solid rgba(224,50,74,0.25);
  color: #e0324a;
}
.ft-top-btn--quit:hover { background: rgba(224,50,74,0.16); }

/* ── VS header ───────────────────────────────────────────────────── */
.ft-vs-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 16px;
  margin-bottom: 12px;
}
.ft-score-main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.ft-vs-player {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ft-vs-player--you { align-items: flex-start; }
.ft-vs-player--opp { align-items: flex-end; }
.ft-vs-name {
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}
.ft-vs-elo {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}
.ft-vs-center {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ft-vs-score-you,
.ft-vs-score-opp {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ft-score-dash {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
}
.ft-result-text {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  text-align: center;
}
.ft-result-text--win  { color: var(--green); }
.ft-result-text--loss { color: #e0324a; }
.ft-result-text--draw { color: #f5a623; }
.ft-box-title {
  display: block;
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 10px 14px 0;
}

/* ── ELO chip ────────────────────────────────────────────────────── */
.ft-elo-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.ft-elo-chip--up   { background: rgba(0,200,83,0.08);  border: 1px solid rgba(0,200,83,0.22);   color: var(--green); }
.ft-elo-chip--down { background: rgba(224,50,74,0.07); border: 1px solid rgba(224,50,74,0.2);   color: #e0324a; }
.ft-elo-chip--same { background: var(--bg-card);       border: 1px solid var(--border);          color: var(--text-muted); }

/* ── Stats ───────────────────────────────────────────────────────── */
.ft-stats {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
}
.ft-stats-header {
  padding: 8px 14px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.ft-stats-header span:last-child { text-align: right; }
.ft-stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  padding: 9px 14px;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.ft-stat-row:last-child { border-bottom: none; }
.ft-stat-you {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text);
  text-align: left;
}
.ft-stat-opp {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-muted);
  text-align: right;
}
.ft-stat-you--best { color: var(--green); }
.ft-stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

/* ── Timeline ────────────────────────────────────────────────────── */
.ft-timeline {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.ft-tl-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.ft-tl-hdr-you,
.ft-tl-hdr-opp,
.ft-tl-hdr-min {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ft-tl-hdr-you { text-align: left; }
.ft-tl-hdr-min { text-align: center; min-width: 32px; }
.ft-tl-hdr-opp { text-align: right; }

.ft-tl-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 8px 14px;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.ft-tl-row:last-child { border-bottom: none; }

.ft-tl-you {
  font-size: 0.8rem;
  font-weight: 700;
  text-align: left;
}
.ft-tl-opp {
  font-size: 0.8rem;
  font-weight: 700;
  text-align: right;
}
.ft-tl-goal { color: var(--green); }
.ft-tl-miss { color: var(--text-muted); }
.ft-tl-min {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-align: center;
  min-width: 32px;
  font-variant-numeric: tabular-nums;
}

/* ════════════════════════════════════════════════════════════════
   SCREEN 7 — LEADERBOARD
   ════════════════════════════════════════════════════════════════ */
#scr-leaderboard {
  background: var(--bg);
}
.lb-inner { padding: 20px 0 0; }

.lb-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 4px;
}
.lb-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 20px;
}

.lb-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.lb-tab {
  padding: 9px 16px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
  -webkit-tap-highlight-color: transparent;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}
.lb-tab.lb-tab-active { color: var(--green); border-bottom-color: var(--green); }

.lb-table { display: flex; flex-direction: column; }

/* Column header row — aligns with .lb-row layout */
.lb-col-hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.lb-col-hdr-rank  { min-width: 26px; }       /* matches .lb-rank */
.lb-col-hdr-spacer { flex: 1; }              /* matches avatar + info stretching */
.lb-col-hdr-elo {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 36px;          /* matches .lb-elo min-width */
  text-align: right;
}
.lb-col-hdr-wr {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 36px;          /* matches .lb-winrate min-width */
  text-align: right;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.lb-row:last-child { border-bottom: none; }
.lb-row--me { background: rgba(0,200,83,0.04); margin: 0 -16px; padding: 11px 16px; border-radius: 0; }

.lb-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 32px 0;
}

.lb-rank {
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--text-muted);
  min-width: 26px;
  text-align: center;
}
.lb-rank--1 { color: #f5c842; }
.lb-rank--2 { color: #c0c8d8; }
.lb-rank--3 { color: #cd7f32; }

.lb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 900;
  color: var(--text-muted);
  flex-shrink: 0;
}
.lb-info { flex: 1; min-width: 0; }
.lb-username {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-wins {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
}
.lb-elo {
  font-size: 0.88rem;
  font-weight: 900;
  color: var(--green);
  flex-shrink: 0;
}
.lb-winrate {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 36px;
  text-align: right;
}

/* ── Goal flash ─────────────────────────────────────────────────── */
#arena-goal-flash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}
#arena-goal-flash.flash-active {
  animation: goal-flash 0.55s ease-out forwards;
}
@keyframes goal-flash {
  0%   { opacity: 1; background: rgba(0,200,83,0.22); }
  100% { opacity: 0; background: transparent; }
}
.goal-flash-text {
  font-size: clamp(2.5rem, 10vw, 4.5rem);
  font-weight: 900;
  color: var(--text);
  text-shadow: 0 0 32px rgba(0,200,83,0.7);
  letter-spacing: -0.02em;
  animation: goal-text-pop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
@keyframes goal-text-pop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
