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

:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #12122a;
  --bg-card: rgba(255, 255, 255, 0.06);
  --bg-card-hover: rgba(255, 255, 255, 0.1);
  --text-primary: #f0f0f0;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.35);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.2);
  --accent: #6c5ce7;
  --accent-hover: #7c6cf7;
  --accent-glow: rgba(108, 92, 231, 0.4);
  --danger: #e74c3c;
  --success: #2ecc71;
  --warning: #f39c12;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;

  --ball-1: #ff4757;
  --ball-1-glow: rgba(255, 71, 87, 0.5);
  --ball-2: #2ed573;
  --ball-2-glow: rgba(46, 213, 115, 0.5);
  --ball-3: #ffa502;
  --ball-3-glow: rgba(255, 165, 2, 0.5);
  --ball-4: #a55eea;
  --ball-4-glow: rgba(165, 94, 234, 0.5);
  --ball-5: #ff6b81;
  --ball-5-glow: rgba(255, 107, 129, 0.5);
  --ball-6: #45aaf2;
  --ball-6-glow: rgba(69, 170, 242, 0.5);
  --ball-7: #2bcbba;
  --ball-7-glow: rgba(43, 203, 186, 0.5);
  --ball-8: #fd9644;
  --ball-8-glow: rgba(253, 150, 68, 0.5);
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2e 30%, #0a1a2e 60%, #0a0a1a 100%);
  background-size: 400% 400%;
  animation: bgShift 20s ease infinite;
}

@keyframes bgShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

/* ---- Login Screen ---- */
#login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: var(--shadow);
  animation: fadeUp 0.6s ease-out;
  position: relative;
}

.login-logo {
  font-size: 48px;
  margin-bottom: 8px;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

.login-card h1 {
  font-size: 36px;
  font-weight: 700;
  background: linear-gradient(135deg, #6c5ce7, #a55eea, #6c5ce7);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: bgShift 3s ease infinite;
}

.login-subtitle {
  color: var(--text-secondary);
  margin: 8px 0 28px;
  font-size: 14px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form input {
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: 16px;
  font-family: var(--font);
  outline: none;
  transition: var(--transition);
}

.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(255, 255, 255, 0.12);
}

.login-form input::placeholder {
  color: var(--text-muted);
}

.app-footer {
  position: fixed;
  bottom: 8px;
  right: 12px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  opacity: 0.7;
  z-index: 999;
  pointer-events: none;
}

.btn {
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #a55eea);
  color: white;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: scale(1.1);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* ---- Game Screen ---- */
#game-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.game-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  gap: 12px;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.game-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.score-display {
  display: flex;
  flex-direction: column;
}

.score-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.score-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  transition: var(--transition);
}

.score-value.pop {
  animation: scorePop 0.4s ease-out;
}

.player-display {
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 16px;
  border-left: 1px solid var(--border-color);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.game-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 0;
}

.board-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#board-container {
  position: relative;
  width: min(65vmin, 480px);
  height: min(65vmin, 480px);
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow), inset 0 0 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

#board-grid {
  display: grid;
  width: 100%;
  height: 100%;
  padding: 4px;
  gap: 2px;
  position: relative;
  z-index: 1;
}

.cell {
  position: relative;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.cell:hover {
  background: rgba(255, 255, 255, 0.06);
}

.cell.cursor {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
  z-index: 5;
}

.cell.path-preview {
  background: rgba(108, 92, 231, 0.12);
  box-shadow: inset 0 0 8px rgba(108, 92, 231, 0.15);
}

@media (hover: none) {
  .cell:hover {
    background: rgba(255, 255, 255, 0.03);
  }
}

.cell.empty-highlight {
  background: rgba(108, 92, 231, 0.15);
  box-shadow: inset 0 0 12px rgba(108, 92, 231, 0.1);
}

.cell.valid-move {
  background: rgba(46, 213, 115, 0.12);
  box-shadow: inset 0 0 8px rgba(46, 213, 115, 0.08);
}

.ball {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
  cursor: pointer;
  z-index: 2;
}

.ball::after {
  content: '';
  position: absolute;
  top: 15%;
  left: 25%;
  width: 35%;
  height: 30%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.4) 0%, transparent 70%);
}

.ball:hover {
  transform: scale(1.08);
  z-index: 3;
}

.ball.selected {
  transform: scale(1.12);
  z-index: 4;
  animation: ballSelected 1s ease-in-out infinite;
}

.ball.selected::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  animation: ringPulse 1s ease-out infinite;
}

.ball.eliminating {
  animation: ballEliminate 0.5s ease-out forwards;
}

.ball.appearing {
  animation: ballAppear 0.4s ease-out;
}

.ball.color-1, .next-ball.color-1 { background: radial-gradient(circle at 35% 35%, #ff6b7a, var(--ball-1)); box-shadow: 0 2px 8px var(--ball-1-glow); }
.ball.color-2, .next-ball.color-2 { background: radial-gradient(circle at 35% 35%, #4de889, var(--ball-2)); box-shadow: 0 2px 8px var(--ball-2-glow); }
.ball.color-3, .next-ball.color-3 { background: radial-gradient(circle at 35% 35%, #ffb840, var(--ball-3)); box-shadow: 0 2px 8px var(--ball-3-glow); }
.ball.color-4, .next-ball.color-4 { background: radial-gradient(circle at 35% 35%, #c084fc, var(--ball-4)); box-shadow: 0 2px 8px var(--ball-4-glow); }
.ball.color-5, .next-ball.color-5 { background: radial-gradient(circle at 35% 35%, #ff8fa3, var(--ball-5)); box-shadow: 0 2px 8px var(--ball-5-glow); }
.ball.color-6, .next-ball.color-6 { background: radial-gradient(circle at 35% 35%, #74c8ff, var(--ball-6)); box-shadow: 0 2px 8px var(--ball-6-glow); }
.ball.color-7, .next-ball.color-7 { background: radial-gradient(circle at 35% 35%, #50e3c2, var(--ball-7)); box-shadow: 0 2px 8px var(--ball-7-glow); }
.ball.color-8, .next-ball.color-8 { background: radial-gradient(circle at 35% 35%, #fdb07a, var(--ball-8)); box-shadow: 0 2px 8px var(--ball-8-glow); }

#particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

/* ---- Next Balls ---- */
.next-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.next-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.next-balls {
  display: flex;
  gap: 8px;
}

.next-ball {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: transform 0.2s ease;
  position: relative;
}

.next-ball::after {
  content: '';
  position: absolute;
  top: 15%;
  left: 25%;
  width: 35%;
  height: 30%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.3) 0%, transparent 70%);
}

/* ---- Message Bar ---- */
.msg-bar {
  padding: 10px 20px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  flex-shrink: 0;
  min-height: 44px;
  transition: var(--transition);
}

.msg-bar.success {
  color: var(--success);
  border-color: rgba(46, 204, 113, 0.3);
}

.msg-bar.info {
  color: var(--accent);
  border-color: rgba(108, 92, 231, 0.3);
}

.msg-bar.game-over {
  color: var(--danger);
  border-color: rgba(231, 76, 60, 0.3);
}

/* ---- Score Popup ---- */
.score-popup {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  font-size: 28px;
  font-weight: 800;
  color: var(--warning);
  text-shadow: 0 2px 12px rgba(243, 156, 18, 0.4);
  animation: scoreFloat 1.2s ease-out forwards;
}

/* ---- Modals ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 440px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: modalSlide 0.3s ease;
}

.modal h2 {
  font-size: 22px;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.modal-close {
  float: right;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
}

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

/* ---- Settings ---- */
.settings-group {
  margin-bottom: 20px;
}

.settings-group:last-child {
  margin-bottom: 0;
}

.settings-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.settings-label span:last-child {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 16px;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--border-color);
  outline: none;
  transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px var(--accent-glow);
  transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px var(--accent-glow);
}

.settings-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23888' d='M1.41.59L6 5.17 10.59.59 12 2l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.settings-select:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
}

.settings-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.settings-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  justify-content: flex-end;
}

/* ---- Leaderboard ---- */
.leaderboard-list {
  list-style: none;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  margin-bottom: 6px;
  transition: var(--transition);
}

.leaderboard-item:hover {
  background: var(--bg-card-hover);
}

.leaderboard-rank {
  width: 28px;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 14px;
}

.leaderboard-rank.gold { color: #ffd700; }
.leaderboard-rank.silver { color: #c0c0c0; }
.leaderboard-rank.bronze { color: #cd7f32; }

.leaderboard-name {
  flex: 1;
  font-size: 15px;
}

.leaderboard-score {
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
}

.leaderboard-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 12px;
}

.leaderboard-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 32px;
  font-size: 14px;
}

/* ---- Game Over Overlay ---- */
.gameover-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-radius: var(--radius);
  animation: fadeIn 0.5s ease;
}

.gameover-overlay.active {
  display: flex;
}

.gameover-overlay h2 {
  font-size: 32px;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--warning), var(--danger));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gameover-overlay p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 16px;
}

.gameover-overlay .final-score {
  font-size: 48px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}

/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

@keyframes ballSelected {
  0%, 100% { transform: scale(1.12); }
  50% { transform: scale(1.05); }
}

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

@keyframes ballEliminate {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
  100% { transform: scale(0); opacity: 0; }
}

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

@keyframes scorePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes scoreFloat {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-60px) scale(1.3); }
}

.combo-popup {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  font-size: 36px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--warning), var(--danger));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 2px 8px rgba(243, 156, 18, 0.4));
  animation: comboFloat 1.4s ease-out forwards;
  white-space: nowrap;
}

@keyframes comboFloat {
  0% { opacity: 0; transform: translateY(0) scale(0.5); }
  15% { opacity: 1; transform: translateY(0) scale(1.2); }
  30% { opacity: 1; transform: translateY(-10px) scale(1); }
  100% { opacity: 0; transform: translateY(-80px) scale(1.1); }
}

/* ---- Modal Tabs ---- */
.modal-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 3px;
}

.modal-tab {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: calc(var(--radius) - 3px);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.modal-tab.active {
  background: var(--accent);
  color: white;
}

.modal-tab:hover:not(.active) {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

/* ---- Stats Grid ---- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}

/* ---- Responsive ---- */
@media (max-width: 500px) {
  .game-layout {
    padding: 8px;
    gap: 8px;
  }

  .game-header {
    padding: 8px 14px;
  }

  .score-value {
    font-size: 20px;
  }

  .player-display {
    font-size: 12px;
    padding-left: 10px;
  }

  #board-container {
    width: min(88vmin, 380px);
    height: min(88vmin, 380px);
  }

  .login-card {
    padding: 32px 24px;
  }

  .modal {
    padding: 24px 20px;
  }

  .next-ball {
    width: 22px;
    height: 22px;
  }

  .cell {
    border-radius: 3px;
  }

  .ball {
    inset: 1px;
  }

  .btn {
    padding: 12px 20px;
    font-size: 15px;
  }

  .login-card h1 {
    font-size: 28px;
  }

  .login-form input {
    padding: 12px 16px;
    font-size: 15px;
  }

  .score-popup {
    font-size: 22px;
  }

  .combo-popup {
    font-size: 28px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .gameover-overlay h2 {
    font-size: 26px;
  }

  .gameover-overlay .final-score {
    font-size: 36px;
  }
}

/* ---- Scrollbar ---- */
.modal::-webkit-scrollbar {
  width: 4px;
}

.modal::-webkit-scrollbar-track {
  background: transparent;
}

.modal::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}
