/*
 * Copyright (C) 2026 Lele
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body {
    font-family: 'Segoe UI', 'Poppins', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 36px;
    padding: 24px 20px 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    text-align: center;
}

h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 4px;
}

.subtitle {
    color: #5a6e7c;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.back-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.back-link {
    color: #2c7da0;
    text-decoration: none;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: 0.2s;
}

.back-link:hover {
    color: #1f5068;
    transform: translateX(-2px);
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #eef2f5;
    padding: 10px 18px;
    border-radius: 60px;
    margin-bottom: 24px;
    font-weight: bold;
}

#newGameBtn {
    background: #2e7d64;
    border: none;
    color: white;
    padding: 6px 18px;
    border-radius: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

#newGameBtn:hover {
    background: #1f5e4a;
    transform: scale(1.02);
}

.sudoku-grid {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

table.sudoku-board {
    border-collapse: collapse;
    background-color: #fef9e8;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

table.sudoku-board td {
    padding: 0;
    margin: 0;
}

.sudoku-cell {
    width: 52px;
    height: 52px;
    text-align: center;
    vertical-align: middle;
    font-size: 28px;
    font-weight: 500;
    font-family: monospace;
    border: 1px solid #bbb;
    background-color: #fffdf7;
    transition: 0.05s linear;
    cursor: pointer;
}

table.sudoku-board td:nth-child(3) .sudoku-cell {
    border-right-width: 2px;
}
table.sudoku-board td:nth-child(6) .sudoku-cell {
    border-right-width: 2px;
}
table.sudoku-board tr:nth-child(3) .sudoku-cell {
    border-bottom-width: 2px;
}
table.sudoku-board tr:nth-child(6) .sudoku-cell {
    border-bottom-width: 2px;
}

.sudoku-cell.prefilled {
    color: #2c5f8a;
    font-weight: 600;
}

.sudoku-cell.user {
    color: #1f8a4c;
    font-weight: 500;
}

.sudoku-cell.selected {
    background-color: #c9e9ff;
    box-shadow: inset 0 0 0 2px #2c7da0;
}

.sudoku-cell.same-value {
    background-color: #ffe1b3;
}

.sudoku-cell.error {
    background-color: #ffe0e0;
    color: #d9534f;
}

.number-panel {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 20px 0 16px;
}

.num-btn {
    width: 58px;
    height: 58px;
    background: #2c3e50;
    color: white;
    font-size: 28px;
    font-weight: bold;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.1s;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.num-btn:hover {
    background: #1e2f3a;
    transform: scale(1.03);
}

.num-btn.delete {
    background: #b33b2c;
    font-size: 20px;
}

.message {
    font-size: 1rem;
    font-weight: bold;
    min-height: 48px;
    color: #2e7d64;
    margin: 8px 0;
}

.instructions {
    background: #eef2f5;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 0.75rem;
    color: #2c3e50;
    text-align: left;
    margin-top: 12px;
}

details summary {
    font-weight: bold;
    cursor: pointer;
    color: #1e4663;
}

.game-info span {
  background: rgba(0, 0, 0, 0.05);
  padding: 4px 12px;
  border-radius: 30px;
}

#timer {
  font-weight: bold;
  color: #2e7d64;
  font-size: 1.2rem;
  min-width: 50px;
  display: inline-block;
}

@media (max-width: 550px) {
    .sudoku-cell {
    width: 36px;
    height: 36px;
    font-size: 20px;
    }
    .num-btn {
    width: 48px;
    height: 48px;
    font-size: 24px;
    }
    .container {
    padding: 18px 12px 24px;
    }
}