.tables-app {
    --tables-ink: #102d43;
    --tables-teal: #086278;
    --tables-line: #bcd8dc;
    color: var(--tables-ink);
}

.tables-content {
    max-width: 58rem;
    margin: 1rem auto 0;
}

.tables-app [hidden] {
    display: none !important;
}

.tables-back,
.tables-scoring summary {
    color: var(--tables-teal);
    font-weight: 700;
}

.tables-header {
    margin: 1rem 0 1.2rem;
}

.tables-header h2 {
    margin: 0;
    font-size: clamp(1.5rem, 4vw, 2.1rem);
    line-height: 1.08;
}

.tables-header p {
    margin: .65rem 0 0;
}

.tables-setup {
    display: grid;
    gap: 1rem;
}

.tables-panel {
    min-width: 0;
    padding: clamp(1rem, 3vw, 1.6rem);
    border: 1px solid var(--tables-line);
    border-radius: 1rem;
    background: #fff;
}

.tables-setup > section {
    background: #edf8f7;
}

.tables-panel h2,
.tables-panel legend {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
}

.tables-panel fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.tables-panel legend {
    padding: 0;
}

.tables-panel p {
    margin: .6rem 0 1rem;
}

.tables-picker {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .35rem;
}

.tables-picker label {
    position: relative;
    cursor: pointer;
}

.tables-picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
}

.tables-picker span {
    display: grid;
    min-height: 2.75rem;
    place-items: center;
    border: 1px solid var(--tables-line);
    border-radius: .5rem;
    background: #f5fbfc;
    font-weight: 750;
}

.tables-picker input:checked + span,
.tables-app button {
    color: #fff;
    background: var(--tables-teal);
}

.tables-picker input:focus-visible + span,
.tables-app :is(button, a, summary, input):focus-visible {
    outline: 2px solid #a8471d;
    outline-offset: 3px;
}

.tables-app button {
    min-height: 2.75rem;
    padding: .55rem 1rem;
    border: 1px solid transparent;
    border-radius: .6rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.tables-app button:disabled {
    opacity: .55;
    cursor: default;
}

.tables-app .tables-secondary {
    border-color: var(--tables-line);
    color: var(--tables-teal);
    background: #fff;
}

.tables-play,
.tables-results {
    max-width: 40rem;
    margin-inline: auto;
}

.tables-progress {
    display: grid;
    gap: .35rem;
    font-size: .92rem;
}

.tables-progress progress {
    width: 100%;
    accent-color: var(--tables-teal);
}

#tables-question {
    display: block;
    margin: .85rem 0;
    font-size: clamp(2rem, 8vw, 3.75rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.tables-answer-row,
.tables-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

#tables-answer {
    width: 7rem;
    min-height: 2.75rem;
    padding: .45rem;
    border: 1px solid #668d97;
    border-radius: .55rem;
    font: inherit;
    font-size: 1.2rem;
}

.tables-panel .tables-feedback {
    min-height: 1.5em;
    margin-bottom: .7rem;
}

.tables-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
    gap: .6rem;
}

.tables-stats div {
    padding: .7rem;
    border-radius: .6rem;
    background: #edf8f7;
}

.tables-stats dd {
    margin: .2rem 0 0;
    font-size: 1.4rem;
    font-weight: 800;
}

.tables-results summary,
.tables-scoring summary {
    cursor: pointer;
}

.tables-actions,
.tables-scoring {
    margin-top: 1rem;
}

@media (min-width: 720px) {
    .tables-setup {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 719px), (pointer: coarse) and (max-height: 540px) {
    body > main.tables-app[data-playing] > section.hero.maths-banner,
    .tables-app[data-playing] .tables-header {
        display: none;
    }

    .tables-play {
        margin-top: .75rem;
    }

    .tables-question-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        column-gap: .65rem;
    }

    #tables-answer {
        width: 4.5rem;
    }
}

.tables-profile label {
    display: block;
    margin-bottom: .4rem;
    font-weight: 650;
}

#tables-pseudo {
    width: min(100%, 15rem);
    padding: .45rem .65rem;
    border: 1px solid #668d97;
    border-radius: .55rem;
    font: inherit;
}

.tables-history,
.tables-sync {
    margin-top: 1rem;
}

.tables-history li + li {
    margin-top: .45rem;
}

#tables-registration-error {
    color: #9b2815;
}
