@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  --bg-dark: #070b19;
  --bg-surface: #0f172a;
  --bg-card: #16203a;
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --accent-gold: #f7b801;
  --accent-cyan: #38bdf8;
  --accent-emerald: #00e676;
  
  --match-correct: #00c853;
  --match-correct-glow: rgba(0, 200, 83, 0.4);
  --match-partial: #e65100;
  --match-partial-bg: #d97706;
  --match-wrong: #374151;
  
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(247, 184, 1, 0.04) 0%, transparent 50%);
  color: #f8fafc;
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Ad Placement Containers */
.ad-container {
  transition: all 0.3s ease;
}

.ad-container:hover {
  border-color: rgba(247, 184, 1, 0.5);
  box-shadow: 0 0 15px rgba(247, 184, 1, 0.1);
}

/* Status Box Styling */
.status-green {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border: 1px solid #34d399;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
  color: #ffffff;
}

.status-yellow {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  border: 1px solid #fbbf24;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
  color: #ffffff;
}

.status-gray {
  background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
  border: 1px solid #6b7280;
  color: #9ca3af;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(247, 184, 1, 0.4);
  backdrop-filter: blur(12px);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), fadeOut 0.3s ease 2.7s forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

/* Team Badge Colors */
.badge-rcb { background: #d32f2f; color: #fff; }
.badge-csk { background: #fbc02d; color: #000; font-weight: 700; }
.badge-mi { background: #0288d1; color: #fff; }
.badge-kkr { background: #4a148c; color: #fff; }
.badge-rr { background: #e91e63; color: #fff; }
.badge-srh { background: #f57c00; color: #fff; }
.badge-gt { background: #1a237e; color: #fff; }
.badge-lsg { background: #00bcd4; color: #000; font-weight: 700; }
.badge-dc { background: #1565c0; color: #fff; }
.badge-pbks { background: #c62828; color: #fff; }

/* Custom Modal Backdrop Blur */
dialog::backdrop {
  background: rgba(7, 11, 25, 0.85);
  backdrop-filter: blur(8px);
}

/* Career Path Mode Visual Classes */
.timeline-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  padding: 1rem 1rem 1rem 1.75rem;
  border-radius: 1.25rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideInUp 0.4s ease-out forwards;
}

.timeline-card::before {
  content: '';
  position: absolute;
  left: -25px;
  top: 1.5rem;
  width: 10px;
  height: 10px;
  background: var(--accent-gold);
  border: 2px solid var(--bg-dark);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-gold);
  z-index: 10;
}

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

.international-card {
  background: linear-gradient(135deg, rgba(23, 37, 84, 0.7) 0%, rgba(15, 23, 42, 0.7) 100%);
  border: 1.5px solid rgba(247, 184, 1, 0.4);
  box-shadow: 0 0 20px rgba(247, 184, 1, 0.15);
  border-radius: 1.25rem;
  padding: 1.25rem;
  animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Tic-Tac-Toe Grid Game Styles */
.grid-header-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem 0.25rem;
  font-size: 9px;
  line-height: 1.15;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.3);
}

@media (min-width: 640px) {
  .grid-header-cell {
    font-size: 11px;
    padding: 0.75rem 0.5rem;
  }
}

.grid-playable-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border-radius: 0.85rem;
  background: rgba(30, 41, 59, 0.35);
  border: 1.5px dashed rgba(71, 85, 105, 0.4);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.grid-playable-cell:hover {
  background: rgba(51, 65, 85, 0.45);
  border-color: var(--accent-gold);
  transform: scale(1.02);
  color: white;
}

.grid-playable-cell.filled {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(4, 120, 87, 0.2) 100%);
  border: 2px solid rgba(16, 185, 129, 0.6);
  color: white;
  cursor: default;
}

.grid-playable-cell.filled:hover {
  transform: none;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(4, 120, 87, 0.2) 100%);
  border-color: rgba(16, 185, 129, 0.6);
}

.grid-playable-cell .plus-icon {
  font-size: 1.25rem;
  color: rgba(247, 184, 1, 0.6);
  transition: transform 0.2s ease;
}

.grid-playable-cell:hover .plus-icon {
  transform: rotate(90deg);
  color: var(--accent-gold);
}

.grid-playable-cell .player-name {
  font-size: 9px;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
  max-width: 100%;
}

@media (min-width: 640px) {
  .grid-playable-cell .player-name {
    font-size: 12px;
  }
}

.grid-playable-cell .rarity-badge {
  font-size: 7px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--accent-gold);
  background: rgba(247, 184, 1, 0.15);
  padding: 0.1rem 0.35rem;
  border-radius: 9999px;
  margin-top: 0.25rem;
  border: 0.5px solid rgba(247, 184, 1, 0.3);
}

@media (min-width: 640px) {
  .grid-playable-cell .rarity-badge {
    font-size: 8px;
    margin-top: 0.35rem;
  }
}

/* Shake Animation for incorrect attempts */
.shake {
  animation: shakeAnimation 0.5s ease-in-out;
}

@keyframes shakeAnimation {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* 2-Player Tic-Tac-Toe Claimed Cells */
.grid-playable-cell.p1-claimed {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(185, 28, 28, 0.2) 100%);
  border: 2px solid rgba(239, 68, 68, 0.7);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
  color: white;
  cursor: default;
}

.grid-playable-cell.p1-claimed:hover {
  transform: none;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(185, 28, 28, 0.2) 100%);
  border-color: rgba(239, 68, 68, 0.7);
}

.grid-playable-cell.p2-claimed {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(29, 78, 216, 0.2) 100%);
  border: 2px solid rgba(59, 130, 246, 0.7);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.15);
  color: white;
  cursor: default;
}

.grid-playable-cell.p2-claimed:hover {
  transform: none;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(29, 78, 216, 0.2) 100%);
  border-color: rgba(59, 130, 246, 0.7);
}

.player-badge-p1 {
  font-size: 7px;
  font-weight: 900;
  text-transform: uppercase;
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  margin-top: 0.25rem;
  border: 0.5px solid rgba(239, 68, 68, 0.3);
}

.player-badge-p2 {
  font-size: 7px;
  font-weight: 900;
  text-transform: uppercase;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.15);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  margin-top: 0.25rem;
  border: 0.5px solid rgba(59, 130, 246, 0.3);
}

@media (min-width: 640px) {
  .player-badge-p1, .player-badge-p2 {
    font-size: 8px;
    margin-top: 0.35rem;
  }
}

/* Winning line highlights */
.winning-line-highlight {
  animation: winPulse 1.2s infinite alternate ease-in-out;
  z-index: 15;
}

@keyframes winPulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
    filter: brightness(1.2);
  }
}


