/*
 * hundred-square — 10-column grid of numbers (1-100 by default). Tap
 * cells to shade. Built for spotting multiples ("shade all multiples
 * of 7"), prime numbers, +10/-10 movements, and counting patterns.
 */

.maths-activity .hs-stage {
    background: #fffaf0;
    border: 1px solid var(--maths-border, #e0e7ef);
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(20, 40, 80, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.maths-activity .hs-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
    background: #1b5e20;
    padding: 3px;
    border-radius: 10px;
    width: 100%;
    max-width: 540px;
}

.maths-activity .hs-cell {
    background: #fff;
    border: 1px solid #e0e7ef;
    border-radius: 4px;
    padding: 0;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Nunito", sans-serif;
    font-weight: 700;
    font-size: clamp(0.75rem, 2.4vw, 1.05rem);
    color: var(--maths-text, #1f2937);
    cursor: pointer;
    user-select: none;
    transition: background-color 120ms ease-out, color 120ms ease-out;
    font-variant-numeric: tabular-nums;
}

.maths-activity .hs-cell:hover { background: #fff8e1; }

.maths-activity .hs-cell.hs-shaded {
    background: #d84315;
    color: #fff;
    border-color: #8d2a0b;
}

.maths-activity .hs-cell.hs-shaded:hover { background: #bf360c; }

.maths-activity .hs-cell.hs-current {
    outline: 3px solid var(--maths-primary, #2E7D32);
    outline-offset: -3px;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.3);
}

.maths-activity .hs-cell.hs-prime {
    background: #1565c0;
    color: #fff;
    border-color: #0b3a73;
}

.maths-activity .hs-cell.hs-correct {
    background: #2E7D32;
    color: #fff;
    border-color: #1b5e20;
}

.maths-activity .hs-cell.hs-incorrect {
    background: #ffebee;
    color: #b71c1c;
    border-color: #ef5350;
}

.maths-activity .hs-readouts {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) 2fr;
    gap: 0.75rem;
    width: 100%;
    max-width: 540px;
}

.maths-activity .hs-readout {
    background: #fff;
    border: 1px solid var(--maths-border, #e0e7ef);
    border-radius: 12px;
    padding: 0.625rem 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    box-shadow: 0 2px 8px rgba(20, 40, 80, 0.04);
}

.maths-activity .hs-readout-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--maths-text-muted, #6b7280);
}

.maths-activity .hs-readout-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--maths-primary-dark, #1b5e20);
    font-variant-numeric: tabular-nums;
}

.maths-activity .hs-readout-value-text {
    font-weight: 700;
    color: var(--maths-text, #1f2937);
    font-size: 0.95rem;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}

.maths-activity .hs-mode-chip {
    display: inline-block;
    background: var(--maths-primary, #2E7D32);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    margin-top: 0.25rem;
}

.maths-activity .hs-target-label {
    font-weight: 800;
    color: #8d4e0b;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.maths-activity .hs-target-prompt { flex: 1; font-weight: 700; color: #1f2937; }

.maths-activity .hs-your-turn {
    margin-top: 1.25rem;
    background: #f1f8e9;
    border: 1px solid #aed581;
    border-radius: 14px;
    padding: 1rem 1.25rem;
}

.maths-activity .hs-your-turn-label {
    font-weight: 800;
    color: #33691e;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.maths-activity .hs-your-turn-list { margin: 0; padding-left: 1.25rem; color: #1f2937; font-weight: 600; }
.maths-activity .hs-your-turn-list li { margin-bottom: 0.25rem; }

/* Display mode — 100-square grid + Shaded / Numbers readouts side-by-side
 * so the worked example fits a laptop or IWB without scrolling. Target
 * panel, callout and challenge runner hidden; cells locked. Your-turn
 * prompts stay — those are display-only discussion prompts.
 */
body.display-mode .hs-target-panel,
body.display-mode .hs-callout,
body.display-mode #challengeRunner { display: none !important; }

body.display-mode .hs-cell { cursor: default !important; pointer-events: none; }

body.display-mode .hs-stage {
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.85rem;
    margin-bottom: 0.75rem;
}

body.display-mode .hs-stage > .hs-grid {
    flex: 0 1 480px;
}

body.display-mode .hs-stage > .hs-readouts {
    flex: 1 1 200px;
    grid-template-columns: 1fr;
    max-width: none;
    width: auto;
}
