:root {
  --bg: #0d0d1a;
  --surface: #161628;
  --border: rgba(255,255,255,0.08);
  --text: #f0f0ff;
  --muted: #888aaa;
  --gold: #FFD700;
  --green: #00cc66;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
}

/* ── CONFETTI ── */
#confetti-canvas {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999; display: none;
}

/* ── FT POPUP ── */
.ft-popup {
  position: fixed;
  bottom: 50%; left: 50%;
  transform: translate(-50%, 50%);
  background: #1a1a2e;
  border: 1px solid var(--gold);
  border-radius: 20px;
  padding: 32px 28px 24px;
  text-align: center;
  z-index: 999;
  width: min(90vw, 360px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes popIn {
  from { opacity: 0; transform: translate(-50%, 50%) scale(0.8); }
  to   { opacity: 1; transform: translate(-50%, 50%) scale(1); }
}

.ft-popup-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: var(--muted);
  font-size: 1rem; cursor: pointer; padding: 4px 8px;
}
.ft-popup-close:hover { color: var(--text); }

.ft-popup-icon { font-size: 2.5rem; margin-bottom: 8px; }
.ft-popup-title {
  font-size: 1.4rem; font-weight: 900;
  color: var(--gold); margin-bottom: 8px;
}
.ft-popup-sub {
  font-size: 0.82rem; color: var(--muted);
  line-height: 1.5; margin-bottom: 16px;
}
.ft-popup-next {
  font-size: 1rem; font-weight: 800;
  color: var(--text); margin-bottom: 18px;
  padding: 10px; background: rgba(255,255,255,0.05);
  border-radius: 10px; line-height: 1.4;
}
.ft-popup-btn {
  display: inline-block;
  background: linear-gradient(135deg, #FFD700, #FF6B35);
  color: #000; font-weight: 800; font-size: 0.9rem;
  padding: 10px 24px; border-radius: 10px;
  text-decoration: none;
}

/* ── NAV ── */
nav {
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex; align-items: center; gap: 20px;
  height: 48px;
  position: sticky; top: 0; z-index: 100;
}

.logo {
  font-size: 1.3rem; font-weight: 900;
  background: linear-gradient(90deg, #FFD700, #FF6B35, #FF2D55);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  text-decoration: none; letter-spacing: -0.5px;
}

nav a { color: var(--muted); text-decoration: none; font-size: 0.88rem; font-weight: 500; }
nav a:hover { color: var(--text); }

/* ── MAIN ── */
main { max-width: 1100px; margin: 0 auto; padding: 12px 16px 60px; }

/* ── COMPACT HERO ── */
.hero-compact {
  text-align: center;
  padding: 12px 0 8px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  flex-wrap: wrap;
}

.hero-compact h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 900; letter-spacing: -0.5px;
  background: linear-gradient(90deg, #FFD700, #FF6B35, #FF2D55, #FF6B35, #FFD700);
  background-size: 200%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  0%   { background-position: 0% }
  100% { background-position: 200% }
}

.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #cc0000; color: #fff;
  font-size: 0.68rem; font-weight: 800; letter-spacing: 1px;
  padding: 3px 10px; border-radius: 20px; text-transform: uppercase;
  white-space: nowrap;
}
.live-badge::before {
  content: ''; width: 6px; height: 6px;
  background: #fff; border-radius: 50%;
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.7); }
}

/* ── INFO BAR ── */
.info-bar {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 16px;
  margin: 8px 0 12px;
  font-size: 0.8rem; color: var(--muted);
}
.info-bar-item { white-space: nowrap; }
.info-bar-divider { color: rgba(255,255,255,0.2); }

/* ── SCOREBOARD ── */
#scoreboard {
  border-radius: 18px; padding: 20px 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 0 60px rgba(0,0,0,0.6);
  transition: background 0.5s ease;
}

.teams-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 8px;
}

.team-block { flex: 1; text-align: center; }
.team-block h2 {
  font-size: clamp(0.9rem, 2.5vw, 1.3rem);
  font-weight: 800;
  text-shadow: 0 2px 12px rgba(0,0,0,0.8);
}

.score-center {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px; min-width: 100px;
}
.score-digits { display: flex; align-items: center; gap: 6px; }

.score-digit {
  font-size: clamp(2.2rem, 7vw, 4rem);
  font-weight: 900; width: 54px; text-align: center;
  background: rgba(0,0,0,0.4); border-radius: 10px;
  padding: 4px 6px; line-height: 1;
  text-shadow: 0 4px 20px rgba(0,0,0,0.9);
  transition: all 0.3s ease;
}
.score-sep { font-size: 2rem; font-weight: 900; color: rgba(255,255,255,0.4); }

.match-minute {
  font-size: 0.8rem; font-weight: 700;
  background: rgba(0,0,0,0.5);
  padding: 2px 10px; border-radius: 20px; letter-spacing: 1px;
}

/* ── CHEER SECTION ── */
.cheer-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; margin-bottom: 14px;
}
.cheer-section h3 {
  text-align: center; font-size: 0.9rem; color: var(--gold);
  margin-bottom: 12px; letter-spacing: 0.5px;
  text-transform: uppercase; font-weight: 800;
}
.cheer-buttons { display: flex; gap: 10px; margin-bottom: 12px; }

.cheer-btn {
  flex: 1; padding: 14px 10px;
  border: none; border-radius: 10px; color: #fff;
  font-size: 0.95rem; font-weight: 800; cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  position: relative; overflow: hidden;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  /* touch target: min 48px */
  min-height: 52px;
}
.cheer-btn:active, .cheer-btn.cheering {
  transform: scale(0.94); box-shadow: 0 0 30px rgba(255,255,255,0.2);
}
.cheer-btn::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,0); transition: background 0.3s; }
.cheer-btn.cheering::after { background: rgba(255,255,255,0.25); }

.cheer-counts { display: flex; gap: 8px; align-items: center; font-size: 0.82rem; }
.cheer-team { flex: 1; text-align: center; color: var(--muted); }
.cheer-count-num { font-weight: 800; font-size: 1rem; color: var(--text); }
.cheer-bar-wrap {
  flex: 2; height: 7px; background: rgba(255,255,255,0.08);
  border-radius: 4px; display: flex; overflow: hidden;
}
.cheer-bar { height: 100%; border-radius: 4px; transition: width 0.4s ease; }

/* ── MATCH LAYOUT ── */
.match-layout {
  display: grid;
  grid-template-columns: 1fr 1fr 300px;
  gap: 16px; margin-bottom: 16px; align-items: start;
}
.match-body { display: contents; }

.ad-sidebar { display: flex; flex-direction: column; gap: 12px; }
.ad-sidebar-unit {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  min-height: 250px; display: flex;
  align-items: center; justify-content: center;
}
.ad-placeholder-inner {
  text-align: center; padding: 20px 16px;
}

@media (max-width: 900px) {
  .match-layout { grid-template-columns: 1fr 1fr; }
  .ad-sidebar { display: none; }
}
@media (max-width: 640px) {
  .match-layout { grid-template-columns: 1fr; }
  main { padding: 10px 12px 60px; }
  .hero-compact { padding: 8px 0 6px; }
  .info-bar { font-size: 0.72rem; padding: 7px 12px; }
  #scoreboard { padding: 14px 10px; }
  .cheer-section { padding: 12px; }
  .cheer-btn { padding: 12px 8px; font-size: 0.85rem; }
}

/* ── PITCH & COMMENTARY ── */
.pitch-wrap {
  background: #1a1a2e; border-radius: 14px;
  border: 1px solid var(--border); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  min-height: 320px;
}
#pitch { display: block; width: 100%; max-width: 280px; height: auto; aspect-ratio: 280/480; }

.commentary-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px; display: flex; flex-direction: column;
}
#commentary-feed {
  flex: 1; overflow-y: auto; display: flex;
  flex-direction: column; gap: 7px;
  max-height: 360px;
}
.comment {
  background: rgba(255,255,255,0.04);
  border-left: 3px solid rgba(255,255,255,0.1);
  border-radius: 0 8px 8px 0; padding: 7px 10px;
  font-size: 0.85rem; animation: slideIn 0.3s ease; color: var(--muted);
}
.comment.goal-comment {
  background: rgba(255,215,0,0.12); border-left-color: var(--gold);
  color: var(--gold); font-weight: 700; font-size: 0.95rem;
}
.comment.kickoff-comment,
.comment.halftime-comment,
.comment.fulltime-comment {
  background: rgba(0,204,102,0.1); border-left-color: var(--green);
  color: var(--green); font-weight: 700;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── VOICE BUTTON ── */
.voice-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--muted); font-size: 0.72rem; font-weight: 700;
  padding: 4px 10px; border-radius: 20px; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
}
.voice-btn.voice-on {
  background: rgba(0,204,102,0.15);
  border-color: var(--green); color: var(--green);
}

/* ── NO MATCH ── */
#no-match { text-align: center; padding: 60px 20px; color: var(--muted); }
#no-match h2 { font-size: 1.6rem; color: var(--gold); margin-bottom: 12px; }

/* ── SCHEDULE TEASER ── */
.schedule-teaser {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; margin-top: 16px;
}
.bracket-link-btn {
  display: inline-block;
  background: linear-gradient(135deg,#FFD700,#FF6B35);
  color: #000; font-weight: 800; padding: 9px 18px;
  border-radius: 10px; text-decoration: none; font-size: 0.88rem;
}

/* ── BRACKET PAGE ── */
.bracket-grid { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; }
.bracket-round { min-width: 170px; flex: 1; }
.bracket-round h3 {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px;
  color: var(--gold); margin-bottom: 10px; text-align: center;
}
.bracket-match {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 11px;
  margin-bottom: 8px; font-size: 0.83rem;
}
.bracket-match-date { font-size: 0.68rem; color: var(--muted); margin-bottom: 5px; }
.bracket-team { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; }
.bracket-team.winner { color: var(--gold); font-weight: 700; }
.bracket-team.loser  { color: var(--muted); }
.bracket-score { font-weight: 800; min-width: 18px; text-align: right; }

/* ── LIVE CHAT ── */
.chat-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 16px;
  overflow: hidden;
  display: flex; flex-direction: column;
}

.chat-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 800; font-size: 0.9rem;
}

.chat-online {
  font-size: 0.72rem; color: var(--green); font-weight: 600;
}

.chat-feed {
  height: 260px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px;
  scroll-behavior: smooth;
}

.chat-msg {
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
}

.chat-msg.chat-bot {
  background: rgba(255,215,0,0.06);
  border-left: 3px solid var(--gold);
}

.chat-meta {
  font-size: 0.68rem; color: var(--muted);
  font-weight: 600; letter-spacing: 0.3px;
}

.chat-bot .chat-meta { color: var(--gold); }

.chat-text {
  font-size: 0.85rem; color: var(--text);
  line-height: 1.4; word-break: break-word;
}

.chat-input-row {
  display: flex; gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}

.chat-input {
  flex: 1; background: rgba(255,255,255,0.06);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 0.88rem;
  padding: 8px 12px; outline: none;
  min-height: 40px;
}
.chat-input:focus { border-color: rgba(255,255,255,0.2); }
.chat-input::placeholder { color: var(--muted); }

.chat-send-btn {
  background: var(--gold); color: #000;
  font-weight: 800; font-size: 0.85rem;
  padding: 8px 18px; border: none;
  border-radius: 8px; cursor: pointer;
  white-space: nowrap; min-height: 40px;
  transition: opacity 0.2s;
}
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; background: var(--muted); }

@media (max-width: 640px) {
  .chat-feed { height: 200px; }
}

/* ── FOOTER ── */
footer {
  text-align: center; padding: 20px;
  color: var(--muted); font-size: 0.78rem;
  border-top: 1px solid var(--border);
}
footer a { color: var(--muted); }

/* ── UTILS ── */
.page-title { font-size: 1.5rem; font-weight: 900; margin-bottom: 16px; color: var(--gold); }
