/* ── Flag wave animation ─────────────────────────────────────────────────── */
.team-flag {
  display: inline-block;
  width: 36px;
  height: 24px;
  object-fit: cover;
  border-radius: 3px;
  margin-right: 7px;
  vertical-align: middle;
  box-shadow: 0 1px 5px rgba(0,0,0,0.5);
  animation: flag-wave 2.2s ease-in-out infinite;
  transform-origin: left center;
  transform-style: preserve-3d;
}
@keyframes flag-wave {
  0%   { transform: perspective(120px) rotateY(0deg)   scaleY(1);    }
  20%  { transform: perspective(120px) rotateY(-12deg) scaleY(0.97); }
  40%  { transform: perspective(120px) rotateY(0deg)   scaleY(1);    }
  60%  { transform: perspective(120px) rotateY(12deg)  scaleY(0.97); }
  80%  { transform: perspective(120px) rotateY(0deg)   scaleY(1);    }
  100% { transform: perspective(120px) rotateY(0deg)   scaleY(1);    }
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:      #00b04f;
  --green-dark: #007a36;
  --green-dim:  #00b04f22;
  --gold:       #f0c040;
  --red:        #e03030;
  --bg:         #0d1117;
  --bg2:        #161b22;
  --bg3:        #21262d;
  --border:     #30363d;
  --text:       #e6edf3;
  --text-dim:   #8b949e;
  --radius:     12px;
  --shadow:     0 4px 24px #0006;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.hidden { display: none !important; }

/* ── Login ───────────────────────────────────────────────────────────────── */
#login-screen, #password-gate-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #003d1a 0%, var(--bg) 70%);
  padding: 24px;
}

.login-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-logo { font-size: 64px; margin-bottom: 12px; }
.login-box h1 { font-size: 26px; font-weight: 700; color: var(--green); }
.login-box .subtitle { color: var(--text-dim); margin-bottom: 28px; font-size: 14px; }

.lang-switch-wrap {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.lang-switch-btn {
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  min-width: 44px;
  padding: 5px 10px;
  cursor: pointer;
}

.lang-switch-btn:hover {
  border-color: var(--green);
  color: var(--green);
}

/* ── Avatars ─────────────────────────────────────────────────────────────── */
.avatar-img {
  border-radius: 50%;
  object-fit: cover;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.avatar-fallback {
  border-radius: 50%;
  background: var(--green-dim);
  color: var(--green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  vertical-align: middle;
}
#user-avatar-wrap { cursor: pointer; display: flex; align-items: center; }

/* ── Header ──────────────────────────────────────────────────────────────── */
#app-screen { display: flex; flex-direction: column; min-height: 100vh; }

header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
}

.header-row h1 { font-size: 17px; font-weight: 700; color: var(--green); }
.header-user { display: flex; align-items: center; gap: 8px; }
.header-user span { font-size: 13px; color: var(--text-dim); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── News ticker — wheel of luck / FTC / match-score notifications only ──── */
/* Vertical marquee: messages are centered and continuously float from the
   bottom edge up and out the top, instead of the old horizontal left-right scroll. */
.news-ticker {
  direction: rtl;
  background: var(--gold);
  border-top: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  overflow: hidden;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px #f0c04055;
}

.news-ticker-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  animation: news-ticker-scroll-up 40s linear infinite;
  will-change: transform;
}
.news-ticker-track:hover { animation-play-state: paused; }

.news-ticker-item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  width: 100%;
  box-sizing: border-box;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 700;
  color: #1a1500;
  text-align: center;
}

@keyframes news-ticker-scroll-up {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}

/* ── Wheel of Luck announcement strip (shown while wheel is disabled) ────── */
.wheel-announce-strip {
  background: linear-gradient(90deg, #12050a 0%, #2a0a18 40%, #2a0a18 60%, #12050a 100%);
  border-top: 1px solid #c0205555;
  border-bottom: 1px solid #c0205555;
  padding: 8px 14px 6px;
  text-align: center;
}
.wheel-announce-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.wheel-announce-icon {
  font-size: 16px;
}
.wheel-announce-title {
  font-size: 12px;
  font-weight: 700;
  color: #f0c040;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.wheel-announce-countdown {
  font-size: 16px;
  font-weight: 800;
  color: #ff6b6b;
  letter-spacing: 3px;
  font-variant-numeric: tabular-nums;
  min-width: 75px;
  text-align: center;
  background: #2a0505;
  border: 1px solid #c0205577;
  border-radius: 6px;
  padding: 1px 8px;
}
.wheel-announce-warning {
  font-size: 11px;
  color: #e07070;
  letter-spacing: 0.2px;
  opacity: 0.9;
}
.wheel-announce-gift {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.wheel-announce-gift .wheel-announce-title {
  color: #7ee8a2;
  white-space: normal;
  text-align: center;
}
.wheel-announce-gift strong { color: #fff; }

/* ── Wheel of Luck strip ─────────────────────────────────────────────────── */
.wheel-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 16px;
  background: linear-gradient(90deg, #1a1200 0%, #2a1f00 50%, #1a1200 100%);
  border-top: 1px solid #f0c04033;
  border-bottom: 1px solid #f0c04033;
  text-align: center;
}
.wheel-strip-label {
  font-size: 12px;
  color: #c9a030;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.wheel-strip-timer {
  font-size: 15px;
  font-weight: 800;
  color: #f0c040;
  letter-spacing: 3px;
  font-variant-numeric: tabular-nums;
  min-width: 72px;
  text-align: center;
}

/* ── Tab bar ─────────────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  border-top: 1px solid var(--border);
}

.tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 10px 4px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .2s;
}

.tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
  font-weight: 600;
}

/* ── "Who Wins?" tab highlight: draws the eye while it's not the open tab,
   calms down once selected (matches .tab.active's own green/no-animation). ── */
.tab-highlight {
  position: relative;
  color: var(--gold);
  animation: tab-highlight-pulse 2s ease-in-out infinite;
}

.tab-highlight.active {
  color: var(--green);
  animation: none;
}

@keyframes tab-highlight-pulse {
  0%, 100% { text-shadow: 0 0 0 transparent; }
  50%      { text-shadow: 0 0 8px #f0c04099; }
}

.tab-highlight::after {
  content: '';
  position: absolute;
  top: 4px;
  inset-inline-end: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: tab-highlight-badge-ping 1.6s ease-out infinite;
}

.tab-highlight.active::after { display: none; }

@keyframes tab-highlight-badge-ping {
  0%   { box-shadow: 0 0 0 0 #f0c04099; }
  70%  { box-shadow: 0 0 0 7px #f0c04000; }
  100% { box-shadow: 0 0 0 0 #f0c04000; }
}

@media (prefers-reduced-motion: reduce) {
  .tab-highlight, .tab-highlight::after {
    animation: none;
  }
}

/* ── "Who Wins?" content banner ─────────────────────────────────────────── */
.bracket-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 10px;
  border: 1px solid #f0c04044;
  background: linear-gradient(120deg, #f0c04022, #f0c04008, #f0c04022);
  background-size: 200% 100%;
  animation: bracket-hero-sweep 4s linear infinite;
}

.bracket-hero-crown {
  font-size: 22px;
  animation: bracket-hero-crown-bounce 1.8s ease-in-out infinite;
}

.bracket-hero-title {
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(90deg, var(--gold), #fff6d8, var(--gold));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: bracket-hero-text-shine 3s linear infinite;
}

@keyframes bracket-hero-sweep {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes bracket-hero-crown-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25%      { transform: translateY(-3px) rotate(-8deg); }
  75%      { transform: translateY(-1px) rotate(8deg); }
}

@keyframes bracket-hero-text-shine {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

@media (prefers-reduced-motion: reduce) {
  .bracket-hero, .bracket-hero-crown, .bracket-hero-title {
    animation: none;
  }
}

/* ── Main content ────────────────────────────────────────────────────────── */
.tab-content { display: none; flex: 1; padding: 16px; }
.tab-content.active { display: block; }

/* ── Inputs / Buttons ────────────────────────────────────────────────────── */
input, select, textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 14px;
  font-size: 15px;
  margin-bottom: 10px;
  outline: none;
  transition: border-color .2s;
}
input:focus, select:focus { border-color: var(--green); }
select option { background: var(--bg3); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--green); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--green-dark); }
.btn-sm { padding: 6px 12px; font-size: 13px; width: auto; }
.btn-danger { background: var(--red); color: #fff; }
.btn-ghost { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-icon { background: none; border: none; color: var(--text-dim); font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.btn-icon:hover { background: var(--bg3); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

/* ── Game card ───────────────────────────────────────────────────────────── */
.game-card { overflow: hidden; }

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.game-stage {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-dim);
  background: var(--bg3);
  padding: 2px 8px;
  border-radius: 20px;
}

.game-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.status-upcoming { background: var(--green-dim); color: var(--green); }
.status-live     { background: #ff3b3022; color: #ff6b6b; }
.status-finished { background: #ffffff11; color: var(--text-dim); }
.status-pending  { background: #ffb02022; color: #ffb020; }

/* Live score shown inside game card */
.live-score-display {
  color: #ff4444;
  font-weight: 700;
  font-size: 15px;
}
.live-score-display .live-clock {
  font-size: 11px;
  font-weight: 400;
  color: #ff9999;
}

/* Details button on game card */
.btn-details {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 7px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg3);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-details:hover {
  border-color: var(--green);
  color: var(--green);
}

/* Glow animation for attention */
@keyframes btn-glow-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 176, 79, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(0, 176, 79, 0.2);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 176, 79, 0);
  }
}

@keyframes btn-highlight {
  0% {
    background: var(--bg3);
    border-color: var(--border);
  }
  50% {
    background: rgba(0, 176, 79, 0.1);
    border-color: var(--green);
  }
  100% {
    background: var(--bg3);
    border-color: var(--border);
  }
}

/* Details button in card header */
.btn-details-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  animation: btn-highlight 2s ease-in-out infinite, btn-glow-pulse 2s ease-in-out infinite;
}
.btn-details-header:hover {
  background: linear-gradient(135deg, rgba(0, 176, 79, 0.15), rgba(0, 176, 79, 0.1));
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 12px rgba(0, 176, 79, 0.2);
  transform: translateY(-1px);
}
.btn-details-header:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ── Matchday recap ──────────────────────────────────────────────────────── */
.recap-trigger-btn {
  width: 100%;
  margin-bottom: 12px;
}

.recap-box {
  max-width: 480px;
}

.recap-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.recap-nav #recap-nav-label {
  direction: ltr;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 700;
  min-width: 40px;
  text-align: center;
}

.recap-games {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.recap-game-row {
  direction: ltr;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg3);
  border-radius: 8px;
  font-size: 13px;
}
.recap-team { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap-team:last-child { text-align: right; }
.recap-score { font-weight: 800; color: var(--gold); flex-shrink: 0; padding: 0 8px; }

.recap-highlight {
  background: var(--green-dim);
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  text-align: center;
}

.recap-section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}

.recap-standings {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.recap-stand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
}
.recap-stand-row.is-perfect { background: #f0c04018; }
.recap-stand-rank { width: 18px; text-align: center; color: var(--text-dim); font-weight: 700; font-size: 12px; flex-shrink: 0; }
.recap-stand-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap-stand-score { font-weight: 700; color: var(--green); flex-shrink: 0; }

.recap-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Match details modal ─────────────────────────────────────────────────── */
.match-details-box {
  max-width: 600px;
}
.match-details-box .modal-header {
  padding: 14px 16px 10px;
}
.match-details-box .modal-title {
  font-size: 16px;
}
.match-details-box .modal-subtitle {
  font-size: 14px;
}

/* Tab strip */
.md-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.md-tab {
  flex: 1;
  padding: 9px 2px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.md-tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

.md-empty {
  color: var(--text-dim);
  text-align: center;
  padding: 28px 0;
  font-size: 12px;
}

/* ── Events tab ──────────────────────────────────────────────────────────── */
.md-event {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 6px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  border-radius: 6px;
}
.md-event:last-child { border-bottom: none; }
.md-event-left  { flex-direction: row; }
.md-event-right { flex-direction: row-reverse; }

/* Goals stand out from cards/substitutions in the events timeline */
.md-event.is-goal {
  background: var(--green-dim);
  margin: 2px 0;
}

.md-event-icon {
  width: 24px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}
.md-event.is-goal .md-event-icon { font-size: 17px; }

.md-event-clock {
  width: 30px;
  text-align: center;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.md-event-name {
  flex: 1;
  font-weight: 600;
  font-size: 12px;
}
.md-event.is-goal .md-event-name {
  color: var(--green);
  font-weight: 700;
}
.md-event-left  .md-event-name { text-align: left; }
.md-event-right .md-event-name { text-align: right; }

/* ── Stats tab ───────────────────────────────────────────────────────────── */
.md-stats-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.md-stat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
}
.md-stat-val {
  width: 32px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.md-stat-val-r {
  text-align: right;
}
.md-stat-mid {
  flex: 1;
  min-width: 0;
}
.md-stat-label {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 3px;
  font-weight: 600;
}
.md-stat-bar {
  display: flex;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg3);
}
.md-stat-bar-left {
  background: var(--green);
  transition: width .3s ease;
}
.md-stat-bar-right {
  background: #4a7aff;
  transition: width .3s ease;
}

/* ── Lineup tab ──────────────────────────────────────────────────────────── */
.md-lineup {
  display: flex;
  gap: 8px;
}
.md-team-col {
  flex: 1;
  min-width: 0;
}
.md-team-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  text-align: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 5px;
}
.md-section-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 4px 0 2px;
}
.md-player {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 2px;
  border-bottom: 1px solid #ffffff08;
  font-size: 11px;
}
.md-jersey {
  width: 20px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--bg3);
  border-radius: 4px;
  flex-shrink: 0;
}
.md-pname {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.md-pos {
  font-size: 9px;
  color: var(--text-dim);
  font-weight: 700;
  flex-shrink: 0;
}

/* Details button small icon at top of card */
.btn-details-small {
  padding: 4px 8px;
  font-size: 14px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: color .15s;
  line-height: 1;
}
.btn-details-small:hover {
  color: var(--green);
}

/* Field-based lineup visualization */
.lineup-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 12px;
}

.field-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--bg3);
}

.field-team-name {
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  margin-bottom: 12px;
  color: var(--text);
}

.field-pitch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  min-height: 200px;
  background: linear-gradient(180deg, transparent 0%, rgba(0,176,79,.05) 50%, transparent 100%);
  padding: 12px;
  border-radius: 6px;
  align-content: start;
}

.field-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
  background: var(--bg2);
  border: 1px solid var(--border);
  font-size: 11px;
  min-height: 50px;
  cursor: default;
}

.field-player.gk {
  grid-column: 1 / -1;
  justify-self: center;
  width: 60px;
  background: linear-gradient(135deg, #d84343, #c03030);
  border: 1px solid var(--red);
}

.field-player.defender {
  background: linear-gradient(135deg, #4169e1, #1e40af);
  border: 1px solid #1e40af;
}

.field-player.midfielder {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  border: 1px solid #6d28d9;
}

.field-player.forward {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: 1px solid #d97706;
}

.fp-num {
  font-weight: 700;
  font-size: 12px;
  color: white;
}

.fp-name {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.bench-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
}

/* ── Formation Display ───────────────────────────────────────────────────── */
.lineup-formations {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 12px;
}

.formation-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.formation-team {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-weight: 500;
}

.formation-display {
  font-size: 32px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 4px;
}

.game-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 700;
}

.team-name { flex: 1; text-align: center; }
.vs { color: var(--text-dim); font-size: 13px; }

.game-time {
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.countdown {
  font-weight: 700;
  color: var(--gold);
  font-size: 14px;
  display: block;
  margin-top: 2px;
}
.countdown.live { color: #ff6b6b; }

/* ── Vote options ────────────────────────────────────────────────────────── */
.vote-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}

.vo-preset-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 8px;
}

.vo-preset-help {
  margin: 0 0 10px;
  color: var(--text-dim);
  font-size: 13px;
}

.vote-option-card {
  background: var(--bg3);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 10px 8px;
  font-size: 12px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  color: var(--text);
  line-height: 1.3;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.vote-option-card:hover {
  border-color: var(--green);
  background: #00b04f11;
}

.vote-option-card.selected {
  border-color: var(--green);
  background: var(--green-dim);
  color: var(--green);
  font-weight: 700;
  box-shadow: 0 0 0 1px var(--green);
}

.vote-option-card.selected:hover {
  border-color: var(--red);
  background: #e0303018;
  color: var(--red);
  box-shadow: 0 0 0 1px var(--red);
}

/* ── Vote bars (post-kickoff) ────────────────────────────────────────────── */
.vote-bar-list { display: flex; flex-direction: column; gap: 6px; }

.vote-bar-item { }

.vote-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 3px;
  color: var(--text-dim);
}

.playoff-card {
  border-color: #245a3a;
}

.playoff-section {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.playoff-section-title {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.playoff-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.playoff-vote-option {
  min-height: 64px;
  text-align: center;
}

.playoff-vote-option input {
  display: none;
}

.playoff-vote-option.result {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

.playoff-vote-option.locked {
  cursor: default;
}

.playoff-vote-option.locked:not(.selected):not(.result):hover {
  border-color: var(--border);
  background: var(--bg3);
}

.playoff-vote-option.result:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

.playoff-section[id$='-section2'] .playoff-options {
  grid-template-columns: 1fr 1fr 1fr;
}

.playoff-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 6px;
}

.playoff-summary {
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0f1d16;
}

.playoff-summary-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}

.playoff-summary-row {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.45;
}

.playoff-r16-intro {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--gold);
  border-radius: 10px;
  background: #1d1a0f;
}

.playoff-r16-intro-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px;
}

.playoff-r16-intro-line {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 4px;
}

.playoff-r16-intro-line:last-child { margin-bottom: 0; }

.playoff-collapse-card { padding: 0; }

.playoff-collapse-header {
  width: 100%;
  display: block;
  background: none;
  border: none;
  padding: 16px;
  margin: 0;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}
.playoff-collapse-header:active { background: var(--bg3); }
.playoff-collapse-header .game-time { margin-bottom: 0; }

.playoff-collapse-body {
  padding: 0 16px 16px;
}
.vote-bar-label span:first-child { color: var(--text); }

.vote-bar-track {
  height: 8px;
  background: var(--bg3);
  border-radius: 4px;
  overflow: hidden;
}
.vote-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 4px;
  transition: width .4s ease;
}
.vote-bar-fill.is-result { background: var(--gold); }

/* ── Who voted on each option ───────────────────────────────────────────── */
.vote-voters-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.vote-voters-group {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.vote-voters-group:first-child {
  padding-top: 0;
  border-top: none;
}

.vote-voters-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 4px;
}
.vote-voters-title.is-result { color: var(--gold); }

.vote-voters-names {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}
.vote-voters-names em { color: var(--text-dim); opacity: .7; }

.vote-submit-btn {
  width: 100%;
  margin-top: 4px;
}

.vote-submitted-msg {
  text-align: center;
  font-size: 13px;
  color: var(--green);
  padding: 6px;
  font-weight: 600;
}

.no-vote-msg {
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  padding: 6px;
}

/* ── Leaderboard ────────────────────────────────────────────────────────── */
.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 24px;
  padding-top: 12px;
}

#leaderboard-list {
  position: relative;
  overflow: hidden;
}

.podium.podium-celebrate .podium-item {
  animation: podium-rise .55s ease both, podium-float 2.8s ease-in-out .55s infinite;
}

.podium.podium-celebrate .p2 { animation-delay: .05s, .65s; }
.podium.podium-celebrate .p1 { animation-delay: .15s, .95s; }
.podium.podium-celebrate .p3 { animation-delay: .25s, 1.25s; }

.podium .p1 .podium-block,
.podium .p2 .podium-block,
.podium .p3 .podium-block {
  transform-origin: center bottom;
  animation: podium-sway 3.4s ease-in-out infinite;
}

.podium .p1 .podium-block { animation-delay: .2s; }
.podium .p2 .podium-block { animation-delay: .6s; }
.podium .p3 .podium-block { animation-delay: 1s; }

@keyframes podium-rise {
  from { transform: translateY(14px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes podium-float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

@keyframes podium-sway {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-0.7deg); }
  75% { transform: rotate(0.7deg); }
  100% { transform: rotate(0deg); }
}

.podium-item {
  flex: 1;
  max-width: 150px;
  min-width: 120px;
  text-align: center;
}

.podium-item.count-2 { min-width: 150px; max-width: 180px; }
.podium-item.count-3 { min-width: 190px; max-width: 240px; }
.podium-item.count-4 { min-width: 220px; max-width: 280px; }

.podium-place-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.podium-name {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  word-break: break-word;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 28px;
}

.podium-name.tied span {
  background: #1f2937;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  line-height: 1.2;
  color: var(--text);
}

.podium-block {
  border-radius: 8px 8px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  font-weight: 700;
  color: var(--bg);
  padding: 10px 6px 12px;
  height: auto;
}

.podium-block.tied {
  padding: 8px 0;
}

.podium-avatar { margin-bottom: 4px; }
.podium-avatar .avatar-img,
.podium-avatar .avatar-fallback { border: 2px solid rgba(0,0,0,.3); }

.podium-block .medal { font-size: 18px; margin-bottom: 2px; }
.podium-block .pts { font-size: 14px; margin-top: 4px; line-height: 1.1; }

.podium-split {
  width: 100%;
  display: flex;
  justify-content: center;
}

.podium-split.tied {
  gap: 0;
}

.podium-split-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
  min-height: 66px;
  padding: 2px 6px;
}

.podium-split-entry.empty {
  font-size: 20px;
  opacity: .55;
}

.podium-split.tied .podium-split-entry + .podium-split-entry {
  border-left: 1px dashed rgba(0,0,0,.35);
}

.podium-entry-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--bg);
  text-align: center;
  line-height: 1.25;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p1 .podium-block { background: var(--gold); min-height: 138px; }
.p2 .podium-block { background: #c0c0c0; min-height: 122px; }
.p3 .podium-block { background: #cd7f32; min-height: 114px; }

@media (max-width: 560px) {
  .podium { gap: 8px; }
  .podium-item { min-width: 98px; max-width: 118px; }
  .podium-item.count-2 { min-width: 128px; max-width: 150px; }
  .podium-item.count-3 { min-width: 168px; max-width: 210px; }
  .podium-item.count-4 { min-width: 190px; max-width: 240px; }
  .podium-name { font-size: 11px; min-height: 24px; }
  .podium-name.tied span { padding: 2px 6px; }
  .podium-entry-name { font-size: 10px; }
  .podium-split-entry { min-height: 58px; }
  .p1 .podium-block { min-height: 126px; }
  .p2 .podium-block { min-height: 112px; }
  .p3 .podium-block { min-height: 108px; }
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  background: var(--bg2);
  border: 1px solid var(--border);
}
.leaderboard-row.me { border-color: var(--green); background: var(--green-dim); }

.leaderboard-row.top3-row {
  position: relative;
  animation: top3-row-float 2.6s ease-in-out infinite;
}

.leaderboard-row.top3-row::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 8px;
  pointer-events: none;
  opacity: .65;
  animation: top3-row-glow 2.2s ease-in-out infinite;
}

.leaderboard-row.top3-row-1 {
  animation-delay: .1s;
}

.leaderboard-row.top3-row-1::before {
  box-shadow: 0 0 0 1px rgba(240,192,64,.65), 0 0 14px rgba(240,192,64,.35);
  animation-delay: .2s;
}

.leaderboard-row.top3-row-2 {
  animation-delay: .35s;
}

.leaderboard-row.top3-row-2::before {
  box-shadow: 0 0 0 1px rgba(192,192,192,.65), 0 0 12px rgba(192,192,192,.28);
  animation-delay: .45s;
}

.leaderboard-row.top3-row-3 {
  animation-delay: .6s;
}

.leaderboard-row.top3-row-3::before {
  box-shadow: 0 0 0 1px rgba(205,127,50,.65), 0 0 10px rgba(205,127,50,.25);
  animation-delay: .7s;
}

@keyframes top3-row-float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

@keyframes top3-row-glow {
  0% { opacity: .25; }
  50% { opacity: .8; }
  100% { opacity: .25; }
}

.lb-rank { font-size: 16px; font-weight: 700; width: 32px; text-align: center; color: var(--text-dim); }
.lb-rank.top3 { color: var(--gold); }
.lb-name { flex: 1; font-size: 14px; font-weight: 500; }

.streak-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff7a18, #f0c040);
  color: #1a1500;
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
  white-space: nowrap;
}
.streak-badge-podium {
  margin: 2px 0 0;
  text-align: center;
}

.modal-streak {
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
  margin-top: 3px;
}
.modal-streak-best { color: var(--text-dim); font-weight: 600; }
.lb-move {
  width: 18px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}
.lb-move.up { color: var(--green); }
.lb-move.down { color: var(--red); }
.lb-move.same { color: var(--text-dim); }
.lb-pts { font-size: 18px; font-weight: 700; color: var(--green); min-width: 36px; text-align: right; }
.lb-pts-label { font-size: 10px; color: var(--text-dim); text-align: right; }

.leaderboard-confetti {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 20;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -14px;
  width: 6px;
  height: 10px;
  opacity: 0.85;
  animation-name: confetti-fall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  transform: rotate(12deg);
  border-radius: 2px;
}

@keyframes confetti-fall {
  0% { transform: translateY(-10px) rotate(0deg) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  25% { transform: translateY(90px) rotate(120deg) translateX(-5px); }
  50% { transform: translateY(180px) rotate(220deg) translateX(5px); }
  75% { transform: translateY(280px) rotate(300deg) translateX(-3px); }
  100% { transform: translateY(420px) rotate(380deg) translateX(4px); opacity: 0; }
}

.leaderboard-sparkles {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 21;
  overflow: hidden;
}

.spark-piece {
  position: absolute;
  color: #f7d25a;
  font-size: 14px;
  line-height: 1;
  opacity: 0;
  text-shadow: 0 0 8px rgba(247, 210, 90, 0.45);
  animation: spark-twinkle ease-in-out forwards;
}

@keyframes spark-twinkle {
  0% { transform: scale(0.5) rotate(0deg); opacity: 0; }
  25% { opacity: 0.9; }
  50% { transform: scale(1.15) rotate(25deg); opacity: 1; }
  100% { transform: scale(0.8) rotate(45deg); opacity: 0; }
}

/* ── Admin ───────────────────────────────────────────────────────────────── */
.admin-login-box {
  max-width: 300px;
  margin: 40px auto;
  text-align: center;
}
.admin-login-box h2 { margin-bottom: 16px; }

.section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: 12px;
}

.admin-game-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--bg2);
  gap: 8px;
}
.admin-game-row .game-info { flex: 1; min-width: 0; }
.admin-game-row .game-info .teams { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-game-row .game-info .time  { font-size: 12px; color: var(--text-dim); }
.admin-game-row .result-badge { font-size: 11px; color: var(--gold); background: #f0c04022; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }

.result-form { margin-top: 12px; }
.result-form select { margin-bottom: 8px; }

/* ── Admin collapsible sections ──────────────────────────────────────────── */
.admin-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.admin-section-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  cursor: pointer;
  text-align: left;
}
.admin-section-header:active { background: var(--bg3); }

.admin-section-body {
  border-top: 1px solid var(--border);
  padding: 16px;
}

/* ── Vote options editor ─────────────────────────────────────────────────── */
.vo-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--bg3);
  font-size: 13px;
}

.vo-add-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 8px;
}
.vo-add-row select { flex: 0 0 120px; margin-bottom: 0; }
.vo-add-row input  { flex: 1; margin-bottom: 0; }
.vo-add-row button  { flex-shrink: 0; }

/* ── Section headers ─────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 2px;
}

.section-header h2 { font-size: 15px; font-weight: 700; }

.pills {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.pills::-webkit-scrollbar { display: none; }

.pill {
  white-space: nowrap;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  color: var(--text-dim);
}
.pill.active { background: var(--green-dim); border-color: var(--green); color: var(--green); font-weight: 600; }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-dim);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* ── Daily Award (fun easter egg) ───────────────────────────────────────── */

/* ── Toast ───────────────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a2a1a;
  border: 1px solid var(--green);
  color: var(--green);
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  transition: transform .3s ease;
  z-index: 999;
  pointer-events: none;
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.error { border-color: var(--red); color: var(--red); background: #2a1a1a; }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 32px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Password rows ───────────────────────────────────────────────────────── */
.pw-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 5px;
  background: var(--bg2);
}
.pw-name { flex: 1; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-code {
  font-family: 'Courier New', monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  background: var(--bg3);
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 2px;
  flex-shrink: 0;
}

/* ── Date groups ─────────────────────────────────────────────────────────── */
.date-group { margin-bottom: 24px; }

.date-header {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-dim);
  padding: 6px 4px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.today-group .date-header {
  color: var(--green);
}

.today-badge {
  background: var(--green);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: .5px;
}

/* ── Votes tab ───────────────────────────────────────────────────────────── */
.votes-collapse-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}

.votes-collapse-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.votes-collapse-header:active { background: var(--bg3); }

.votes-collapse-left { flex: 1; min-width: 0; }

.votes-collapse-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.collapse-chevron {
  font-size: 18px;
  color: var(--text-dim);
  transition: transform .2s ease;
  line-height: 1;
}

.votes-collapse-body {
  border-top: 1px solid var(--border);
  padding: 10px 12px 12px;
}

.votes-game-teams {
  font-size: 14px;
  font-weight: 700;
}

.votes-game-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.result-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  background: #f0c04018;
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
}
.result-pill.pending  { color: var(--text-dim); background: transparent; }
.result-pill.open-pill { color: #60a5fa; background: #1e3a5f; }

.votes-rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.playoff-votes-empty {
  padding: 10px 0;
}

.playoff-votes-table-wrap {
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.playoff-votes-table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 12px;
}

.playoff-votes-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.playoff-votes-table .pv-col-head,
.playoff-votes-table .pv-cell {
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  word-break: break-word;
}

.playoff-votes-table .pv-col-head {
  font-size: 11px;
  letter-spacing: .2px;
  font-weight: 700;
  color: var(--text);
  background: var(--bg3);
}

.playoff-votes-table .pv-cell {
  color: var(--text);
  line-height: 1.35;
}

.playoff-votes-table .pv-cell-member {
  color: var(--text);
  font-weight: 700;
  width: 24%;
}

.playoff-votes-table .pv-member-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.playoff-votes-table .pv-live-badge {
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1;
}

.playoff-votes-table .pv-col-head:nth-child(2),
.playoff-votes-table .pv-col-head:nth-child(3),
.playoff-votes-table .pv-col-head:nth-child(4),
.playoff-votes-table .pv-cell:nth-child(2),
.playoff-votes-table .pv-cell:nth-child(3),
.playoff-votes-table .pv-cell:nth-child(4) {
  width: 25.33%;
}

.playoff-votes-table tbody tr:nth-child(odd) .pv-cell {
  background: rgba(255, 255, 255, 0.015);
}

.playoff-votes-table tbody tr:nth-child(even) .pv-cell {
  background: rgba(255, 255, 255, 0.05);
}

.playoff-votes-table tbody tr.pv-live-right .pv-cell {
  background: #00b04f22;
  box-shadow: inset 0 0 0 1px #00b04f44;
}

.playoff-votes-table tbody tr:last-child .pv-cell {
  border-bottom: none;
}

.playoff-votes-table .pv-no-vote {
  font-size: 10px;
  color: var(--text-dim);
  font-style: italic;
}

.vote-summary-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg3);
}

.vote-summary-row.no-vote { opacity: .45; }
.vote-summary-row.correct-vote { background: #00b04f18; border: 1px solid #00b04f44; }
.vote-summary-row.live-correct {
  animation: live-correct-pulse 1.6s ease-in-out infinite;
  box-shadow: 0 0 0 rgba(0, 176, 79, 0.0);
}

@keyframes live-correct-pulse {
  0% {
    background: #00b04f18;
    box-shadow: 0 0 0 0 rgba(0, 176, 79, 0.35);
  }
  50% {
    background: #00b04f2b;
    box-shadow: 0 0 0 6px rgba(0, 176, 79, 0.08);
  }
  100% {
    background: #00b04f18;
    box-shadow: 0 0 0 0 rgba(0, 176, 79, 0.0);
  }
}

.vs-name {
  width: 140px;
  flex-shrink: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

.vs-pick {
  flex: 1;
  color: var(--text-dim);
  font-size: 12px;
}

.vs-correct {
  flex-shrink: 0;
  font-size: 14px;
}

@media (max-width: 720px) {
  .playoff-votes-table {
    font-size: 11px;
  }

  .playoff-votes-table .pv-col-head,
  .playoff-votes-table .pv-cell {
    padding: 8px 6px;
  }

  .playoff-votes-table .pv-col-head {
    font-size: 10px;
  }

  .playoff-votes-table .pv-cell-member {
    font-size: 11px;
  }

  .playoff-votes-table .pv-no-vote {
    font-size: 9px;
  }
}

/* ── Member points modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fadeIn .15s ease;
}

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp .2s ease;
}

@keyframes slideUp { from { transform: translateY(40px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
}

.modal-subtitle {
  font-size: 16px;
  color: var(--green);
  margin-top: 3px;
  font-weight: 600;
}

.modal-close {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-games {
  overflow-y: auto;
  padding: 12px 16px 24px;
  flex: 1;
}

.modal-game-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.modal-game-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green-dim);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-game-info { flex: 1; min-width: 0; }

.modal-game-teams {
  font-size: 14px;
  font-weight: 600;
}

.modal-game-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.modal-game-result {
  font-size: 11px;
  color: var(--gold);
  margin-top: 3px;
}

.modal-game-pt {
  font-size: 15px;
  font-weight: 800;
  color: var(--green);
  flex-shrink: 0;
}

/* ── Welcome modal ───────────────────────────────────────────────────────── */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 240;
  background: rgba(5, 10, 8, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.welcome-card {
  position: relative;
  width: min(560px, 100%);
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid #25543f;
  background: linear-gradient(180deg, #10281d 0%, #0d1117 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  animation: welcome-pop .24s ease;
}

@keyframes welcome-pop {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.welcome-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #ffffff33;
  background: #00000055;
  color: #f3f4f6;
  font-size: 13px;
  cursor: pointer;
  z-index: 2;
}

.welcome-hero {
  width: 100%;
  display: block;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border-bottom: 1px solid #25543f;
}

.welcome-content {
  padding: 18px 16px 18px;
  text-align: center;
}

.welcome-content h2 {
  font-size: 22px;
  margin-bottom: 8px;
  color: #ecfdf5;
}

.welcome-content p {
  font-size: 14px;
  color: #b6c2c9;
  margin-bottom: 14px;
}

@media (max-width: 480px) {
  .welcome-overlay {
    align-items: flex-end;
    padding: 10px;
  }

  .welcome-card {
    border-radius: 18px;
  }

  .welcome-content h2 {
    font-size: 20px;
  }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (min-width: 480px) {
  .vote-options { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .vs-name { width: 180px; }
}

/* ── Groups / Standings ──────────────────────────────────────────────────────── */
.groups-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 16px;
  max-width: 1200px;
}

.group-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.group-table-scroll {
  overflow-x: hidden;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.group-header {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--green), #008a3d);
  padding: 12px 16px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.standings-table-pro {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
}

.standings-table-pro thead {
  background: rgba(0, 176, 79, 0.08);
  border-bottom: 2px solid var(--border);
}

.standings-table-pro th {
  padding: 10px 6px;
  text-align: center;
  font-weight: 600;
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-right: 1px solid var(--border);
}

.standings-table-pro th:last-child {
  border-right: none;
}

.col-pos { width: 4%; }
.col-team { text-align: left; width: 42%; min-width: 0; border-right: 2px solid var(--border); }
.col-stat { width: 6%; }
.col-diff { width: 7%; background: rgba(0, 176, 79, 0.05); font-weight: 600; }
.col-pts { width: 7%; background: rgba(0, 176, 79, 0.1); font-weight: 700; }

.standings-row {
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease;
}

.standings-row:hover {
  background-color: rgba(0, 176, 79, 0.04);
}

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

.standings-row.badge-1st { background: rgba(0, 176, 79, 0.06); }
.standings-row.badge-2nd { background: rgba(0, 176, 79, 0.04); }
.standings-row.badge-3rd { background: rgba(0, 176, 79, 0.02); }
.standings-row.badge-4th { background: var(--bg2); }

.cell-pos {
  text-align: center;
  font-weight: 600;
  width: 4%;
}

.position-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--green);
  color: #000;
  font-weight: 700;
  border-radius: 50%;
  font-size: 12px;
}

.cell-team {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border-right: 2px solid var(--border);
  min-width: 0;
}

.team-logo {
  width: 28px;
  height: 20px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.team-name {
  font-weight: 500;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell-stat {
  padding: 10px 6px;
  text-align: center;
  color: var(--text);
  border-right: 1px solid var(--border);
}

.cell-stat:last-of-type {
  border-right: none;
}

.cell-diff {
  padding: 10px 6px;
  text-align: center;
  background: rgba(0, 176, 79, 0.05);
  font-weight: 600;
  color: var(--green);
  border-left: 2px solid var(--border);
  border-right: 2px solid var(--border);
}

.cell-diff.positive {
  color: var(--green);
}

.cell-diff.negative {
  color: #ff6b6b;
}

.cell-pts {
  padding: 10px 6px;
  text-align: center;
  background: rgba(0, 176, 79, 0.1);
  font-weight: 700;
  color: var(--green);
  border-left: 2px solid var(--border);
}

@media (max-width: 720px) {
  .groups-wrapper {
    padding: 12px;
    gap: 16px;
  }
  
  .group-header {
    font-size: 14px;
    padding: 10px 12px;
    letter-spacing: 1px;
  }
  
  .standings-table-pro {
    min-width: 0;
    width: 100%;
    font-size: 10px;
  }
  
  .standings-table-pro th {
    padding: 6px 2px;
    font-size: 9px;
    letter-spacing: 0;
  }
  
  .cell-pos, .cell-stat, .cell-diff, .cell-pts {
    padding: 6px 2px;
    font-size: 10px;
  }
  
  .cell-team {
    padding: 6px 4px;
    gap: 4px;
  }
  
  .team-logo {
    width: 16px;
    height: 12px;
  }
  
  .team-name {
    font-size: 10px;
  }
  
  .position-badge {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .col-pos { width: 4%; }
  .col-team { width: 42%; }
  .col-stat { width: 6%; }
  .col-diff { width: 7%; }
  .col-pts { width: 7%; }
}

/* ── Knockout plan (Spielplan) ───────────────────────────────────────────── */
.tournament-wrap {
  padding: 16px;
}

.knockout-plan-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  max-width: 1460px;
  margin: 0 auto;
}

.knockout-plan-title {
  font-size: 17px;
  font-weight: 800;
  color: #4a5563;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.tournament-board {
  overflow-x: auto;
  overflow-y: visible;
  padding: 2px 8px 8px;
}

.seed-column {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(84, 101, 122, 0.55);
  border-radius: 10px;
  padding: 8px;
}

.seed-panel {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(84, 101, 122, 0.55);
  border-radius: 10px;
  padding: 8px;
}

.seed-title {
  font-size: 11px;
  font-weight: 800;
  color: #9fd5bb;
  text-align: center;
  margin-bottom: 8px;
}

.seed-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.pool-card {
  background: rgba(0, 48, 91, 0.25);
  border: 1px solid rgba(75, 140, 230, 0.35);
  border-radius: 8px;
  overflow: hidden;
}

.pool-title {
  font-size: 10px;
  font-weight: 700;
  color: #d8fbe7;
  background: rgba(0, 176, 79, 0.12);
  padding: 4px 6px;
}

.pool-body {
  padding: 5px;
}

.pool-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.pool-row:last-child {
  margin-bottom: 0;
}

.pool-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 14px;
  border-radius: 8px;
  background: rgba(0, 176, 79, 0.18);
  color: #b6f8d3;
  font-size: 9px;
  font-weight: 700;
}

.pool-team {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 9px;
  color: #e6edf3;
}

.pool-team .team-logo {
  width: 12px;
  height: 9px;
}

.pool-team span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pool-empty {
  font-size: 9px;
  color: #9bb0c5;
}

.knockout-tree-grid {
  --match-h: 52px;
  --r32-gap: 8px;
  --r16-gap: calc(var(--match-h) + (2 * var(--r32-gap)));
  --qf-gap: calc(var(--match-h) + (2 * var(--r16-gap)));
  --sf-gap: calc(var(--match-h) + (2 * var(--qf-gap)));
  --conn-len: 12px;
  --conn-color: #cfd6df;
  display: grid;
  grid-template-columns: 1.12fr 0.9fr 0.78fr 0.72fr 0.78fr 0.9fr 1.12fr;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding-inline: 4px 14px;
}

.plan-round {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 2px;
}

.plan-round-title {
  font-size: 10.5px;
  font-weight: 800;
  color: #657487;
  text-transform: uppercase;
  margin-bottom: 10px;
  text-align: center;
  letter-spacing: 0.4px;
}

.plan-round-body {
  display: grid;
  gap: var(--r32-gap);
  overflow: visible;
}

.tree-l-r32 .plan-round-body,
.tree-r-r32 .plan-round-body {
  gap: var(--r32-gap);
}

.tree-l-r16 .plan-round-body,
.tree-r-r16 .plan-round-body {
  gap: var(--r16-gap);
  margin-top: calc((var(--match-h) + var(--r32-gap)) / 2);
}

.tree-l-qf .plan-round-body,
.tree-r-qf .plan-round-body {
  gap: var(--qf-gap);
  margin-top: calc((var(--match-h) + var(--r16-gap)) / 2);
}

.tree-center-final .plan-round-body {
  gap: var(--sf-gap);
  margin-top: calc((var(--match-h) + var(--qf-gap)) / 2);
}

.plan-match {
  background: #ffffff;
  border: 1px solid #d7dce4;
  border-radius: 5px;
  padding: 5px;
  min-height: var(--match-h);
  position: relative;
  box-shadow: 0 1px 2px rgba(20, 28, 38, 0.05);
}

/* Source lines (left side going right) */
.tree-l-r32 .plan-match::after,
.tree-l-r16 .plan-match::after,
.tree-l-qf .plan-match::after {
  content: '';
  position: absolute;
  right: calc(-1 * var(--conn-len));
  top: 50%;
  width: var(--conn-len);
  border-top: 1px solid var(--conn-color);
  transform: translateY(-50%);
  pointer-events: none;
}

/* Source lines (right side going left) */
.tree-r-r32 .plan-match::after,
.tree-r-r16 .plan-match::after,
.tree-r-qf .plan-match::after {
  content: '';
  position: absolute;
  left: calc(-1 * var(--conn-len));
  top: 50%;
  width: var(--conn-len);
  border-top: 1px solid var(--conn-color);
  transform: translateY(-50%);
  pointer-events: none;
}

/* Target elbows on left columns */
.tree-l-r16 .plan-match::before,
.tree-l-qf .plan-match::before,
.tree-center-final .plan-match:nth-child(1)::before,
.tree-center-final .plan-match:nth-child(3)::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--conn-len));
  width: var(--conn-len);
  top: 50%;
  border-left: 1px solid var(--conn-color);
  border-top: 1px solid var(--conn-color);
  border-bottom: 1px solid var(--conn-color);
  transform: translateY(-50%);
  pointer-events: none;
}

.tree-l-r16 .plan-match::before {
  height: calc(var(--match-h) + var(--r32-gap));
}

.tree-l-qf .plan-match::before {
  height: calc(var(--match-h) + var(--r16-gap));
}

.tree-center-final .plan-match:nth-child(1)::before {
  height: calc(var(--match-h) + var(--qf-gap));
}

.tree-center-final .plan-match:nth-child(3)::before {
  height: calc(var(--match-h) + var(--sf-gap));
}

/* Target elbows on right columns */
.tree-r-r16 .plan-match::before,
.tree-r-qf .plan-match::before,
.tree-center-final .plan-match:nth-child(2)::before,
.tree-center-final .plan-match:nth-child(3)::after {
  content: '';
  position: absolute;
  right: calc(-1 * var(--conn-len));
  width: var(--conn-len);
  top: 50%;
  border-right: 1px solid var(--conn-color);
  border-top: 1px solid var(--conn-color);
  border-bottom: 1px solid var(--conn-color);
  transform: translateY(-50%);
  pointer-events: none;
}

.tree-r-r16 .plan-match::before {
  height: calc(var(--match-h) + var(--r32-gap));
}

.tree-r-qf .plan-match::before {
  height: calc(var(--match-h) + var(--r16-gap));
}

.tree-center-final .plan-match:nth-child(2)::before {
  height: calc(var(--match-h) + var(--qf-gap));
}

.tree-center-final .plan-match:nth-child(3)::after {
  height: calc(var(--match-h) + var(--sf-gap));
}

/* Mobile keeps a clean simple stack without connector elbows */
.knockout-tree-mobile .plan-match::before,
.knockout-tree-mobile .plan-match::after {
  content: none !important;
}

.plan-team-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 18px;
}

.plan-team-row + .plan-team-row {
  margin-top: 3px;
  border-top: 1px dashed #e2e6ec;
  padding-top: 3px;
}

.plan-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 16px;
  border-radius: 10px;
  background: rgba(0, 176, 79, 0.18);
  color: #a6f4c5;
  font-size: 10px;
  font-weight: 700;
}

.plan-team {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.plan-team .team-logo {
  width: 14px;
  height: 10px;
  border-radius: 1px;
}

.plan-team-name {
  font-size: 9.5px;
  color: #192638;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-match-meta {
  font-size: 10px;
  color: #7c8796;
  text-align: right;
  margin-bottom: 2px;
}

.plan-team-score {
  margin-inline-start: auto;
  font-size: 10px;
  font-weight: 700;
  color: #25384f;
}

.winner-row .plan-team-name,
.winner-row .plan-team-score {
  color: #0f7a44;
  font-weight: 700;
}

/* ── Bracket predictions ─────────────────────────────────────────────────────
   Deliberately reuses .vote-option-card's proportions (12px text, 52px touch
   target, 2px border) rather than the old tree-grid's .plan-team-row (9.5px
   text meant for a dense 7-column desktop layout) — this is the pattern
   already proven to work on phones everywhere else in the app. */
.bracket-status-line {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.bracket-progress {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
  margin-bottom: 14px;
}

.bracket-round { margin-bottom: 18px; }
.bracket-round:last-child { margin-bottom: 0; }

.bracket-round-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

/* Groups one match's candidate card(s) into a single visible unit so a
   round reads as a list of matches, not an undifferentiated card grid. */
.bracket-match-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg3);
  padding: 8px;
  margin-bottom: 10px;
}

.bracket-round > .bracket-match-box:last-child { margin-bottom: 0; }

.bracket-match-datetime {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 6px;
}

/* Flex, not grid, so "vs" can sit between the two teams as a fixed-width
   middle item while both team cards share the remaining space equally —
   this is also what keeps them side by side at any phone width instead of
   ever stacking (grid-template-columns: 1fr would need a breakpoint to drop
   to a single column; flex + min-width:0 + text-ellipsis never needs one). */
.bracket-slot-grid {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.bracket-vs {
  flex: none;
  align-self: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  padding: 0 2px;
}

.bracket-option {
  flex: 1 1 0;
  min-width: 0;
  justify-content: flex-start;
  gap: 6px;
  text-align: start;
  min-height: 56px;
}

.bracket-option .team-logo { flex: none; }

.bracket-option-name {
  font-size: 12px;
  line-height: 1.3;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bracket-pick-check {
  margin-inline-start: auto;
  color: var(--green);
  font-weight: 700;
  font-size: 14px;
  flex: none;
}

.bracket-slot-pending {
  min-height: 52px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  padding: 8px;
}

.bracket-correct-card {
  border-color: var(--green) !important;
  background: var(--green-dim) !important;
  color: var(--green) !important;
  font-weight: 700;
  box-shadow: 0 0 0 1px var(--green);
}

.bracket-wrong-card {
  border-color: var(--red) !important;
  background: #e0303018 !important;
  color: var(--red) !important;
  font-weight: 700;
  box-shadow: 0 0 0 1px var(--red);
}

.bracket-pending-card {
  opacity: 0.75;
}

/* View mode: one boxed result card per match, two matches per row; the
   Final and 3rd-place rounds have a single box, so let it span the full
   row instead of leaving an empty grid cell beside it. */
.bracket-view-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bracket-view-grid .bracket-match-box { margin-bottom: 0; }

.bracket-view-grid .bracket-match-box:only-child {
  grid-column: 1 / -1;
}

/* .bracket-view-grid (multiple match boxes per round) still drops to one
   box per row on the narrowest phones — but .bracket-slot-grid (the two
   teams *within* one match) must never stack; it just shrinks further so
   both teams keep fitting on a single line. */
@media (max-width: 380px) {
  .bracket-view-grid { grid-template-columns: 1fr; }
  .bracket-option { gap: 4px; min-height: 48px; }
  .bracket-option-name { font-size: 11px; }
  .bracket-vs { font-size: 10px; padding: 0 1px; }
}

.mobile-path-list {
  display: grid;
  gap: 8px;
}

.mobile-path-card {
  border: 1px solid #d8dde5;
  border-radius: 8px;
  background: #ffffff;
}

.mobile-path-card > summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.mobile-path-card > summary::-webkit-details-marker {
  display: none;
}

.mobile-path-title {
  font-size: 12px;
  font-weight: 700;
  color: #25384f;
}

.mobile-path-summary-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.mobile-path-summary-teams {
  font-size: 12px;
  color: #1c2d43;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-path-summary-date {
  font-size: 11px;
  color: #788598;
}

.mobile-path-hint {
  font-size: 11px;
  color: #768396;
  white-space: normal;
  margin-top: 0;
  max-width: 74px;
  text-align: right;
  line-height: 1.2;
}

.mobile-path-card[open] .mobile-path-hint {
  color: #1a7a45;
}

.mobile-path-match,
.mobile-path-next {
  padding: 0 10px 10px;
}

.mobile-path-next {
  border-top: 1px dashed #dde3ea;
  margin-top: 8px;
  padding-top: 8px;
}

.mobile-path-next-title {
  font-size: 11px;
  font-weight: 700;
  color: #30455d;
}

.mobile-path-next-date,
.mobile-path-opponent {
  font-size: 11px;
  color: #6f7e92;
  margin-top: 2px;
}

.mobile-path-team {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #18293f;
  margin-top: 5px;
}

.plan-match-empty {
  display: grid;
  place-items: center;
  min-height: 40px;
}

.plan-winner {
  font-size: 10px;
  color: #d5e3f8;
  font-weight: 700;
}

.plan-code {
  margin-top: 3px;
  font-size: 9px;
  color: #8aa0ba;
}

.plan-round-final {
  background: linear-gradient(180deg, rgba(11, 64, 112, 0.15), rgba(16, 42, 67, 0.05));
  border-radius: 6px;
  padding-inline: 2px;
}

.plan-final-match {
  border-color: rgba(255, 220, 120, 0.8);
  background: rgba(255, 210, 90, 0.08);
}

.knockout-tree-mobile {
  display: none;
}

@media (max-width: 1440px) {
  .knockout-tree-grid {
    grid-template-columns: 1.02fr 0.82fr 0.68fr 0.72fr 0.68fr 0.82fr 1.02fr;
    min-width: 0;
  }
}

@media (max-width: 1100px) {
  .seed-column {
    display: none;
  }
}

@media (max-width: 980px) {
  .knockout-tree-grid {
    display: none;
  }

  .knockout-tree-mobile {
    display: grid;
    gap: 8px;
  }

  .knockout-plan-section {
    background: var(--bg2);
    padding: 10px;
    max-width: 100%;
  }

  .seed-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .tournament-wrap {
    padding: 8px;
  }

  .knockout-plan-section {
    padding: 8px;
  }

  .seed-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .plan-round-title {
    font-size: 10px;
  }
}

/* ── Wheel of Luck ─────────────────────────────────────────────────────────── */
.wheel-box {
  max-width: 360px;
  text-align: center;
  padding: 24px 18px;
}
.wheel-header {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold, #f0c040);
  margin-bottom: 12px;
  letter-spacing: 1px;
}
.wheel-desc {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.6;
}
.wheel-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 16px;
  direction: rtl;
}
.wheel-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  direction: rtl;
}
.wheel-opt-good { background: #1a3a1a; border: 1px solid #2ecc7155; color: #6ef0a0; }
.wheel-opt-bad  { background: #3a1a1a; border: 1px solid #e74c3c55; color: #f09090; }
.wo-icon { font-size: 18px; flex-shrink: 0; }
.wo-label { font-size: 11px; line-height: 1.3; }
.wheel-canvas-wrap {
  position: relative;
  width: min(300px, calc(100vw - 80px));
  margin: 0 auto;
}
.wheel-pointer {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 28px;
  color: var(--gold, #f0c040);
  z-index: 2;
  filter: drop-shadow(0 2px 4px #000a);
}
#wheel-canvas {
  border-radius: 50%;
  box-shadow: 0 0 24px #0008;
  width: 100%;
  height: auto;
  display: block;
}
.wheel-countdown-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--bg2, #1a1a2e);
  border-radius: 10px;
  padding: 10px 20px;
  border: 1px solid var(--border, #333);
}
@keyframes wheel-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(var(--spin-deg, 1800deg)); }
}
.wheel-spinning {
  animation: wheel-spin var(--spin-dur, 4s) cubic-bezier(0.17, 0.67, 0.12, 1) forwards;
}

/* ── Bonus Tab ─────────────────────────────────────────────────────────── */
.bonus-section {
  background: var(--card-bg, #1a1a2e);
  border: 1px solid var(--border, #333);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}
.bonus-section-coin {
  opacity: 0.6;
}
.bonus-section-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.bonus-section-icon {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
}
.bonus-section-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
}
.bonus-section-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.6;
}
.bonus-status-wrap {
  margin-bottom: 14px;
}
.bonus-status-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}
.bonus-status-ready   { background: rgba(46,204,113,0.15); color: #2ecc71; border: 1px solid #2ecc71; }
.bonus-status-used    { background: rgba(52,152,219,0.15); color: #3498db; border: 1px solid #3498db; }
.bonus-status-canceled { background: rgba(231,76,60,0.15); color: #e74c3c; border: 1px solid #e74c3c; }
.bonus-action-wrap {
  margin-bottom: 20px;
}
.bonus-wheel-countdown-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 8px;
}
.bonus-wheel-countdown {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.bonus-history-wrap {
  border-top: 1px solid var(--border, #333);
  padding-top: 16px;
}
.bonus-history-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
}
.bonus-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.bonus-history-table th {
  text-align: right;
  padding: 6px 10px;
  color: var(--text-dim);
  font-weight: 500;
  border-bottom: 1px solid var(--border, #333);
}
.bonus-history-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border, #2a2a3e);
}
.bonus-history-table tr:last-child td { border-bottom: none; }

/* ── Flip The Coin ─────────────────────────────────────────────────────── */
.coin-desc { text-align: center; color: var(--text-dim); font-size: 14px; margin-bottom: 14px; }
.coin-rules { background: rgba(255,255,255,.04); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.coin-rule { font-size: 13px; padding: 3px 0; color: var(--text-dim); }
.coin-field { margin-bottom: 14px; }
.coin-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text-dim); }
.coin-stake-btns, .coin-option-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.coin-stake-btn, .coin-option-btn {
  flex: 1; padding: 10px 8px; border: 2px solid var(--border); border-radius: 10px;
  background: var(--card-bg); color: var(--text); font-size: 15px; font-weight: 600; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.coin-stake-btn.selected, .coin-option-btn.selected {
  border-color: var(--gold); background: rgba(212,175,55,.15); color: var(--gold);
}
.coin-select { width: 100%; padding: 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); font-size: 14px; }
.coin-sides { display: flex; gap: 14px; justify-content: center; margin: 16px 0; }
.coin-side-btn {
  flex: 1; max-width: 140px; padding: 18px 12px; border: 2px solid var(--border); border-radius: 14px;
  background: var(--card-bg); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px; transition: all .15s;
}
.coin-side-btn.selected { border-color: var(--gold); background: rgba(212,175,55,.15); }
.coin-face { font-size: 36px; }
.coin-anim-wrap { display: flex; justify-content: center; margin: 20px 0; perspective: 600px; }
.coin-3d {
  width: 90px; height: 90px; position: relative; transform-style: preserve-3d;
  border-radius: 50%; font-size: 44px;
}
.coin-3d.flipping { animation: coin-flip 1.6s ease-out forwards; }
.coin-face-front, .coin-face-back {
  position: absolute; inset: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  backface-visibility: hidden; background: radial-gradient(circle, #f5d060, #c9a227);
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.coin-face-back { transform: rotateY(180deg); }
@keyframes coin-flip {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(var(--coin-final-rot, 1440deg)); }
}

/* ── Notification Bell ─────────────────────────────────────────────────── */
.notif-bell-wrap { position: relative; display: flex; align-items: center; }
.notif-bell-btn {
  background: none; border: none; cursor: pointer; font-size: 20px;
  padding: 4px 6px; border-radius: 8px; position: relative; line-height: 1; transition: transform 0.2s;
}
.notif-bell-btn:hover { transform: scale(1.15); }
.notif-bell-btn.has-unread { animation: bell-shake 0.6s ease 0.5s 2; }
@keyframes bell-shake {
  0%,100% { transform: rotate(0); }
  20%      { transform: rotate(-18deg); }
  40%      { transform: rotate(16deg); }
  60%      { transform: rotate(-10deg); }
  80%      { transform: rotate(8deg); }
}
.notif-badge {
  position: absolute; top: -2px; right: -2px; background: #f44336; color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.notif-badge.hidden { display: none; }
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 310px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35); z-index: 900; overflow: hidden;
}
@media (max-width: 480px) {
  .notif-panel {
    position: fixed; top: 60px; left: 8px; right: 8px; width: auto;
    border-radius: 10px; max-height: calc(100vh - 80px); overflow-y: auto;
  }
}
.notif-panel.hidden { display: none; }
.notif-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; font-weight: 700; font-size: 14px;
  border-bottom: 1px solid var(--border); background: var(--bg3);
}
.notif-panel-close { background: none; border: none; cursor: pointer; font-size: 14px; color: var(--text-dim); padding: 2px 6px; border-radius: 6px; }
.notif-panel-close:hover { background: var(--border); }
.notif-panel-list { max-height: 340px; overflow-y: auto; padding: 8px; }
.notif-item {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 8px;
  margin-bottom: 6px; border: 1px solid var(--border); background: var(--bg3);
  font-size: 13px; direction: rtl;
}
.notif-item.unread { border-color: #4caf5066; background: #4caf5011; }
.notif-item-icon { font-size: 20px; flex-shrink: 0; }
.notif-item-body { flex: 1; }
.notif-item-label { line-height: 1.4; margin-bottom: 3px; }
.notif-item-date { font-size: 11px; color: var(--text-dim); }
