/* =============================================
   style.css — SUDOKU
   Palette: Beige × Navy × Gold
   ============================================= */

/* ── CSS Variables: Dark (default) ── */
:root {
  --navy:        #1a2744;
  --navy-deep:   #0f1a30;
  --navy-mid:    #243255;
  --navy-light:  #2e4070;
  --beige:       #f2ead8;
  --beige-warm:  #e8dcc4;
  --beige-dark:  #d4c4a8;
  --beige-deep:  #c4af8c;
  --gold:        #b8943c;
  --gold-light:  #d4aa4e;
  --cream:       #faf6ee;
  --text-light:  #f0e8d4;
  --text-dim:    #8899bb;
  --error:       #c0392b;
  --success:     #2e7d5e;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-ui:      'Josefin Sans', sans-serif;
  --font-mono:    'Courier Prime', monospace;
  --shadow-navy:  0 8px 40px rgba(15,26,48,0.55);
  --shadow-soft:  0 4px 20px rgba(15,26,48,0.18);
  --transition:   0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ── CSS Variables: Light theme ── */
body.light {
  --navy-deep:   #f7f2e8;
  --navy-mid:    #ede5d4;
  --navy-light:  #e0d4be;
  --text-light:  #1a2030;
  --text-dim:    #7a6e5e;
  --beige:       #1a2030;
  --beige-warm:  #2a3040;
  --beige-dark:  #8a7a68;
  --gold:        #9a7428;
  --gold-light:  #b8943c;
  --shadow-navy: 0 8px 40px rgba(100,80,40,0.18);
  --shadow-soft: 0 4px 20px rgba(100,80,40,0.10);
}

/* ── Global transition for theme switch ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition:
    background-color 0.35s ease,
    border-color 0.35s ease,
    color 0.35s ease,
    box-shadow 0.35s ease;
}

/* Keep transform/opacity snappy */
.screen, .choice-card, .btn, .num-btn, .landing-btn, .toggle-thumb {
  transition:
    background-color 0.35s ease,
    border-color 0.35s ease,
    color 0.35s ease,
    box-shadow 0.35s ease,
    opacity 0.5s ease,
    transform 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ── Base ── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--navy-deep);
  color: var(--text-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Subtle grid texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}
body.light::before {
  background-image:
    linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
}

/* =============================================
   THEME TOGGLE
   ============================================= */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 999;
  width: 52px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.toggle-track {
  width: 52px;
  height: 28px;
  border-radius: 14px;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.2);
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 3px;
}
body.light .toggle-track {
  background: rgba(26,32,48,0.12);
  border-color: rgba(26,32,48,0.2);
}

.toggle-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold-light);
  position: absolute;
  left: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
body.light .toggle-thumb {
  transform: translateX(24px);
  background: var(--gold);
}

/* =============================================
   SCREENS — multi-step flow
   ============================================= */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
  transform: translateY(20px);
  z-index: 10;
  overflow-y: auto;
  padding: 2rem 1rem;
}
.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
.screen.exit {
  opacity: 0;
  transform: translateY(-24px);
  pointer-events: none;
}

/* =============================================
   SCREEN 1 — LANDING
   ============================================= */
#screen-landing {
  background: radial-gradient(ellipse at 40% 30%, var(--navy-mid) 0%, var(--navy-deep) 70%);
}
body.light #screen-landing {
  background: radial-gradient(ellipse at 40% 30%, #e8dfc8 0%, #f7f2e8 70%);
}

.landing-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.deco-num {
  position: absolute;
  font-family: var(--font-display);
  font-size: clamp(6rem, 15vw, 11rem);
  font-weight: 700;
  color: rgba(255,255,255,0.025);
  user-select: none;
}
body.light .deco-num { color: rgba(0,0,0,0.04); }

.landing-inner { text-align: center; max-width: 560px; }

.landing-badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold-light);
  border: 1px solid var(--gold);
  padding: 0.3rem 1rem;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.2s forwards;
}

.landing-title {
  font-family: var(--font-display);
  font-size: clamp(5rem, 18vw, 9rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 0.9;
  color: var(--beige);
  opacity: 0;
  animation: fadeUp 0.8s ease 0.4s forwards;
  position: relative;
}
.landing-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  margin: 1.2rem auto 0;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.9s forwards;
}

.landing-subtitle {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 1.5rem;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.7s forwards;
}

.landing-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--gold);
  color: var(--navy-deep);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 1rem 2.8rem;
  border: none;
  cursor: pointer;
  opacity: 0;
  animation: fadeUp 0.6s ease 1s forwards;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}
.landing-btn:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(184,148,60,0.35);
}

/* =============================================
   SCREENS 2 & 3 — CHOICE SCREENS
   ============================================= */
.choice-screen {
  background: radial-gradient(ellipse at 60% 60%, var(--navy-mid) 0%, var(--navy-deep) 70%);
}
body.light .choice-screen {
  background: radial-gradient(ellipse at 60% 60%, #e8dfc8 0%, #f7f2e8 70%);
}

.choice-wrapper { text-align: center; width: 100%; max-width: 560px; }

.choice-eyebrow {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.7rem;
}

.choice-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 3.2rem);
  font-weight: 600;
  color: var(--beige);
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
}

.choice-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  margin-bottom: 3rem;
}

.choice-cards {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.choice-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 1.8rem 2rem;
  min-width: 130px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-align: center;
}
body.light .choice-card {
  background: rgba(255,255,255,0.6);
  border-color: rgba(0,0,0,0.1);
}
.choice-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.choice-card:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(184,148,60,0.4);
  transform: translateY(-4px);
  box-shadow: var(--shadow-navy);
}
body.light .choice-card:hover {
  background: rgba(255,255,255,0.9);
  border-color: rgba(184,148,60,0.5);
}
.choice-card:hover::before, .choice-card.selected::before { transform: scaleX(1); }
.choice-card.selected {
  background: rgba(184,148,60,0.15);
  border-color: var(--gold);
}

.card-icon  { font-size: 2rem; margin-bottom: 0.6rem; }
.card-label {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--beige);
  display: block;
  letter-spacing: 0.04em;
}
.card-sub {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 0.3rem;
  display: block;
}

.choice-back {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 2.5rem;
}
.choice-back:hover { color: var(--beige); }

/* =============================================
   SCREEN 4 — GAME
   ============================================= */
#screen-game {
  background: var(--navy-deep);
  justify-content: flex-start;
  padding-top: 0;
}

/* ── Topbar ── */
.game-topbar {
  width: 100%;
  background: var(--navy-mid);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 0.7rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
body.light .game-topbar { border-bottom-color: rgba(0,0,0,0.08); }

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-light);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  border-radius: 2px;
  white-space: nowrap;
}
.topbar-back-btn:hover {
  background: rgba(255,255,255,0.14);
  border-color: var(--gold);
  color: var(--gold-light);
  transform: translateX(-2px);
}
body.light .topbar-back-btn {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.15);
  color: #1a2030;
}
body.light .topbar-back-btn:hover {
  background: rgba(0,0,0,0.1);
  border-color: var(--gold);
  color: var(--gold);
}

.topbar-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--beige);
  letter-spacing: 0.12em;
}

.topbar-meta { display: flex; align-items: center; gap: 0.8rem; }

.badge-diff {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--navy-deep);
  background: var(--gold);
  padding: 0.2rem 0.6rem;
}

.badge-size {
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 0.2rem 0.6rem;
}

.timer-display {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.08em;
  min-width: 70px;
  text-align: center;
}

/* ── Game layout ── */
.game-body {
  display: flex;
  gap: 1.5rem;
  padding: 1.2rem 1.5rem 4rem;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  align-items: flex-start;
  flex: 1;
}

/* =============================================
   SUDOKU GRID
   ============================================= */
.grid-container { flex-shrink: 0; }

.sudoku-grid {
  display: grid;
  border: 2.5px solid var(--beige-dark);
  background: var(--navy-mid);
  box-shadow: var(--shadow-navy);
}
body.light .sudoku-grid {
  background: #ffffff;
  border-color: #8a7a68;
}

.sudoku-grid.size-9 {
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  width: min(52vw, 468px);
  height: min(52vw, 468px);
}
.sudoku-grid.size-3 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: min(40vw, 300px);
  height: min(40vw, 300px);
}

.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  cursor: pointer;
  border-right: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
body.light .cell {
  border-right-color: rgba(0,0,0,0.1);
  border-bottom-color: rgba(0,0,0,0.1);
}

/* 9×9 font sizes */
.size-9 .cell { font-size: clamp(0.85rem, 2.2vw, 1.25rem); }
/* 3×3 font sizes */
.size-3 .cell { font-size: clamp(1.5rem, 5vw, 2.4rem); }

/* Bold box borders — 9×9 */
.size-9 .cell[data-col="2"],
.size-9 .cell[data-col="5"] { border-right: 2px solid var(--beige-dark); }
.size-9 .cell[data-col="8"] { border-right: none; }
.size-9 .cell[data-row="2"],
.size-9 .cell[data-row="5"] { border-bottom: 2px solid var(--beige-dark); }
.size-9 .cell[data-row="8"] { border-bottom: none; }

body.light .size-9 .cell[data-col="2"],
body.light .size-9 .cell[data-col="5"] { border-right-color: #8a7a68; }
body.light .size-9 .cell[data-row="2"],
body.light .size-9 .cell[data-row="5"] { border-bottom-color: #8a7a68; }

/* 3×3 outer borders only */
.size-3 .cell[data-col="2"] { border-right: none; }
.size-3 .cell[data-row="2"] { border-bottom: none; }

/* Cell states */
.cell.given        { color: var(--beige); }
body.light .cell.given { color: #1a2030; }

.cell.user-input   { color: var(--gold-light); }
body.light .cell.user-input { color: #1a5a8a; }

.cell.error        { color: #e05a4a !important; background: rgba(192,57,43,0.12) !important; }
body.light .cell.error { background: rgba(192,57,43,0.08) !important; }

.cell.highlighted  { background: rgba(242,234,216,0.05); }
body.light .cell.highlighted { background: rgba(184,148,60,0.07); }

.cell.selected     { background: rgba(184,148,60,0.2) !important; }
body.light .cell.selected { background: rgba(184,148,60,0.25) !important; }

.cell.same-num     { background: rgba(184,148,60,0.1); }
body.light .cell.same-num { background: rgba(184,148,60,0.12); }

/* Notes mini-grid inside cell */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  padding: 1px;
}
.notes-grid span {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.35rem, 0.8vw, 0.55rem);
  color: var(--text-dim);
  line-height: 1;
  font-family: var(--font-mono);
}

/* =============================================
   NUMPAD — below the grid
   ============================================= */
.numpad {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-top: none;
  padding: 0.8rem;
  width: 100%;
}
body.light .numpad {
  background: rgba(255,255,255,0.6);
  border-color: rgba(0,0,0,0.08);
}

.numpad-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.3rem;
}
.numpad-grid.cols-3 { grid-template-columns: repeat(4, 1fr); }

.num-btn {
  aspect-ratio: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-light);
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 1.6vw, 1rem);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.num-btn:hover {
  background: rgba(184,148,60,0.2);
  border-color: var(--gold);
  color: var(--gold-light);
}
.num-btn:active { transform: scale(0.93); }

body.light .num-btn {
  background: rgba(255,255,255,0.8);
  border-color: rgba(0,0,0,0.1);
  color: #1a2030;
}
body.light .num-btn:hover {
  background: rgba(184,148,60,0.15);
  border-color: var(--gold);
  color: var(--gold);
}

.erase-btn {
  aspect-ratio: 1;
  padding: 0;
  font-size: clamp(0.6rem, 1.2vw, 0.85rem);
  font-family: var(--font-ui);
  letter-spacing: 0;
}

/* =============================================
   SIDE PANEL
   ============================================= */
.side-panel {
  flex: 1;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

/* ── Timeline ── */
.timeline-box {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 0.9rem 1rem;
}
body.light .timeline-box {
  background: rgba(255,255,255,0.7);
  border-color: rgba(0,0,0,0.1);
}

.timeline-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.timeline-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 3px;
  width: 0%;
  transition: width 1s linear;
}
.timeline-numbers {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

/* ── Stats ── */
.stats-box {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 0.9rem 1rem;
}
body.light .stats-box {
  background: rgba(255,255,255,0.7);
  border-color: rgba(0,0,0,0.1);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.stat-row:last-child { border-bottom: none; }
body.light .stat-row { border-bottom-color: rgba(0,0,0,0.06); }
.stat-row span:first-child { color: var(--text-dim); letter-spacing: 0.05em; }
.stat-row span:last-child  { font-family: var(--font-mono); color: var(--gold-light); }

/* ── Buttons ── */
.btn-group { display: flex; flex-direction: column; gap: 0.45rem; }

.btn {
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text-light);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: center;
  width: 100%;
}
.btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
  transform: translateX(2px);
}
body.light .btn {
  background: rgba(255,255,255,0.7);
  border-color: rgba(0,0,0,0.12);
  color: #1a2030;
}
body.light .btn:hover {
  background: rgba(255,255,255,0.95);
  border-color: rgba(0,0,0,0.25);
}
.btn.gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy-deep);
}
.btn.gold:hover { filter: brightness(1.1); }

.btn.danger { border-color: rgba(192,57,43,0.4); color: #e07060; }
.btn.danger:hover { background: rgba(192,57,43,0.15); border-color: #e07060; }

.btn.active {
  background: rgba(184,148,60,0.2);
  border-color: var(--gold);
  color: var(--gold-light);
}
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

/* =============================================
   COMPLETION OVERLAY
   ============================================= */
#overlay-complete {
  position: fixed;
  inset: 0;
  background: rgba(10,16,30,0.85);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
#overlay-complete.show { opacity: 1; pointer-events: all; }

.complete-card {
  background: var(--navy-mid);
  border: 1px solid rgba(184,148,60,0.35);
  padding: 3rem 3.5rem;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: var(--shadow-navy);
  animation: popIn 0.45s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
  overflow: hidden;
}
.complete-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
}
.complete-icon  { font-size: 3rem; margin-bottom: 0.5rem; }
.complete-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--beige);
  margin-bottom: 0.3rem;
}
.complete-sub  { font-size: 0.75rem; color: var(--text-dim); letter-spacing: 0.15em; margin-bottom: 1.8rem; }
.complete-time { font-family: var(--font-mono); font-size: 2rem; font-weight: 700; color: var(--gold-light); margin-bottom: 0.3rem; }
.complete-info { font-size: 0.7rem; color: var(--text-dim); letter-spacing: 0.15em; }
.complete-actions { display: flex; gap: 0.6rem; justify-content: center; margin-top: 1.5rem; }
.complete-actions .btn { width: auto; padding: 0.6rem 1.4rem; }

/* =============================================
   CONFETTI
   ============================================= */
#confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 300;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg) scaleX(1); opacity: 1; }
  50%  { transform: translateY(50vh) rotate(400deg) scaleX(-1); }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* =============================================
   FOOTER
   ============================================= */
footer {
  width: 100%;
  text-align: center;
  padding: 1rem;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.18);
  border-top: 1px solid rgba(255,255,255,0.05);
  background: var(--navy-deep);
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 5;
}
body.light footer {
  color: rgba(0,0,0,0.25);
  border-top-color: rgba(0,0,0,0.08);
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 680px) {
  .game-body {
    flex-direction: column;
    align-items: center;
    padding: 0.8rem;
  }
  .sudoku-grid.size-9 {
    width: min(96vw, 380px);
    height: min(96vw, 380px);
  }
  .sudoku-grid.size-3 {
    width: min(70vw, 280px);
    height: min(70vw, 280px);
  }
  .side-panel { width: min(96vw, 380px); }
  .numpad-grid { grid-template-columns: repeat(10, 1fr); }
  .numpad-grid.cols-3 { grid-template-columns: repeat(4, 1fr); }
}
