:root {
    --mw-ink: #080b0e;
    --mw-panel: #10161b;
    --mw-line: #2a343d;
    --mw-line-bright: #465661;
    --mw-copy: #d5dde4;
    --mw-muted: #8997a2;
    --mw-cyan: #47dce8;
    --mw-cyan-soft: #b4f9ff;
    --mw-amber: #ffab2e;
    --mw-gold: #ead27c;
    --mw-green: #5cf7a2;
    --mw-danger: #ff476f;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 92px;
}

body.math-wars-home {
    min-width: 320px;
    color: var(--mw-copy);
    background:
        radial-gradient(circle at 80% 17%, rgba(255, 71, 111, 0.07), transparent 24rem),
        radial-gradient(circle at 16% 10%, rgba(71, 220, 232, 0.08), transparent 30rem),
        linear-gradient(rgba(55, 68, 78, 0.13) 1px, transparent 1px),
        linear-gradient(90deg, rgba(55, 68, 78, 0.13) 1px, transparent 1px),
        var(--mw-ink);
    background-size: auto, auto, 32px 32px, 32px 32px, auto;
    line-height: 1.55;
}

.math-wars-home main {
    overflow: hidden;
}

.math-wars-home .container {
    max-width: 1440px;
    padding-inline: clamp(1rem, 3vw, 2.5rem);
}

.math-wars-home .site-header {
    position: sticky;
    z-index: 50;
    top: 0;
    border-bottom: 1px solid rgba(71, 220, 232, 0.2);
    background: rgba(8, 11, 14, 0.92);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(16px);
}

.math-wars-home .header {
    min-height: 74px;
    padding-block: 0.75rem;
}

.math-wars-home .logo-img {
    width: 46px;
    height: 46px;
    filter: drop-shadow(0 0 12px rgba(71, 220, 232, 0.2));
}

.math-wars-home .logo-title {
    color: #f5f8fa;
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.math-wars-home .nav {
    align-items: center;
    gap: 0.45rem 1.15rem;
}

.math-wars-home .nav a {
    color: #9eabb4;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.math-wars-home .nav a:hover {
    color: var(--mw-cyan-soft);
}

.math-wars-home .nav .nav-play {
    min-height: 42px;
    border: 1px solid rgba(255, 171, 46, 0.78);
    padding: 0.68rem 1rem;
    color: #130d04;
    background: linear-gradient(110deg, #ef8c16, #ffd361);
    box-shadow: 0 0 20px rgba(255, 171, 46, 0.18);
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.math-wars-home .nav .nav-play:hover {
    color: #000;
    filter: brightness(1.08);
}

.mw-shell,
.mw-wide-shell {
    width: min(calc(100% - clamp(2rem, 7vw, 7rem)), 1280px);
    margin-inline: auto;
}

.mw-wide-shell {
    width: min(calc(100% - clamp(1rem, 4vw, 4rem)), 1714px);
}

.mw-hero {
    position: relative;
    padding-top: clamp(4rem, 8vw, 7.5rem);
}

.mw-hero::before {
    position: absolute;
    z-index: -1;
    top: 7%;
    left: 50%;
    width: min(80vw, 1000px);
    height: min(46vw, 550px);
    border: 1px solid rgba(71, 220, 232, 0.08);
    content: "";
    transform: translateX(-50%) rotate(-3deg);
}

.mw-hero-copy {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
    gap: clamp(2rem, 7vw, 7rem);
    align-items: end;
    margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.mw-kicker {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    margin: 0 0 1.15rem;
    color: var(--mw-cyan);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.mw-kicker > span {
    display: inline-block;
    width: 1.4rem;
    height: 2px;
    background: currentColor;
    box-shadow: 0 0 9px currentColor;
}

.mw-kicker-warm {
    color: var(--mw-amber);
}

.mw-hero h1 {
    max-width: 900px;
    margin: 0;
    color: #f4f7f9;
    font-size: clamp(3.8rem, 8.4vw, 8.2rem);
    font-weight: 700;
    letter-spacing: -0.075em;
    line-height: 0.84;
    text-wrap: balance;
}

.mw-hero h1 span {
    display: block;
    color: var(--mw-amber);
    text-shadow: 0 0 30px rgba(255, 171, 46, 0.14);
}

.mw-hero-intro {
    padding-bottom: 0.3rem;
}

.mw-hero-intro > p {
    margin: 0 0 1.7rem;
    color: #b3bec6;
    font-size: clamp(1rem, 1.4vw, 1.13rem);
    line-height: 1.75;
}

.mw-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.mw-button {
    display: inline-flex;
    min-height: 50px;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--mw-line-bright);
    padding: 0.85rem 1.15rem;
    color: #d7e0e6;
    background: rgba(17, 23, 28, 0.9);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
    transition: border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
    clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
}

.mw-button:hover {
    border-color: var(--mw-cyan);
    color: #fff;
    transform: translateY(-2px);
}

.mw-button-primary {
    border-color: #ffc050;
    color: #130d04;
    background: linear-gradient(110deg, #ef8c16, #ffd361);
    box-shadow: 0 0 24px rgba(255, 171, 46, 0.16);
}

.mw-button-primary:hover {
    border-color: #ffe2a1;
    color: #000;
    box-shadow: 0 0 32px rgba(255, 171, 46, 0.28);
}

.mw-hero-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.25rem;
    margin: 1.35rem 0 0;
    padding: 0;
    color: #75838d;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    list-style: none;
    text-transform: uppercase;
}

.mw-hero-facts li::before {
    margin-right: 0.5rem;
    color: var(--mw-green);
    content: "■";
    font-size: 0.52rem;
}

.mw-stage {
    margin-top: 0;
    margin-bottom: 0;
}

.mw-stage-viewport {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(234, 210, 124, 0.6);
    background: #15171d;
    box-shadow: 0 38px 90px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 171, 46, 0.08), 0 0 52px rgba(255, 171, 46, 0.08);
    clip-path: polygon(0 14px, 14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px));
}

.mw-stage-viewport::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(5, 7, 9, 0.17), transparent 18%, transparent 82%, rgba(5, 7, 9, 0.17)), repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.018) 3px 4px);
    content: "";
    pointer-events: none;
}

.mw-stage img {
    display: block;
    width: 100%;
    height: auto;
}

.mw-stage-label {
    position: absolute;
    z-index: 2;
    display: flex;
    min-height: 34px;
    gap: 0.5rem;
    align-items: center;
    border: 1px solid rgba(71, 220, 232, 0.42);
    padding: 0.5rem 0.75rem;
    color: #b8eaf0;
    background: rgba(7, 11, 14, 0.84);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

.mw-stage-label-top {
    top: 1rem;
    left: 1rem;
}

.mw-stage-label-top span {
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 50%;
    background: var(--mw-green);
    box-shadow: 0 0 10px var(--mw-green);
}

.mw-stage-label-bottom {
    right: 1rem;
    bottom: 1rem;
    border-color: rgba(255, 171, 46, 0.55);
    color: #ffe1a7;
}

.mw-stage-corners::before,
.mw-stage-corners::after {
    position: absolute;
    z-index: 3;
    width: 70px;
    height: 70px;
    border-color: var(--mw-amber);
    content: "";
    pointer-events: none;
}

.mw-stage-corners::before {
    top: 7px;
    right: 7px;
    border-top: 2px solid;
    border-right: 2px solid;
}

.mw-stage-corners::after {
    bottom: 7px;
    left: 7px;
    border-bottom: 2px solid;
    border-left: 2px solid;
}

.mw-stage figcaption {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0.2rem 0;
    color: #697782;
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mw-stage figcaption a,
.mw-text-link {
    color: var(--mw-cyan);
    text-decoration: none;
}

.mw-stage figcaption a:hover,
.mw-text-link:hover {
    color: var(--mw-cyan-soft);
}

.mw-signal-strip {
    margin-top: clamp(3.5rem, 7vw, 7rem);
    overflow: hidden;
    border-top: 1px solid rgba(71, 220, 232, 0.18);
    border-bottom: 1px solid rgba(71, 220, 232, 0.18);
    background: rgba(11, 16, 20, 0.86);
}

.mw-signal-strip > div {
    display: flex;
    width: max-content;
    min-width: 100%;
    gap: clamp(1rem, 4vw, 3.4rem);
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    color: #aab6be;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.mw-signal-strip i {
    color: rgba(255, 171, 46, 0.6);
    font-style: normal;
}

.mw-loop,
.mw-arsenal {
    padding-block: clamp(6rem, 10vw, 10rem);
}

.mw-section-heading {
    max-width: 840px;
    margin-bottom: clamp(3rem, 6vw, 5rem);
}

.mw-section-heading h2,
.mw-battle-copy h2,
.mw-playtest h2,
.mw-final-cta h2 {
    margin: 0;
    color: #f1f5f7;
    font-size: clamp(2.6rem, 5.4vw, 5.5rem);
    letter-spacing: -0.055em;
    line-height: 0.98;
    text-wrap: balance;
}

.mw-section-heading > p:last-child,
.mw-section-heading-split > p,
.mw-battle-copy > p,
.mw-playtest-copy > p {
    max-width: 680px;
    margin: 1.4rem 0 0;
    color: #95a2ab;
    font-size: 1rem;
    line-height: 1.75;
}

.mw-equation-rail {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1.12fr auto 1.35fr auto 0.9fr;
    gap: clamp(0.35rem, 1.2vw, 1rem);
    align-items: center;
    margin-bottom: 4rem;
}

.mw-equation-rail::before {
    position: absolute;
    z-index: -1;
    right: 4%;
    left: 4%;
    height: 5px;
    border-top: 1px solid rgba(234, 210, 124, 0.55);
    border-bottom: 1px solid rgba(234, 210, 124, 0.2);
    background: #141a1f;
    content: "";
}

.mw-equation-node {
    display: grid;
    min-height: clamp(94px, 11vw, 142px);
    place-content: center;
    border: 1px solid var(--mw-line-bright);
    text-align: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 38%), #11171c;
    box-shadow: inset 0 0 0 5px #0b0f13, 0 15px 30px rgba(0, 0, 0, 0.25);
    clip-path: polygon(0 11px, 11px 0, calc(100% - 11px) 0, 100% 11px, 100% calc(100% - 11px), calc(100% - 11px) 100%, 11px 100%, 0 calc(100% - 11px));
}

.mw-equation-node small {
    color: #7f8b94;
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.mw-equation-node strong {
    color: var(--mw-amber);
    font-size: clamp(2rem, 4vw, 4.2rem);
    line-height: 1;
    text-shadow: 0 0 18px rgba(255, 171, 46, 0.42);
}

.mw-equation-number {
    border-color: rgba(255, 171, 46, 0.65);
    border-radius: 50%;
    clip-path: none;
}

.mw-equation-math {
    border-color: rgba(92, 247, 162, 0.6);
}

.mw-equation-math strong {
    color: var(--mw-green);
    text-shadow: 0 0 18px rgba(92, 247, 162, 0.38);
}

.mw-equation-ammo {
    border-color: rgba(255, 71, 111, 0.62);
}

.mw-equation-ammo strong {
    color: #ff8ba4;
    font-size: clamp(1rem, 2.2vw, 2rem);
    text-shadow: 0 0 18px rgba(255, 71, 111, 0.34);
}

.mw-equation-tower strong {
    color: var(--mw-cyan);
    text-shadow: 0 0 18px rgba(71, 220, 232, 0.38);
}

.mw-equation-link {
    color: var(--mw-gold);
    font-size: clamp(1.3rem, 2.5vw, 2.4rem);
    font-weight: 700;
    text-shadow: 0 0 12px rgba(234, 210, 124, 0.35);
}

.mw-equation-arrow {
    color: #5d6b75;
}

.mw-loop-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--mw-line);
    border-left: 1px solid var(--mw-line);
}

.mw-loop-grid article {
    min-height: 315px;
    border-right: 1px solid var(--mw-line);
    border-bottom: 1px solid var(--mw-line);
    padding: clamp(1.4rem, 3vw, 2.25rem);
    background: linear-gradient(145deg, rgba(22, 29, 35, 0.74), rgba(11, 15, 19, 0.72));
}

.mw-step-index {
    display: block;
    margin-bottom: 3rem;
    color: #34414a;
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -0.08em;
}

.mw-step-label,
.mw-arsenal-card > div:last-child > p {
    margin: 0 0 0.55rem;
    color: var(--mw-amber);
    font-size: 0.61rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.mw-loop-grid h3,
.mw-arsenal-card h3 {
    margin: 0 0 0.75rem;
    color: #ebf1f4;
    font-size: 1.2rem;
    line-height: 1.2;
}

.mw-loop-grid article > p:last-child,
.mw-arsenal-card > div:last-child > span {
    color: #86949d;
    font-size: 0.86rem;
    line-height: 1.65;
}

.mw-battle-band {
    position: relative;
    border-top: 1px solid rgba(255, 71, 111, 0.2);
    border-bottom: 1px solid rgba(255, 71, 111, 0.2);
    background: radial-gradient(circle at 82% 32%, rgba(255, 71, 111, 0.12), transparent 24rem), repeating-linear-gradient(135deg, rgba(255, 71, 111, 0.025) 0 2px, transparent 2px 18px), #0b0f13;
}

.mw-battle-band::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 7px;
    background: repeating-linear-gradient(0deg, var(--mw-danger) 0 18px, transparent 18px 30px);
    content: "";
    opacity: 0.7;
}

.mw-battle-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.75fr);
    gap: clamp(3rem, 9vw, 9rem);
    align-items: center;
    padding-block: clamp(6rem, 10vw, 10rem);
}

.mw-battle-copy > p {
    margin-bottom: 1.8rem;
}

.mw-text-link {
    display: inline-flex;
    gap: 0.8rem;
    align-items: center;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.mw-tactical-readout {
    border: 1px solid rgba(255, 71, 111, 0.38);
    padding: 0.4rem;
    background: rgba(8, 11, 14, 0.84);
    box-shadow: 18px 18px 0 rgba(255, 71, 111, 0.035);
    clip-path: polygon(0 13px, 13px 0, 100% 0, 100% calc(100% - 13px), calc(100% - 13px) 100%, 0 100%);
}

.mw-readout-head,
.mw-readout-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid #252d34;
    padding: 1.2rem;
}

.mw-readout-head {
    color: var(--mw-danger);
    background: rgba(255, 71, 111, 0.07);
    font-size: 0.7rem;
    letter-spacing: 0.13em;
}

.mw-readout-head strong {
    color: #ffc0ce;
}

.mw-readout-row span {
    color: #71808a;
    font-size: 0.7rem;
}

.mw-readout-row strong {
    color: #dce3e8;
    font-size: 0.75rem;
    text-align: right;
}

.mw-readout-meter {
    height: 18px;
    margin: 1.2rem;
    border: 1px solid #2e3840;
    padding: 3px;
}

.mw-readout-meter span {
    display: block;
    width: 78%;
    height: 100%;
    background: repeating-linear-gradient(90deg, var(--mw-danger) 0 14px, transparent 14px 18px);
    box-shadow: 0 0 18px rgba(255, 71, 111, 0.26);
}

.mw-section-heading-split {
    display: grid;
    max-width: none;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.55fr);
    gap: clamp(2rem, 8vw, 8rem);
    align-items: end;
}

.mw-section-heading-split > p {
    margin-bottom: 0.4rem;
}

.mw-arsenal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    border: 1px solid var(--mw-line);
    background: var(--mw-line);
}

.mw-arsenal-card {
    display: grid;
    min-height: 260px;
    grid-template-columns: 152px minmax(0, 1fr);
    gap: clamp(1.2rem, 3vw, 2.4rem);
    align-items: center;
    padding: clamp(1.5rem, 4vw, 3rem);
    background: #0d1216;
}

.mw-machine-glyph {
    display: grid;
    width: 132px;
    height: 132px;
    place-items: center;
    border: 1px solid rgba(255, 171, 46, 0.68);
    border-radius: 50%;
    background: repeating-radial-gradient(circle, transparent 0 33px, rgba(255, 171, 46, 0.15) 34px 36px, transparent 37px 47px), #11171c;
    box-shadow: inset 0 0 22px #060809, 0 0 22px rgba(255, 171, 46, 0.09);
}

.mw-machine-glyph span {
    display: grid;
    width: 68px;
    height: 68px;
    place-items: center;
    border: 2px solid currentColor;
    border-radius: 50%;
    color: var(--mw-amber);
    font-size: 2.1rem;
    font-weight: 700;
    text-shadow: 0 0 12px currentColor;
}

.mw-arsenal-card-rail .mw-machine-glyph,
.mw-arsenal-card-rail .mw-machine-glyph span {
    border-radius: 4px;
    color: var(--mw-green);
    border-color: rgba(92, 247, 162, 0.58);
}

.mw-arsenal-card-hex .mw-machine-glyph {
    border-radius: 4px;
    border-color: rgba(255, 71, 111, 0.58);
}

.mw-arsenal-card-hex .mw-machine-glyph span {
    color: #ff7f9c;
}

.mw-arsenal-card-relay .mw-machine-glyph,
.mw-arsenal-card-relay .mw-machine-glyph span {
    border-color: rgba(71, 220, 232, 0.62);
    color: var(--mw-cyan);
}

.mw-playtest {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(390px, 0.65fr);
    gap: clamp(3rem, 9vw, 9rem);
    align-items: end;
    border: 1px solid rgba(71, 220, 232, 0.28);
    padding: clamp(2rem, 6vw, 5.5rem);
    background: linear-gradient(115deg, rgba(71, 220, 232, 0.07), transparent 42%), #0d1216;
    clip-path: polygon(0 18px, 18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}

.mw-playtest-copy > p {
    margin-bottom: 0;
}

.mw-playtest-facts {
    margin: 0;
    border-top: 1px solid var(--mw-line);
}

.mw-playtest-facts > div {
    display: grid;
    grid-template-columns: 105px 1fr;
    gap: 1rem;
    border-bottom: 1px solid var(--mw-line);
    padding: 0.95rem 0;
}

.mw-playtest-facts dt {
    color: #687680;
    font-size: 0.66rem;
    text-transform: uppercase;
}

.mw-playtest-facts dd {
    margin: 0;
    color: #d4dde2;
    font-size: 0.74rem;
    font-weight: 700;
    text-align: right;
}

.mw-final-cta {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto;
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center;
    padding-block: clamp(7rem, 12vw, 12rem);
}

.mw-final-core {
    display: grid;
    width: 108px;
    height: 108px;
    place-items: center;
    border: 2px solid var(--mw-amber);
    border-radius: 50%;
    background: #11171c;
    box-shadow: 0 0 0 8px #080b0e, 0 0 0 10px #38434b, 0 0 32px rgba(255, 171, 46, 0.22);
}

.mw-final-core span {
    color: var(--mw-amber);
    font-size: 2.8rem;
    font-weight: 700;
    text-shadow: 0 0 13px currentColor;
}

.mw-final-cta h2 {
    max-width: 760px;
    font-size: clamp(2.2rem, 4vw, 4.4rem);
}

.mw-final-actions {
    justify-content: flex-end;
}

.math-wars-home .footer {
    border-top: 1px solid rgba(71, 220, 232, 0.22);
    background: #080b0e;
}

.math-wars-home .footer-inner {
    padding-block: 2.8rem;
}

.math-wars-home .footer-title {
    color: #e9f0f3;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.math-wars-home .footer-tagline {
    color: #66737d;
    font-size: 0.72rem;
}

.math-wars-home .footer-nav {
    margin-top: 1.6rem;
}

.math-wars-home .footer-meta {
    margin-top: 1.5rem;
    border-top: 1px solid #1d252b;
    padding-top: 1.2rem;
    color: #606d76;
    font-size: 0.68rem;
}

.math-wars-home .footer-link {
    color: #95a4ad;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.math-wars-home .footer-nav .footer-link {
    color: #bdc8ce;
    font-weight: 700;
    text-transform: uppercase;
}

@media (max-width: 1120px) {
    .mw-hero-copy,
    .mw-battle-layout,
    .mw-playtest {
        grid-template-columns: 1fr;
    }

    .mw-hero-intro {
        max-width: 700px;
    }

    .mw-loop-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mw-battle-layout {
        gap: 3.5rem;
    }

    .mw-tactical-readout {
        max-width: 720px;
    }

    .mw-final-cta {
        grid-template-columns: 108px 1fr;
    }

    .mw-final-actions {
        grid-column: 2;
        justify-content: flex-start;
    }
}

@media (max-width: 900px) {
    .mw-equation-rail {
        grid-template-columns: repeat(9, auto);
        justify-content: start;
        overflow-x: auto;
        padding-bottom: 1rem;
        scrollbar-color: var(--mw-line-bright) transparent;
    }

    .mw-equation-node {
        width: 124px;
    }

    .mw-equation-rail::before {
        right: auto;
        left: 30px;
        width: 850px;
    }

    .mw-arsenal-grid {
        grid-template-columns: 1fr;
    }

    .mw-section-heading-split {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 70px;
    }

    .math-wars-home .header {
        min-height: 64px;
        padding-block: 0.55rem;
    }

    .math-wars-home .logo-img {
        width: 40px;
        height: 40px;
    }

    .math-wars-home .logo-title {
        font-size: 0.82rem;
    }

    .math-wars-home .nav {
        border: 1px solid rgba(71, 220, 232, 0.24);
        border-radius: 0;
        padding: 0.5rem;
        background: #0a0e12;
    }

    .math-wars-home .nav a,
    .math-wars-home .nav .nav-play {
        min-height: 44px;
        border: 1px solid #232d34;
        border-radius: 0;
        padding: 0.8rem;
        color: #b9c4ca;
        background: #10161b;
        clip-path: none;
    }

    .math-wars-home .nav .nav-play {
        border-color: rgba(255, 171, 46, 0.65);
        color: #ffcc75;
    }

    .math-wars-home .nav-toggle {
        border-radius: 0;
        background: #10161b;
    }

    .mw-shell {
        width: min(calc(100% - 2rem), 1280px);
    }

    .mw-wide-shell {
        width: min(calc(100% - 1rem), 1714px);
    }

    .mw-hero {
        display: flex;
        flex-direction: column;
        padding-top: 3.4rem;
    }

    .mw-hero-copy {
        display: contents;
    }

    .mw-hero-heading {
        order: 1;
        margin-bottom: 2.3rem;
    }

    .mw-stage {
        order: 2;
        margin-bottom: 2.3rem;
    }

    .mw-hero-intro {
        order: 3;
        width: min(calc(100% - 2rem), 1280px);
        margin-inline: auto;
    }

    .mw-hero h1 {
        font-size: clamp(3.2rem, 17vw, 5.5rem);
        line-height: 0.88;
    }

    .mw-stage-label {
        display: none;
    }

    .mw-stage figcaption {
        display: grid;
    }

    .mw-signal-strip {
        overflow-x: auto;
        scrollbar-color: var(--mw-line-bright) transparent;
    }

    .mw-signal-strip > div {
        width: max-content;
        min-width: 100%;
        justify-content: flex-start;
    }

    .mw-loop,
    .mw-arsenal {
        padding-block: 5.5rem;
    }

    .mw-loop-grid {
        grid-template-columns: 1fr;
    }

    .mw-loop-grid article {
        min-height: 0;
    }

    .mw-step-index {
        margin-bottom: 1.8rem;
    }

    .mw-battle-layout {
        padding-block: 5.5rem;
    }

    .mw-section-heading h2,
    .mw-battle-copy h2,
    .mw-playtest h2 {
        font-size: clamp(2.4rem, 12vw, 4rem);
    }

    .mw-arsenal-card {
        grid-template-columns: 94px 1fr;
        gap: 1.2rem;
        padding: 1.4rem;
    }

    .mw-machine-glyph {
        width: 86px;
        height: 86px;
    }

    .mw-machine-glyph span {
        width: 48px;
        height: 48px;
        font-size: 1.45rem;
    }

    .mw-playtest {
        gap: 2.5rem;
        padding: 2rem 1.4rem;
    }

    .mw-final-cta {
        grid-template-columns: 1fr;
        padding-block: 6.5rem;
        text-align: center;
    }

    .mw-final-core {
        margin-inline: auto;
    }

    .mw-final-cta .mw-kicker,
    .mw-final-actions {
        justify-content: center;
    }

    .mw-final-actions {
        grid-column: 1;
    }
}

@media (max-width: 520px) {
    .mw-actions,
    .mw-button {
        width: 100%;
    }

    .mw-hero-facts {
        display: grid;
    }
    .mw-stage-corners::before,
    .mw-stage-corners::after {
        width: 44px;
        height: 44px;
    }

    .mw-readout-head,
    .mw-readout-row {
        padding: 1rem 0.75rem;
    }

    .mw-arsenal-card {
        grid-template-columns: 1fr;
    }

    .mw-playtest-facts > div {
        grid-template-columns: 86px 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .mw-signal-strip > div { animation: none; }
    .mw-button { transition: none; }
}
