/* ============================================
   Tablo — Number Slider Styles
   ============================================ */

:root {
  --bg-dark: var(--bg-primary, #0f1923);
  --bg-panel: var(--bg-surface, #1a2332);
  --bg-input: var(--bg-surface, #1a2332);
  --accent-light: #5eead4;
  --font-primary: 'Nunito', sans-serif;
}

.game-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px 20px;
  gap: 24px;
}

.game-wrapper::before {
  content: '';
  display: block;
  height: 12px;
  flex-shrink: 0;
}

.game-stats {
  flex-shrink: 0;
  display: flex;
  gap: 24px;
  padding: 16px 24px;
  background: var(--bg-surface, #1a2332);
  border: 1px solid var(--border-color, #2a3441);
  border-radius: var(--radius-lg, 12px);
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 500px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 80px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, #8892a0);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent, #2dd4bf);
  font-family: 'Nunito', monospace;
}

.slider-board {
  flex-shrink: 0;
  display: grid;
  gap: 8px;
  max-width: 360px;
  width: 100%;
  padding: 12px;
  background: var(--bg-surface, #1a2332);
  border-radius: var(--radius-lg, 12px);
  margin-bottom: 20px;
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

.tile {
  aspect-ratio: 1;
  background: var(--accent, #2dd4bf);
  color: #0f1923;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: default;
  transition: transform 0.15s ease, background 0.15s ease;
}

.tile.movable {
  cursor: pointer;
  opacity: 1;
}

.tile.movable:hover {
  transform: scale(1.05);
  background: var(--accent-light, #5eead4);
}

.game-controls {
  flex-shrink: 0;
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.size-select {
  background: var(--bg-input, #1a2332);
  color: var(--text-primary, #e4e7eb);
  border: 1px solid var(--border-color, #2a3441);
  border-radius: var(--radius-md, 8px);
  padding: 10px 16px;
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.size-select:hover { border-color: var(--accent, #2dd4bf); }
.size-select:focus { border-color: var(--accent, #2dd4bf); }

.game-btn {
  background: var(--bg-surface, #1a2332);
  border: 1px solid var(--border-color, #2a3441);
  color: var(--text-primary, #e4e7eb);
  padding: 10px 20px;
  border-radius: var(--radius-md, 8px);
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.game-btn:hover {
  background: var(--bg-hover, #243044);
  border-color: var(--accent, #2dd4bf);
  color: var(--accent, #2dd4bf);
}

.game-btn.primary {
  background: var(--accent, #2dd4bf);
  border-color: var(--accent, #2dd4bf);
  color: #0f1923;
}

.game-btn.primary:hover {
  background: var(--accent-light, #5eead4);
  border-color: var(--accent-light, #5eead4);
}

.game-hint {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-muted, #5a6e7c);
  text-align: center;
  margin-top: 8px;
}

.winner-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.winner-modal.visible {
  display: flex;
}

.winner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.winner-content {
  position: relative;
  z-index: 1;
  background: var(--bg-panel, #1a2332);
  border: 2px solid var(--accent, #2dd4bf);
  border-radius: var(--radius-lg, 12px);
  padding: 32px 24px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5);
}

.winner-icon { font-size: 48px; margin-bottom: 16px; }

.winner-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
}

.winner-stats {
  margin-bottom: 24px;
}

.winner-stat-row {
  display: flex;
  gap: 24px;
  justify-content: center;
}

.winner-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.winner-stat-label {
  font-size: 11px;
  color: var(--text-secondary, #8892a0);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.winner-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary, #e4e7eb);
  font-family: 'Nunito', monospace;
}

.tablo-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-panel, #1a2332);
  border: 1px solid var(--border-color, #2a3441);
  color: var(--text-primary, #e4e7eb);
  padding: 12px 24px;
  border-radius: var(--radius-md, 8px);
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.tablo-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tile.empty {
  background: transparent;
  visibility: hidden;
}

@media (max-width: 768px) {
  .game-stats { gap: 16px; padding: 12px 16px; }
  .stat-value { font-size: 18px; }
  .tile { font-size: 1.5rem; }
  .game-controls { flex-direction: column; width: 100%; }
  .size-select, .game-btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .game-wrapper { padding: 0 12px 12px; }
  .slider-board { gap: 4px; padding: 8px; max-width: 300px; }
  .tile { font-size: 1.2rem; border-radius: 6px; }
}