/* CineAHO Premium Sudoku Pro Game Stylesheet */

/* Core Variables & Tokens */
:root {
  --hue-purple: 270;
  --hue-blue: 210;
  --hue-green: 145;
  --hue-gold: 45;
  --hue-red: 350;
  --hue-cyan: 190;

  /* Theme Core - Dark Glassmorphism */
  --bg-color: #040712;
  --bg-grid: rgba(255, 255, 255, 0.015);
  
  --panel-bg: rgba(10, 16, 32, 0.6);
  --panel-border: rgba(255, 255, 255, 0.05);
  --panel-hover-border: rgba(59, 130, 246, 0.25);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #475569;
  
  /* Gradation Accents */
  --grad-purple: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
  --grad-blue: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --grad-cyan: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  --grad-green: linear-gradient(135deg, #10b981 0%, #047857 100%);
  --grad-gold: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  --grad-red: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);

  --neon-glow: 0 0 30px rgba(59, 130, 246, 0.2);
  --font-main: 'Noto Sans KR', 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 12px 40px 0 rgba(0, 0, 0, 0.6);
  
  --highlight-color: #3b82f6;
  --accent-purple: #a855f7;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Grid Background */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -2;
  pointer-events: none;
}

/* Ambient Glow Orbs */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(150px);
  z-index: -3;
  pointer-events: none;
  opacity: 0.18;
}

.bg-glow-purple {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #7e22ce 0%, transparent 70%);
  top: -100px;
  left: 5%;
}

.bg-glow-blue {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #1d4ed8 0%, transparent 70%);
  top: 35%;
  right: 5%;
}

/* Header */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  margin: 1rem 1.5rem 0 1.5rem;
  border-radius: 50px;
  transition: var(--transition-smooth);
}

.glass-header {
  background: rgba(10, 16, 32, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.logo-circle {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-text {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.95rem;
}

.logo-text span {
  color: var(--text-muted);
  font-weight: 400;
}

.header-nav {
  flex-grow: 1;
  margin: 0 2rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.header-nav::-webkit-scrollbar {
  display: none;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 1.25rem;
  white-space: nowrap;
}

.nav-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  padding: 0.5rem 0.25rem;
  position: relative;
}

.nav-list a:hover,
.nav-list a.active {
  color: var(--text-main);
}

.nav-list a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #3b82f6;
  border-radius: 2px;
}

.btn-back-dashboard {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  padding: 0.5rem 1.2rem;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-back-dashboard:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #3b82f6;
  transform: translateX(-2px);
}

/* Common Glass Panels */
.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: var(--panel-hover-border);
}

/* Sudoku Container */
.sudoku-container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sudoku-header-section {
  text-align: center;
}

.main-title {
  font-size: 2.1rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  letter-spacing: -0.5px;
}

.main-title span {
  background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.main-title i {
  color: #a855f7;
  margin-right: 0.5rem;
}

.subtitle-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto 1.25rem auto;
  line-height: 1.6;
}

.tag-badges {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.25rem 0.75rem;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.badge-tag {
  background: rgba(168, 85, 247, 0.05);
  border-color: rgba(168, 85, 247, 0.12);
  color: #c084fc;
}

/* Control Config Bar */
.sudoku-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.5rem;
}

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

.mode-toggle-group {
  display: flex;
  background: rgba(0,0,0,0.3);
  padding: 0.25rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.05);
}

.btn-mode {
  padding: 0.45rem 0.95rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-smooth);
}

.btn-mode.active {
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.4);
  color: #fb923c;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.15);
}

.select-wrapper {
  position: relative;
}

.dropdown-select {
  appearance: none;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.55rem 2.2rem 0.55rem 1rem;
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.dropdown-select:focus {
  border-color: #3b82f6;
  box-shadow: var(--neon-glow);
}

.select-wrapper::after {
  content: '▼';
  font-size: 0.6rem;
  color: var(--text-muted);
  position: absolute;
  right: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(59, 130, 246, 0.35);
}

.control-right {
  display: flex;
  gap: 0.5rem;
}

.btn-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-icon-circle:hover {
  background: rgba(255,255,255,0.08);
  border-color: #3b82f6;
  color: #fff;
}

/* Sudoku Workspace */
.sudoku-workspace {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}

/* 9x9 Board Panel */
.board-panel {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sudoku-board-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  background: rgba(0, 0, 0, 0.35);
  border: 3px solid #1e293b;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.5);
}

/* Cell styles */
.sudoku-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  user-select: none;
  font-family: var(--font-display);
  font-weight: 700;
  transition: background-color 0.15s ease, border 0.15s ease;
}

/* Thick borders mapping for 3x3 blocks */
/* 0-indexed column border-right */
.sudoku-cell[data-col="2"],
.sudoku-cell[data-col="5"] {
  border-right: 3px solid #1e293b;
}

/* 0-indexed row border-bottom */
.sudoku-cell[data-row="2"],
.sudoku-cell[data-row="5"] {
  border-bottom: 3px solid #1e293b;
}

/* Cell Value display text */
.cell-value {
  font-size: 1.6rem;
  font-weight: 700;
  position: absolute;
  pointer-events: none;
}

/* Starting number value (Bold white fixed) */
.sudoku-cell.starting-num {
  background: rgba(255, 255, 255, 0.02);
}
.sudoku-cell.starting-num .cell-value {
  color: #fff;
  font-weight: 800;
}

/* User entered value (Cyan font color) */
.sudoku-cell.user-num .cell-value {
  color: #06b6d4;
  font-weight: 600;
}

/* Error value (Crimson bold text) */
.sudoku-cell.error-num {
  background-color: rgba(244, 63, 94, 0.08) !important;
}
.sudoku-cell.error-num .cell-value {
  color: #f43f5e;
  font-weight: 700;
  animation: shake 0.3s ease-in-out;
}

/* Conflict/duplicate value (Orange soft highlight with underline) */
.sudoku-cell.conflict-num {
  background-color: rgba(249, 115, 22, 0.08) !important;
}
.sudoku-cell.conflict-num .cell-value {
  color: #fb923c;
  font-weight: 700;
  text-decoration: underline dotted #fb923c;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* 3x3 Pencil notes layout grid */
.pencil-notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  padding: 2px;
  pointer-events: none;
}

.note-slot {
  font-size: 0.65rem;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  line-height: 1;
}

.note-slot.active {
  color: #a855f7;
}

/* Highlight behaviors */
/* Row/col/box area highlights */
.sudoku-cell.area-highlight {
  background-color: rgba(99, 102, 241, 0.05);
}

/* Selected cell */
.sudoku-cell.selected-cell {
  background-color: rgba(59, 130, 246, 0.22) !important;
  box-shadow: inset 0 0 8px rgba(59, 130, 246, 0.4);
}

/* Same number highlights */
.sudoku-cell.number-highlight {
  background-color: rgba(251, 191, 36, 0.16) !important;
}

/* Sidebar Sidebar Panel */
.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Stats Card */
.stat-card-box {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge-capsules {
  display: flex;
  gap: 0.35rem;
}

.badge-mini {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
}

.badge-mini.orange {
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249,115,22,0.3);
  color: #fb923c;
}

.badge-mini.yellow {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234,179,8,0.25);
  color: #eab308;
}

.btn-pause {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  transition: var(--transition-smooth);
}

.btn-pause:hover {
  background: rgba(255,255,255,0.08);
  color: #3b82f6;
}

.btn-pause.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: #3b82f6;
  color: #fff;
}

.stat-card-body {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.25rem;
  align-items: center;
}

/* Progress ring */
.radial-progress-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
}

.radial-ring {
  transform: rotate(-90deg);
}

.radial-ring-fill {
  transition: stroke-dashoffset 0.35s;
}

.radial-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
}

/* Timer details rows */
.stat-rows-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.stat-row span {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.stat-row strong {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
}

/* Actions Toolbar */
.tools-action-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0.5rem;
  gap: 0.25rem;
}

.tool-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 0.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.tool-btn i {
  font-size: 1.05rem;
}

.tool-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.tool-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.tool-btn.active {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  color: #10b981 !important;
}

.tool-btn.btn-highlight {
  background: rgba(251, 191, 36, 0.06);
  border-color: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.tool-btn.btn-highlight:hover {
  background: rgba(251, 191, 36, 0.12);
  border-color: #fbbf24;
}

.tool-hint-text {
  font-size: 0.68rem;
  color: var(--text-dark);
  text-align: center;
  margin-top: -0.25rem;
  padding: 0 0.5rem;
}

/* Keypad Grid box */
.keypad-card-box {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.btn-num {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: #fff;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
}

.btn-num:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.15);
}

.btn-num.completed {
  border-color: #10b981;
  color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.btn-num:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  background: rgba(0,0,0,0.1);
  border-color: transparent;
}

/* Superscript remaining placement count badge */
.num-count-sub {
  position: absolute;
  bottom: 3px;
  right: 5px;
  font-size: 0.58rem;
  color: var(--text-muted);
  font-weight: 500;
}

.keypad-bottom-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.5rem;
}

.btn-action-pad {
  border-radius: 10px;
  height: 40px;
  border: 1px solid transparent;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: var(--transition-smooth);
}

.btn-action-pad.delete {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.2);
  color: #f43f5e;
}

.btn-action-pad.delete:hover {
  background: rgba(244, 63, 94, 0.18);
  border-color: #f43f5e;
}

.btn-action-pad.pencil {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.btn-action-pad.pencil:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.btn-action-pad.pencil.active {
  background: rgba(168, 85, 247, 0.15) !important;
  border-color: #a855f7 !important;
  color: #fff !important;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

/* Explanation Accordion Table of Contents */
.explanation-board-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.explanation-board-section .board-header {
  border-bottom: 2px solid #3b82f6;
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.explanation-board-section .board-header i {
  font-size: 1.25rem;
  color: #3b82f6;
}

.explanation-board-section .board-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.explanation-board-section .board-header span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.explanation-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.explanation-index-list {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 16px;
  overflow: hidden;
}

.explanation-index-list ul {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.explanation-index-list li {
  padding: 0.7rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition-smooth);
}

.explanation-index-list li:last-child {
  border-bottom: none;
}

.explanation-index-list li:hover {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
  padding-left: 1.25rem;
}

.explanation-index-list li.active {
  background: rgba(59, 130, 246, 0.1);
  color: #fff;
  border-left: 4px solid #3b82f6;
  padding-left: 1.25rem;
}

.index-num {
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.08);
  font-weight: 700;
}

.explanation-index-list li.active .index-num {
  color: #3b82f6;
}

.explanation-display-box {
  min-height: 380px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  border-left: 4px solid #93c5fd; /* Soft Blue accent */
}

.display-content-inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

.display-top-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(59, 130, 246, 0.12);
  padding: 0.25rem 0.8rem;
  border-radius: 30px;
  width: fit-content;
}

.display-top-badge i {
  font-size: 0.8rem;
  color: #60a5fa;
}

.display-top-badge span {
  font-size: 0.72rem;
  font-weight: 700;
  color: #93c5fd;
}

.explanation-display-box h3 {
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.display-text-body {
  font-size: 0.92rem;
  color: #e2e8f0;
  line-height: 1.7;
}

.display-text-body p {
  margin-bottom: 1rem;
}

.display-text-body ul, .display-text-body ol {
  margin-left: 1.25rem;
  margin-bottom: 1rem;
}

.display-text-body li {
  margin-bottom: 0.45rem;
}

.display-text-body strong {
  color: #60a5fa;
}

.fade-out {
  opacity: 0;
}

/* Modals Overlay */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  width: 90%;
  max-width: 440px;
  padding: 1.75rem;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-close-modal:hover {
  color: #fff;
}

/* Stats Modal Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-num-large {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: #3b82f6;
}

.stat-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244,63,94,0.3);
  color: #f43f5e;
}

.btn-danger:hover {
  background: rgba(244,63,94,0.25);
  border-color: #f43f5e;
}

/* Settings List Options */
.settings-options-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.setting-toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 80%;
}

.toggle-info strong {
  font-size: 0.85rem;
  color: #fff;
}

.toggle-info span {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.setting-toggle-item input[type="checkbox"] {
  accent-color: #3b82f6;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Floating Navigator */
.floating-navigator {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
}

.floating-buttons-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-float {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(10, 16, 32, 0.8);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
}

.btn-float:hover {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
  transform: translateY(-2px);
}

/* Media Queries */
@media (max-width: 850px) {
  .sudoku-workspace {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .sidebar-panel {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1rem;
  }
  .keypad-card-box {
    grid-row: span 2;
    justify-content: center;
  }
  .explanation-layout {
    grid-template-columns: 1fr;
  }
  .explanation-index-list ul {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .explanation-index-list li {
    flex: 1 1 180px;
  }
}

@media (max-width: 600px) {
  .main-header {
    margin: 0.5rem;
    padding: 0.5rem 1.1rem;
  }
  .logo-text {
    display: none;
  }
  .main-title {
    font-size: 1.7rem;
  }
  .sudoku-control-bar {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  .control-left {
    flex-wrap: wrap;
    justify-content: center;
  }
  .control-right {
    justify-content: center;
  }
  .sidebar-panel {
    grid-template-columns: 1fr;
  }
  .keypad-card-box {
    grid-row: auto;
  }
}
