/* ============================================
   SNAKES & LADDERS - COMPLETE STYLESHEET
   ============================================ */

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

:root {
  --primary: #6c3fc5;
  --secondary: #f7c948;
  --accent: #ff4d6d;
  --snake: #22c55e;
  --ladder: #f97316;
  --bg: #0f0a1e;
  --surface: #1a1035;
  --surface2: #251748;
  --text: #f0eaff;
  --text2: #b0a0cc;
  --border: rgba(255,255,255,0.1);
  --radius: 16px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --cell-size: 60px;
  --transition: 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

/* ---- THEME OVERRIDES ---- */
body.theme-jungle {
  --primary: #2d6a4f; --secondary: #95d5b2; --accent: #d62828;
  --bg: #081c15; --surface: #1b4332; --surface2: #2d6a4f;
  --text: #d8f3dc; --text2: #95d5b2;
}
body.theme-candy {
  --primary: #ff006e; --secondary: #ffbe0b; --accent: #3a86ff;
  --bg: #1a0a2e; --surface: #2d0a4e; --surface2: #440d72;
  --text: #ffe8f5; --text2: #ffb3d9;
}
body.theme-ocean {
  --primary: #0077b6; --secondary: #90e0ef; --accent: #f77f00;
  --bg: #03045e; --surface: #023e8a; --surface2: #0077b6;
  --text: #caf0f8; --text2: #90e0ef;
}
body.theme-fire {
  --primary: #e85d04; --secondary: #faa307; --accent: #dc2f02;
  --bg: #1a0500; --surface: #370617; --surface2: #6a040f;
  --text: #ffedca; --text2: #ffba08;
}
body.theme-ice {
  --primary: #4cc9f0; --secondary: #f0f4ff; --accent: #7b2d8b;
  --bg: #03071e; --surface: #1a1f4e; --surface2: #2a3070;
  --text: #e0f0ff; --text2: #90c8f0;
}

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.5s, color 0.5s;
}
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, select { font-family: inherit; }

/* ---- FULLSCREEN ---- */
#app {
  width: 100vw;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ============================================
   SETUP SCREEN
   ============================================ */
#setup-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: radial-gradient(ellipse at 30% 20%, rgba(108,63,197,0.25) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(255,77,109,0.15) 0%, transparent 60%),
              var(--bg);
  animation: fadeIn 0.5s ease;
}

.setup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 36px;
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow), 0 0 80px rgba(108,63,197,0.15);
}

.setup-logo {
  text-align: center;
  margin-bottom: 32px;
}
.setup-logo h1 {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(2rem, 5vw, 3.2rem);
  background: linear-gradient(135deg, var(--secondary), var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
.setup-logo p {
  color: var(--text2);
  font-size: 0.9rem;
  margin-top: 6px;
}

.setup-section {
  margin-bottom: 28px;
}
.setup-section h3 {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 14px;
}

/* Theme picker */
.theme-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.theme-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
}
.theme-btn:hover { transform: scale(1.15); }
.theme-btn.active { border-color: white; transform: scale(1.2); }
.theme-btn.active::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: white;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.theme-btn[data-theme="default"] { background: linear-gradient(135deg, #6c3fc5, #f7c948); }
.theme-btn[data-theme="jungle"]  { background: linear-gradient(135deg, #2d6a4f, #95d5b2); }
.theme-btn[data-theme="candy"]   { background: linear-gradient(135deg, #ff006e, #ffbe0b); }
.theme-btn[data-theme="ocean"]   { background: linear-gradient(135deg, #0077b6, #90e0ef); }
.theme-btn[data-theme="fire"]    { background: linear-gradient(135deg, #e85d04, #faa307); }
.theme-btn[data-theme="ice"]     { background: linear-gradient(135deg, #4cc9f0, #f0f4ff); }

/* Player count selector */
.count-row {
  display: flex;
  gap: 8px;
}
.count-btn {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text2);
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid transparent;
  transition: all 0.2s;
}
.count-btn:hover { border-color: var(--primary); color: var(--text); }
.count-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Player rows */
#players-setup {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
}
.player-avatar-pick {
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  position: relative;
}
.player-avatar-pick:hover { border-color: var(--primary); transform: scale(1.05); }

.player-name-input {
  flex: 1;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  transition: border-color 0.2s;
}
.player-name-input:focus { outline: none; border-color: var(--primary); }

.player-color-pick {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 3px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  padding: 2px;
  background: none;
}
.player-color-pick:hover { transform: scale(1.15); }

/* Start button */
.btn-start {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(108,63,197,0.4);
}
.btn-start:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(108,63,197,0.5); }
.btn-start:active { transform: translateY(0); }

/* ============================================
   GAME SCREEN
   ============================================ */
#game-screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  background: radial-gradient(ellipse at 20% 10%, rgba(108,63,197,0.18) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 90%, rgba(255,77,109,0.12) 0%, transparent 50%),
              var(--bg);
}
#game-screen.active { display: flex; }

/* Top bar */
.game-topbar {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.game-topbar .game-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.3rem;
  background: linear-gradient(90deg, var(--secondary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex: 1;
  text-align: center;
}

/* Hamburger */
.hamburger-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s;
  flex-shrink: 0;
}
.hamburger-btn:hover { background: var(--primary); }
.hamburger-btn span {
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Game layout */
.game-layout {
  display: flex;
  flex: 1;
  gap: 0;
  overflow: hidden;
  flex-direction: column;
}

@media (min-width: 900px) {
  .game-layout { flex-direction: row; }
}

/* Board wrapper */
.board-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
}

/* Game board */
#game-board {
  display: grid;
  grid-template-columns: repeat(10, var(--cell-size));
  grid-template-rows: repeat(10, var(--cell-size));
  border: 3px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow), 0 0 60px rgba(108,63,197,0.2);
  position: relative;
  background: var(--surface);
}

.board-cell {
  width: var(--cell-size);
  height: var(--cell-size);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1px solid rgba(255,255,255,0.05);
  font-size: 0.65rem;
  font-weight: 800;
  color: rgba(255,255,255,0.4);
  transition: background 0.2s;
  overflow: visible;
}
.board-cell:hover { background: rgba(255,255,255,0.05); }
.board-cell.even { background: rgba(255,255,255,0.02); }
.board-cell.odd  { background: rgba(0,0,0,0.1); }

.cell-number {
  position: absolute;
  top: 3px; left: 4px;
  font-size: 0.55rem;
  font-weight: 700;
  opacity: 0.5;
  line-height: 1;
  pointer-events: none;
}

/* Snake/Ladder indicators on cells */
.cell-snake { background: rgba(34,197,94,0.15) !important; }
.cell-ladder { background: rgba(249,115,22,0.15) !important; }
.cell-snake::before, .cell-ladder::before {
  content: attr(data-icon);
  font-size: 1.2rem;
  position: absolute;
  pointer-events: none;
}

/* SVG overlay for snakes & ladders */
#board-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* Player tokens */
.player-token {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  position: absolute;
  z-index: 10;
  transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  cursor: default;
  pointer-events: none;
}
.player-token.active-token { animation: tokenBounce 0.5s ease; z-index: 11; }

@keyframes tokenBounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3) translateY(-6px); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* ============================================
   SIDE PANEL
   ============================================ */
.side-panel {
  width: 100%;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  flex-shrink: 0;
}

@media (min-width: 900px) {
  .side-panel {
    width: 300px;
    border-top: none;
    border-left: 1px solid var(--border);
  }
}

/* Player cards */
.player-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.player-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface2);
  border: 2px solid transparent;
  transition: all 0.3s;
}
.player-card.current-turn {
  border-color: var(--secondary);
  background: rgba(247,201,72,0.08);
  box-shadow: 0 0 20px rgba(247,201,72,0.15);
}
.player-card .p-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.player-card .p-info { flex: 1; min-width: 0; }
.player-card .p-name {
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-card .p-pos {
  font-size: 0.75rem;
  color: var(--text2);
}
.player-card .p-status {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.turn-indicator {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--secondary);
  background: rgba(247,201,72,0.1);
  border-radius: 6px;
  padding: 2px 6px;
}

/* Dice area */
.dice-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.dice-wrapper {
  display: flex;
  gap: 14px;
  align-items: center;
}
.dice {
  width: 60px; height: 60px;
  background: white;
  border-radius: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 8px;
  gap: 2px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.4);
  transition: transform 0.1s;
}
.dice.rolling { animation: diceRoll 0.5s ease; }
@keyframes diceRoll {
  0%,100% { transform: rotate(0deg) scale(1); }
  20%      { transform: rotate(-20deg) scale(1.1); }
  40%      { transform: rotate(20deg) scale(1.05); }
  60%      { transform: rotate(-10deg) scale(1.08); }
  80%      { transform: rotate(10deg) scale(1.02); }
}

.dot {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: #1a1035;
  display: none;
}
/* Dice faces */
.dice[data-val="1"] .d5 { display: block; }
.dice[data-val="2"] .d1,.dice[data-val="2"] .d9 { display: block; }
.dice[data-val="3"] .d1,.dice[data-val="3"] .d5,.dice[data-val="3"] .d9 { display: block; }
.dice[data-val="4"] .d1,.dice[data-val="4"] .d3,.dice[data-val="4"] .d7,.dice[data-val="4"] .d9 { display: block; }
.dice[data-val="5"] .d1,.dice[data-val="5"] .d3,.dice[data-val="5"] .d5,.dice[data-val="5"] .d7,.dice[data-val="5"] .d9 { display: block; }
.dice[data-val="6"] .d1,.dice[data-val="6"] .d3,.dice[data-val="6"] .d4,.dice[data-val="6"] .d6,.dice[data-val="6"] .d7,.dice[data-val="6"] .d9 { display: block; }

.btn-roll {
  padding: 13px 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(108,63,197,0.3);
}
.btn-roll:hover:not(:disabled) { transform: translateY(-2px) scale(1.03); box-shadow: 0 8px 24px rgba(108,63,197,0.45); }
.btn-roll:active:not(:disabled) { transform: scale(0.97); }
.btn-roll:disabled { opacity: 0.4; cursor: not-allowed; }

/* Status message */
.status-msg {
  background: var(--surface2);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
  text-align: center;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
}

/* Move log */
.move-log {
  flex: 1;
  overflow-y: auto;
  max-height: 160px;
}
.move-log h4 {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 8px;
}
.log-entry {
  font-size: 0.78rem;
  color: var(--text2);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
  animation: fadeIn 0.2s ease;
}
.log-entry span { color: var(--text); font-weight: 700; }

/* ============================================
   HAMBURGER MENU (SIDE DRAWER)
   ============================================ */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(4px);
}
.menu-overlay.open { opacity: 1; pointer-events: all; }

.side-menu {
  position: fixed;
  top: 0; left: 0;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 101;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.34,1.2,0.64,1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.side-menu.open { transform: translateX(0); }

.menu-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.menu-header h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.3rem;
  color: var(--secondary);
}
.menu-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.menu-close:hover { background: var(--accent); }

.menu-body {
  flex: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.menu-section h3 {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 12px;
}

/* Toggle switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}
.toggle-row label {
  font-size: 0.9rem;
  font-weight: 600;
}
.toggle {
  position: relative;
  width: 44px; height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface2);
  border-radius: 24px;
  border: 1px solid var(--border);
  transition: 0.3s;
  cursor: pointer;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: var(--text2);
  border-radius: 50%;
  transition: 0.3s;
}
.toggle input:checked + .toggle-slider { background: var(--primary); border-color: var(--primary); }
.toggle input:checked + .toggle-slider::after { transform: translateX(20px); background: white; }

/* Sound URL input */
.menu-input {
  width: 100%;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 0.85rem;
  transition: border-color 0.2s;
}
.menu-input:focus { outline: none; border-color: var(--primary); }

.btn-secondary {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s;
  margin-top: 6px;
}
.btn-secondary:hover { background: var(--primary); border-color: var(--primary); }

/* Music player controls */
.music-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.music-controls button {
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.2s;
}
.music-controls button:hover { background: var(--primary); }
.music-vol {
  flex: 1;
  accent-color: var(--primary);
}
.music-file-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--surface2);
  border: 2px dashed var(--border);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
  transition: all 0.2s;
  width: 100%;
}
.music-file-label:hover { border-color: var(--primary); color: var(--text); }
.music-file-label input { display: none; }

/* ============================================
   EMOJI PICKER POPUP
   ============================================ */
.emoji-picker {
  position: absolute;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  box-shadow: var(--shadow);
  animation: popIn 0.15s ease;
}
.emoji-option {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: none;
  border: 1px solid transparent;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.emoji-option:hover { background: var(--surface2); border-color: var(--border); transform: scale(1.15); }

/* ============================================
   WIN SCREEN
   ============================================ */
.win-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.4s ease;
}
.win-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 44px 40px;
  text-align: center;
  max-width: 360px;
  width: 90%;
  box-shadow: var(--shadow), 0 0 100px rgba(247,201,72,0.25);
  animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.win-trophy { font-size: 4rem; margin-bottom: 12px; animation: trophySpin 1s ease; }
@keyframes trophySpin {
  0%   { transform: rotate(-15deg) scale(0.5); opacity: 0; }
  60%  { transform: rotate(10deg) scale(1.1); }
  100% { transform: rotate(0) scale(1); opacity: 1; }
}
.win-card h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.8rem;
  color: var(--secondary);
  margin-bottom: 6px;
}
.win-card p {
  color: var(--text2);
  font-size: 0.95rem;
  margin-bottom: 24px;
}
.win-buttons { display: flex; gap: 10px; }
.win-buttons button {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.btn-replay {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
}
.btn-new {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-replay:hover { transform: translateY(-2px); }
.btn-new:hover { background: var(--primary); }

/* Confetti */
.confetti-piece {
  position: fixed;
  width: 10px; height: 10px;
  border-radius: 2px;
  animation: confettiFall 2.5s ease-in forwards;
  z-index: 400;
  pointer-events: none;
}
@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg) scale(0.5); opacity: 0; }
}

/* ============================================
   UTILITY & ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(247,201,72,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(247,201,72,0); }
}
.pulse { animation: pulse 1s infinite; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* Responsive board sizing */
@media (max-width: 680px) {
  :root { --cell-size: 34px; }
  .player-token { width: 18px; height: 18px; font-size: 0.6rem; }
  .side-panel { max-height: 45vh; }
}
@media (min-width: 681px) and (max-width: 900px) {
  :root { --cell-size: 48px; }
}
@media (min-width: 901px) and (max-width: 1200px) {
  :root { --cell-size: 54px; }
}
@media (min-width: 1201px) {
  :root { --cell-size: 64px; }
}
