/* ═══════════════════════════════════════════════════════════════
   EuroMLions — Site Styles
   Dark theme, lottery balls, playful energy
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg-primary: #0a0e1a;
  --bg-card: #131726;
  --bg-card-hover: #1a1f35;
  --bg-input: #1a1f35;
  --border: #2a2f45;
  --text-primary: #e8ecf4;
  --text-secondary: #8b93a8;
  --text-muted: #5a6178;
  --accent-gold: #ffd700;
  --accent-gold-dim: #b8960b;
  --accent-blue: #4a8eff;
  --accent-blue-dim: #2a5eb8;
  --ball-main-from: #1a3a8a;
  --ball-main-to: #3b6cf5;
  --ball-star-from: #b8860b;
  --ball-star-to: #ffd700;
  --match-green: #22c55e;
  --miss-red: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

/* ─── Reset ─────────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ─── Password Gate ─────────────────────────────────────────── */

#gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: 1000;
}

.gate-card {
  text-align: center;
  padding: 48px 40px;
  max-width: 400px;
  width: 100%;
}

.gate-logo {
  font-size: 4rem;
  margin-bottom: 12px;
  animation: float 3s ease-in-out infinite;
}

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

.gate-title {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-gold), #fff8dc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.gate-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 32px;
  line-height: 1.5;
}

.gate-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.gate-input-group input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.gate-input-group input:focus {
  border-color: var(--accent-gold);
}

.gate-input-group button {
  padding: 12px 24px;
  background: linear-gradient(
    135deg,
    var(--accent-gold-dim),
    var(--accent-gold)
  );
  color: #1a1a2e;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.gate-input-group button:hover {
  opacity: 0.9;
}

.gate-error {
  color: var(--miss-red);
  font-size: 0.85rem;
}

/* ─── Header ────────────────────────────────────────────────── */

.header {
  padding: 40px 0 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-gold), #fff8dc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.tagline {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ─── Navigation ────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  padding: 12px 0;
}

.nav .container {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.nav-btn {
  padding: 8px 20px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: 20px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-btn.active {
  color: var(--accent-gold);
  border-color: var(--accent-gold-dim);
  background: rgba(255, 215, 0, 0.08);
}

/* ─── Sections ──────────────────────────────────────────────── */

.section {
  display: none;
  padding: 32px 0 48px;
  animation: fadeIn 0.3s ease;
}

.section.active {
  display: block;
}

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

.section-header {
  margin-bottom: 28px;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.countdown {
  color: var(--accent-gold);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* ─── Prediction Card ───────────────────────────────────────── */

.prediction-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow);
}

.prediction-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 2px;
}

.prediction-sublabel {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ─── Lottery Balls ─────────────────────────────────────────── */

.balls-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.balls-row.small {
  gap: 6px;
}

.balls-divider {
  color: var(--text-muted);
  font-size: 1.2rem;
  margin: 12px 0;
}

.ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.15rem;
  font-family: var(--font-mono);
  transition: transform 0.2s;
}

.ball:hover {
  transform: scale(1.1);
}

.ball-main {
  background: linear-gradient(
    145deg,
    var(--ball-main-from),
    var(--ball-main-to)
  );
  color: white;
  box-shadow: 0 4px 16px rgba(59, 108, 245, 0.3);
}

.ball-star {
  background: linear-gradient(
    145deg,
    var(--ball-star-from),
    var(--ball-star-to)
  );
  color: #1a1a2e;
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.25);
}

.ball.small {
  width: 42px;
  height: 42px;
  font-size: 0.9rem;
}

.ball.match {
  box-shadow:
    0 0 0 3px var(--match-green),
    0 4px 16px rgba(34, 197, 94, 0.3);
}
.ball.miss {
  opacity: 0.4;
}

.uncertainty-row {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ─── Meta Row ──────────────────────────────────────────────── */

.meta-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.meta-item {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.meta-item span {
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* ─── Model Cards ───────────────────────────────────────────── */

.model-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.model-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color 0.2s;
}

.model-card:hover {
  border-color: var(--accent-blue-dim);
}

.model-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(74, 142, 255, 0.15);
  color: var(--accent-blue);
  font-weight: 500;
}

.model-badge.specialist {
  background: rgba(255, 215, 0, 0.12);
  color: var(--accent-gold);
}

.model-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.model-picks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.consensus-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.consensus-card strong {
  color: var(--accent-gold);
  font-weight: 600;
}

/* ─── History ───────────────────────────────────────────────── */

.history-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
}

.history-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.history-version {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.history-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  width: 72px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-result {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(34, 197, 94, 0.1);
  color: var(--match-green);
  font-weight: 600;
}

.history-result.none {
  background: rgba(239, 68, 68, 0.1);
  color: var(--miss-red);
}

.history-pending {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.history-models {
  margin-left: 4px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
  margin-top: 4px;
  margin-bottom: 4px;
}

.history-label.sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  width: 72px;
}

/* ─── Stats Table ──────────────────────────────────────────── */

.stats-table-wrap {
  overflow-x: auto;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

.stats-table th,
.stats-table td {
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.stats-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.stats-table td:first-child,
.stats-table th:first-child {
  text-align: left;
}

.stats-table td {
  color: var(--text-primary);
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

/* ─── Stats ─────────────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-gold);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.stat-baseline {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.eval-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
}

.eval-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.eval-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.eval-bar-label {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  width: 80px;
  text-align: right;
  flex-shrink: 0;
}

.eval-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
}

.eval-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    var(--accent-blue-dim),
    var(--accent-blue)
  );
  transition: width 0.6s ease;
}

.eval-bar-fill.baseline {
  background: var(--text-muted);
  opacity: 0.5;
}

/* ─── Footer ────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
}

.footer-brand {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.footer-disclaimer {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.footer-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ─── Responsive ────────────────────────────────────────────── */

@media (max-width: 600px) {
  .ball {
    width: 46px;
    height: 46px;
    font-size: 1rem;
  }

  .ball.small {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }

  .prediction-card {
    padding: 24px 16px;
  }
  .meta-row {
    flex-direction: column;
    gap: 8px;
    align-items: center;
  }
  .history-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .history-label {
    width: auto;
  }
}
