/*
 * number-line — horizontal SVG number line with one or more draggable
 * markers. Range and tick spacing configurable. Teaches counting,
 * positioning, jumping, fractions and decimals on a line, integer
 * ordering. The highest-frequency primary-maths scaffold.
 */

.maths-activity .nl-stage {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
}

.maths-activity .nl-svg {
    width: 100%;
    height: auto;
    max-height: 220px;
    background: #fffaf0;
    border: 1px solid var(--maths-border, #e0e7ef);
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(20, 40, 80, 0.05);
    user-select: none;
    touch-action: none;
}

.maths-activity .nl-axis {
    stroke: #1b5e20;
    stroke-width: 3;
    stroke-linecap: round;
}

.maths-activity .nl-axis-arrow { fill: #1b5e20; }

.maths-activity .nl-tick-major {
    stroke: #1b5e20;
    stroke-width: 2;
    stroke-linecap: round;
}

.maths-activity .nl-tick-minor {
    stroke: #1b5e20;
    stroke-width: 1;
    opacity: 0.45;
    stroke-linecap: round;
}

.maths-activity .nl-tick-label {
    fill: #1f2937;
    font-family: "Nunito", sans-serif;
    font-weight: 700;
    font-size: 13px;
    text-anchor: middle;
    dominant-baseline: hanging;
    user-select: none;
}

.maths-activity .nl-marker {
    cursor: grab;
    transition: filter 120ms ease-out;
}

.maths-activity .nl-marker:active,
.maths-activity .nl-marker.nl-marker-dragging { cursor: grabbing; }

.maths-activity .nl-marker:hover { filter: brightness(1.1); }
.maths-activity .nl-marker:focus { outline: none; filter: drop-shadow(0 0 4px var(--maths-primary, #2E7D32)); }

.maths-activity .nl-marker-pin { fill: #d84315; stroke: #8d2a0b; stroke-width: 2; }
.maths-activity .nl-marker-flag { fill: #fff; stroke: #8d2a0b; stroke-width: 1.5; }

.maths-activity .nl-marker-text {
    fill: #1f2937;
    font-family: "Nunito", sans-serif;
    font-weight: 800;
    font-size: 15px;
    text-anchor: middle;
    dominant-baseline: middle;
    user-select: none;
    pointer-events: none;
}

.maths-activity .nl-marker-2 .nl-marker-pin { fill: #1565c0; stroke: #0b3a73; }
.maths-activity .nl-marker-2 .nl-marker-flag { stroke: #0b3a73; }

.maths-activity .nl-marker-3 .nl-marker-pin { fill: #6a1b9a; stroke: #3d0f5b; }
.maths-activity .nl-marker-3 .nl-marker-flag { stroke: #3d0f5b; }

.maths-activity .nl-readouts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.875rem;
}

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

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

.maths-activity .nl-readout-value-text {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--maths-primary-dark, #1b5e20);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.maths-activity .nl-readout-fraction .nl-readout-value-text sup,
.maths-activity .nl-readout-fraction .nl-readout-value-text sub { font-size: 0.6em; font-weight: 700; }

.maths-activity .nl-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 .nl-target-label {
    font-weight: 800;
    color: #8d4e0b;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

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

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

.maths-activity .nl-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 .nl-your-turn-list {
    margin: 0;
    padding-left: 1.25rem;
    color: #1f2937;
    font-weight: 600;
}

.maths-activity .nl-your-turn-list li { margin-bottom: 0.25rem; }

/* Display mode — hide controls, lock interaction */

body.display-mode .activity-header .controls-container,
body.display-mode .nl-target-panel,
body.display-mode .nl-your-turn { display: none !important; }

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

@media (max-width: 720px) {
    .maths-activity .nl-tick-label { font-size: 11px; }
    .maths-activity .nl-marker-text { font-size: 13px; }
}
