/* Top navy blue band styles */
.top-band {
    width: 100%;
    background-color: #001f3f;
    padding: 0;
    text-align: center;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.10);
}

.top-title {
    color: #fff;
    margin: 0;
    font-size: 2.2em;
    font-weight: bold;
    letter-spacing: 2px;
    padding: 0 16px;
    line-height: 60px;
    text-shadow: 0 2px 8px rgba(44, 62, 80, 0.10);
}

body {
    background: #f6f8fa;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    color: #222;
}

@media (max-width: 600px),
(max-height: 600px) {
    body {
        padding: 0;
        margin: 0;
        min-height: 100vh;
        font-size: 1rem;
    }

    .sudoku-container {
        padding: 18px 8px 16px 8px;
        margin-top: 16px;
        border-radius: 16px;
        box-shadow: 0 4px 18px rgba(44, 62, 80, 0.18);
        width: 98vw;
        max-width: 99vw;
    }

    #sudoku-board {
        padding: 8px;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(44, 62, 80, 0.15);
        gap: 2px;
    }

    .sudoku-cell {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
        border-radius: 10px;
        -webkit-appearance: none;
        appearance: none;
        background: #fff;
        color: #222;
        border: none;
        outline: none;
        box-shadow: 0 1px 4px rgba(44, 62, 80, 0.08);
        padding: 0;
        margin: 0;
        transition: background 0.2s, box-shadow 0.2s, color 0.2s;
    }

    .sudoku-cell:focus {
        background: #e3eaf3;
        box-shadow: 0 0 0 2px #1976d2;
    }

    input[type="text"] {
        font-size: 1.25rem;
    }

    .controls {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 10px;
    }

    select#size {
        font-size: 1.15rem;
        padding: 12px 14px;
        border-radius: 10px;
        margin-right: 0;
        width: 100%;
        box-sizing: border-box;
        -webkit-appearance: none;
        appearance: none;
    }

    #checkSolution,
    #newGame {
        width: 100%;
        padding: 14px 0;
        font-size: 1.25rem;
        margin: 0 0 8px 0;
        border-radius: 10px;
        box-shadow: 0 1px 8px rgba(44, 62, 80, 0.13);
        touch-action: manipulation;
    }

    #message {
        font-size: 1rem;
        min-height: 24px;
        margin-top: 10px;
    }

    .sudoku-history-rules {
        flex-direction: column;
        gap: 18px;
        margin: 24px auto;
        max-width: 99vw;
    }

    .sudoku-history-card,
    .sudoku-rules-card {
        width: 98vw;
        min-width: 0;
        padding: 18px 8px;
        font-size: 1.05rem;
        border-radius: 14px;
        box-shadow: 0 2px 12px rgba(44, 62, 80, 0.15);
    }

    .sudoku-history-card h2,
    .sudoku-rules-card h2 {
        font-size: 1.15rem;
        margin-bottom: 10px;
    }

    .sudoku-history-text p,
    .sudoku-rules-text p {
        font-size: 1rem;
    }

    .sudoku-rules-text pre {
        font-size: 0.95rem;
        padding: 7px;
    }

    h1 {
        margin-top: 32px;
        font-size: 2.2rem;
        font-weight: 600;
        letter-spacing: 1px;
    }
}

.sudoku-container {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(44, 62, 80, 0.13);
    padding: 36px 40px 28px 40px;
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#sudoku-board {
    display: grid;
    gap: 3px;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 32px rgba(44, 62, 80, 0.13);
    padding: 16px;
    align-items: center;
    justify-items: center;
    width: fit-content;
    min-width: 0;
    margin: 0 auto 20px auto;
}

.sudoku-cell {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
    text-align: center;
    border: none;
    outline: none;
    background: #fff;
    color: #222;
    margin: 0;
    transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}

.sudoku-cell:focus {
    background: #e3eaf3;
    box-shadow: 0 0 0 2px #6c8ed3;
}

.sudoku-cell.fixed {
    background: #f0f4f8;
    color: #6c8ed3;
    font-weight: 600;
    box-shadow: none;
}

.sudoku-cell.forbidden {
    background: #ffeaea;
    color: #b30000;
}

/* Sector borders */
.sector-top {
    border-top: 2px solid #6c8ed3;
}

.sector-left {
    border-left: 2px solid #6c8ed3;
}

.sector-bottom {
    border-bottom: 2px solid #6c8ed3;
}

.sector-right {
    border-right: 2px solid #6c8ed3;
}

.controls {
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
    align-items: center;
}

select#size {
    font-size: 1rem;
    padding: 7px 16px;
    border-radius: 8px;
    border: 2px solid #1976d2;
    background: linear-gradient(90deg, #e3eaf2 0%, #f6f8fa 100%);
    color: #1976d2;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.08);
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, border 0.2s;
    outline: none;
    margin-right: 8px;
}

select#size:focus {
    background: #e3eaf3;
    border: 2px solid #1976d2;
    box-shadow: 0 0 0 2px #1976d2;
}

select#size:hover {
    background: #e3eaf3;
    border: 2px solid #1976d2;
}


#checkSolution,
#newGame {
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 500;
    box-shadow: 0 1px 4px rgba(44, 62, 80, 0.06);
    margin: 0 8px;
}

#checkSolution:hover,
#newGame:hover {
    background: #1565c0;
}

#message {
    margin-top: 16px;
    font-size: 1.1rem;
    color: #222;
    min-height: 28px;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.5px;
}


.sudoku-history-rules {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    justify-content: center;
    margin: 48px auto;
    max-width: 1500px;
}

.sudoku-history-card,
.sudoku-rules-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(44, 62, 80, 0.13);
    padding: 44px 36px;
    width: 650px;
    min-width: 320px;
    font-size: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.sudoku-history-card {
    border: 2px solid #1976d2;
}

.sudoku-rules-card {
    border: 2px solid #43a047;
}

.sudoku-history-card h2 {
    color: #1976d2;
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 18px;
}

.sudoku-rules-card h2 {
    color: #43a047;
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 18px;
}

.sudoku-history-text p,
.sudoku-rules-text p {
    margin: 10px 0 6px 0;
    color: #333;
}

.sudoku-history-text ul,
.sudoku-rules-text ul {
    margin: 0 0 10px 18px;
    padding-left: 18px;
    color: #444;
}

.sudoku-rules-text pre {
    background: #f6f8fa;
    border-radius: 6px;
    padding: 10px;
    font-size: 1.05rem;
    margin: 10px 0;
    color: #222;
    font-family: 'Fira Mono', 'Consolas', monospace;
}