/* 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: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.puzzle-container {
    max-width: 400px;
    margin: 80px auto 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(44, 62, 80, 0.08);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.puzzle-container h1 {
    margin-bottom: 24px;
    color: #222;
    font-size: 2rem;
    text-align: center;
}

#puzzle-board {
    display: grid;
    grid-template-columns: repeat(4, 64px);
    grid-template-rows: repeat(4, 64px);
    gap: 4px;
    margin-bottom: 24px;
    background: #e3eaf2;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(44, 62, 80, 0.04);
    width: 100%;
    max-width: 270px;
    min-width: 200px;
    touch-action: manipulation;
}

.puzzle-cell {
    width: 64px;
    height: 64px;
    min-width: 48px;
    min-height: 48px;
    position: static;
    background: #f9fafb;
    border: 1px solid #cfd8dc;
    font-size: 1.5rem;
    color: #1976d2;
    display: flex;
    align-items: center;
    justify-content: center;

    @media (max-width: 600px) {
        .puzzle-container {
            max-width: 98vw;
            padding: 16px 4px;
        }

        #puzzle-board {
            grid-template-columns: repeat(4, 48px);
            grid-template-rows: repeat(4, 48px);
            max-width: 98vw;
            min-width: 160px;
            gap: 2px;
        }

        .puzzle-cell {
            width: 48px;
            height: 48px;
            min-width: 36px;
            min-height: 36px;
            font-size: 1rem;
        }

        .puzzle-history-card,
        .puzzle-rules-card {
            width: 98vw;
            min-width: 0;
            padding: 18px 6px;
            font-size: 1rem;
        }

        .puzzle-controls {
            flex-direction: column;
            gap: 8px;
        }

        .puzzle-controls-note {
            max-width: 98vw;
            font-size: 0.9rem;
            padding: 8px 4px;
        }
    }

    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.puzzle-cell.empty {
    background: #e0f7fa;
    border: 1px dashed #90caf9;
    cursor: default;
}

.puzzle-controls {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 12px;
}

#puzzle-message {
    font-size: 1.1rem;
    color: #333;
}

#restart {
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

#restart:hover {
    background: #1565c0;
}

.puzzle-controls-note {
    margin: 10px auto 0 auto;
    text-align: center;
    font-size: 0.72rem;
    color: #1976d2;
    background: #e3eaf2;
    border-radius: 8px;
    padding: 8px 16px;
    box-shadow: 0 1px 4px rgba(44, 62, 80, 0.07);
    max-width: 260px;
    font-weight: 500;
    letter-spacing: 0.5px;
    display: block;
}

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

.puzzle-history-card,
.puzzle-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;
}

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

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

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

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

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

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

.puzzle-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;
}