.how-page {
    width: min(850px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 65px;
    color: #243247;
}

.how-page h1 {
    margin: 0 0 12px;
    font-size: 26px;
}

.how-intro {
    margin-bottom: 28px;
    color: #68778b;
    font-size: 16px;
}

.how-page section {
    margin-bottom: 15px;
    padding: 22px 26px;
    background: #fff;
    border: 1px solid #dce3eb;
    border-radius: 12px;
}

.how-page h2 {
    margin: 0 0 10px;
    font-size: 19px;
    color: #3265a8;
}

.how-page section p {
    margin: 0 0 10px;
    line-height: 1.65;
}

.how-page section p:last-child {
    margin-bottom: 0;
}

@media (max-width: 650px) {
    .how-page section {
        padding: 18px;
    }
}

/* Non-interactive Sudoku example */
.example-board {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    width: min(100%, 405px);
    aspect-ratio: 1;
    margin: 18px auto;
    border: 3px solid #26384e;
    background: #26384e;
    gap: 1px;
    pointer-events: none;
    user-select: none;
}

.example-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #26384e;
    font-weight: 700;
    font-size: clamp(12px, 2.5vw, 22px);
    min-width: 0;
}

.example-cell:nth-child(3n):not(:nth-child(9n)) {
    border-right: 2px solid #26384e;
}

.example-cell:nth-child(n+19):nth-child(-n+27),
.example-cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid #26384e;
}

.example-given {
    background: #244a83;
    color: white;
}

.example-correct {
    background: #d5f3dc;
    color: #176b35;
}

.example-wrong {
    background: #ffe0df;
    color: #b42318;
}

.example-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin: 16px 0;
    font-size: 0.9rem;
}

.example-legend span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.example-legend b {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
}

.example-board {
    grid-template-rows: repeat(9, minmax(0, 1fr));
    box-sizing: border-box;
}

.example-cell {
    box-sizing: border-box;
}

/* Match the actual Sudoku game cell colors */
.example-board .example-given {
    background: #edf1f5;
    color: #26384a;
}

.example-board .example-correct {
    background: #edf8f1;
    color: #176b3a;
}

.example-board .example-wrong {
    background: #ffe4e4;
    color: #a52222;
}

/* Match the real game board */
.example-board {
    border-color: #183b5b;
    background: #183b5b;
    gap: 0;
}
.example-cell {
    border-right: 1px solid #aebdcb;
    border-bottom: 1px solid #aebdcb;
}
.example-cell:nth-child(3n):not(:nth-child(9n)) {
    border-right: 3px solid #183b5b;
}
.example-cell:nth-child(n+19):nth-child(-n+27),
.example-cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 3px solid #183b5b;
}

/* Number pad — display only */
.example-number-pad {
    width: min(100%, 405px);
    margin: 10px auto 18px;
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 7px;
}
.example-number-pad span {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0;
    border: 1px solid #d5e1ee;
    border-radius: 9px;
    background: #edf3fa;
    color: #183b5b;
    font-weight: 700;
    pointer-events: none;
    user-select: none;
}

/* Legend uses the same colors as the game */
.example-legend .example-given {
    background: #edf1f5;
    color: #26384a;
}
.example-legend .example-correct {
    background: #edf8f1;
    color: #176b3a;
}
.example-legend .example-wrong {
    background: #ffe4e4;
    color: #a52222;
}

/* Page layout with internal activity */
.how-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 28px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    align-items: start;
}

.how-page {
    width: 100%;
    min-width: 0;
    padding: 0 0 65px;
}

.how-activity-area {
    width: 100%;
    max-width: 300px;
}

@media (max-width: 880px) {
    .how-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .how-activity-area {
        grid-row: 2;
    }
}


@media (max-width: 880px) {
    .how-activity-area {
        justify-self: center;
    }
}
