:root {
  /* Modern Minimal Color System */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-card: #ffffff;
  --bg-card-hover: #f9f9f9;

  --accent-primary: #1e9b8a;
  --accent-secondary: #717171;
  --accent-tertiary: #ff6b5b;

  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-dim: #959595;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 3px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12);
  --border-color: #e0e0e0;

  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-mono: 'Menlo', 'Monaco', 'Courier New', monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Header & Typography */
h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--accent-primary);
  margin-bottom: 1rem;
}

h2,
h3 {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.5px;
}

/* Navigation & Buttons */
nav {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

button {
  background: var(--accent-primary);
  border: none;
  padding: 0.5rem 1.25rem;
  color: white;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 150ms ease-out;
}

button:hover {
  background: #17826f;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
}

.btn-secondary:hover {
  background: var(--accent-secondary);
  box-shadow: var(--shadow-md);
}

/* Game Containers */
#game-container {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  min-height: 400px;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

/* Bingo Grid */
.bingo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 0 auto;
  max-width: 600px;
  aspect-ratio: 1;
}

.bingo-cell {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 150ms ease-out;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
  overflow: hidden;
  color: var(--text-secondary);
  font-weight: 500;
}

.bingo-cell:hover {
  background: #eeeeee;
  border-color: var(--accent-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.bingo-cell.marked {
  background: #e0f5f1;
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.bingo-cell.marked::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  animation: flash 0.3s ease-out;
}

@keyframes flash {
  0% {
    opacity: 0;
    transform: scale(1.1);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
  }
}

/* Bingo Alert */
.bingo-alert {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border: 2px solid var(--accent-primary);
  padding: 3rem 4rem;
  border-radius: var(--radius-md);
  z-index: 1000;
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

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

/* Feud Styles */
.feud-container {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.score-board {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 3rem;
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.team-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 150px;
}

.team-score span {
  font-size: 2.5rem;
  font-family: var(--font-mono);
  margin-top: 0.5rem;
  font-weight: 700;
}

.team-score.red {
  color: var(--accent-error);
}
.team-score.blue {
  color: var(--accent-primary);
}

.question-display {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: var(--radius-md);
  margin-bottom: 3rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.question-display h4 {
  font-size: 1.5rem;
  margin: 0;
  color: var(--text-primary);
}

.big-buzzer {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.2);
  background: radial-gradient(circle at 30% 30%, #ff4444, #990000);
  color: white;
  font-size: 1.5rem;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.4),
    inset 0 5px 15px rgba(255, 255, 255, 0.4),
    0 0 30px rgba(255, 0, 0, 0.3);
  transition:
    transform 0.1s,
    box-shadow 0.1s;
  position: relative;
  overflow: hidden;
}

.big-buzzer:active {
  transform: scale(0.95);
  box-shadow:
    0 5px 10px rgba(0, 0, 0, 0.4),
    inset 0 5px 15px rgba(255, 255, 255, 0.4),
    0 0 20px rgba(255, 0, 0, 0.3);
}

.big-buzzer:disabled {
  background: #333;
  border-color: #555;
  color: #888;
  box-shadow: none;
  cursor: not-allowed;
}

/* Loading State */
#loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 50vh;
  color: var(--accent-primary);
  font-family: var(--font-mono);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

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