/* Sudoku Puzzle Custom Stylesheet - Dark Terminal / Matrix Theme */

/* Define Color Palette */
:root {
    --bg-dark: #111111; /* Deep Black Background */
    --accent-primary: #00CC00; /* Bright Green (Main Accent, Borders, Correct) */
    --accent-secondary: #00FFFF; /* Cyan (Initial Numbers) */
    --feedback-incorrect: #FF4444; /* Bright Red */
    --text-light: #F0F0F0; /* White/Light Gray Text */
    --text-muted: #A0A0A0; /* Muted Gray Text */
    --border-thin: #333333; /* Dark Gray for thin lines */
    --card-bg: #1A1A1A; /* Slightly lighter black for cards */
}

/* ================================== */
/* BASIC & RESET                      */
/* ================================== */
body {
	background-color: var(--bg-dark); 
	font-family: 'Consolas', 'Courier New', monospace; 
	font-size: small;
	color: var(--text-light); 
	margin: 0;
	padding: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

h1 {
	color: var(--accent-primary); 
	text-shadow: 0 0 5px rgba(0, 204, 0, 0.7); 
}

h2 {
	color: var(--accent-primary);
	text-align: left; 
	border-bottom: 1px solid rgba(0, 204, 0, 0.3);
	padding-bottom: 5px;
	margin-bottom: 15px;
}

h3.card-header {
	color: var(--accent-secondary); 
	margin-top: 5px;
	margin-bottom: 5px;
}

p.difficulty-text {
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* ================================== */
/* LAYOUT & CONTAINERS                */
/* ================================== */
.container {
	display: flex;
	max-width: 1400px;
	margin: 20px auto;
	padding: 0 20px;
	flex-grow: 1;
	align-items: flex-start;
}

.sidebar {
	flex: 0 0 250px;
	margin-right: 30px;
	position: sticky;
	top: 20px;
	background-color: var(--card-bg);
	padding: 15px;
	border: 1px solid var(--accent-primary);
	box-shadow: 0 0 10px rgba(0, 204, 0, 0.3);
}

.main-content {
	flex-grow: 1;
	min-width: 700px;
}

header {
	background-color: #080808;
	padding: 15px 0;
	text-align: center;
	border-bottom: 2px solid var(--accent-primary);
}

header h1 {
	margin: 0;
}

/* Sidebar Links */
.sidebar ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.sidebar li {
	margin-bottom: 10px;
}

.sidebar a {
	color: var(--text-light);
	text-decoration: none;
	transition: color 0.2s;
	display: block;
	padding: 5px 0;
	border-bottom: 1px dotted rgba(255, 255, 255, 0.1);
}

.sidebar a:hover {
	color: var(--accent-primary);
	text-shadow: 0 0 5px rgba(0, 204, 0, 0.5);
}

/* ================================== */
/* SUDOKU GRID STYLING                */
/* ================================== */

.sudoku-display-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 20px auto;
    justify-items: center;
}
.sudoku-card {
    text-align: center;
    background-color: var(--card-bg);
    padding: 15px;
    border: 1px solid var(--accent-primary);
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 204, 0, 0.2);
}

.sudoku-grid {
    border-collapse: collapse;
    margin: 10px auto;
    border: 4px solid var(--accent-primary); 
    background-color: #080800;
    box-shadow: 0 0 10px rgba(0, 204, 0, 0.5);
}

.sudoku-grid td {
    width: 38px;
    height: 38px;
    padding: 0; 
    text-align: center;
    font-size: 1.4em;
    font-weight: 500;
    color: var(--text-light); 
    border: 1px solid var(--border-thin); 
    vertical-align: middle;
}

/* Thicker lines for 3x3 box separation */
.sudoku-grid .border-right-3 {
    border-right-width: 3px;
    border-right-color: var(--accent-primary);
}
.sudoku-grid .border-bottom-3 {
    border-bottom-width: 3px;
    border-bottom-color: var(--accent-primary);
}

/* Ensure the last row/column lines are not excessively thick */
.sudoku-grid tr:last-child td {
    border-bottom: 1px solid var(--border-thin);
}
.sudoku-grid td:last-child {
    border-right: 1px solid var(--border-thin);
}

/* --- Input Field Styling --- */
.sudoku-input {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border: none;
    padding: 0;
    margin: 0;
    background-color: transparent; 
    color: var(--text-light);
    font-family: inherit;
    font-size: inherit;
    text-align: center;
    outline: none; 
}

/* Pre-filled numbers (bold, secondary accent color) */
.sudoku-grid .initial-number {
    font-weight: bold;
    color: var(--accent-secondary); 
    text-shadow: 0 0 3px rgba(0, 255, 255, 0.5);
    display: block; 
    line-height: 38px;
}

/* Solution numbers (in the solution grid, regular white) */
.sudoku-grid .solved-number {
    color: var(--text-muted); 
    font-weight: normal;
    display: block;
    line-height: 38px;
}

/* --- Feedback Styling --- */
.sudoku-input.correct {
    color: var(--accent-primary); 
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 204, 0, 0.7);
}

.sudoku-input.incorrect {
    color: var(--feedback-incorrect); 
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 68, 68, 0.7);
}

/* ================================== */
/* SPOILER/OVERLAY STYLING (FIXED)    */
/* ================================== */

/* Container for the solution grid, which will be hidden */
.solution-spoiler {
    position: relative; /* <-- THE CRITICAL FIX */
    display: block; /* Ensure it takes up its necessary space */
}

.spoiler-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #080808; 
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 0 15px rgba(0, 204, 0, 0.5) inset;
    transition: background-color 0.3s ease;
}

.spoiler-overlay:hover {
    background-color: #111111; 
}

/* Button Styling for Reveal */
.spoiler-overlay button {
    padding: 10px 20px;
    font-size: 1.1em;
    background-color: var(--accent-primary);
    color: var(--bg-dark);
    border: 2px solid var(--accent-secondary);
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: bold;
    transition: all 0.2s ease;
}

.spoiler-overlay button:hover {
    background-color: var(--accent-secondary);
    color: var(--bg-dark);
    box-shadow: 0 0 10px var(--accent-secondary);
}

.spoiler-overlay p {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9em;
}

/* The element is removed from the screen when the class is removed. */
/* We don't need a specific class to remove the overlay, because removing the
   .solution-spoiler class (which contains the overlay) should be sufficient,
   but we will explicitly target the overlay to be safe. */


/* Responsive adjustments and SEED FORM STYLING (omitted for brevity, assume they are still included in the final file) */

/* ================================== */
/* SEED FORM STYLING                  */
/* ================================== */
.seed-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10px;
    justify-content: center;
}
.seed-form label {
    flex-basis: 100%;
    text-align: center;
    font-size: 0.9em;
    color: var(--text-muted);
}
.seed-form input[type="text"] {
    padding: 5px;
    border: 1px solid var(--accent-secondary);
    background-color: var(--bg-dark);
    color: var(--text-light);
    border-radius: 4px;
    width: 120px;
    text-align: center;
    font-size: 1em;
}
.seed-form input[type="submit"] {
    padding: 5px 15px;
    background-color: #303030;
    color: var(--accent-secondary);
    border: 2px solid var(--accent-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.seed-form input[type="submit"]:hover {
    background-color: var(--accent-primary);
    border-color: var(--accent-secondary);
    color: var(--bg-dark);
    text-shadow: none;
}