/* index.css — extracted from inline <style> blocks. Generated by scripts/h1-extract.mjs */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

        *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

        :root {
            --bg-primary: #08080f;
            --bg-secondary: #0e0e1a;
            --bg-tertiary: #141425;
            --bg-card: #1a1a2e;
            --border: #2a2a45;
            --border-hover: #3a3a60;
            --text-primary: #e8e8f0;
            --text-secondary: #8888a0;
            --text-muted: #555570;
            --gold: #d4a843;
            --gold-dim: #a08030;
            --gold-glow: rgba(212, 168, 67, 0.15);
            --red: #e74c3c;
            --blue: #4a9eff;
            --green: #4caf50;
            --eval-white: #f0f0f0;
            --eval-black: #1a1a2e;
        }

        body {
            display: flex;
            height: 100vh;
            font-family: 'Inter', system-ui, -apple-system, sans-serif;
            background: var(--bg-primary);
            color: var(--text-primary);
            overflow: hidden;
            user-select: none;
        }

        /* ─── Sidebar ─── */
        #sidebar {
            width: 340px;
            min-width: 0;
            background: var(--bg-secondary);
            display: flex;
            flex-direction: column;
            border-right: 1px solid var(--border);
            z-index: 10;
        }

        .sidebar-header {
            padding: 18px 20px 14px;
            border-bottom: 1px solid var(--border);
            text-align: center;
        }
        .sidebar-header h1 {
            font-size: 1.4rem;
            font-weight: 700;
            letter-spacing: 3px;
            background: linear-gradient(135deg, #c9a44a, #f0d080, #e8c050, #c9a44a);
            background-size: 200% auto;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            text-transform: uppercase;
            animation: shimmer 3s ease-in-out infinite;
        }
        @keyframes shimmer {
            0%, 100% { background-position: 0% center; }
            50% { background-position: 200% center; }
        }
        .sidebar-header .subtitle {
            font-size: 0.68rem;
            color: var(--text-muted);
            letter-spacing: 4px;
            margin-top: 3px;
            text-transform: uppercase;
        }

        /* ─── Status Bar ─── */
        .status-bar {
            padding: 10px 20px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            gap: 10px;
            min-height: 44px;
        }
        .turn-dot {
            width: 12px; height: 12px;
            border-radius: 50%;
            border: 2px solid #444;
            flex-shrink: 0;
            transition: all 0.3s;
        }
        .turn-dot.white { background: #f0f0f0; border-color: #999; box-shadow: 0 0 10px rgba(255,255,255,0.4); }
        .turn-dot.black { background: #222; border-color: #555; box-shadow: 0 0 10px rgba(0,0,0,0.6); }
        #status-text { font-size: 0.85rem; font-weight: 500; }
        .status-check { color: var(--red); }
        .status-mate { color: var(--red); font-weight: 700; }
        .status-draw { color: #f39c12; }
        .status-thinking { color: var(--blue); }

        /* ─── Evaluation Bar ─── */
        .eval-container {
            padding: 8px 20px;
            border-bottom: 1px solid var(--border);
        }
        .eval-label {
            font-size: 0.65rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 1.5px;
            margin-bottom: 6px;
            display: flex;
            justify-content: space-between;
        }
        .eval-label .eval-score { color: var(--text-secondary); font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; }
        .eval-bar-track {
            width: 100%;
            height: 18px;
            background: #222;
            border-radius: 9px;
            overflow: hidden;
            position: relative;
            border: 1px solid var(--border);
        }
        .eval-bar-fill {
            height: 100%;
            background: linear-gradient(90deg, #e8e8e8, #f5f5f5);
            width: 50%;
            transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            border-radius: 9px 0 0 9px;
        }
        .eval-bar-center {
            position: absolute;
            left: 50%;
            top: 0;
            bottom: 0;
            width: 2px;
            background: var(--gold-dim);
            transform: translateX(-50%);
            opacity: 0.5;
        }

        /* ─── Chess Clock ─── */
        .clock-container {
            padding: 8px 20px;
            border-bottom: 1px solid var(--border);
            display: flex;
            gap: 8px;
        }
        .clock-panel {
            flex: 1;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 6px 10px;
            text-align: center;
            transition: all 0.3s;
        }
        .clock-panel.active {
            border-color: var(--gold-dim);
            box-shadow: 0 0 12px var(--gold-glow);
        }
        .clock-panel.low-time {
            border-color: var(--red);
            box-shadow: 0 0 12px rgba(231, 76, 60, 0.2);
        }
        .clock-label {
            font-size: 0.6rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        .clock-time {
            font-family: 'JetBrains Mono', monospace;
            font-size: 1.1rem;
            font-weight: 500;
            color: var(--text-primary);
            margin-top: 2px;
        }

        /* ─── Controls ─── */
        .controls {
            padding: 10px 20px;
            border-bottom: 1px solid var(--border);
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        .controls select, .controls button {
            padding: 5px 10px;
            border: 1px solid var(--border);
            border-radius: 6px;
            background: var(--bg-card);
            color: var(--text-secondary);
            font-size: 0.75rem;
            font-family: 'Inter', sans-serif;
            cursor: pointer;
            transition: all 0.2s;
        }
        .controls select:hover, .controls button:hover {
            border-color: var(--gold-dim);
            color: var(--text-primary);
        }
        .controls button:active { transform: scale(0.96); }
        .controls select { flex: 1; min-width: 90px; }
        .btn-new { background: #152215; border-color: #1e3a1e; }
        .btn-new:hover { background: #1e3a1e; border-color: var(--green); }
        .btn-undo { background: #151528; }
        .btn-flip { background: #281515; }

        /* ─── Captured Pieces ─── */
        .captured-section { padding: 6px 20px; border-bottom: 1px solid var(--border); }
        .captured-label {
            font-size: 0.6rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 1.5px;
            margin-bottom: 2px;
        }
        .captured-pieces {
            font-size: 1.1rem;
            min-height: 24px;
            display: flex;
            flex-wrap: wrap;
            gap: 1px;
            letter-spacing: 1px;
        }
        .captured-pieces .advantage {
            font-size: 0.7rem;
            color: var(--text-secondary);
            margin-left: 4px;
            align-self: center;
            font-family: 'JetBrains Mono', monospace;
        }

        /* ─── Move History ─── */
        .move-history { flex: 1; overflow-y: auto; padding: 8px 20px; }
        .move-history-label {
            font-size: 0.6rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 1.5px;
            margin-bottom: 6px;
        }
        .move-row {
            display: flex;
            gap: 4px;
            padding: 2px 0;
            font-size: 0.8rem;
            font-family: 'JetBrains Mono', monospace;
        }
        .move-num { color: var(--text-muted); min-width: 30px; }
        .move-white, .move-black {
            min-width: 65px;
            padding: 2px 6px;
            border-radius: 4px;
            cursor: default;
            transition: background 0.15s;
        }
        .move-white:hover, .move-black:hover { background: rgba(255,255,255,0.05); }
        .move-last { background: rgba(212, 168, 67, 0.1); }

        /* ─── Theme Selector ─── */
        .theme-row {
            padding: 8px 20px;
            border-bottom: 1px solid var(--border);
            display: flex;
            gap: 6px;
            align-items: center;
        }
        .theme-row label {
            font-size: 0.6rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 1.5px;
            white-space: nowrap;
        }
        .theme-btn {
            flex: 1;
            padding: 4px 8px;
            border: 1px solid var(--border);
            border-radius: 6px;
            background: var(--bg-card);
            color: var(--text-secondary);
            font-size: 0.68rem;
            font-family: 'Inter', sans-serif;
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
        }
        .theme-btn:hover { border-color: var(--gold-dim); color: var(--text-primary); }
        .theme-btn.active { border-color: var(--gold); color: var(--gold); background: var(--gold-glow); }

        /* ─── Game Container ─── */
        #game-container {
            flex: 1;
            position: relative;
            cursor: default;
        }
        #game-container canvas { display: block; }

        /* ─── Promotion Dialog ─── */
        #promotion-dialog {
            display: none;
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.75);
            z-index: 100;
            justify-content: center;
            align-items: center;
            backdrop-filter: blur(4px);
        }
        #promotion-dialog.active { display: flex; }
        .promo-box {
            background: var(--bg-tertiary);
            border: 2px solid var(--gold);
            border-radius: 14px;
            padding: 24px;
            text-align: center;
            box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 30px var(--gold-glow);
        }
        .promo-box h3 {
            margin-bottom: 16px;
            color: var(--gold);
            font-size: 0.9rem;
            letter-spacing: 2px;
            text-transform: uppercase;
        }
        .promo-options { display: flex; gap: 10px; }
        .promo-btn {
            width: 64px; height: 64px;
            border: 2px solid var(--border);
            border-radius: 10px;
            background: var(--bg-primary);
            color: var(--text-primary);
            font-size: 2.2rem;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .promo-btn:hover {
            border-color: var(--gold);
            background: var(--bg-card);
            transform: scale(1.1);
            box-shadow: 0 0 20px var(--gold-glow);
        }

        /* ─── Game Over Overlay ─── */
        #game-over-overlay {
            display: none;
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.6);
            z-index: 90;
            justify-content: center;
            align-items: center;
            backdrop-filter: blur(6px);
        }
        #game-over-overlay.active { display: flex; }
        .game-over-box {
            background: var(--bg-tertiary);
            border: 2px solid var(--gold);
            border-radius: 16px;
            padding: 30px 50px;
            text-align: center;
            box-shadow: 0 20px 80px rgba(0,0,0,0.6), 0 0 40px var(--gold-glow);
            animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        @keyframes popIn {
            from { transform: scale(0.8); opacity: 0; }
            to { transform: scale(1); opacity: 1; }
        }
        .game-over-box h2 {
            font-size: 1.6rem;
            font-weight: 700;
            background: linear-gradient(135deg, #c9a44a, #f0d080);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            margin-bottom: 8px;
        }
        .game-over-box .result-text {
            color: var(--text-secondary);
            font-size: 0.95rem;
            margin-bottom: 20px;
        }
        .game-over-box button {
            padding: 10px 30px;
            border: 1px solid var(--gold-dim);
            border-radius: 8px;
            background: var(--gold-glow);
            color: var(--gold);
            font-family: 'Inter', sans-serif;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            letter-spacing: 1px;
            transition: all 0.2s;
        }
        .game-over-box button:hover {
            background: var(--gold-dim);
            color: #fff;
        }

        /* ─── Scrollbar ─── */
        ::-webkit-scrollbar { width: 5px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
        ::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

        /* ─── Mobile ─── */
        @media (max-width: 768px) {
            body { flex-direction: column-reverse; }
            #sidebar {
                width: 100%; min-width: 0;
                max-height: 45vh;
                border-right: none;
                border-top: 1px solid var(--border);
                overflow-y: auto;
            }
            #game-container { height: 55vh; }
            .sidebar-header {
                padding: 6px 16px 4px;
            }
            .sidebar-header h1 {
                font-size: 1rem;
                letter-spacing: 2px;
            }
            .sidebar-header .subtitle {
                font-size: 10px;
                margin-top: 1px;
            }
            .status-bar {
                padding: 4px 16px;
                min-height: 44px;
                gap: 8px;
            }
            #status-text { font-size: 0.75rem; }
            .eval-container {
                padding: 4px 16px;
            }
            .eval-label { margin-bottom: 3px; font-size: 10px; }
            .eval-label .eval-score { font-size: 10px; }
            .eval-bar-track { height: 12px; }
            .clock-container {
                padding: 4px 16px;
                gap: 6px;
            }
            .clock-panel { padding: 3px 8px; }
            .clock-label { font-size: 10px; }
            .clock-time { font-size: 0.85rem; }
            .controls {
                padding: 4px 16px;
                gap: 4px;
            }
            .controls select, .controls button {
                padding: 6px 8px;
                font-size: 11px;
                min-height: 44px;
            }
            .controls select { min-width: 70px; }
            .theme-row {
                padding: 3px 16px;
                font-size: 10px;
            }
            .theme-btn { font-size: 10px; padding: 4px 6px; min-height: 44px; }
            .captured-section { padding: 3px 16px; }
            .captured-label { font-size: 10px; }
            .move-history { font-size: 11px; }
            /* Reorder sidebar children: controls near top, hide non-essential */
            .sidebar-header { order: 1; }
            .status-bar { order: 2; }
            .controls { order: 3; padding: 3px 12px; gap: 3px; }
            .controls select, .controls button { padding: 4px 6px; font-size: 11px; min-height: 44px; }
            .eval-container { order: 4; }
            .clock-container { order: 5; }
            .theme-row { order: 6; display: none; }
            .captured-section { order: 7; display: none; }
            .move-history { order: 8; }
        }
