/* ============================================
   CSS VARIABLES & RESET
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-glass: rgba(255,255,255,0.03);
  --bg-glass-hover: rgba(255,255,255,0.06);
  --border-glass: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.15);
  --accent: #58a6ff;
  --accent-green: #3fb950;
  --accent-orange: #d29922;
  --accent-red: #f85149;
  --accent-purple: #a371f7;
  --accent-cyan: #39c5cf;
  --accent-pink: #db61a2;
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --gold: #ffd700;
  --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --gradient-5: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(88,166,255,0.3);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

/* ============================================
   BASE STYLES
   ============================================ */
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Background Pattern */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(88,166,255,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(163,113,247,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(63,185,80,0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Selection */
::selection { background: var(--accent); color: var(--bg-primary); }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px var(--accent), 0 0 15px var(--accent); }
  50% { box-shadow: 0 0 15px var(--accent), 0 0 30px var(--accent); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes slideRight {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.animate-fade { animation: fadeIn 0.4s ease-out; }
.animate-fade-up { animation: fadeInUp 0.5s ease-out; }
.animate-scale { animation: scaleIn 0.3s ease-out; }
.animate-bounce { animation: bounceIn 0.6s ease-out; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* ============================================
   LAYOUT
   ============================================ */
.app-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px;
  min-height: 100vh;
}

/* ============================================
   TOP BAR / HEADER
   ============================================ */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  position: sticky;
  top: 8px;
  z-index: 100;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
}
.logo:hover { transform: scale(1.02); }
.logo-icon {
  font-size: 1.8rem;
  animation: float 3s ease-in-out infinite;
}
.logo-text {
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--gradient-3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}
.logo-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  -webkit-text-fill-color: var(--text-muted);
}

.quick-stats {
  display: flex;
  gap: 16px;
  align-items: center;
}
.qs-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  transition: var(--transition);
}
.qs-item:hover { background: var(--bg-glass-hover); }
.qs-icon { font-size: 1rem; }
.qs-val { font-weight: 700; color: var(--accent); }

.back-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.back-btn:hover { background: var(--accent); color: var(--bg-primary); border-color: var(--accent); }
.back-btn.visible { display: inline-flex; }

.save-btn {
  padding: 8px;
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  border-radius: var(--radius-sm);
}
.save-btn:hover { background: var(--bg-glass); transform: scale(1.1); }

/* ============================================
   VIEWS / PAGES
   ============================================ */
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.4s ease-out; }

/* ============================================
   INTRO SCREEN
   ============================================ */
#intro-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 85vh;
  text-align: center;
  padding: 20px;
}

.intro-hero {
  margin-bottom: 40px;
}
.intro-icon {
  font-size: 5rem;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}
.intro-title {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #58a6ff, #a371f7, #3fb950);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.intro-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.intro-form {
  width: 100%;
  max-width: 420px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
.intro-form label {
  display: block;
  text-align: left;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.intro-form input,
.intro-form select {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 20px;
  outline: none;
  transition: var(--transition);
}
.intro-form input:focus,
.intro-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88,166,255,0.15);
}
.intro-form select option { background: var(--bg-secondary); }

.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--gradient-4);
  color: var(--bg-primary);
  font-size: 1rem;
  font-weight: 800;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  width: 100%;
  padding: 14px;
  margin-top: 12px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}
.btn-secondary:hover {
  background: var(--bg-glass-hover);
  border-color: var(--accent);
}

/* ============================================
   DASHBOARD / HOME
   ============================================ */
.dashboard-header {
  text-align: center;
  margin-bottom: 28px;
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
}
.player-name {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--gradient-5);
  color: var(--bg-primary);
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Condition Bars */
.condition-section {
  margin-bottom: 24px;
}
.condition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.cond-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: var(--transition);
}
.cond-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.cond-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.cond-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.cond-val {
  font-size: 0.9rem;
  font-weight: 800;
}
.cond-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}
.cond-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Menu Grid */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.menu-card {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
}
.menu-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-3);
  opacity: 0;
  transition: var(--transition);
}
.menu-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.menu-card:hover::before { opacity: 1; }
.menu-card:nth-child(1):hover::before { background: var(--gradient-4); }
.menu-card:nth-child(2):hover::before { background: var(--gradient-1); }
.menu-card:nth-child(3):hover::before { background: var(--gradient-2); }
.menu-card:nth-child(4):hover::before { background: var(--gradient-3); }
.menu-card:nth-child(5):hover::before { background: var(--gradient-5); }
.menu-card:nth-child(6):hover::before { background: linear-gradient(135deg, #ffd700, #ff8c00); }

.mc-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
}
.mc-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.mc-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Recent Match Widget */
.recent-match {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.rm-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.rm-score {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent-green);
}
.rm-detail {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ============================================
   MATCH SCREEN
   ============================================ */
.match-container { max-width: 850px; margin: 0 auto; }

/* Scoreboard */
.scoreboard {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 16px;
  text-align: center;
}
.sb-teams {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sb-team { flex: 1; }
.sb-team-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.sb-score {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -1px;
}
.sb-overs {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.sb-vs {
  padding: 0 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}
.sb-target {
  margin-top: 12px;
  padding: 8px 16px;
  background: rgba(210,153,34,0.15);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-orange);
}

/* Pitch Report */
.pitch-report {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.pr-icon { font-size: 1.6rem; }
.pr-info { flex: 1; }
.pr-type { font-weight: 700; font-size: 0.95rem; }
.pr-effect { font-size: 0.75rem; color: var(--text-muted); }

/* Match Info Bar */
.match-info-bar {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.mi-item { text-align: center; min-width: 70px; }
.mi-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.mi-val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent);
}

/* Batsmen Display */
.batsmen-display {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.batsman-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: var(--transition);
}
.batsman-card.on-strike {
  border-color: var(--accent-green);
  box-shadow: 0 0 12px rgba(63,185,80,0.15);
}
.bc-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bc-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 4px 0;
}
.bc-stats {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.bc-stats span { margin-right: 10px; }
.strike-indicator { color: var(--accent-green); font-weight: 700; }

/* Action Panel */
.action-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.action-title {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.batting-styles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.style-btn {
  padding: 14px 8px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.style-btn:hover { border-color: var(--accent); }
.style-btn.selected {
  border-color: var(--accent-green);
  background: rgba(63,185,80,0.1);
}
.style-emoji { font-size: 1.5rem; display: block; margin-bottom: 6px; }
.style-label { font-size: 0.8rem; font-weight: 700; }
.style-desc { font-size: 0.65rem; color: var(--text-muted); margin-top: 2px; }

.btn-play {
  width: 100%;
  padding: 16px;
  background: var(--gradient-4);
  color: var(--bg-primary);
  font-size: 1rem;
  font-weight: 800;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(63,185,80,0.3);
}

/* This Over Display */
.this-over {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-glass);
}
.this-over-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-right: 6px;
}
.over-ball {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
}
.over-ball.dot { background: var(--bg-tertiary); color: var(--text-muted); }
.over-ball.runs { background: var(--accent); color: var(--bg-primary); }
.over-ball.boundary { background: var(--accent-orange); color: var(--bg-primary); }
.over-ball.six { background: var(--accent-purple); color: white; }
.over-ball.wicket { background: var(--accent-red); color: white; }

/* Commentary */
.commentary-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  max-height: 200px;
  overflow-y: auto;
}
.comm-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.comm-line {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.85rem;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
}
.comm-line:first-of-type { font-weight: 600; }
.comm-over {
  display: inline-block;
  min-width: 36px;
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  margin-right: 8px;
}
.comm-wicket { color: var(--accent-red) !important; }
.comm-boundary { color: var(--accent-orange) !important; }
.comm-six { color: var(--accent-purple) !important; }

/* ============================================
   MATCH RESULT OVERLAY
   ============================================ */
.match-result-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  backdrop-filter: blur(10px);
  animation: fadeIn 0.4s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.match-result-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  text-align: center;
  max-width: 480px;
  width: 90%;
  margin: 20px auto;
  animation: bounceIn 0.6s ease;
  position: relative;
}
.mr-icon { font-size: 4rem; margin-bottom: 16px; }
.mr-title { font-size: 2rem; font-weight: 900; margin-bottom: 8px; }
.mr-title.win { color: var(--accent-green); }
.mr-title.lose { color: var(--accent-red); }
.mr-sub { color: var(--text-secondary); margin-bottom: 24px; font-size: 1rem; }

.mr-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.mr-stat {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 14px;
}
.mrs-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }
.mrs-val { font-size: 1.4rem; font-weight: 800; color: var(--accent); }

.mr-rewards {
  background: rgba(63,185,80,0.1);
  border: 1px solid rgba(63,185,80,0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
}
.mr-rewards h4 { font-size: 0.8rem; color: var(--accent-green); margin-bottom: 6px; }
.mr-rewards p { font-size: 0.9rem; color: var(--text-secondary); }

.btn-continue {
  padding: 14px 40px;
  background: var(--gradient-4);
  color: var(--bg-primary);
  font-weight: 800;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
}
.btn-continue:hover { transform: translateY(-2px); }

/* ============================================
   INNINGS BREAK
   ============================================ */
.innings-break {
  text-align: center;
  padding: 48px 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
}
.innings-break h3 { font-size: 1.4rem; margin-bottom: 12px; }
.ib-score { font-size: 3rem; font-weight: 900; color: var(--accent-orange); }
.innings-break p { color: var(--text-secondary); margin-top: 10px; }

/* ============================================
   STATS PAGE
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  transition: var(--transition);
}
.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.sc-val {
  font-size: 1.8rem;
  font-weight: 900;
  background: var(--gradient-3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sc-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Match History Table */
.history-section h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.history-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-glass);
}
.history-table th {
  background: var(--bg-tertiary);
  padding: 12px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.history-table td {
  padding: 12px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-glass);
}
.history-table tr:hover { background: var(--bg-glass); }
.score-highlight { font-weight: 700; color: var(--accent-green); }
.result-won { color: var(--accent-green); font-weight: 600; }
.result-lost { color: var(--accent-red); font-weight: 600; }
.result-tied { color: var(--accent-orange); font-weight: 600; }

/* ============================================
   TRAINING PAGE
   ============================================ */
.cooldown-notice {
  text-align: center;
  padding: 28px;
  background: rgba(248,81,73,0.1);
  border: 1px solid rgba(248,81,73,0.2);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}
.cooldown-icon { font-size: 2.5rem; margin-bottom: 8px; }
.cooldown-notice p { color: var(--text-secondary); font-size: 0.95rem; }

.training-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.train-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: var(--transition);
}
.train-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.tc-icon { font-size: 2.2rem; margin-bottom: 10px; }
.tc-name { font-weight: 700; font-size: 1rem; margin-bottom: 6px; }
.tc-desc { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 12px; }
.tc-effect {
  font-size: 0.75rem;
  color: var(--accent-green);
  padding: 6px 12px;
  background: rgba(63,185,80,0.1);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  display: inline-block;
}
.btn-train {
  padding: 10px 28px;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  transition: var(--transition);
}
.btn-train:hover { background: var(--accent-green); }
.btn-train:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================
   CAREER LADDER
   ============================================ */
.ladder-container { max-width: 600px; margin: 0 auto; }
.ladder-step {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  margin-bottom: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: var(--transition);
  position: relative;
}
.ladder-step.current {
  border-color: var(--accent-green);
  background: rgba(63,185,80,0.05);
  box-shadow: 0 0 20px rgba(63,185,80,0.1);
}
.ladder-step.completed { border-color: rgba(63,185,80,0.3); }
.ladder-step.locked { opacity: 0.4; }

.ladder-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}
.ladder-step.current .ladder-icon {
  background: var(--accent-green);
  animation: glow 2s infinite;
}
.ladder-step.completed .ladder-icon { background: rgba(63,185,80,0.3); }

.ladder-info { flex: 1; }
.li-name { font-weight: 700; font-size: 1rem; }
.li-req { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.ladder-check { color: var(--accent-green); font-size: 1.3rem; }

/* ============================================
   SCHEDULE PAGE
   ============================================ */
.schedule-list { display: flex; flex-direction: column; gap: 10px; }
.schedule-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.schedule-item:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}
.schedule-item:first-child { border-left: 3px solid var(--accent-green); }

.si-left { display: flex; align-items: center; gap: 14px; }
.si-icon { font-size: 1.4rem; }
.si-opponent { font-weight: 700; font-size: 0.95rem; }
.si-league { font-size: 0.75rem; color: var(--text-muted); }
.si-right { text-align: right; }
.si-format { font-size: 0.75rem; color: var(--accent); font-weight: 600; }
.si-diff {
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
  margin-top: 4px;
  display: inline-block;
}
.diff-easy { background: rgba(63,185,80,0.15); color: var(--accent-green); }
.diff-medium { background: rgba(210,153,34,0.15); color: var(--accent-orange); }
.diff-hard { background: rgba(248,81,73,0.15); color: var(--accent-red); }

/* ============================================
   SHOP PAGE
   ============================================ */
.shop-balance {
  text-align: center;
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}
.balance-amount {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--gold);
}
.balance-label { font-size: 0.8rem; color: var(--text-muted); }

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.shop-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  transition: var(--transition);
}
.shop-item:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.item-icon { font-size: 2.8rem; margin-bottom: 10px; }
.item-name { font-weight: 700; margin-bottom: 6px; }
.item-boost {
  font-size: 0.75rem;
  color: var(--accent-green);
  margin-bottom: 8px;
}
.item-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 14px;
}
.btn-buy {
  padding: 10px 24px;
  background: var(--gold);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  transition: var(--transition);
}
.btn-buy:hover { background: #ffed4a; }
.btn-buy:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-buy.owned { background: var(--accent-green); }

/* ============================================
   SECTION HEADER
   ============================================ */
.section-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-glass);
}
.section-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-header p { color: var(--text-secondary); font-size: 0.9rem; }

/* ============================================
   NOTIFICATIONS / POPUPS
   ============================================ */
.event-popup {
  position: fixed;
  top: 80px;
  right: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-orange);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  z-index: 500;
  max-width: 320px;
  animation: slideRight 0.4s ease;
  box-shadow: var(--shadow-lg);
}
.event-popup .ep-text { font-size: 0.9rem; }

.save-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--accent-green);
  color: var(--bg-primary);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  animation: fadeInUp 0.3s ease;
  z-index: 999;
  box-shadow: var(--shadow-md);
}

/* ============================================
   STORY / INTRO SYSTEM
   ============================================ */
.story-container {
  max-width: 600px;
  margin: 0 auto;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.story-progress {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  margin-bottom: 40px;
  overflow: hidden;
}

.story-progress-bar {
  height: 100%;
  background: var(--gradient-4);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.story-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-narrator {
  text-align: center;
  padding: 40px 20px;
}

.story-image {
  font-size: 4rem;
  margin-bottom: 24px;
  animation: float 3s ease-in-out infinite;
}

.story-text {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

.story-text .highlight {
  color: var(--accent);
  font-weight: 700;
}

.story-dialogue {
  width: 100%;
  max-width: 500px;
}

.dialogue-speaker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.speaker-avatar {
  width: 60px;
  height: 60px;
  background: var(--bg-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  border: 2px solid var(--accent);
}

.speaker-name {
  font-weight: 700;
  font-size: 1.1rem;
}

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

.dialogue-bubble {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  margin-left: 30px;
}

.dialogue-bubble::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 20px;
  border: 10px solid transparent;
  border-right-color: var(--bg-secondary);
}

.dialogue-bubble p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-primary);
  font-style: italic;
}

.story-event {
  width: 100%;
  max-width: 500px;
}

.event-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  line-height: 1.8;
}

.event-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-orange);
  display: block;
  margin-bottom: 8px;
}

.club-reveal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 20px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.club-icon {
  font-size: 3rem;
}

.club-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
}

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

.club-specialty {
  font-size: 0.85rem;
  color: var(--accent-green);
}

.story-controls {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
}

.story-btn {
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.story-btn-back {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.story-btn-back:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.story-btn-next {
  background: var(--gradient-4);
  color: var(--bg-primary);
  flex: 1;
  max-width: 200px;
}

.story-btn-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(63,185,80,0.3);
}

.story-skip {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  margin-top: 20px;
  padding: 8px;
  transition: var(--transition);
}

.story-skip:hover {
  color: var(--text-secondary);
}

/* ============================================
   SOUND TOGGLE
   ============================================ */
.sound-toggle {
  padding: 8px;
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  border-radius: var(--radius-sm);
  opacity: 0.7;
}

.sound-toggle:hover {
  opacity: 1;
  background: var(--bg-glass);
}

.sound-toggle.muted {
  opacity: 0.4;
}

/* ============================================
   SET METER
   ============================================ */
.set-meter {
  margin-top: 8px;
}

.set-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.set-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.set-status {
  font-size: 0.7rem;
  font-weight: 700;
}

.set-bar {
  height: 5px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.set-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease, background 0.4s ease;
}

/* Batting order badge */
.bat-order-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 4px;
}

.bat-order-top {
  background: rgba(88,166,255,0.15);
  color: var(--accent);
}

.bat-order-middle {
  background: rgba(210,153,34,0.15);
  color: var(--accent-orange);
}

.bat-order-lower {
  background: rgba(248,81,73,0.15);
  color: var(--accent-red);
}

/* Pre-innings simulation screen */
.pre-innings {
  text-align: center;
  padding: 40px 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
}

.pre-innings h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.pre-innings .pi-score {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent-orange);
  margin: 16px 0;
}

.pre-innings .pi-info {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.pre-innings .pi-callup {
  margin-top: 20px;
  padding: 16px;
  background: rgba(63,185,80,0.1);
  border: 1px solid rgba(63,185,80,0.2);
  border-radius: var(--radius-md);
  font-weight: 700;
  color: var(--accent-green);
}

/* ============================================
   SIMULATE BUTTON
   ============================================ */
.btn-simulate {
  width: 100%;
  padding: 16px;
  background: var(--gradient-1);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  margin-top: 12px;
}

.btn-simulate:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102,126,234,0.3);
}

.simulate-info {
  text-align: center;
  padding: 20px;
  background: rgba(102,126,234,0.1);
  border: 1px solid rgba(102,126,234,0.2);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

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

/* ============================================
   PLAYER OUT INDICATOR
   ============================================ */
.player-out-banner {
  background: linear-gradient(135deg, rgba(248,81,73,0.15), rgba(248,81,73,0.05));
  border: 1px solid rgba(248,81,73,0.3);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
  animation: fadeIn 0.4s ease;
}

.player-out-banner .pob-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.player-out-banner .pob-text {
  font-weight: 700;
  color: var(--accent-red);
  margin-bottom: 4px;
}

.player-out-banner .pob-score {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ============================================
   ENHANCED ANIMATIONS
   ============================================ */
@keyframes celebrate {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.1) rotate(-5deg); }
  75% { transform: scale(1.1) rotate(5deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.animate-celebrate {
  animation: celebrate 0.5s ease;
}

.animate-shake {
  animation: shake 0.3s ease;
}

/* ============================================
   SHOT ANIMATIONS (Google Cricket Style)
   ============================================ */

/* Full-screen overlay container */
.shot-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ===== FOUR ANIMATION ===== */
.four-anim {
  animation: fourOverlayFade 1.4s ease forwards;
}

.four-anim .shot-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 50% 50%, rgba(210,153,34,0.25) 0%, transparent 65%);
  animation: shotPulse 0.6s ease;
}

.four-anim .shot-text {
  font-size: 4rem;
  font-weight: 900;
  color: #fbbf24;
  text-shadow: 0 0 40px rgba(251,191,36,0.6), 0 0 80px rgba(251,191,36,0.3);
  animation: shotTextPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  position: relative;
  z-index: 2;
}

.four-anim .shot-sub {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(251,191,36,0.8);
  margin-top: 4px;
  animation: shotSubSlide 0.5s 0.15s ease both;
  position: relative;
  z-index: 2;
}

.four-anim .shot-particles {
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
}

.four-anim .shot-particles span {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fbbf24;
  animation: particleBurst 0.8s ease-out forwards;
}

/* ===== SIX ANIMATION ===== */
.six-anim {
  animation: sixOverlayFade 1.8s ease forwards;
}

.six-anim .shot-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 50% 50%, rgba(163,113,247,0.3) 0%, transparent 60%);
  animation: shotPulseBig 0.7s ease;
}

.six-anim .shot-text {
  font-size: 5rem;
  font-weight: 900;
  color: #a371f7;
  text-shadow: 0 0 50px rgba(163,113,247,0.7), 0 0 100px rgba(163,113,247,0.4), 0 4px 20px rgba(0,0,0,0.5);
  animation: sixTextPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  position: relative;
  z-index: 2;
}

.six-anim .shot-sub {
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(163,113,247,0.9);
  margin-top: 6px;
  animation: shotSubSlide 0.5s 0.2s ease both;
  position: relative;
  z-index: 2;
}

.six-anim .shot-particles span {
  position: absolute;
  border-radius: 50%;
  animation: particleBurstBig 1s ease-out forwards;
}

.six-anim .shot-ring {
  position: absolute;
  width: 80px; height: 80px;
  border: 3px solid rgba(163,113,247,0.6);
  border-radius: 50%;
  animation: ringExpand 0.8s ease-out forwards;
  z-index: 1;
}

/* ===== WICKET ANIMATION ===== */
.wicket-anim {
  animation: wicketOverlayFade 1.5s ease forwards;
}

.wicket-anim .shot-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 50% 50%, rgba(248,81,73,0.25) 0%, transparent 60%);
  animation: wicketShake 0.4s ease;
}

.wicket-anim .shot-text {
  font-size: 3.5rem;
  font-weight: 900;
  color: #f85149;
  text-shadow: 0 0 30px rgba(248,81,73,0.5), 0 0 60px rgba(248,81,73,0.3);
  animation: wicketTextSlam 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  position: relative;
  z-index: 2;
}

.wicket-anim .shot-sub {
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(248,81,73,0.8);
  margin-top: 6px;
  animation: shotSubSlide 0.4s 0.15s ease both;
  position: relative;
  z-index: 2;
}

.wicket-anim .stump-pieces {
  position: absolute;
  top: 50%; left: 50%;
}

.wicket-anim .stump-pieces span {
  position: absolute;
  width: 3px;
  background: #f85149;
  border-radius: 2px;
  animation: stumpFly 0.7s ease-out forwards;
  opacity: 0.8;
}

/* ===== SHARED KEYFRAMES ===== */

@keyframes shotPulse {
  0% { transform: scale(0.3); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: scale(1.5); opacity: 0.3; }
}

@keyframes shotPulseBig {
  0% { transform: scale(0.2); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: scale(2); opacity: 0.2; }
}

@keyframes shotTextPop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes sixTextPop {
  0% { transform: scale(0) rotate(-10deg); opacity: 0; }
  50% { transform: scale(1.4) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes shotSubSlide {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes fourOverlayFade {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes sixOverlayFade {
  0%, 65% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes wicketOverlayFade {
  0%, 60% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes particleBurst {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { opacity: 0; }
}

@keyframes particleBurstBig {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { opacity: 0; }
}

@keyframes ringExpand {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(6); opacity: 0; }
}

@keyframes wicketShake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-8px); }
  30% { transform: translateX(8px); }
  45% { transform: translateX(-6px); }
  60% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
  90% { transform: translateX(3px); }
}

@keyframes wicketTextSlam {
  0% { transform: scale(3) rotate(-5deg); opacity: 0; }
  60% { transform: scale(0.9) rotate(1deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes stumpFly {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0.9; }
  100% { opacity: 0; }
}

/* Mobile sizing */
@media (max-width: 480px) {
  .four-anim .shot-text { font-size: 3rem; }
  .six-anim .shot-text { font-size: 3.5rem; }
  .wicket-anim .shot-text { font-size: 2.5rem; }
  .four-anim .shot-sub,
  .six-anim .shot-sub,
  .wicket-anim .shot-sub { font-size: 0.8rem; }
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--bg-tertiary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   SIMULATION PROGRESS
   ============================================ */
.sim-progress {
  text-align: center;
  padding: 40px;
}

.sim-progress .sim-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  animation: float 2s ease-in-out infinite;
}

.sim-progress .sim-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.sim-progress .sim-score {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .app-container { padding: 8px; }
  .top-bar {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .quick-stats { gap: 6px; }
  .qs-item { padding: 4px 6px; font-size: 0.7rem; }
  
  .intro-title { font-size: 2rem; }
  .intro-form { padding: 20px; }
  
  .menu-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .menu-card { padding: 18px 12px; }
  .mc-icon { font-size: 1.6rem; }
  .mc-title { font-size: 0.85rem; }
  
  .scoreboard { padding: 14px; }
  .sb-score { font-size: 1.8rem; }
  .sb-team-name { font-size: 0.7rem; }
  .batsmen-display { grid-template-columns: 1fr; }
  
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-card { padding: 14px 10px; }
  .sc-val { font-size: 1.4rem; }
  
  .match-result-card { padding: 24px 16px; }
  .mr-icon { font-size: 3rem; margin-bottom: 10px; }
  .mr-title { font-size: 1.4rem; }
  .mr-sub { font-size: 0.9rem; margin-bottom: 16px; }
  .mr-stats { gap: 8px; }
  .mr-stat { padding: 10px 8px; }
  .mrs-val { font-size: 1.1rem; }
  .btn-continue { padding: 12px 28px; font-size: 0.9rem; }
  
  .innings-break { padding: 30px 20px; }
  .ib-score { font-size: 2.2rem; }
  .pre-innings { padding: 30px 16px; }
  .pre-innings .pi-score { font-size: 1.8rem; }
  
  .pitch-report { padding: 10px 12px; gap: 10px; }
  .pr-icon { font-size: 1.2rem; }
  .pr-type { font-size: 0.85rem; }
  
  .action-panel { padding: 14px; }
  .btn-play { padding: 14px; font-size: 0.9rem; }
  
  .commentary-box { max-height: 150px; padding: 12px; }
  
  .training-result-card { padding: 24px 16px; }
  .train-result-icon { font-size: 2.5rem; }
  .train-result-title { font-size: 1.1rem; }
  
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .shop-item { padding: 14px 10px; }
  .item-icon { font-size: 2rem; }
  
  .training-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .train-card { padding: 16px 12px; }
  
  .schedule-item { padding: 12px 14px; }
  
  .hof-card { padding: 16px; }
  .hof-stats { gap: 10px; }
  
  .guide-section-body { font-size: 0.85rem; }
  
  .story-container { padding: 12px; }
}

@media (max-width: 480px) {
  .intro-title { font-size: 1.5rem; }
  .intro-icon { font-size: 3.5rem; }
  .intro-subtitle { font-size: 0.9rem; }
  .intro-form { padding: 16px; }
  
  .menu-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .menu-card { padding: 14px 8px; }
  .mc-icon { font-size: 1.4rem; }
  .mc-title { font-size: 0.8rem; }
  .mc-sub { font-size: 0.65rem; }
  
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .stat-card { padding: 12px 8px; }
  .sc-val { font-size: 1.2rem; }
  .sc-label { font-size: 0.6rem; }
  
  .batting-styles { gap: 4px; }
  .style-btn { padding: 8px 4px; }
  .style-emoji { font-size: 1.2rem; }
  .style-label { font-size: 0.7rem; }
  .style-desc { font-size: 0.6rem; }
  
  .scoreboard { padding: 10px; }
  .sb-score { font-size: 1.5rem; }
  .sb-vs { padding: 0 8px; font-size: 0.7rem; }
  
  .match-result-card { padding: 20px 12px; }
  .mr-icon { font-size: 2.5rem; margin-bottom: 8px; }
  .mr-title { font-size: 1.2rem; }
  .mr-stats { grid-template-columns: 1fr 1fr; gap: 6px; }
  .mrs-val { font-size: 1rem; }
  .mrs-label { font-size: 0.6rem; }
  
  .match-info-bar { padding: 8px; gap: 4px; }
  .mi-val { font-size: 0.85rem; }
  .mi-label { font-size: 0.6rem; }
  
  .bc-name { font-size: 0.85rem; }
  .bc-stats { font-size: 0.7rem; }
  .bc-stats span { margin-right: 6px; }
  
  .over-ball { width: 26px; height: 26px; font-size: 0.65rem; }
  
  .story-btn { padding: 10px 16px; font-size: 0.85rem; }
  .story-text { font-size: 0.9rem; }
  .story-image { font-size: 3rem; }
  .dialogue-bubble { margin-left: 0; padding: 14px; }
  .speaker-avatar { width: 44px; height: 44px; font-size: 1.4rem; }
  .club-icon { font-size: 2rem; }
  .club-name { font-size: 1rem; }
  
  .section-header h2 { font-size: 1.2rem; }
  .section-header p { font-size: 0.8rem; }
  
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .shop-item { padding: 12px 8px; }
  .item-icon { font-size: 1.6rem; }
  .item-name { font-size: 0.85rem; }
  .item-price { font-size: 0.9rem; }
  
  .training-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  
  .hof-stats { gap: 8px; }
  .hof-stat-val { font-size: 1rem; }
  .hof-name { font-size: 1.1rem; }
  
  .dashboard-header { padding: 16px; }
  .player-name { font-size: 1.4rem; }
  .level-badge { padding: 6px 14px; font-size: 0.7rem; }
  
  .condition-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .cond-card { padding: 10px 12px; }
}

/* ============================================
   ADDITIONAL POLISH
   ============================================ */
   
/* Tooltip styles */
[title] {
  position: relative;
}

/* Better focus states */
button:focus, input:focus, select:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}

/* Smooth page transitions */
.view {
  transition: opacity 0.3s ease;
}

/* Card hover lift effect */
.menu-card, .stat-card, .train-card, .shop-item, .schedule-item {
  will-change: transform;
}

/* Better text rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Loading state for buttons */
button.loading {
  pointer-events: none;
  opacity: 0.7;
}

button.loading::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Match screen enhancements */
.scoreboard {
  position: relative;
  overflow: hidden;
}

.scoreboard::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  animation: shimmer 3s infinite;
}

/* Better over ball animations */
.over-ball {
  transform: scale(0);
  animation: popIn 0.3s ease forwards;
}

@keyframes popIn {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Commentary line enhancements */
.comm-line:first-of-type {
  background: var(--bg-glass);
  padding: 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

/* Pulsing effect for important elements */
.level-badge {
  animation: subtlePulse 3s ease-in-out infinite;
}

@keyframes subtlePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(250,183,20,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(250,183,20,0); }
}

/* Match win/lose celebration */
.mr-title.win {
  animation: celebrate 0.6s ease;
}

.mr-title.lose {
  animation: shake 0.4s ease;
}

/* Intro screen version badge */
.version-badge {
  position: fixed;
  bottom: 16px;
  left: 16px;
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.5;
}

/* Better mobile touch targets */
@media (hover: none) {
  .menu-card, .style-btn, .btn-play, .btn-primary, .btn-secondary {
    min-height: 48px;
  }
}

/* ============================================
   ANNOUNCEMENT BANNER
   ============================================ */
.announce-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(88,101,242,0.15), rgba(88,101,242,0.05));
  border: 1px solid rgba(88,101,242,0.3);
  border-radius: var(--radius-md);
  animation: fadeIn 0.4s ease;
  position: relative;
}

.announce-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  animation: float 3s ease-in-out infinite;
}

.announce-body {
  flex: 1;
}

.announce-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #5865F2;
  margin-bottom: 2px;
}

.announce-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.announce-btn {
  padding: 8px 16px;
  background: #5865F2;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  display: inline-block;
}

.announce-btn:hover {
  background: #4752c4;
  transform: translateY(-1px);
}

.announce-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.announce-close:hover {
  opacity: 1;
}

@media (max-width: 480px) {
  .announce-bar {
    flex-wrap: wrap;
    padding: 12px 14px;
    padding-right: 30px;
  }
  .announce-btn {
    width: 100%;
    text-align: center;
    margin-top: 4px;
  }
}

/* ============================================
   SCORECARD TICKER
   ============================================ */
.scorecard-ticker {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  align-items: center;
}

.ticker-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 6px;
}

.ticker-ball {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  animation: tickerPop 0.3s ease;
}

.ticker-ball.t-dot { background: var(--bg-tertiary); color: var(--text-muted); }
.ticker-ball.t-run { background: rgba(88,166,255,0.2); color: var(--accent); }
.ticker-ball.t-four { background: rgba(251,191,36,0.25); color: #fbbf24; }
.ticker-ball.t-six { background: rgba(163,113,247,0.25); color: #a371f7; }
.ticker-ball.t-wicket { background: rgba(248,81,73,0.25); color: #f85149; }
.ticker-ball.t-over-sep { background: none; color: var(--text-muted); font-size: 0.5rem; width: 8px; }

@keyframes tickerPop {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ============================================
   REPLAY HIGHLIGHTS
   ============================================ */
.replay-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.95);
  z-index: 1000;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.replay-container {
  max-width: 500px;
  width: 90%;
  margin: 30px auto;
  text-align: center;
}

.replay-title {
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.replay-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.replay-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 16px;
  text-align: center;
  animation: fadeInUp 0.5s ease both;
}

.replay-card-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.replay-card-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.replay-card-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
}

.replay-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

.replay-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
  margin-bottom: 30px;
}

.replay-skip {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 8px 16px;
  transition: var(--transition);
}

.replay-skip:hover { color: var(--text-secondary); }

@media (max-width: 480px) {
  .replay-card { padding: 20px 16px; }
  .replay-card-value { font-size: 1.5rem; }
  .replay-card-icon { font-size: 2.2rem; }
  .replay-title { font-size: 1.3rem; }
  .scorecard-ticker { gap: 3px; padding: 8px 10px; }
  .ticker-ball { width: 18px; height: 18px; font-size: 0.55rem; }
}

/* ============================================
   ENDORSEMENT & FOLLOWERS
   ============================================ */
.endorse-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: var(--transition);
}

.endorse-card:hover { border-color: var(--gold); }

.endorse-icon { font-size: 1.6rem; flex-shrink: 0; }
.endorse-info { flex: 1; }
.endorse-name { font-weight: 700; font-size: 0.9rem; }
.endorse-income { font-size: 0.75rem; color: var(--gold); }
.endorse-badge {
  padding: 4px 12px;
  background: rgba(255,215,0,0.15);
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold);
}

.followers-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.followers-count {
  font-weight: 800;
  color: var(--accent-pink);
}

/* ============================================
   AUCTION SYSTEM
   ============================================ */
.auction-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.95);
  z-index: 1000;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.auction-container {
  max-width: 520px;
  width: 90%;
  margin: 30px auto;
}

.auction-header {
  text-align: center;
  margin-bottom: 24px;
}

.auction-header h2 {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold);
}

.auction-bid {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 16px;
}

.auction-bid:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255,215,0,0.1);
}

.auction-bid-team {
  flex: 1;
}

.auction-bid-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.auction-bid-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.auction-bid-price {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--gold);
}

/* ============================================
   TRAINING RESULT OVERLAY
   ============================================ */
.training-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.training-result-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  margin: 20px auto;
  animation: bounceIn 0.5s ease;
}

.train-result-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.train-result-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-green);
  margin-bottom: 4px;
}

.train-result-name {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.train-result-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.train-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.train-stat-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.train-stat-gain {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-green);
}

/* ============================================
   HOW TO PLAY GUIDE
   ============================================ */
.guide-section {
  margin-bottom: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.guide-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: var(--transition);
}

.guide-section-header:hover {
  background: var(--bg-glass-hover);
}

.guide-section-icon {
  font-size: 1.5rem;
}

.guide-section-title {
  font-weight: 700;
  font-size: 1rem;
  flex: 1;
}

.guide-section-toggle {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: transform 0.3s;
}

.guide-section.open .guide-section-toggle {
  transform: rotate(180deg);
}

.guide-section-body {
  display: none;
  padding: 0 20px 20px;
  line-height: 1.7;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.guide-section.open .guide-section-body {
  display: block;
  animation: fadeIn 0.3s ease;
}

.guide-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  margin: 8px 0;
}

.guide-tip-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ============================================
   STORY EVENTS
   ============================================ */
.story-choice {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  margin-bottom: 10px;
}
.story-choice:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.story-choice-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.story-choice-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================
   HALL OF FAME
   ============================================ */
.hof-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.hof-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-5);
}

.hof-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.hof-rank {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 2rem;
  opacity: 0.2;
  font-weight: 900;
}

.hof-name {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.hof-level {
  font-size: 0.8rem;
  color: var(--accent-orange);
  margin-bottom: 12px;
}

.hof-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hof-stat {
  text-align: center;
}

.hof-stat-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
}

.hof-stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

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

.hof-empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.3;
}
