/* ============================================
   WinPredict Pro — Retro-Futuristic Dark Theme
   ============================================ */

:root {
  --bg-primary: #080B14;
  --bg-secondary: #0D1220;
  --bg-card: #111827;
  --bg-card-hover: #161f35;
  --border: rgba(99, 179, 237, 0.12);
  --border-bright: rgba(99, 179, 237, 0.3);

  --green: #00FF88;
  --green-dim: #00cc6a;
  --green-glow: rgba(0, 255, 136, 0.25);
  --red: #FF3B5C;
  --red-dim: #cc2f4a;
  --red-glow: rgba(255, 59, 92, 0.25);
  --violet: #B44FFF;
  --violet-dim: #8f3fcc;
  --violet-glow: rgba(180, 79, 255, 0.25);
  --gold: #FFD700;
  --gold-glow: rgba(255, 215, 0, 0.2);
  --cyan: #00D4FF;
  --cyan-glow: rgba(0, 212, 255, 0.2);

  --text-primary: #F0F4FF;
  --text-secondary: #8899BB;
  --text-muted: #4A5568;

  --font-display: 'Clash Display', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --font-body: 'Outfit', sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.04) inset;
  --shadow-glow-green: 0 0 30px var(--green-glow);
  --shadow-glow-red: 0 0 30px var(--red-glow);
  --shadow-glow-violet: 0 0 30px var(--violet-glow);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Background Grid ── */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ── Particles ── */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.particle {
  position: absolute;
  border-radius: 50%;
  animation: floatUp linear infinite;
  opacity: 0;
}
@keyframes floatUp {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 11, 20, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.logo-icon { font-size: 24px; filter: drop-shadow(0 0 8px var(--gold)); }
.logo-accent { color: var(--cyan); }
.header-stats {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}
.stat-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}
.stat-dot.green { background: var(--green); box-shadow: 0 0 6px var(--green); }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
.stat-value {
  color: var(--cyan);
  font-weight: 700;
}

/* ── Main ── */
.main {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* ── Hero ── */
.hero { text-align: center; padding: 20px 0 10px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 59, 92, 0.1);
  border: 1px solid rgba(255, 59, 92, 0.3);
  border-radius: 100px;
  padding: 6px 18px;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 1.5px;
  color: var(--red);
  margin-bottom: 24px;
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,59,92,0.3); }
  50% { box-shadow: 0 0 0 8px rgba(255,59,92,0); }
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 18px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--green) 0%, var(--cyan) 50%, var(--violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Period & Countdown ── */
.period-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.period-card, .countdown-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.period-card::before, .countdown-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
}
.period-label, .countdown-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.period-number {
  font-family: var(--font-mono);
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 2px;
  text-shadow: 0 0 20px var(--cyan-glow);
  margin-bottom: 12px;
  word-break: break-all;
}
.period-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.period-dot { color: var(--text-muted); }
.period-status { color: var(--green); font-weight: 500; }

.countdown-display {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.countdown-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.countdown-num {
  font-family: var(--font-mono);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  text-shadow: 0 0 30px rgba(255,255,255,0.2);
  min-width: 2ch;
  text-align: center;
}
.countdown-unit {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-muted);
}
.countdown-sep {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
  margin-bottom: 14px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.countdown-bar-wrap {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 100px;
  overflow: hidden;
}
.countdown-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  border-radius: 100px;
  transition: width 1s linear;
  box-shadow: 0 0 10px var(--cyan-glow);
}

/* ── Section Header ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
}
.refresh-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 100px;
  padding: 7px 18px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--cyan);
  cursor: pointer;
  transition: all 0.2s;
}
.refresh-btn:hover {
  background: rgba(0, 212, 255, 0.2);
  box-shadow: 0 0 20px var(--cyan-glow);
}
.refresh-icon { font-size: 16px; display: inline-block; }
.refresh-btn.spinning .refresh-icon { animation: spin 0.6s linear; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Prediction Grid ── */
.prediction-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.pred-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.pred-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card), 0 12px 40px rgba(0,0,0,0.3);
}
.pred-card.reveal {
  animation: cardReveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes cardReveal {
  0% { transform: scale(0.9) translateY(10px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.pred-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}
.pred-card-icon { font-size: 18px; }
.pred-card-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-muted);
}

/* Color Prediction */
.pred-color-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.color-circle {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.1);
  transition: all 0.4s ease;
  position: relative;
}
.color-circle.green-color {
  background: radial-gradient(circle at 35% 35%, #00FF88, #00994d);
  box-shadow: 0 0 30px var(--green-glow), 0 0 60px rgba(0,255,136,0.1);
  border-color: var(--green);
}
.color-circle.red-color {
  background: radial-gradient(circle at 35% 35%, #FF3B5C, #99233a);
  box-shadow: 0 0 30px var(--red-glow), 0 0 60px rgba(255,59,92,0.1);
  border-color: var(--red);
}
.color-circle.violet-color {
  background: radial-gradient(circle at 35% 35%, #B44FFF, #6b2f99);
  box-shadow: 0 0 30px var(--violet-glow), 0 0 60px rgba(180,79,255,0.1);
  border-color: var(--violet);
}
.color-circle.red-violet-color {
  background: conic-gradient(var(--red) 0deg 180deg, var(--violet) 180deg 360deg);
  box-shadow: 0 0 30px rgba(255,59,92,0.2), 0 0 30px rgba(180,79,255,0.2);
}
.color-circle.green-violet-color {
  background: conic-gradient(var(--green) 0deg 180deg, var(--violet) 180deg 360deg);
  box-shadow: 0 0 30px rgba(0,255,136,0.2), 0 0 30px rgba(180,79,255,0.2);
}
.color-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Number Prediction */
.pred-number-display {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}
.number-circle {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a2540, #0d1220);
  border: 2px solid var(--border-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 42px;
  font-weight: 700;
  color: var(--text-primary);
  transition: all 0.4s ease;
  box-shadow: 0 0 0 0 transparent;
}
.number-circle.active {
  border-color: var(--gold);
  box-shadow: 0 0 30px var(--gold-glow), 0 0 60px rgba(255,215,0,0.05);
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold-glow);
}

/* Size Prediction */
.pred-size-display {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}
.size-badge {
  padding: 14px 36px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
  transition: all 0.4s ease;
}
.size-badge.big {
  background: rgba(255, 59, 92, 0.15);
  border: 2px solid var(--red);
  color: var(--red);
  box-shadow: 0 0 20px var(--red-glow);
}
.size-badge.small {
  background: rgba(0, 255, 136, 0.1);
  border: 2px solid var(--green);
  color: var(--green);
  box-shadow: 0 0 20px var(--green-glow);
}

/* Confidence Bar */
.pred-confidence { margin-bottom: 16px; }
.conf-label {
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.conf-bar-wrap {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 6px;
}
.conf-bar {
  height: 100%;
  border-radius: 100px;
  width: 0%;
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.conf-bar.green-bar { background: linear-gradient(90deg, var(--green-dim), var(--green)); box-shadow: 0 0 8px var(--green-glow); }
.conf-bar.red-bar { background: linear-gradient(90deg, var(--red-dim), var(--red)); box-shadow: 0 0 8px var(--red-glow); }
.conf-bar.violet-bar { background: linear-gradient(90deg, var(--violet-dim), var(--violet)); box-shadow: 0 0 8px var(--violet-glow); }
.conf-bar.gold-bar { background: linear-gradient(90deg, #cc9900, var(--gold)); box-shadow: 0 0 8px var(--gold-glow); }
.conf-bar.cyan-bar { background: linear-gradient(90deg, #0099bb, var(--cyan)); box-shadow: 0 0 8px var(--cyan-glow); }
.conf-pct {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: right;
}

/* Prediction Tags */
.pred-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pred-tag {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid;
  letter-spacing: 0.5px;
}
.pred-tag.green { color: var(--green); border-color: rgba(0,255,136,0.3); background: rgba(0,255,136,0.06); }
.pred-tag.red { color: var(--red); border-color: rgba(255,59,92,0.3); background: rgba(255,59,92,0.06); }
.pred-tag.violet { color: var(--violet); border-color: rgba(180,79,255,0.3); background: rgba(180,79,255,0.06); }
.pred-tag.gold { color: var(--gold); border-color: rgba(255,215,0,0.3); background: rgba(255,215,0,0.06); }
.pred-tag.cyan { color: var(--cyan); border-color: rgba(0,212,255,0.3); background: rgba(0,212,255,0.06); }

/* ── Accuracy Meter ── */
.accuracy-section {}
.accuracy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 40px;
  box-shadow: var(--shadow-card);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.accuracy-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--violet));
}
.accuracy-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}
.accuracy-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}
.accuracy-badge {
  background: rgba(0,255,136,0.1);
  border: 1px solid rgba(0,255,136,0.3);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  padding: 3px 10px;
  border-radius: 100px;
  animation: badgePulse 2s ease-in-out infinite;
}
.accuracy-meter {
  max-width: 600px;
  margin: 0 auto 16px;
}
.meter-track {
  height: 20px;
  background: rgba(255,255,255,0.06);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
  margin-bottom: 8px;
}
.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--green));
  border-radius: 100px;
  width: 0%;
  transition: width 2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 20px var(--green-glow);
}
.meter-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}
.accuracy-pct {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -2px;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 8px;
}
.accuracy-sub {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ── History Table ── */
.history-section {}
.history-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
.history-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.history-table {
  width: 100%;
  border-collapse: collapse;
}
.history-table thead tr {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.history-table th {
  padding: 14px 20px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 400;
}
.history-table td {
  padding: 14px 20px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-family: var(--font-mono);
}
.history-table tbody tr {
  transition: background 0.2s;
}
.history-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}
.history-table tbody tr:last-child td { border-bottom: none; }
.history-table tbody tr.new-row {
  animation: rowSlideIn 0.4s ease forwards;
}
@keyframes rowSlideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.color-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.color-dot.green { background: var(--green); box-shadow: 0 0 6px var(--green-glow); }
.color-dot.red { background: var(--red); box-shadow: 0 0 6px var(--red-glow); }
.color-dot.violet { background: var(--violet); box-shadow: 0 0 6px var(--violet-glow); }

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}
.result-badge.correct {
  background: rgba(0,255,136,0.1);
  color: var(--green);
  border: 1px solid rgba(0,255,136,0.3);
}
.result-badge.wrong {
  background: rgba(255,59,92,0.1);
  color: var(--red);
  border: 1px solid rgba(255,59,92,0.3);
}

/* ── Game Selector ── */
.game-selector-section {}
.game-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.game-tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 24px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.game-tab:hover {
  border-color: var(--border-bright);
  color: var(--text-primary);
}
.game-tab.active {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 20px var(--cyan-glow);
}

/* ── Stats Row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-card);
  transition: all 0.2s;
}
.stat-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
}
.stat-icon { font-size: 28px; }
.stat-num {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-lbl {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Footer ── */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
}
.footer-inner { max-width: 600px; margin: 0 auto; }
.footer-logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}
.footer-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.6;
}
.footer-copy {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .period-section { grid-template-columns: 1fr; }
  .prediction-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .header-stats .stat-pill:nth-child(3) { display: none; }
  .history-table th:nth-child(5),
  .history-table td:nth-child(5) { display: none; }
  .accuracy-pct { font-size: 48px; }
}
@media (max-width: 480px) {
  .main { padding: 24px 16px 60px; gap: 32px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .game-tabs { gap: 8px; }
  .game-tab { padding: 10px 16px; font-size: 13px; }
}