/*
 * ============================================================
 *  TNT | Sudoku Saga — S.P.A.R.K. Edition
 *  File:    sudokuSPARKStyles.css
 *  Coder:   KLP + GitHub Copilot
 *  Created: 2026-07-15
 *
 *  Clean logic-puzzle palette — focused, cerebral, confident.
 *  Requires CSS custom properties from tnt-base-styles.css.
 *  Replaces the legacy masthead/nav rules that matched no
 *  elements after the TNT SPARK renovation.
 * ============================================================
 */


/* ── Local palette additions ── */
:root {
    --sudoku-green:      #2e7d32;
    --sudoku-green-lt:   #e8f5e9;
    --sudoku-green-mid:  #c8e6c9;
    --sudoku-ink:        #1a1a2e;
}


/* ─────────────────────────────────────────────────────────
   HERO — deep blue-to-green gradient over the Einstein image.
   Sudoku is a logic puzzle: the palette leans intellectual
   rather than festive. Deep blue (focused, analytic) slides
   toward forest green (the board's own border color), so the
   hero gradient bridges into the game below.
───────────────────────────────────────────────────────── */
#hero {
    min-height: 160px;
    background-image:
        linear-gradient(135deg,
            rgba(10, 14, 50, 0.72)  0%,
            rgba(20, 80, 30, 0.58) 100%),
        url('../images/sumoSudokuCartoon.jpeg');
    background-size: cover;
    background-position: center bottom;
    padding: 1.4rem 1rem 1.2rem;
    border-bottom: 4px solid var(--tnt-red);
}

#hero .hero-title {
    font-size: clamp(2.4rem, 5.5vw, 3.5rem);
    margin-bottom: 0.5rem;
    color: #fff;
    text-shadow: 0 3px 14px rgba(0, 0, 0, 0.9);
}

#hero .hero-eyebrow {
    color: var(--tnt-amber);
}

#hero .hero-subtitle {
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(0.88rem, 2vw, 1.1rem);
}

/* Sudoku grid icon in the hero heading */
.hero-sudoku-icon {
    height: 2.6rem;
    vertical-align: middle;
    margin-right: 0.4rem;
    filter: brightness(0) invert(1);   /* white on dark overlay */
}


/* ─────────────────────────────────────────────────────────
   APP SECTION — clean off-white background.
   Sudoku is a focusing task; a patterned/festive background
   would compete with the grid's own visual information.
   Off-white keeps attention on the board.
───────────────────────────────────────────────────────── */
#appSection {
    background: #f4f6f0;
    padding: 2rem 0 4rem;
    min-height: 60vh;
}


/* ─────────────────────────────────────────────────────────
   SUDOKU PANEL — the centered game container.
   Fixed width matches the board (360px) so the digit palette
   and demo form stay perfectly aligned below it.
───────────────────────────────────────────────────────── */
#sudokuPanel {
    width: 360px;
}


/* ─────────────────────────────────────────────────────────
   AI SOLVER — board cell states
   Two strategy colours for confirmed placements:
     ai-naked    = Naked Single  (blue  — one candidate forced by row/col/box)
     ai-hidden   = Hidden Single (purple — digit confined to one cell in a group)
     ai-trial    = Backtrack trial (amber italic — tentative, may be erased)
     ai-backtrack = about to be erased (red flash, then cleared)
───────────────────────────────────────────────────────── */
table#sb td.ai-naked {
    background-color: #bbdefb !important;   /* Material blue-100 — Naked Single */
    color: #0d47a1;
    font-weight: 600;
    transition: background-color 0.25s;
}

table#sb td.ai-hidden {
    background-color: #d8b4fe !important;   /* Tailwind purple-300 — Hidden Single */
    color: #4c1d95;
    font-weight: 600;
    transition: background-color 0.25s;
}

table#sb td.ai-trial {
    background-color: #fff8e1 !important;   /* Material amber-50 */
    color: #bf360c;
    font-style: italic;
    transition: background-color 0.2s;
}

table#sb td.ai-backtrack {
    background-color: #ffcdd2 !important;   /* Material red-100 */
    transition: background-color 0.15s;
}


/* ─────────────────────────────────────────────────────────
   COLOR LEGEND (inside #solveControls)
───────────────────────────────────────────────────────── */
.color-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
    margin-top: 0.5rem;
    font-size: 0.73rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #546e7a;
    white-space: nowrap;
}

.legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.swatch-naked     { background: #bbdefb; border: 1px solid #90caf9; }
.swatch-hidden    { background: #d8b4fe; border: 1px solid #a855f7; }
.swatch-trial     { background: #fff8e1; border: 1px solid #ffe082; }
.swatch-backtrack { background: #ffcdd2; border: 1px solid #ef9a9a; }


/* ─────────────────────────────────────────────────────────
   SOLVE CONTROLS
───────────────────────────────────────────────────────── */
#solveControls {
    border-top: 2px dashed #c8e6c9;
    padding-top: 0.85rem;
    margin-top: 0.6rem;
}

/* Status bar */
.solve-status {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    text-align: center;
    line-height: 1.5;
}
.solve-status-ready   { background: #f5f5f5; color: #546e7a; }
.solve-status-running { background: #e3f2fd; color: #1565c0; }
.solve-status-paused  { background: #fff8e1; color: #bf360c; }
.solve-status-success { background: #e8f5e9; color: #1b5e20; }
.solve-status-error   { background: #fce4ec; color: #880e4f; }
.solve-status-warn    { background: #fff3e0; color: #e65100; }

/* Stats chips (appear after solve) */
.stat-chip {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    margin: 0 2px;
}
.stat-naked  { background: #bbdefb; color: #0d47a1; }
.stat-hidden { background: #d8b4fe; color: #4c1d95; }
.stat-trial  { background: #fff8e1; color: #bf360c; }
.stat-back   { background: #fce4ec; color: #880e4f; }


/* ─────────────────────────────────────────────────────────
   SOLVER LOG PANEL  (below the centered board)
───────────────────────────────────────────────────────── */
#solveLogPanel {
    max-width: 620px;
    margin: 1.2rem auto 0;
    background: #fff;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    overflow: hidden;
}

.log-header {
    background: #e8f5e9;
    border-bottom: 1px solid #c8e6c9;
    padding: 0.45rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.4rem;
}

#solveStats {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
}

#solveLog {
    max-height: 220px;
    overflow-y: auto;
    padding: 0.35rem 0.5rem;
    font-family: 'Noto Sans Mono', 'Courier New', monospace;
    font-size: 0.77rem;
    line-height: 1.55;
}

/* individual log entries */
.log-entry         { padding: 0.18rem 0.4rem; border-radius: 3px; margin-bottom: 2px; }
.log-num           { color: #90a4ae; font-size: 0.7rem; margin-right: 0.35rem;
                     min-width: 2.4rem; display: inline-block; text-align: right; }
.log-naked         { background: #e3f2fd; color: #0d47a1; }   /* Naked Single  — blue */
.log-hidden        { background: #ede9fe; color: #4c1d95; }   /* Hidden Single — purple */
.log-logical       { background: #e3f2fd; color: #0d47a1; }   /* fallback if no sub */
.log-trial         { background: #fff8e1; color: #bf360c; }
.log-backtrack     { background: #fce4ec; color: #880e4f; }
.log-info          { background: #f5f5f5; color: #546e7a; font-style: italic; }
.log-solved        { background: #e8f5e9; color: #1b5e20; font-weight: 700; }
.log-error         { background: #fce4ec; color: #880e4f; font-weight: 700; }

