/* ═══════════════════════════════════════════════════════════════
   SUDOKU ARCADE — GAME STYLES
   Game Panel · Board · Cells · Sidebar · Controls · Animations
   ═══════════════════════════════════════════════════════════════ */

/* ── Game panel ──────────────────────────────────────────────── */
.game-panel { padding: 18px; }

/* ── Game head ───────────────────────────────────────────────── */
.game-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.game-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-title    { margin: 0; font-size: 28px; }
.game-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 13px;
  white-space: nowrap;
}

.badge-dark {
  background: var(--accent);
  color: var(--accent-inverse);
}

/* ── Game stats bar ──────────────────────────────────────────── */
.game-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: min(100%, 430px);
}

/* ── Board area layout ───────────────────────────────────────── */
.board-area {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 18px;
}

.board-panel-inner {
  border: 2px solid var(--line);
  border-radius: 24px;
  padding: 16px;
  background: var(--panel);
}

.board-status {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

/* ── Board wrap & board ──────────────────────────────────────── */
.board-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(var(--cell-size) * 7);
  position: relative;
}

.board {
  display: grid;
  border: 3px solid var(--line);
  background: #ffffff;
  user-select: none;
  touch-action: manipulation;
  position: relative;
}

.board.clutch {
  animation: clutchPulse 800ms ease-in-out infinite;
}

.board.loading {
  opacity: 0.45;
}

/* ── Cells ───────────────────────────────────────────────────── */
.cell {
  border: 0;
  background: var(--panel);
  color: var(--text);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background var(--transition-fast), transform var(--transition-fast), color var(--transition-fast);
}

.cell.fixed      { background: var(--panel-soft); }
.cell.editable:hover { background: #f1f1f1; }
.cell.related    { background: #f8f8f8; }
.cell.selected   { background: #eaeaea; }
.cell.same-value { background: #eeeeee; }

.cell.invalid {
  background: var(--accent);
  color: var(--accent-inverse);
  animation: pulseInvalid 260ms ease;
}

.cell.success {
  animation: popIn 200ms ease;
}

/* ── Board sidebar ───────────────────────────────────────────── */
.board-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-card {
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: var(--panel);
}

.sidebar-card h3 { margin: 0 0 10px; font-size: 18px; }
.sidebar-card p  { margin: 0; color: var(--muted); line-height: 1.5; }

.sidebar-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.sidebar-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
}

.sidebar-item span:last-child { font-weight: 700; }

/* ── Game controls ───────────────────────────────────────────── */
.game-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.helpbar {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

kbd {
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 12px;
  background: #fff;
}

/* ── Keyframes ───────────────────────────────────────────────── */
@keyframes pulseInvalid {
  0%   { transform: scale(1); }
  50%  { transform: scale(0.94); }
  100% { transform: scale(1); }
}

@keyframes popIn {
  0%   { transform: scale(0.82); }
  100% { transform: scale(1); }
}

@keyframes clutchPulse {
  0%   { box-shadow: 0 0 0 0   rgba(17, 17, 17, 0.03); }
  50%  { box-shadow: 0 0 0 10px rgba(17, 17, 17, 0.10); }
  100% { box-shadow: 0 0 0 0   rgba(17, 17, 17, 0.03); }
}

/* ── Game responsive ─────────────────────────────────────────── */
@media (max-width: 980px) {
  .board-area  { grid-template-columns: 1fr; }
  .game-stats  { grid-template-columns: 1fr; }
  .game-head   { flex-direction: column; }
}

@media (max-width: 720px) {
  :root { --cell-size: min(9.6vw, 44px); }
  .game-panel         { padding: 16px; }
  .game-controls      { width: 100%; }
  .game-controls .btn { flex: 1 1 0; }
}

@media (max-width: 420px) {
  :root { --cell-size: min(9.3vw, 38px); }
  .game-title { font-size: 24px; }
}
