.ma-mode-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.ma-tab-mark {
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 2px solid currentColor;
    border-radius: 50%;
    font: 800 18px/1 Georgia, serif;
}

body.ma-active .container {
    max-width: 1420px;
}

body.ma-active header {
    display: none;
}

.ma-shell {
    --ma-navy: #172541;
    --ma-indigo: #29345f;
    --ma-brass: #dcae49;
    --ma-brass-light: #ffe29a;
    --ma-cyan: #71f1ff;
    --ma-cream: #fff8df;
    --ma-ink: #18243f;
    width: 100%;
    color: var(--ma-cream);
    font-family: "Avenir Next", "Microsoft YaHei", "PingFang SC", sans-serif;
}

.ma-shell:fullscreen {
    width: 100%;
    min-height: 100vh;
    overflow-y: auto;
    background: var(--ma-navy);
}

.ma-shell:fullscreen .ma-start-screen,
.ma-shell:fullscreen .ma-map-screen,
.ma-shell:fullscreen .ma-play-screen,
.ma-shell:fullscreen .ma-summary-screen {
    min-height: 100vh;
    border-radius: 0;
}

.ma-start-screen,
.ma-map-screen,
.ma-play-screen,
.ma-summary-screen {
    position: relative;
    overflow: hidden;
    min-height: 680px;
    border: 4px solid #7d5525;
    border-radius: 28px;
    box-shadow:
        0 22px 60px rgba(20, 17, 48, 0.34),
        inset 0 0 0 3px rgba(255, 226, 154, 0.45);
    isolation: isolate;
}

.ma-summary-glow {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: radial-gradient(circle at 30% 34%, rgba(255, 223, 101, 0.2), transparent 24%);
    pointer-events: none;
}

.ma-start-screen {
    display: grid;
    grid-template-columns: minmax(330px, 0.95fr) minmax(470px, 1.05fr);
    align-items: center;
    padding: 44px clamp(28px, 4vw, 68px);
    background:
        linear-gradient(90deg, rgba(17, 35, 59, 0.1), rgba(17, 35, 59, 0.28)),
        url("assets/multiplication/sky-bridge-v1.webp") center / cover;
}

.ma-map-screen {
    min-height: 700px;
    background: #79ccef;
}

.ma-map-stage,
.ma-map-background,
.ma-map-route-glow {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.ma-map-stage {
    overflow: hidden;
    border-radius: 24px;
}

.ma-map-background {
    z-index: -3;
    object-fit: cover;
}

.ma-map-route-glow {
    z-index: -2;
    background:
        linear-gradient(180deg, rgba(17, 38, 63, 0.64), transparent 23%, transparent 70%, rgba(14, 28, 47, 0.28)),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.04), transparent 48%);
    pointer-events: none;
}

.ma-map-header {
    position: absolute;
    top: 20px;
    right: 24px;
    left: 24px;
    z-index: 5;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    pointer-events: none;
}

.ma-map-header > div,
.ma-map-actions > * {
    pointer-events: auto;
}

.ma-map-header > div:first-child {
    max-width: min(620px, 66%);
    padding: 16px 22px;
    border: 2px solid rgba(255, 226, 154, 0.78);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(45, 52, 91, 0.94), rgba(21, 34, 61, 0.88));
    box-shadow: 0 9px 24px rgba(19, 29, 54, 0.3), inset 0 1px rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
}

.ma-map-header h2 {
    margin: 0;
    color: #fff5c9;
    font-family: Georgia, "Songti SC", serif;
    font-size: clamp(1.55rem, 3.2vw, 2.65rem);
    line-height: 1.1;
    text-shadow: 0 3px 0 #795025;
}

.ma-map-route-copy {
    margin: 7px 0 0;
    color: rgba(255, 248, 223, 0.82);
    font-size: 0.88rem;
    line-height: 1.5;
}

.ma-map-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ma-map-progress-copy {
    min-width: 112px;
    padding: 9px 13px;
    border: 1px solid rgba(255, 226, 154, 0.58);
    border-radius: 13px;
    text-align: center;
    background: rgba(26, 42, 70, 0.82);
    box-shadow: 0 7px 18px rgba(19, 29, 54, 0.24);
}

.ma-map-progress-copy span,
.ma-map-progress-copy strong {
    display: block;
}

.ma-map-progress-copy span {
    color: rgba(255, 248, 223, 0.68);
    font-size: 0.7rem;
}

.ma-map-progress-copy strong {
    margin-top: 2px;
    color: var(--ma-cyan);
    font-size: 0.88rem;
}

.ma-location-nodes {
    position: absolute;
    inset: 0;
    z-index: 4;
}

.ma-location-node {
    position: absolute;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    align-items: center;
    min-width: 166px;
    padding: 8px 11px 8px 8px;
    border: 2px solid rgba(255, 232, 145, 0.86);
    border-radius: 15px;
    text-align: left;
    color: var(--ma-cream);
    background: linear-gradient(145deg, rgba(43, 54, 100, 0.96), rgba(19, 34, 62, 0.94));
    box-shadow: 0 8px 18px rgba(14, 26, 46, 0.35), inset 0 1px rgba(255, 255, 255, 0.16);
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease;
}

.ma-location-node.bridge { left: 68%; top: 70%; }
.ma-location-node.windmill { left: 33%; top: 35%; }
.ma-location-node.greenhouse { left: 61%; top: 27%; }

.ma-location-node:hover,
.ma-location-node:focus-visible {
    border-color: var(--ma-cyan);
    filter: brightness(1.13);
    transform: translate(-50%, -54%) scale(1.03);
}

.ma-location-node:focus-visible {
    outline: 3px solid rgba(113, 241, 255, 0.5);
    outline-offset: 4px;
}

.ma-location-node.is-complete {
    border-color: #8df0c0;
}

.ma-location-node.is-locked {
    border-color: rgba(255, 255, 255, 0.28);
    color: rgba(255, 248, 223, 0.5);
    background: rgba(27, 37, 64, 0.74);
    cursor: not-allowed;
    filter: grayscale(0.55);
}

.ma-location-pin {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 2px solid #bd8731;
    border-radius: 50%;
    color: #fff3a7;
    background: radial-gradient(circle, #8dffff 0 12%, #2ab4c9 36%, #1e4164 70%);
    box-shadow: 0 0 13px rgba(113, 241, 255, 0.72);
    font-size: 1.15rem;
}

.ma-location-node.is-locked .ma-location-pin {
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.36);
    background: #46516c;
    box-shadow: none;
}

.ma-location-copy strong,
.ma-location-copy small,
.ma-location-stars {
    display: block;
}

.ma-location-copy strong {
    color: #fff7d9;
    font-size: 0.96rem;
}

.ma-location-copy small {
    margin-top: 2px;
    color: rgba(255, 248, 223, 0.65);
    font-size: 0.7rem;
}

.ma-location-stars {
    grid-column: 2;
    color: #ffdc62;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.05em;
}

.ma-location-node.is-locked .ma-location-stars {
    color: rgba(255, 248, 223, 0.48);
}

.ma-map-hint,
.ma-map-feedback {
    position: absolute;
    left: 50%;
    z-index: 8;
    max-width: 82%;
    padding: 9px 16px;
    border: 1px solid rgba(255, 243, 173, 0.75);
    border-radius: 999px;
    text-align: center;
    color: #fff8d8;
    background: rgba(25, 38, 68, 0.9);
    box-shadow: 0 8px 20px rgba(13, 25, 47, 0.28);
    font-size: 0.82rem;
    font-weight: 900;
    transform: translateX(-50%);
}

.ma-map-hint { bottom: 20px; }

.ma-map-feedback {
    bottom: 62px;
    opacity: 0;
    transform: translate(-50%, 12px);
    transition: opacity 180ms ease, transform 180ms ease;
    pointer-events: none;
}

.ma-map-feedback.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.ma-travel-panel {
    position: absolute;
    inset: 0;
    z-index: 15;
    display: grid;
    grid-template-rows: auto 1fr;
    align-content: center;
    justify-items: center;
    padding: 170px 24px 70px;
    background: linear-gradient(180deg, rgba(23, 39, 70, 0.76), rgba(32, 73, 102, 0.38));
    backdrop-filter: blur(4px);
}

.ma-travel-copy {
    position: relative;
    z-index: 2;
    min-width: min(320px, 90vw);
    padding: 13px 24px;
    border: 2px solid rgba(255, 226, 154, 0.82);
    border-radius: 16px;
    text-align: center;
    background: rgba(29, 43, 79, 0.94);
    box-shadow: 0 9px 20px rgba(13, 24, 44, 0.35);
}

.ma-travel-copy span,
.ma-travel-copy strong,
.ma-travel-copy small {
    display: block;
}

.ma-travel-copy span {
    color: var(--ma-brass-light);
    font-size: 0.74rem;
    font-weight: 800;
}

.ma-travel-copy strong {
    margin-top: 2px;
    color: #fff5c9;
    font-family: Georgia, "Songti SC", serif;
    font-size: clamp(1.6rem, 3vw, 2.45rem);
}

.ma-travel-copy small {
    margin-top: 3px;
    color: rgba(255, 248, 223, 0.72);
    font-size: 0.78rem;
}

.ma-travel-sky {
    position: relative;
    width: min(700px, 90%);
    height: 260px;
}

.ma-travel-hero,
.ma-travel-companion {
    position: absolute;
    bottom: -10px;
    object-fit: contain;
    filter: drop-shadow(0 14px 12px rgba(22, 27, 45, 0.4));
}

.ma-travel-hero {
    left: 4%;
    width: 220px;
    height: 250px;
    animation: ma-travel-hero 850ms ease-in-out both;
}

.ma-travel-companion {
    right: 8%;
    width: 150px;
    height: 170px;
    animation: ma-travel-companion 850ms ease-in-out both;
}

.ma-travel-cloud {
    position: absolute;
    width: 150px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.42);
    filter: blur(5px);
}

.cloud-one { top: 70px; left: 16%; animation: ma-cloud-drift 850ms ease-in-out both; }
.cloud-two { right: 8%; top: 125px; animation: ma-cloud-drift 850ms 80ms ease-in-out both reverse; }

.ma-start-screen::after,
.ma-summary-screen::after {
    position: absolute;
    inset: 0;
    z-index: -1;
    content: "";
    background: linear-gradient(180deg, rgba(16, 35, 59, 0.06), rgba(14, 21, 41, 0.52));
    pointer-events: none;
}

.ma-start-art {
    position: relative;
    align-self: stretch;
    min-height: 570px;
    pointer-events: none;
}

.ma-start-hero {
    position: absolute;
    bottom: -34px;
    left: 0;
    width: min(72%, 400px);
    max-height: 620px;
    object-fit: contain;
    filter: drop-shadow(0 22px 16px rgba(20, 24, 39, 0.35));
}

.ma-start-companion {
    position: absolute;
    right: 0;
    bottom: 10px;
    width: min(46%, 245px);
    filter: drop-shadow(0 15px 12px rgba(20, 24, 39, 0.35));
    animation: ma-companion-float 3.4s ease-in-out infinite;
}

.ma-start-panel,
.ma-summary-card {
    position: relative;
    z-index: 2;
    padding: clamp(26px, 3.5vw, 48px);
    border: 2px solid rgba(255, 226, 154, 0.78);
    border-radius: 26px;
    color: var(--ma-cream);
    background:
        linear-gradient(145deg, rgba(48, 54, 99, 0.96), rgba(20, 34, 61, 0.96));
    box-shadow:
        0 20px 48px rgba(13, 18, 39, 0.4),
        inset 0 1px rgba(255, 255, 255, 0.16),
        inset 0 0 36px rgba(103, 239, 255, 0.06);
    backdrop-filter: blur(12px);
}

.ma-start-panel::before,
.ma-summary-card::before {
    position: absolute;
    inset: 9px;
    content: "";
    border: 1px solid rgba(220, 174, 73, 0.38);
    border-radius: 19px;
    pointer-events: none;
}

.ma-eyebrow {
    margin: 0 0 5px;
    color: var(--ma-brass-light);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.ma-start-panel h2,
.ma-summary-card h2 {
    margin: 0;
    color: #fff5c9;
    font-family: Georgia, "Songti SC", serif;
    font-size: clamp(2.25rem, 4.2vw, 4rem);
    line-height: 1.08;
    text-shadow: 0 3px 0 #795025, 0 7px 20px rgba(0, 0, 0, 0.3);
}

.ma-lead {
    max-width: 650px;
    margin: 13px 0 20px;
    color: rgba(255, 248, 223, 0.82);
    font-size: 1rem;
    line-height: 1.75;
}

.ma-profile-strip,
.ma-summary-stats {
    display: grid;
    gap: 9px;
    margin: 18px 0 22px;
}

.ma-profile-strip {
    grid-template-columns: repeat(3, 1fr);
}

.ma-summary-stats {
    grid-template-columns: repeat(4, 1fr);
}

.ma-profile-strip > div,
.ma-summary-stats > div {
    padding: 10px 8px;
    border: 1px solid rgba(113, 241, 255, 0.24);
    border-radius: 13px;
    text-align: center;
    background: rgba(8, 20, 42, 0.34);
}

.ma-profile-strip span,
.ma-summary-stats span {
    display: block;
    color: rgba(255, 248, 223, 0.7);
    font-size: 0.74rem;
}

.ma-profile-strip strong,
.ma-summary-stats strong {
    display: block;
    margin-top: 2px;
    color: var(--ma-cyan);
    font: 800 1.5rem/1.15 "Trebuchet MS", sans-serif;
}

.ma-route-picker {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.ma-route-picker legend {
    margin-bottom: 8px;
    color: var(--ma-brass-light);
    font-size: 0.9rem;
    font-weight: 800;
}

.ma-route-card {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 11px 13px;
    border: 1px solid rgba(255, 226, 154, 0.22);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.ma-route-card:hover {
    transform: translateY(-1px);
    border-color: rgba(113, 241, 255, 0.58);
}

.ma-route-card:has(input:checked) {
    border-color: var(--ma-cyan);
    background: linear-gradient(90deg, rgba(42, 189, 210, 0.18), rgba(255, 226, 154, 0.08));
    box-shadow: inset 4px 0 var(--ma-cyan);
}

.ma-route-card input {
    position: absolute;
    opacity: 0;
}

.ma-route-card input:focus-visible + .ma-route-copy {
    outline: 3px solid rgba(113, 241, 255, 0.45);
    outline-offset: 4px;
    border-radius: 6px;
}

.ma-route-copy strong,
.ma-route-copy small {
    display: block;
}

.ma-route-copy strong {
    color: #fff7d9;
    font-size: 1rem;
}

.ma-route-copy small {
    margin-top: 2px;
    color: rgba(255, 248, 223, 0.64);
    line-height: 1.4;
}

.ma-route-badge {
    padding: 5px 9px;
    border: 1px solid rgba(220, 174, 73, 0.52);
    border-radius: 999px;
    color: var(--ma-brass-light);
    font-size: 0.74rem;
    font-weight: 800;
}

.ma-start-actions,
.ma-summary-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.ma-primary-button,
.ma-secondary-button,
.ma-text-button,
.ma-answer-button,
.ma-step-button {
    border: 0;
    font: inherit;
    cursor: pointer;
}

.ma-primary-button,
.ma-secondary-button {
    min-height: 50px;
    padding: 0 24px;
    border-radius: 14px;
    font-weight: 900;
}

.ma-primary-button {
    color: #1d2944;
    background: linear-gradient(180deg, #fff1a9, #dfa33c);
    box-shadow: 0 5px 0 #855720, 0 9px 22px rgba(0, 0, 0, 0.25);
}

.ma-primary-button:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.ma-primary-button:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #855720;
}

.ma-secondary-button {
    border: 1px solid rgba(255, 226, 154, 0.58);
    color: var(--ma-cream);
    background: rgba(255, 255, 255, 0.08);
}

.ma-text-button {
    padding: 10px;
    color: rgba(255, 248, 223, 0.68);
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ma-play-screen {
    min-height: 0;
    aspect-ratio: 16 / 9;
    background: #76c9ef;
}

.ma-scene-background,
.ma-scene-shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.ma-scene-background {
    z-index: -3;
    object-fit: cover;
    transform: scale(1.08) translateX(var(--ma-scene-shift, 0%));
    transition: transform 1.25s cubic-bezier(0.22, 0.72, 0.2, 1);
    will-change: transform;
}

.ma-scene-shade {
    z-index: -2;
    background:
        linear-gradient(180deg, rgba(8, 28, 55, 0.26), transparent 20%, transparent 74%, rgba(10, 24, 40, 0.24)),
        radial-gradient(circle at 50% 31%, rgba(255, 255, 255, 0.14), transparent 42%);
}

.ma-topbar {
    position: absolute;
    top: 14px;
    right: 16px;
    left: 16px;
    z-index: 12;
    display: grid;
    grid-template-columns: minmax(120px, 0.7fr) minmax(300px, 1.5fr) minmax(160px, 0.7fr);
    gap: 12px;
    align-items: center;
    min-height: 62px;
    padding: 9px 13px;
    border: 2px solid rgba(238, 193, 95, 0.86);
    border-radius: 17px;
    background: linear-gradient(180deg, rgba(45, 52, 91, 0.95), rgba(21, 34, 61, 0.95));
    box-shadow: 0 7px 18px rgba(19, 29, 54, 0.34), inset 0 1px rgba(255, 255, 255, 0.13);
}

.ma-chapter-copy span,
.ma-chapter-copy strong {
    display: block;
}

.ma-chapter-copy small {
    display: block;
    max-width: 280px;
    margin-top: 3px;
    overflow: hidden;
    color: rgba(255, 248, 223, 0.66);
    font-size: 0.66rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ma-chapter-copy span {
    color: var(--ma-brass-light);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.ma-chapter-copy strong {
    margin-top: 1px;
    color: white;
    font-size: clamp(0.9rem, 1.45vw, 1.16rem);
}

.ma-bridge-progress {
    min-width: 0;
    text-align: center;
}

.ma-bridge-progress > span {
    display: block;
    margin-bottom: 5px;
    color: #fff5cb;
    font-size: 0.78rem;
    font-weight: 800;
}

.ma-segments {
    display: grid;
    grid-template-columns: repeat(var(--ma-segment-count, 4), 1fr);
    gap: 5px;
}

.ma-segment {
    position: relative;
    height: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(5, 15, 34, 0.62);
}

.ma-segment.is-lit {
    border-color: #fff2a8;
    background: linear-gradient(90deg, #ffd45c, #fff8ad);
    box-shadow: 0 0 10px #ffd85d;
    animation: ma-segment-light 480ms ease-out;
}

.ma-top-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.ma-top-actions button {
    min-width: 42px;
    height: 36px;
    padding: 0 9px;
    border: 1px solid rgba(255, 226, 154, 0.4);
    border-radius: 10px;
    color: #fff5cf;
    background: rgba(255, 255, 255, 0.07);
    font: 800 0.74rem/1 "Microsoft YaHei", sans-serif;
    cursor: pointer;
}

.ma-top-actions button:hover,
.ma-top-actions button:focus-visible {
    border-color: var(--ma-cyan);
    background: rgba(113, 241, 255, 0.16);
}

.ma-top-actions button.is-off {
    color: rgba(255, 248, 223, 0.52);
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(10, 18, 38, 0.3);
}

.ma-volume-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    width: min(236px, calc(100vw - 36px));
    padding: 13px 15px 11px;
    border: 2px solid rgba(238, 193, 95, 0.9);
    border-radius: 14px;
    color: #fff8df;
    background: linear-gradient(145deg, rgba(45, 52, 91, 0.98), rgba(21, 34, 61, 0.98));
    box-shadow: 0 10px 24px rgba(8, 20, 42, 0.4), inset 0 1px rgba(255, 255, 255, 0.14);
}

.ma-volume-heading,
.ma-volume-scale {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ma-volume-heading {
    margin-bottom: 9px;
    font-size: 0.78rem;
}

.ma-volume-heading output {
    color: var(--ma-brass-light);
    font-variant-numeric: tabular-nums;
}

.ma-volume-popover input[type="range"] {
    display: block;
    width: 100%;
    accent-color: var(--ma-cyan);
    cursor: pointer;
}

.ma-volume-scale {
    margin-top: 2px;
    color: rgba(255, 248, 223, 0.58);
    font-size: 0.62rem;
}

.ma-question-card {
    position: absolute;
    top: 15.5%;
    left: 50%;
    z-index: 6;
    width: clamp(320px, 45%, 610px);
    padding: 10px 32px 15px;
    border: 3px solid rgba(226, 182, 82, 0.94);
    border-radius: 20px;
    text-align: center;
    color: var(--ma-ink);
    background: linear-gradient(145deg, rgba(231, 255, 255, 0.95), rgba(159, 231, 241, 0.91));
    box-shadow:
        0 12px 26px rgba(19, 41, 64, 0.28),
        inset 0 0 0 2px rgba(255, 255, 255, 0.52),
        inset 0 0 34px rgba(39, 176, 203, 0.17);
    transform: translateX(-50%);
    transition: opacity 180ms ease, transform 180ms ease;
}

.ma-question-card::before,
.ma-question-card::after {
    position: absolute;
    top: 50%;
    width: 18px;
    height: 46px;
    content: "";
    border: 3px solid #a97429;
    border-radius: 7px;
    background: #dcae49;
    transform: translateY(-50%);
}

.ma-question-card::before { left: -12px; }
.ma-question-card::after { right: -12px; }

.ma-question-card p {
    margin: 0;
    color: #356b75;
    font-size: clamp(0.72rem, 1.15vw, 0.9rem);
    font-weight: 800;
    letter-spacing: 0.08em;
}

.ma-question-type-chip {
    display: inline-block;
    margin-bottom: 3px;
    padding: 3px 9px;
    border: 1px solid rgba(55, 112, 123, 0.35);
    border-radius: 999px;
    color: #235964;
    background: rgba(255, 255, 255, 0.42);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.ma-question-card.is-word-problem {
    width: min(700px, 56%);
}

.ma-application-prompt {
    max-width: 630px;
    margin: 11px auto 1px;
    color: #173c52;
    font-size: clamp(1.05rem, 2vw, 1.55rem);
    font-weight: 900;
    line-height: 1.45;
    text-wrap: balance;
    text-shadow: 0 1px rgba(255, 255, 255, 0.66);
}

.ma-equation {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: clamp(9px, 1.3vw, 18px);
    margin-top: 1px;
    font: 900 clamp(2.5rem, 5.2vw, 5.1rem)/1.08 "Trebuchet MS", "Arial Rounded MT Bold", sans-serif;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px rgba(255, 255, 255, 0.68);
}

.ma-equation b {
    color: #487283;
    font-size: 0.72em;
}

.ma-question-mark {
    color: #85562c;
}

.ma-review-chip {
    position: absolute;
    top: calc(100% + 7px);
    left: 50%;
    width: max-content;
    max-width: 90%;
    padding: 5px 10px;
    border-radius: 999px;
    color: #17344e;
    background: #fff0a6;
    font-size: 0.7rem;
    font-weight: 900;
    transform: translateX(-50%);
    box-shadow: 0 4px 10px rgba(24, 45, 63, 0.2);
}

.ma-answer-grid {
    position: absolute;
    top: 40.5%;
    left: 50%;
    z-index: 7;
    display: grid;
    grid-template-columns: repeat(4, minmax(80px, 138px));
    gap: clamp(8px, 1.2vw, 15px);
    transform: translateX(-50%);
    transition: opacity 180ms ease, transform 180ms ease;
}

.ma-answer-button {
    position: relative;
    min-height: clamp(62px, 7.4vw, 92px);
    border: 3px solid #be8a37;
    border-radius: 18px;
    color: #fff5cc;
    background: linear-gradient(180deg, #414b7a, #222d53);
    box-shadow:
        0 7px 0 #725024,
        0 12px 20px rgba(19, 32, 54, 0.28),
        inset 0 0 0 2px rgba(255, 255, 255, 0.08);
    font: 900 clamp(1.65rem, 3vw, 2.8rem)/1 "Trebuchet MS", sans-serif;
    font-variant-numeric: tabular-nums;
    transition: transform 130ms ease, filter 130ms ease, background 130ms ease;
}

.ma-answer-button::before {
    position: absolute;
    top: 6px;
    left: 9px;
    color: rgba(255, 248, 223, 0.46);
    content: attr(data-key);
    font: 700 0.7rem/1 "Microsoft YaHei", sans-serif;
}

.ma-answer-button:hover,
.ma-answer-button:focus-visible {
    filter: brightness(1.15);
    transform: translateY(-2px);
}

.ma-answer-button:active {
    transform: translateY(4px);
    box-shadow: 0 3px 0 #725024;
}

.ma-answer-button.is-correct {
    border-color: #fff6a4;
    color: #173b36;
    background: linear-gradient(180deg, #c9ff9a, #5bd38e);
    box-shadow: 0 7px 0 #367a55, 0 0 30px rgba(255, 243, 109, 0.85);
}

.ma-answer-button.is-wrong {
    border-color: #ffb18c;
    background: linear-gradient(180deg, #c76b6b, #763b58);
    animation: ma-shake 360ms ease;
}

.ma-answer-button:disabled {
    cursor: default;
}

.ma-scene-journey {
    position: absolute;
    right: 25%;
    bottom: 1.6%;
    left: 17%;
    z-index: 3;
    height: 68px;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.ma-scene-route-line {
    position: absolute;
    top: 29px;
    right: 0;
    left: 0;
    height: 8px;
    overflow: hidden;
    border: 2px solid rgba(117, 76, 31, 0.76);
    border-radius: 999px;
    background: rgba(24, 37, 61, 0.68);
    box-shadow: 0 3px 9px rgba(18, 29, 46, 0.32);
}

.ma-scene-route-line i {
    display: block;
    width: var(--ma-route-fill, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #5ddcec, #fff2a0);
    box-shadow: 0 0 16px rgba(113, 241, 255, 0.9);
    transition: width 1.1s cubic-bezier(0.22, 0.72, 0.2, 1);
}

.ma-scene-stops {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(var(--ma-stop-count, 4), minmax(0, 1fr));
    height: 100%;
}

.ma-scene-stop {
    display: flex;
    align-items: center;
    flex-direction: column;
    min-width: 0;
    color: rgba(255, 248, 223, 0.72);
    font-size: clamp(0.54rem, 0.75vw, 0.68rem);
    font-weight: 900;
    text-align: center;
    text-shadow: 0 2px 5px rgba(12, 25, 42, 0.9);
}

.ma-scene-stop-marker {
    display: block;
    width: 22px;
    height: 22px;
    margin: 20px auto 4px;
    border: 3px solid #9c6c2c;
    border-radius: 7px;
    background: linear-gradient(145deg, #65708e, #253553);
    box-shadow: 0 3px 8px rgba(15, 28, 48, 0.38);
    transition: background 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.ma-scene-stop.is-current .ma-scene-stop-marker {
    border-color: #fff1a0;
    box-shadow: 0 0 0 4px rgba(113, 241, 255, 0.2), 0 0 18px rgba(113, 241, 255, 0.88);
    animation: ma-current-stop 1.25s ease-in-out infinite;
}

.ma-scene-stop.is-complete {
    color: #fff5b8;
}

.ma-scene-stop.is-complete .ma-scene-stop-marker {
    border-color: #fff1a0;
    background: radial-gradient(circle at 35% 30%, white, #71f1ff 32%, #d9a941 70%);
    box-shadow: 0 0 18px rgba(255, 224, 103, 0.95);
    animation: ma-stop-light 520ms ease-out;
}

.ma-play-screen[data-location="bridge"] .ma-scene-stop-marker {
    width: 27px;
    height: 18px;
    margin-top: 22px;
    border-radius: 5px;
    transform: skewX(-8deg);
}

.ma-play-screen[data-location="windmill"] .ma-scene-stop-marker {
    border-style: double;
    border-width: 5px;
    border-radius: 50%;
}

.ma-play-screen[data-location="greenhouse"] .ma-scene-stop-marker {
    width: 19px;
    height: 19px;
    margin-top: 22px;
    border-radius: 5px 12px 5px 12px;
    transform: rotate(45deg);
}

.ma-advance-banner {
    position: absolute;
    top: 26%;
    left: 50%;
    z-index: 9;
    width: min(500px, 74%);
    padding: 17px 26px;
    border: 3px solid rgba(255, 226, 134, 0.94);
    border-radius: 20px;
    text-align: center;
    color: var(--ma-cream);
    background:
        radial-gradient(circle at 50% 0, rgba(113, 241, 255, 0.2), transparent 45%),
        linear-gradient(145deg, rgba(43, 54, 100, 0.97), rgba(18, 35, 61, 0.95));
    box-shadow: 0 15px 38px rgba(12, 27, 48, 0.42), inset 0 1px rgba(255, 255, 255, 0.14);
    opacity: 0;
    transform: translate(-50%, 18px) scale(0.92);
    transition: opacity 220ms ease, transform 260ms ease;
    pointer-events: none;
}

.ma-advance-banner span,
.ma-advance-banner strong,
.ma-advance-banner small {
    display: block;
}

.ma-advance-banner span {
    color: var(--ma-cyan);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.ma-advance-banner strong {
    margin-top: 3px;
    color: #fff5bd;
    font-family: Georgia, "Songti SC", serif;
    font-size: clamp(1.35rem, 2.5vw, 2.1rem);
    text-shadow: 0 2px #795025;
}

.ma-advance-banner small {
    margin-top: 6px;
    color: rgba(255, 248, 223, 0.78);
    font-size: 0.82rem;
    line-height: 1.5;
}

.ma-play-screen.is-advancing .ma-question-card,
.ma-play-screen.is-advancing .ma-answer-grid {
    opacity: 0;
    transform: translate(-50%, -12px) scale(0.95);
    pointer-events: none;
}

.ma-play-screen.is-advancing .ma-advance-banner {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.ma-play-screen.is-advancing .ma-scene-shade {
    background:
        linear-gradient(180deg, rgba(8, 28, 55, 0.28), transparent 24%, transparent 68%, rgba(10, 24, 40, 0.3)),
        radial-gradient(circle at 50% 52%, rgba(113, 241, 255, 0.22), transparent 42%);
}

.ma-hero-sprite,
.ma-companion-sprite {
    position: absolute;
    z-index: 4;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 13px 10px rgba(28, 29, 43, 0.32));
    transition: left 1.15s cubic-bezier(0.22, 0.72, 0.2, 1), opacity 220ms ease, transform 260ms ease;
}

.ma-hero-sprite {
    bottom: -1.5%;
    left: var(--ma-hero-left, 1.2%);
    width: clamp(100px, 16%, 230px);
    height: 43%;
    object-position: bottom;
}

.ma-hero-sprite.is-walking {
    animation: ma-hero-walk 310ms ease-in-out infinite alternate;
}

.ma-play-screen.is-advancing .ma-companion-sprite {
    animation: ma-companion-scout 760ms ease-in-out 2;
}

.ma-companion-sprite {
    right: 2.5%;
    bottom: 5%;
    width: clamp(88px, 14%, 190px);
    height: 30%;
    object-position: bottom;
    animation: ma-companion-float 3.4s ease-in-out infinite;
}

.ma-hero-sprite.is-celebrating {
    width: clamp(110px, 17%, 245px);
    animation: ma-hero-celebrate 850ms ease;
}

.ma-feedback {
    position: absolute;
    bottom: 5.5%;
    left: 50%;
    z-index: 14;
    min-width: 210px;
    max-width: 55%;
    padding: 10px 18px;
    border: 1px solid rgba(255, 243, 173, 0.75);
    border-radius: 999px;
    text-align: center;
    color: #fff8d8;
    background: rgba(25, 38, 68, 0.9);
    box-shadow: 0 8px 20px rgba(13, 25, 47, 0.28);
    font-weight: 900;
    opacity: 0;
    transform: translate(-50%, 12px);
    transition: opacity 180ms ease, transform 180ms ease;
    pointer-events: none;
}

.ma-feedback.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.ma-play-screen.is-teaching .ma-question-card,
.ma-play-screen.is-teaching .ma-answer-grid {
    opacity: 0;
    transform: translate(-50%, -10px);
    pointer-events: none;
}

.ma-play-screen.is-teaching .ma-companion-sprite {
    z-index: 11;
    right: 1.5%;
    bottom: 4%;
    transform: scale(1.08);
}

.ma-play-screen.is-teaching .ma-scene-journey {
    opacity: 0.28;
}

.ma-teaching-panel {
    position: absolute;
    top: 13.5%;
    right: 15%;
    bottom: 7%;
    left: 15%;
    z-index: 10;
    padding: clamp(18px, 2.2vw, 30px);
    border: 3px solid rgba(255, 220, 126, 0.95);
    border-radius: 24px;
    color: var(--ma-ink);
    background:
        radial-gradient(circle at 11% 10%, rgba(113, 241, 255, 0.2), transparent 25%),
        linear-gradient(145deg, rgba(242, 255, 250, 0.97), rgba(194, 239, 236, 0.96));
    box-shadow: 0 18px 50px rgba(12, 33, 53, 0.42), inset 0 0 0 2px rgba(255, 255, 255, 0.65);
    animation: ma-panel-in 260ms ease-out;
}

.ma-teaching-heading {
    display: flex;
    align-items: center;
    gap: 13px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(42, 97, 108, 0.22);
}

.ma-teaching-heading p,
.ma-teaching-heading h3 {
    margin: 0;
}

.ma-teaching-heading p {
    color: #378396;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.ma-teaching-heading h3 {
    margin-top: 2px;
    color: #243054;
    font-size: clamp(1.15rem, 2vw, 1.7rem);
}

.ma-teaching-orb {
    display: block;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border: 5px solid #b78632;
    border-radius: 50%;
    background: radial-gradient(circle, white 0 12%, #7dffff 24%, #29aac1 52%, #183e5c 58%);
    box-shadow: 0 0 18px rgba(48, 215, 239, 0.85);
    animation: ma-orb-pulse 1.8s ease-in-out infinite;
}

.ma-teaching-body {
    display: grid;
    grid-template-columns: minmax(190px, 0.76fr) minmax(260px, 1.24fr);
    gap: clamp(18px, 3vw, 36px);
    align-items: center;
    height: calc(100% - 64px);
    padding-top: 12px;
}

.ma-dot-array {
    display: grid;
    grid-template-columns: repeat(var(--ma-cols, 7), 1fr);
    gap: clamp(3px, 0.55vw, 8px);
    justify-self: center;
    width: min(100%, 290px);
    padding: clamp(13px, 2vw, 23px);
    border: 2px solid rgba(38, 98, 110, 0.28);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.46);
    box-shadow: inset 0 0 25px rgba(38, 159, 181, 0.09);
}

.ma-dot {
    aspect-ratio: 1;
    border: 2px solid #397e8d;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #faffff, #6deafa 38%, #278fa6 72%);
    box-shadow: 0 2px 4px rgba(35, 75, 89, 0.25);
    transition: opacity 250ms ease, transform 250ms ease;
}

.ma-dot.is-extra {
    border-color: #a66e24;
    background: radial-gradient(circle at 35% 30%, #fffdf1, #ffd86a 42%, #d79328 74%);
    box-shadow: 0 0 10px rgba(255, 192, 67, 0.65);
    animation: ma-extra-dot 1.3s ease-in-out infinite alternate;
}

.ma-dot.is-removed {
    border-style: dashed;
    border-color: #a16063;
    background: #e6a6a6;
    opacity: 0.38;
}

.ma-teaching-work {
    min-width: 0;
}

.ma-teaching-copy {
    margin: 0 0 10px;
    color: #335665;
    font-size: clamp(0.88rem, 1.35vw, 1.05rem);
    font-weight: 700;
    line-height: 1.6;
}

.ma-step-equation {
    min-height: 72px;
    color: #27335b;
    font: 900 clamp(2rem, 4.2vw, 4rem)/1.1 "Trebuchet MS", "Arial Rounded MT Bold", sans-serif;
    font-variant-numeric: tabular-nums;
}

.ma-step-equation .ma-known {
    color: #2c8497;
}

.ma-step-equation .ma-new-group {
    color: #bd7625;
}

.ma-step-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(64px, 1fr));
    gap: 9px;
    max-width: 420px;
    margin-top: 10px;
}

.ma-teaching-panel.is-retry .ma-step-options {
    grid-template-columns: repeat(4, minmax(64px, 1fr));
    max-width: 560px;
}

.ma-step-button {
    min-height: 51px;
    border: 2px solid #397d8d;
    border-radius: 13px;
    color: #263454;
    background: linear-gradient(180deg, white, #c9eff0);
    box-shadow: 0 4px 0 #367180;
    font: 900 clamp(1.15rem, 2.3vw, 1.7rem)/1 "Trebuchet MS", sans-serif;
}

.ma-step-button:hover,
.ma-step-button:focus-visible {
    border-color: #b87823;
    background: #fff1a9;
    transform: translateY(-1px);
}

.ma-step-button.is-wrong {
    border-color: #b65f65;
    background: #ffd5cd;
    animation: ma-shake 340ms ease;
}

.ma-step-button.is-correct {
    border-color: #458951;
    background: #ceffb2;
}

.ma-coach-line {
    min-height: 1.6em;
    margin: 10px 0 0;
    color: #286878;
    font-size: 0.88rem;
    font-weight: 800;
}

.ma-summary-screen {
    display: grid;
    grid-template-columns: minmax(270px, 0.85fr) minmax(430px, 1.15fr);
    align-items: center;
    padding: 42px clamp(28px, 5vw, 76px);
    background:
        linear-gradient(90deg, rgba(19, 36, 58, 0.18), rgba(19, 36, 58, 0.48)),
        url("assets/multiplication/sky-bridge-v1.webp") center / cover;
}

.ma-summary-screen > img {
    position: relative;
    z-index: 1;
    align-self: end;
    justify-self: center;
    width: min(84%, 430px);
    max-height: 610px;
    object-fit: contain;
    filter: drop-shadow(0 22px 18px rgba(20, 24, 39, 0.38));
    animation: ma-summary-hero 800ms ease-out;
}

.ma-summary-card {
    position: relative;
    z-index: 2;
    text-align: center;
}

.ma-summary-card h2 {
    font-size: clamp(2rem, 3.7vw, 3.35rem);
}

.ma-summary-card > p:not(.ma-eyebrow) {
    color: rgba(255, 248, 223, 0.78);
    line-height: 1.65;
}

.ma-summary-stars {
    margin: 12px 0 8px;
    color: #ffdc62;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.12em;
    text-shadow: 0 2px #8b5e25, 0 0 18px rgba(255, 213, 80, 0.65);
}

.ma-summary-stars .is-dim {
    color: rgba(255, 255, 255, 0.18);
    text-shadow: none;
}

.ma-summary-actions {
    justify-content: center;
}

@keyframes ma-companion-float {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-7px) rotate(1deg); }
}

@keyframes ma-segment-light {
    0% { transform: scale(0.4); filter: brightness(2); }
    70% { transform: scale(1.14); }
    100% { transform: scale(1); }
}

@keyframes ma-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-7px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-3px); }
}

@keyframes ma-hero-celebrate {
    0% { transform: translateY(0) scale(1); }
    40% { transform: translateY(-14px) scale(1.06); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes ma-panel-in {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ma-orb-pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(48, 215, 239, 0.7); }
    50% { box-shadow: 0 0 26px rgba(48, 215, 239, 1); }
}

@keyframes ma-extra-dot {
    from { transform: scale(0.86); }
    to { transform: scale(1.08); }
}

@keyframes ma-summary-hero {
    from { opacity: 0; transform: translateY(40px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ma-hero-walk {
    from { transform: translateY(0) rotate(-1.5deg); }
    to { transform: translateY(-9px) rotate(2deg); }
}

@keyframes ma-companion-scout {
    0%, 100% { transform: translate(0, 0) rotate(-1deg); }
    45% { transform: translate(-30px, -18px) rotate(-8deg) scale(1.04); }
    70% { transform: translate(-12px, -7px) rotate(4deg); }
}

@keyframes ma-current-stop {
    0%, 100% { transform: scale(0.88); filter: brightness(0.88); }
    50% { transform: scale(1.1); filter: brightness(1.35); }
}

@keyframes ma-stop-light {
    0% { transform: scale(0.35); filter: brightness(2.2); }
    65% { transform: scale(1.24); }
    100% { transform: scale(1); }
}

@keyframes ma-travel-hero {
    from { opacity: 0; transform: translateX(-210px) translateY(18px) rotate(-7deg); }
    55% { opacity: 1; }
    to { opacity: 1; transform: translateX(185px) translateY(-4px) rotate(5deg); }
}

@keyframes ma-travel-companion {
    from { opacity: 0; transform: translateX(-160px) translateY(34px) scale(0.82); }
    55% { opacity: 1; }
    to { opacity: 1; transform: translateX(96px) translateY(-4px) scale(1); }
}

@keyframes ma-cloud-drift {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 0.7; transform: translateX(42px); }
}

@media (max-height: 820px) and (min-width: 761px) {
    .ma-teaching-panel {
        top: 78px;
        right: 6%;
        bottom: 10px;
        left: 6%;
        overflow-y: auto;
        padding: 16px 20px;
    }

    .ma-teaching-heading {
        padding-bottom: 8px;
    }

    .ma-teaching-body {
        height: auto;
        min-height: 0;
        gap: 16px;
        align-items: start;
    }

    .ma-dot-array {
        width: min(100%, 220px);
        padding: 12px;
        gap: 4px;
    }

    .ma-teaching-copy {
        margin-bottom: 6px;
        line-height: 1.35;
    }

    .ma-step-equation {
        min-height: 54px;
        font-size: clamp(1.7rem, 3.6vw, 3rem);
    }

    .ma-step-button {
        min-height: 44px;
    }
}

@media (max-width: 960px) {
    .ma-start-screen,
    .ma-summary-screen {
        grid-template-columns: minmax(210px, 0.65fr) minmax(430px, 1.35fr);
        padding: 30px 24px;
    }

    .ma-start-art { min-height: 520px; }
    .ma-start-hero { width: 94%; left: -12%; }
    .ma-start-companion { width: 55%; right: -3%; }

    .ma-teaching-panel {
        right: 11%;
        left: 11%;
    }

    .ma-location-node {
        min-width: 148px;
    }
}

@media (max-width: 760px) {
    body.ma-active .container {
        width: 100%;
        padding: 8px;
    }

    body.ma-active .mode-switcher {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin-bottom: 8px;
        padding: 0;
    }

    body.ma-active .mode-tab {
        min-width: 0;
        padding: 9px 6px;
        white-space: nowrap;
        font-size: 0.78rem;
    }

    body.ma-active .ma-tab-mark {
        width: 20px;
        height: 20px;
        font-size: 15px;
    }

    .ma-start-screen,
    .ma-summary-screen {
        grid-template-columns: 1fr;
        min-height: 690px;
        padding: 18px;
    }

    .ma-map-screen {
        min-height: 700px;
    }

    .ma-map-header {
        top: 12px;
        right: 12px;
        left: 12px;
        gap: 8px;
    }

    .ma-map-header > div:first-child {
        max-width: 65%;
        padding: 11px 13px;
    }

    .ma-map-route-copy {
        display: none;
    }

    .ma-map-actions {
        align-items: flex-end;
        flex-direction: column;
        gap: 7px;
    }

    .ma-map-progress-copy {
        min-width: 104px;
        padding: 7px 9px;
    }

    .ma-map-actions .ma-secondary-button {
        min-height: 38px;
        padding: 0 12px;
        font-size: 0.78rem;
    }

    .ma-location-node {
        min-width: 132px;
        padding: 6px 8px 6px 6px;
    }

    .ma-location-pin {
        width: 29px;
        height: 29px;
    }

    .ma-location-copy strong { font-size: 0.82rem; }
    .ma-location-copy small { font-size: 0.62rem; }
    .ma-location-stars { font-size: 0.6rem; }

    .ma-start-art {
        position: absolute;
        inset: 0;
        min-height: 0;
        opacity: 0.34;
    }

    .ma-start-hero {
        left: -4%;
        width: 44%;
    }

    .ma-start-companion {
        right: -2%;
        width: 31%;
    }

    .ma-start-panel {
        width: min(100%, 590px);
        margin: auto;
        padding: 25px 20px;
    }

    .ma-play-screen {
        min-height: 700px;
        aspect-ratio: auto;
    }

    .ma-scene-background {
        object-position: center;
    }

    .ma-topbar {
        top: 8px;
        right: 8px;
        left: 8px;
        grid-template-columns: 1fr auto;
        min-height: 82px;
        padding: 8px 10px;
    }

    .ma-chapter-copy { grid-column: 1; }
    .ma-top-actions { grid-column: 2; grid-row: 1; }
    .ma-bridge-progress { grid-column: 1 / -1; }
    .ma-bridge-progress > span { display: none; }

    .ma-chapter-copy small { max-width: 160px; }

    .ma-question-card {
        top: 112px;
        width: min(86%, 520px);
        padding: 9px 22px 12px;
    }

    .ma-question-card.is-word-problem {
        width: min(92%, 620px);
    }

    .ma-application-prompt {
        margin-top: 8px;
        font-size: clamp(1rem, 4.4vw, 1.32rem);
        line-height: 1.38;
    }

    .ma-equation {
        font-size: clamp(2.7rem, 13vw, 4.4rem);
    }

    .ma-answer-grid {
        top: 292px;
        grid-template-columns: repeat(2, minmax(110px, 155px));
        gap: 13px;
    }

    .ma-answer-button {
        min-height: 76px;
        font-size: 2.1rem;
    }

    .ma-hero-sprite {
        left: var(--ma-hero-left, 1%);
        width: 22%;
        height: 29%;
    }

    .ma-scene-journey {
        right: 13%;
        bottom: 1%;
        left: 17%;
        height: 47px;
    }

    .ma-scene-route-line {
        top: 21px;
        height: 6px;
    }

    .ma-scene-stop > span {
        display: none;
    }

    .ma-scene-stop-marker,
    .ma-play-screen[data-location="bridge"] .ma-scene-stop-marker,
    .ma-play-screen[data-location="greenhouse"] .ma-scene-stop-marker {
        width: 18px;
        height: 18px;
        margin-top: 13px;
    }

    .ma-advance-banner {
        top: 27%;
        width: min(86%, 440px);
        padding: 15px 18px;
    }

    .ma-companion-sprite {
        right: 2%;
        bottom: 3%;
        width: 20%;
        height: 22%;
    }

    .ma-feedback {
        bottom: 24%;
        max-width: 76%;
    }

    .ma-teaching-panel {
        top: 102px;
        right: 10px;
        bottom: 16px;
        left: 10px;
        overflow-y: auto;
        padding: 18px;
    }

    .ma-teaching-body {
        grid-template-columns: 1fr;
        gap: 10px;
        height: auto;
    }

    .ma-dot-array {
        width: min(66vw, 240px);
        padding: 12px;
    }

    .ma-teaching-work {
        text-align: center;
    }

    .ma-step-options {
        margin-right: auto;
        margin-left: auto;
    }

    .ma-teaching-panel.is-retry .ma-step-options {
        grid-template-columns: repeat(2, minmax(88px, 1fr));
        max-width: 330px;
    }

    .ma-play-screen.is-teaching .ma-companion-sprite,
    .ma-play-screen.is-teaching .ma-hero-sprite {
        opacity: 0;
    }

    .ma-summary-screen > img {
        position: absolute;
        bottom: -18px;
        left: -18px;
        z-index: 1;
        width: 37%;
        opacity: 0.45;
    }

    .ma-summary-card {
        width: min(100%, 570px);
        margin: auto;
    }

    .ma-travel-panel {
        padding: 145px 12px 60px;
    }
}

@media (max-width: 480px) {
    .ma-start-screen,
    .ma-map-screen,
    .ma-play-screen,
    .ma-summary-screen {
        border-width: 2px;
        border-radius: 20px;
    }

    .ma-start-panel h2 { font-size: 2.35rem; }
    .ma-lead { margin-bottom: 12px; font-size: 0.9rem; }
    .ma-profile-strip { margin: 12px 0; }
    .ma-route-card { padding: 9px 10px; }
    .ma-route-copy small { font-size: 0.72rem; }
    .ma-route-badge { display: none; }
    .ma-start-actions { align-items: stretch; flex-direction: column; }

    .ma-map-screen { min-height: 660px; }
    .ma-map-stage { border-radius: 18px; }
    .ma-map-header > div:first-child { max-width: 61%; }
    .ma-map-header h2 { font-size: 1.45rem; }
    .ma-map-progress-copy { min-width: 94px; }
    .ma-location-node { min-width: 118px; max-width: 140px; }
    .ma-location-node.bridge { left: 67%; top: 67%; }
    .ma-location-node.windmill { left: 27%; top: 36%; }
    .ma-location-node.greenhouse { left: 64%; top: 27%; }
    .ma-travel-copy { padding: 10px 16px; }
    .ma-travel-sky { width: 100%; height: 220px; }
    .ma-travel-hero { width: 180px; height: 210px; }
    .ma-travel-companion { width: 120px; height: 145px; }

    .ma-play-screen { min-height: 660px; }
    .ma-topbar { gap: 6px; padding-right: 6px; padding-left: 6px; }
    .ma-top-actions { gap: 3px; }
    .ma-top-actions button { min-width: 32px; height: 34px; padding: 0 4px; font-size: 0.62rem; }
    .ma-question-card { top: 106px; }
    .ma-answer-grid { top: 278px; }
    .ma-answer-button { min-height: 70px; }
    .ma-step-equation { min-height: 54px; }
    .ma-advance-banner { top: 29%; }

    .ma-summary-card { padding: 28px 18px; }
    .ma-summary-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
    .ma-summary-actions { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    .ma-shell *,
    .ma-shell *::before,
    .ma-shell *::after {
        scroll-behavior: auto !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }
}
