/* ============================================================
   style.css — World Cup Oracle 2026
   Design: Dark glassmorphism · Stadium vibes · Neon accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&family=Bebas+Neue&display=swap');

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
  --bg-deep:       #070b14;
  --bg-mid:        #0d1626;
  --glass-bg:      rgba(255,255,255,0.04);
  --glass-border:  rgba(255,255,255,0.09);
  --glass-hover:   rgba(255,255,255,0.08);

  --gold:          #f5c842;
  --gold-dim:      #a8882e;
  --green:         #00e676;
  --green-dim:     #00563e;
  --red:           #ff4757;
  --blue:          #29b6f6;
  --purple:        #7c4dff;

  --text-primary:  #f0f4ff;
  --text-secondary:#8899bb;
  --text-muted:    #445570;

  --radius-sm:     8px;
  --radius-md:     14px;
  --radius-lg:     22px;

  --shadow-glow:   0 0 40px rgba(245,200,66,0.12);
  --shadow-card:   0 4px 30px rgba(0,0,0,0.5);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Animated Background ─────────────────────────────────────── */
.bg-layer {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(245,200,66,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 80%,  rgba(124,77,255,0.1) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 10% 60%,  rgba(41,182,246,0.08) 0%, transparent 60%);
}

/* Stadium grid lines */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* Floating orbs */
.orb {
  position: fixed; border-radius: 50%; pointer-events: none; z-index: 0;
  filter: blur(80px); opacity: 0.4; animation: drift 20s ease-in-out infinite;
}
.orb-1 { width: 500px; height: 500px; top: -100px; left: -100px; background: rgba(245,200,66,0.15); animation-duration: 25s; }
.orb-2 { width: 400px; height: 400px; bottom: -80px; right: -80px; background: rgba(124,77,255,0.2); animation-duration: 18s; animation-delay: -8s; }

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -40px) scale(1.05); }
  66%       { transform: translate(-20px, 30px) scale(0.95); }
}

/* ── Layout ──────────────────────────────────────────────────── */
.app-wrap {
  position: relative; z-index: 1;
  max-width: 1400px; margin: 0 auto;
  padding: 0 20px 60px;
}

/* ── Hero Header ─────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 70px 20px 50px;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(245,200,66,0.12);
  border: 1px solid rgba(245,200,66,0.3);
  border-radius: 100px;
  padding: 6px 18px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 28px;
  animation: fadeUp 0.6s ease both;
}

.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(52px, 10vw, 110px);
  line-height: 0.9;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #fff 0%, var(--gold) 50%, #fff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite, fadeUp 0.7s ease 0.1s both;
}

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

.hero-sub {
  margin-top: 18px;
  font-size: clamp(14px, 2vw, 18px);
  color: var(--text-secondary);
  font-weight: 300;
  animation: fadeUp 0.7s ease 0.2s both;
}

.hero-actions {
  margin-top: 32px;
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  animation: fadeUp 0.7s ease 0.3s both;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 100px;
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.2s ease;
  text-decoration: none;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #e0a800);
  color: #0a0a0a;
  box-shadow: 0 0 20px rgba(245,200,66,0.4);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(245,200,66,0.6);
}

.btn-ghost {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}
.btn-ghost:hover {
  background: var(--glass-hover);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.btn .icon { font-size: 18px; }

.btn.spinning .icon { animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Glass Utility ───────────────────────────────────────────── */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
}

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs-bar {
  display: flex; gap: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  padding: 5px;
  width: fit-content;
  margin: 0 auto 36px;
  animation: fadeUp 0.7s ease 0.4s both;
}

.tab-btn {
  background: transparent; border: none;
  padding: 10px 24px; border-radius: 100px;
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer; transition: all 0.2s ease;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
  background: linear-gradient(135deg, rgba(245,200,66,0.25), rgba(245,200,66,0.1));
  border: 1px solid rgba(245,200,66,0.35);
  color: var(--gold);
  box-shadow: 0 0 15px rgba(245,200,66,0.15);
}

.tab-panel { display: none; animation: fadeUp 0.35s ease; }
.tab-panel.active { display: block; }

/* ── Group Stage ─────────────────────────────────────────────── */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.group-card {
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.group-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 20px rgba(245,200,66,0.08);
}

.group-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: 0.06em;
  color: var(--gold); margin-bottom: 14px;
}

.standings-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.standings-table th {
  color: var(--text-muted); font-weight: 500;
  padding: 4px 6px; text-align: right; border-bottom: 1px solid var(--glass-border);
}
.standings-table th:first-child { text-align: left; }
.standings-table td { padding: 7px 6px; text-align: right; }
.standings-table td:first-child { text-align: left; }
.standings-table tr:not(:last-child) td { border-bottom: 1px solid rgba(255,255,255,0.04); }

.team-cell { font-weight: 500; white-space: nowrap; }
.pts { font-weight: 700; color: var(--text-primary); }
.pos { color: var(--green); }
.neg { color: var(--red); }

.advancing td { }
.advancing .team-cell::after { content: ' ✓'; color: var(--green); font-size: 10px; }
.third .team-cell::after { content: ' ~'; color: var(--gold); font-size: 10px; opacity: 0.7; }

/* ── Knockout Bracket ────────────────────────────────────────── */
.bracket-wrap {
  position: relative;
}

.bracket-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 20px;
  scroll-snap-type: x mandatory;
}
.bracket-scroll::-webkit-scrollbar { height: 5px; }
.bracket-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
.bracket-scroll::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 10px; }

.bracket-col {
  min-width: 220px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

.round-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px; letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.match-card {
  padding: 12px 14px;
  margin-bottom: 12px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.match-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245,200,66,0.25);
  box-shadow: 0 6px 30px rgba(0,0,0,0.6), 0 0 12px rgba(245,200,66,0.08);
}

.match-team {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  gap: 8px;
}
.match-team.match-winner {
  color: var(--text-primary); font-weight: 700;
}
.match-team.match-winner .score {
  background: var(--gold);
  color: #0a0a0a;
  border-radius: var(--radius-sm);
  padding: 1px 8px;
  min-width: 24px; text-align: center;
}

.score { font-weight: 700; min-width: 20px; text-align: center; }
.pen-note { font-size: 10px; color: var(--text-muted); margin-top: 4px; text-align: center; }

/* ── Champion Banner ─────────────────────────────────────────── */
.champion-banner {
  margin-top: 32px; padding: 40px 24px;
  text-align: center;
  background: linear-gradient(135deg, rgba(245,200,66,0.12), rgba(245,200,66,0.04));
  border: 1px solid rgba(245,200,66,0.35);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 60px rgba(245,200,66,0.15);
  animation: fadeUp 0.5s ease;
}
.champion-banner.hidden { display: none; }
.champion-flag { font-size: 80px; line-height: 1; margin-bottom: 12px; }
.champion-name { font-family: 'Bebas Neue', sans-serif; font-size: 52px; letter-spacing: 0.05em; color: var(--gold); }
.champion-label { font-size: 16px; color: var(--text-secondary); margin-top: 6px; letter-spacing: 0.05em; }

/* ── Monte Carlo Panel ───────────────────────────────────────── */
.mc-controls {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  margin-bottom: 28px;
  padding: 20px 24px;
}

.mc-input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  padding: 8px 20px;
  font-size: 14px; color: var(--text-secondary);
}
.mc-input-wrap input {
  background: transparent; border: none; outline: none;
  color: var(--text-primary); font-family: 'Inter', sans-serif;
  font-size: 14px; font-weight: 600; width: 80px; text-align: center;
}

.mc-status-bar {
  margin-bottom: 20px;
}
.mc-status {
  font-size: 13px; color: var(--text-muted); margin-bottom: 8px;
}
.mc-progress-track {
  height: 4px; background: rgba(255,255,255,0.07);
  border-radius: 10px; overflow: hidden;
}
.mc-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  border-radius: 10px;
  transition: width 0.3s ease;
}

.mc-results { display: flex; flex-direction: column; gap: 8px; }

.mc-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  transition: background 0.15s;
  font-size: 14px;
}
.mc-row:hover { background: var(--glass-hover); }
.mc-row.mc-top {
  background: rgba(245,200,66,0.08);
  border-color: rgba(245,200,66,0.3);
  box-shadow: 0 0 20px rgba(245,200,66,0.1);
}

.mc-rank { width: 28px; color: var(--text-muted); font-size: 12px; font-weight: 600; }
.mc-flag { font-size: 20px; }
.mc-name { width: 140px; font-weight: 500; flex-shrink: 0; }
.mc-bar-wrap { flex: 1; height: 6px; background: rgba(255,255,255,0.07); border-radius: 10px; overflow: hidden; }
.mc-bar { height: 100%; background: linear-gradient(90deg, var(--green-dim), var(--green)); border-radius: 10px; transition: width 0.8s ease; }
.mc-row.mc-top .mc-bar { background: linear-gradient(90deg, var(--gold-dim), var(--gold)); }
.mc-pct { width: 52px; text-align: right; font-weight: 700; font-size: 13px; color: var(--text-secondary); }
.mc-row.mc-top .mc-pct { color: var(--gold); }

/* ── Section Header ──────────────────────────────────────────── */
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px; letter-spacing: 0.06em; color: var(--text-primary);
}
.section-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── Stats Strip ─────────────────────────────────────────────── */
.stats-strip {
  display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 32px;
  animation: fadeUp 0.5s ease 0.5s both;
}
.stat-pill {
  padding: 10px 20px; border-radius: 100px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  font-size: 13px;
}
.stat-pill strong { color: var(--gold); margin-right: 4px; }

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero { padding: 48px 16px 32px; }
  .tabs-bar { flex-wrap: wrap; border-radius: var(--radius-md); width: 100%; justify-content: center; }
  .tab-btn { padding: 9px 18px; font-size: 13px; }
  .mc-name { width: 100px; }
  .bracket-col { min-width: 180px; }
}
