/* /css/main.css
   ==========================================================
        Sudoku Paradise — Global Styles & 20 Themes
        Diamond Aesthetics: Feng Shui Edition
        + Cinematic Hint Spotlight (bubble + animated tails)
   ==========================================================
   • Reset & Box Sizing
   • Wallpaper / Subliminal Bricklayered Background
   • Body & Layout (Header, Controls, Panels)
   • Theme Dropdown, Swatch Dot (Virgin vs Set)
   • Sudoku Grid & 3x3 Block Borders
   • Number Pad & Candidates
   • StoryBook / Footer
   • 20 Themes + NIL Default (Feng Shui Compliant)
   ==========================================================
   Author: Andrew Beaudry (Founder)  ©Sudoku Paradise 2025
   Co-Author: Aria (AI Assistant)
   ==========================================================
*/

/* ==========================================================
   Reset & Box Sizing
=========================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==========================================================
   [1] Body & Pristine Defaults ~ Watermark Background
=========================================================== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url('/assets/sudokuparadiselogo.png'),
                    url('/assets/sudokuparadiselogo.png');
  background-repeat: repeat, repeat;
  background-size: 200px 200px, 200px 200px;
  background-position: 0 0, 1500px 1500px;
  background-color: color-mix(in oklab, var(--bg, #fff) 98%, white);
  opacity: 0.16;
  pointer-events: none;
  z-index: -1;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg, #fff);
  color: var(--fg, #000);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  transition: background 0.25s ease, color 0.25s ease;
}

/* ==========================================================
   [2] Header & Controls
=========================================================== */
header {
  margin-bottom: 1rem;
  text-align: center;
}

header h1 {
  margin-bottom: 0.5rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.controls button,
.controls select {
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  border: 1px solid color-mix(in oklab, var(--fg, #000) 15%, transparent);
  background: var(--surface-2, var(--panel-bg, #f0f0f0));
  color: var(--fg, #000);
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: background 0.25s ease, transform 0.08s ease, border-color 0.25s ease;
}

.controls button:hover,
.controls select:hover {
  transform: translateY(-2px);
  border-color: var(--accent, #000);
}

.controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================================
   [4] Sudoku Grid + 3x3 Block Borders
=========================================================== */
.sudoku-grid {
  display: grid;
  grid-template-columns: repeat(9, 50px);
  grid-template-rows: repeat(9, 50px);
  width: max-content;
  position: relative;
  margin: 20px auto;
  background: var(--grid-bg, #fff);
  border: 3px solid var(--accent, #000);
}

.cell {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--cell-bg, #fff);
  color: var(--cell-fg, #000);
  border: 1px solid var(--grid-line, #000);
}

.cell:nth-child(3n) { border-right: 3px solid var(--accent, #000); }
.cell:nth-child(9n+1) { border-left: 3px solid var(--accent, #000); }
.cell:nth-child(-n+9) { border-top: 3px solid var(--accent, #000); }
.cell:nth-child(n+19):nth-child(-n+27),
.cell:nth-child(n+46):nth-child(-n+54),
.cell:nth-child(n+73):nth-child(-n+81) { border-bottom: 3px solid var(--accent, #000); }

/* 🧩 Alignment override — prevents gravity sag from JS inline styles */
.sudoku-grid .cell {
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  display: flex !important;
}

/* ==========================================================
   [5] Candidates & Number Pad
=========================================================== */
.candidates {
  font-size: 0.6rem;
  color: forestgreen;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  place-items: center;
}

.number-pad {
  display: grid;
  grid-template-columns: repeat(3, var(--cell-size, 50px));
  grid-template-rows: repeat(4, var(--cell-size, 50px));
  gap: 0.5rem;
  margin: 1.5rem auto;
  justify-content: center;
}

.number-pad button {
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: var(--radius, 10px);
  border: 2px solid color-mix(in oklab, var(--fg, #000) 25%, transparent);
  background: var(--surface-2, var(--panel-bg, #f0f0f0));
  color: var(--fg, #000);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.25s ease, border-color 0.25s ease;
}

.number-pad button:hover { transform: translateY(-2px); border-color: var(--accent, #000); }
.number-pad button:active { transform: translateY(0) scale(0.96); }
.number-pad button.clear {
  background: var(--danger, #ff6b6b);
  color: #fff;
  border-color: transparent;
}
.number-pad button.clear:hover {
  background: color-mix(in oklab, var(--danger, #ff6b6b) 85%, white);
}

/* ==========================================================
   [6] Storybook & Footer
=========================================================== */
.storybook {
  margin-top: 1rem;
  text-align: left;
  width: 360px;
  background: var(--panel-bg, #f0f0f0);
  color: var(--panel-fg, #000);
  border: 1px solid #888;
  padding: 0.5rem;
  border-radius: 4px;
  box-shadow: var(--shadow-1);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.storybook-title { margin: 0 0 10px; font-size: 16px; }
.storybook-steps { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; font-size: 0.85rem; }

/* ==========================================================
   [6.5] Footer Legibility Enhancement
=========================================================== */
footer {
  text-align: center;
  padding: 1rem;
  margin-top: auto;
  font-size: 0.8rem;
  position: relative;
  z-index: 1;
  color: color-mix(in oklab, var(--fg) 85%, var(--bg));
  text-shadow: 0 0 2px color-mix(in oklab, var(--fg) 20%, transparent);
}

/* ==========================================================
   [7] Toggles & Indicators
=========================================================== */
.toggle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #888;
  background: transparent;
}

.toggle.true { background: #0a0; }
.toggle.false { background: #a00; }

/* ==========================================================
   [8] Pristine / NIL Default Theme
   =========================================================== */
:root {
  --bg: #ffffff;
  --fg: #000000;
  --grid-bg: #ffffff;
  --grid-line: #000000;
  --cell-bg: #ffffff;
  --cell-fg: #000000;
  --panel-bg: #f0f0f0;
  --panel-fg: #222222;
  --accent: #000000;
  --surface-2: #f0f0f0;
  --shadow-1: 0 2px 6px rgba(0,0,0,0.15);
  --danger: #ff6b6b;
}

/** =========================================================== --
       [9] Force Pristine Theme as default ~ No matter what!
 -- =========================================================== */
html {
  --bg: #ffffff;
  --fg: #000000;
  --grid-bg: #ffffff;
  --grid-line: #000000;
  --cell-bg: #ffffff;
  --cell-fg: #000000;
  --panel-bg: #f0f0f0;
  --panel-fg: #222222;
  --accent: #000000;
  --surface-2: #f0f0f0;
  --shadow-1: 0 2px 6px rgba(0,0,0,0.15);
  --danger: #ff6b6b;
  --pristine-bg: transparent; /* or remove fallback */
  /** background-color: var(--pristine-bg, #fefefe); */
}
body {
  background-color: var(--bg);
  color: var(--fg);
}

