:root {
    --bg-dark: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --primary: #3b82f6;
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --grid-border: #94a3b8;
    --cell-border: #334155;
    --cell-bg: #1e293b;
    --cell-bg-selected: rgba(59, 130, 246, 0.4);
    --cell-bg-highlight: rgba(59, 130, 246, 0.15);
    
    --text-initial: #f8fafc;
    --text-user: #3b82f6;
    --text-error: #ef4444;
}

body {
    background-color: var(--bg-dark);
    color: white;
    font-family: 'Outfit', sans-serif;
    margin: 0;
    overflow-x: hidden;
}

.game-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

.game-header { text-align: center; }
.game-header h1 { font-size: 2.5rem; margin: 1rem 0 0 0; }

.panel {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    margin: 2rem auto;
    text-align: center;
}

.btn-group {
    display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem;
}

/* Progress bar for online/AI */
.progress-container {
    width: 100%; max-width: 450px; margin: 0 auto 1.5rem auto;
}
.progress-label {
    display: flex; justify-content: space-between; font-size: 0.9rem; color: #cbd5e1; margin-bottom: 0.25rem;
}
.progress-bar-bg {
    width: 100%; height: 10px; background-color: #334155; border-radius: 5px; overflow: hidden;
}
.progress-fill {
    height: 100%; background-color: #ef4444; width: 0%; transition: width 0.3s ease;
}

.sudoku-wrapper {
    display: flex; justify-content: center;
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    gap: 1px;
    background-color: var(--grid-border);
    border: 3px solid var(--grid-border);
    width: 100%;
    max-width: 450px;
    aspect-ratio: 1 / 1;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.cell {
    background-color: var(--cell-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 500;
    cursor: pointer; user-select: none;
    transition: background-color 0.1s;
}

/* 3x3 Block borders */
.cell:nth-child(3n) { border-right: 2px solid var(--grid-border); }
.cell:nth-child(9n) { border-right: none; }
.cell:nth-child(n+19):nth-child(-n+27),
.cell:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid var(--grid-border); }

.cell.initial { font-weight: 700; color: var(--text-initial); cursor: default; }
.cell.user { color: var(--text-user); }
.cell.error { color: var(--text-error); background-color: rgba(239, 68, 68, 0.1); }
.cell.selected { background-color: var(--cell-bg-selected) !important; }
.cell.highlight { background-color: var(--cell-bg-highlight); }

/* Numpad */
.numpad {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    max-width: 450px;
    margin: 1.5rem auto 0 auto;
}

.num-btn {
    background: #334155; color: white; border: none; border-radius: 8px;
    padding: 1rem 0; font-size: 1.5rem; font-weight: 700; cursor: pointer;
    font-family: inherit; transition: transform 0.1s, background 0.1s;
}
.num-btn:active { transform: scale(0.95); }

.action-btn { font-size: 1.1rem; grid-column: span 3; }
.bg-red { background: #ef4444; }
.bg-blue { background: #3b82f6; }

.hidden { display: none !important; }

@media (max-width: 500px) {
    .cell { font-size: 1.2rem; }
    .num-btn { font-size: 1.2rem; padding: 0.75rem 0; }
}
