:root {
    --a-bg: #f4f5f7;
    --a-surface: #ffffff;
    --a-panel: #eef0f3;
    --a-border: #d5d9e0;
    --a-text: #12151a;
    --a-muted: #5c6570;
    --a-teal: #0c6b63;
    --a-teal-dim: rgba(12, 107, 99, 0.1);
    --a-coral: #c45c5c;
    --a-amber: #b45309;
    --a-violet: #4b5563;
    --a-radius: 6px;
    --a-font: "Source Sans 3", "Segoe UI", sans-serif;
    --a-display: "Fraunces", Georgia, serif;
    --a-mono: "Source Sans 3", ui-monospace, monospace;
    --a-ink: #12151a;
    /* Readable text/chrome on dark stage boards */
    --a-on-dark: #e8eaed;
    --a-on-dark-muted: #a8b0ba;
    --a-stage: #0a0f14;
    --a-stage-panel: #1a2430;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.arcade {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--a-font);
    color: var(--a-text);
    background: var(--a-bg);
    -webkit-font-smoothing: antialiased;
}

.arcade-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--a-border);
    background: rgba(244, 245, 247, 0.94);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.arcade-logo {
    font-family: var(--a-display);
    font-weight: 600;
    font-size: 1.35rem;
    letter-spacing: -0.03em;
    color: var(--a-ink);
    text-decoration: none;
}

.arcade-logo span { color: var(--a-teal); }

.arcade-nav-links {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.arcade-nav-links a {
    color: var(--a-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    transition: color 0.2s ease;
}

.arcade-nav-links a:hover,
.arcade-nav-links a.is-active { color: var(--a-ink); }

.arcade-home-link {
    color: var(--a-teal) !important;
    font-weight: 700 !important;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--a-teal);
    border-radius: 0;
    background: transparent;
}

.arcade-home-link:hover {
    background: var(--a-teal) !important;
    color: #fff !important;
}

.arcade-footer a {
    color: var(--a-teal);
    text-decoration: none;
    font-weight: 600;
}

.arcade-footer a:hover {
    color: var(--a-ink);
}

.arcade-footer-sep {
    margin: 0 0.35rem;
    opacity: 0.55;
}

.play-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.play-back {
    display: inline-flex;
    align-items: center;
    color: var(--a-teal);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.35rem 0.7rem;
    border-radius: 0;
    border: 1px solid var(--a-teal);
    background: transparent;
}

.play-back:hover {
    background: var(--a-teal);
    color: #fff;
}

.play-back--secondary {
    color: var(--a-muted);
    border-color: var(--a-border);
    background: transparent;
    font-weight: 600;
}

.play-back--secondary:hover {
    color: var(--a-text);
    border-color: var(--a-ink);
    background: transparent;
}

.arcade-main {
    flex: 1;
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 1.75rem 1.25rem 3rem;
}

.arcade-footer {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--a-border);
    color: var(--a-muted);
    font-size: 0.85rem;
    background: var(--a-surface);
}

.arcade-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--a-teal);
    margin: 0 0 0.75rem;
}

.arcade-hero {
    margin-bottom: 2.5rem;
}

.arcade-hero--spread {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 1.5rem 2.5rem;
    align-items: end;
    padding: 0 0 1.5rem;
    border-bottom: 1px solid var(--a-border);
    border-left: none;
    padding-left: 0;
}

.arcade-hero--spread .arcade-hero-main {
    padding-left: 1rem;
    border-left: 4px solid var(--a-teal);
}

.arcade-hero--spread .arcade-hero-lead {
    margin: 0;
    text-align: right;
    max-width: none;
}

@media (max-width: 767px) {
    .arcade-hero--spread {
        grid-template-columns: 1fr;
    }

    .arcade-hero--spread .arcade-hero-lead {
        text-align: left;
    }
}

.arcade-hero h1 {
    font-family: var(--a-display);
    font-size: clamp(2.1rem, 5vw, 3.2rem);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.05;
    margin: 0;
    color: var(--a-ink);
}

.arcade-hero-lead {
    color: var(--a-muted);
    font-size: 1.05rem;
    max-width: 36rem;
    margin: 0;
}

.arcade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.arcade-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.35rem;
    background: var(--a-surface);
    border: 1px solid var(--a-border);
    border-radius: 0;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, transform 0.2s;
}

.arcade-card:hover {
    transform: translateY(-2px);
    border-color: var(--a-ink);
    box-shadow: none;
}

.arcade-card-icon { font-size: 1.75rem; margin-bottom: 0.65rem; }

.arcade-card-tag {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--a-teal);
    background: transparent;
    border: 1px solid var(--a-border);
    padding: 0.2rem 0.45rem;
    border-radius: 0;
    margin-bottom: 0.55rem;
}

.arcade-card h2,
.arcade-card h3 {
    font-family: var(--a-display);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 0.45rem;
    letter-spacing: -0.02em;
}

.arcade-card p {
    flex: 1;
    font-size: 0.88rem;
    color: var(--a-muted);
    margin: 0 0 1rem;
    line-height: 1.5;
}

.arcade-card-cta {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--a-teal);
}

.play-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) 1fr;
    gap: 1.5rem;
    align-items: start;
}

.play-layout--stage-first {
    grid-template-columns: minmax(0, 1.35fr) minmax(240px, 300px);
}

.play-layout--stage-first .play-stage {
    order: 1;
}

.play-layout--stage-first .play-side {
    order: 2;
}

@media (max-width: 860px) {
    .play-layout,
    .play-layout--stage-first {
        grid-template-columns: 1fr;
    }

    .play-layout--stage-first .play-stage {
        order: 2;
    }

    .play-layout--stage-first .play-side {
        order: 1;
        position: static;
    }
}

.play-side {
    background: var(--a-surface);
    border: 1px solid var(--a-ink);
    border-radius: 0;
    padding: 1.25rem 1.35rem;
    position: sticky;
    top: 5rem;
}

@media (max-width: 860px) {
    .play-side { position: static; }
}

.play-side h1 {
    font-family: var(--a-display);
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin: 0 0 0.5rem;
}

.play-blurb {
    color: var(--a-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 1.25rem;
}

.play-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-bottom: 1.1rem;
}

.stat {
    background: var(--a-panel);
    border: 1px solid var(--a-border);
    border-radius: 0;
    padding: 0.65rem 0.75rem;
}

.stat-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--a-muted);
    margin-bottom: 0.2rem;
}

.stat-value {
    font-family: var(--a-mono);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--a-teal);
}

.play-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.arcade-btn {
    appearance: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.65rem 1rem;
    border-radius: 0;
    background: var(--a-teal);
    color: #fff;
    transition: transform 0.15s, background 0.15s;
}

.arcade-btn:hover { background: #09544e; transform: translateY(-1px); }

.arcade-btn--ghost {
    background: transparent;
    color: var(--a-text);
    border: 1px solid var(--a-border);
}

.play-help {
    font-size: 0.8rem;
    color: var(--a-muted);
    line-height: 1.5;
}

.play-help kbd {
    font-family: var(--a-mono);
    font-size: 0.72rem;
    background: var(--a-panel);
    border: 1px solid var(--a-border);
    border-radius: 4px;
    padding: 0.05rem 0.35rem;
}

.play-stage {
    background: var(--a-surface);
    border: 1px solid var(--a-border);
    border-radius: var(--a-radius);
    padding: 1.25rem;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.play-message {
    font-weight: 700;
    color: #fbbf24;
    min-height: 1.4em;
    text-align: center;
}

/* ── Shared boards ── */
.board-2048 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: #0d141b;
    padding: 10px;
    border-radius: 12px;
    width: min(100%, 360px);
}

.tile-2048 {
    aspect-ratio: 1;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-family: var(--a-mono);
    font-weight: 700;
    font-size: 1.4rem;
    background: #1a2430;
    color: transparent;
}

.tile-2048[data-v="2"] { background: #1e3a3a; color: #9fe8df; }
.tile-2048[data-v="4"] { background: #1a4a45; color: #b6f0e8; }
.tile-2048[data-v="8"] { background: #0f766e; color: #fff; }
.tile-2048[data-v="16"] { background: #14b8a6; color: #06201c; }
.tile-2048[data-v="32"] { background: #2dd4bf; color: #06201c; }
.tile-2048[data-v="64"] { background: #5eead4; color: #06201c; }
.tile-2048[data-v="128"] { background: #fbbf24; color: #1a1200; font-size: 1.15rem; }
.tile-2048[data-v="256"] { background: #f59e0b; color: #1a1200; font-size: 1.15rem; }
.tile-2048[data-v="512"] { background: #fb7185; color: #fff; font-size: 1.15rem; }
.tile-2048[data-v="1024"] { background: #e11d48; color: #fff; font-size: 1rem; }
.tile-2048[data-v="2048"] { background: #a78bfa; color: #fff; font-size: 1rem; }

.snake-wrap { position: relative; }
#snakeCanvas {
    display: block;
    width: min(100%, 400px);
    height: auto;
    background: #0d141b;
    border-radius: 12px;
    border: 1px solid var(--a-border);
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: min(100%, 400px);
}

.memory-card {
    aspect-ratio: 1;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: var(--a-panel);
    border: 1px solid var(--a-border);
    font-size: 1.6rem;
    color: transparent;
    transition: transform 0.15s, background 0.15s;
}

.memory-card.is-flipped,
.memory-card.is-matched {
    background: #0f3d38;
    color: var(--a-on-dark);
    border-color: rgba(45, 212, 191, 0.35);
}

.memory-card.is-matched { opacity: 0.7; cursor: default; }

.mole-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: min(100%, 360px);
}

.mole-hole {
    aspect-ratio: 1;
    border-radius: 50%;
    background: #0d141b;
    border: 2px solid var(--a-border);
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 2rem;
    user-select: none;
}

.mole-hole.is-up {
    background: var(--a-teal-dim);
    border-color: var(--a-teal);
}

.reaction-pad {
    width: min(100%, 420px);
    aspect-ratio: 4/3;
    border-radius: 16px;
    display: grid;
    place-items: center;
    text-align: center;
    cursor: pointer;
    font-size: 1.35rem;
    font-weight: 700;
    padding: 1.5rem;
    user-select: none;
    border: 1px solid var(--a-border);
    transition: background 0.15s;
}

.reaction-pad.is-wait { background: #7f1d1d; color: #fecaca; }
.reaction-pad.is-ready { background: #14532d; color: #bbf7d0; }
.reaction-pad.is-idle { background: var(--a-panel); color: var(--a-muted); }
.reaction-pad.is-result { background: #1e3a5f; color: #bfdbfe; }

.typing-box {
    width: min(100%, 520px);
}

.typing-prompt {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 1rem;
    min-height: 2em;
    text-align: center;
    color: var(--a-on-dark);
}

.typing-prompt .ok { color: #5eead4; }
.typing-prompt .bad { color: #fda4af; background: rgba(251, 113, 133, 0.15); }
.typing-prompt .next { color: var(--a-on-dark-muted); }

.typing-input {
    width: 100%;
    font-family: var(--a-mono);
    font-size: 1.1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(232, 234, 237, 0.22);
    background: #0d141b;
    color: var(--a-on-dark);
    outline: none;
}

.typing-input::placeholder { color: var(--a-on-dark-muted); }

.typing-input:focus { border-color: var(--a-teal); }

.simon-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: min(100%, 320px);
}

.simon-btn {
    aspect-ratio: 1;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.1s, transform 0.1s;
}

.simon-btn.is-lit { opacity: 1; transform: scale(0.97); }
.simon-btn[data-c="0"] { background: #22c55e; border-radius: 16px 8px 8px 8px; }
.simon-btn[data-c="1"] { background: #ef4444; border-radius: 8px 16px 8px 8px; }
.simon-btn[data-c="2"] { background: #eab308; border-radius: 8px 8px 8px 16px; }
.simon-btn[data-c="3"] { background: #3b82f6; border-radius: 8px 8px 16px 8px; }

.mines-board {
    display: grid;
    gap: 3px;
    background: #0d141b;
    padding: 8px;
    border-radius: 12px;
}

.mines-cell {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    background: #243040;
    color: var(--a-on-dark);
    font-family: var(--a-mono);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

.mines-cell.is-open { background: #15202b; color: var(--a-on-dark); cursor: default; }
.mines-cell.is-mine { background: var(--a-coral); color: #fff; }
.mines-cell.is-flag { background: #3b2f1a; color: #fbbf24; }

.mapquiz-stage {
    width: min(100%, 480px);
    text-align: center;
}

.mapquiz-shape {
    width: 100%;
    height: 220px;
    background: #0d141b;
    border-radius: 12px;
    border: 1px solid var(--a-border);
    display: grid;
    place-items: center;
    margin-bottom: 1rem;
    overflow: hidden;
}

.mapquiz-shape svg {
    width: 70%;
    height: 70%;
    fill: var(--a-teal);
    opacity: 0.85;
}

.mapquiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.mapquiz-options button {
    font-family: inherit;
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--a-border);
    background: var(--a-panel);
    color: var(--a-text);
    cursor: pointer;
}

.mapquiz-options button:hover { border-color: var(--a-teal); }
.mapquiz-options button.is-correct { background: #14532d; border-color: #22c55e; color: #bbf7d0; }
.mapquiz-options button.is-wrong { background: #7f1d1d; border-color: #ef4444; color: #fecaca; }

.coord-wrap {
    position: relative;
    width: min(100%, 520px);
}

#coordCanvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--a-border);
    cursor: crosshair;
    background: #0d141b;
}

.pipeline-board {
    display: grid;
    gap: 6px;
    background: #0d141b;
    padding: 10px;
    border-radius: 12px;
}

.pipe-cell {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 10px;
    background: #1a2430;
    color: #5eead4;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}

.pipe-cell.is-fixed {
    background: #0f3d38;
    cursor: default;
}

.pipe-cell.is-flow {
    background: rgba(45, 212, 191, 0.25);
    box-shadow: inset 0 0 0 2px var(--a-teal);
}

/* ── UX polish ── */
.arcade-nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.arcade-mute {
    appearance: none;
    border: 1px solid var(--a-border);
    background: var(--a-surface);
    border-radius: 0;
    width: 38px;
    height: 38px;
    cursor: pointer;
    font-size: 1rem;
}

.arcade-mute.is-off { opacity: 0.55; }

.arcade-section { margin-bottom: 2rem; }

.arcade-section-title {
    font-family: var(--a-display);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--a-ink);
    margin: 0 0 0.85rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--a-border);
}

.arcade-card h3 {
    font-family: var(--a-display);
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.45rem;
    letter-spacing: -0.02em;
}

.play-stage {
    position: relative;
    overflow: hidden;
    box-shadow: none;
    border: 1px solid var(--a-border);
    background: var(--a-stage);
    color: var(--a-on-dark);
}

.play-stage.is-celebrate {
    animation: stage-flash 0.45s ease;
}

@keyframes stage-flash {
    0%, 100% { box-shadow: inset 0 0 60px rgba(45, 212, 191, 0.04); }
    50% { box-shadow: inset 0 0 80px rgba(45, 212, 191, 0.22); }
}

.stat-value.is-pulse {
    animation: score-pop 0.35s ease;
}

@keyframes score-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.25); color: #fff; }
    100% { transform: scale(1); }
}

.arcade-toast {
    position: fixed;
    left: 50%;
    bottom: 2rem;
    transform: translateX(-50%) translateY(20px);
    background: rgba(18, 26, 34, 0.95);
    border: 1px solid rgba(232, 234, 237, 0.22);
    color: var(--a-on-dark);
    font-weight: 700;
    padding: 0.7rem 1.2rem;
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 50;
}

.arcade-toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.arcade-toast.is-win { border-color: rgba(45, 212, 191, 0.5); color: #5eead4; }
.arcade-toast.is-bad { border-color: rgba(251, 113, 133, 0.5); color: #fda4af; }

.arcade-burst {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    animation: burst-fly 0.85s ease forwards;
    z-index: 5;
}

@keyframes burst-fly {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(40px, -80px) scale(0); opacity: 0; }
}

/* Chinese game boards */
.llk-board {
    display: grid;
    gap: 4px;
    background: #0d141b;
    padding: 8px;
    border-radius: 12px;
}

.llk-cell {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: #1a2430;
    color: var(--a-on-dark);
    font-size: 1.25rem;
    cursor: pointer;
    border: 1px solid transparent;
}

.llk-cell.is-on { border-color: var(--a-teal); background: var(--a-teal-dim); transform: scale(0.96); }
.llk-cell.is-gone { visibility: hidden; pointer-events: none; }

.gomoku-board {
    display: grid;
    gap: 0;
    background: #c4a574;
    padding: 10px;
    border-radius: 12px;
    box-shadow: inset 0 0 0 2px #8b6914;
}

.gomoku-cell {
    width: 24px;
    height: 24px;
    border: none;
    background:
        linear-gradient(#5c4030, #5c4030) center/1px 100% no-repeat,
        linear-gradient(#5c4030, #5c4030) center/100% 1px no-repeat,
        transparent;
    cursor: pointer;
    position: relative;
}

.gomoku-cell.is-b::after,
.gomoku-cell.is-w::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.35);
}

.gomoku-cell.is-b::after { background: #111; }
.gomoku-cell.is-w::after { background: #f5f5f5; }

#tetrisCanvas, #jumpCanvas, #breakoutCanvas, #hongbaoCanvas, #planeCanvas {
    display: block;
    width: min(100%, 360px);
    height: auto;
    background: #0d141b;
    border-radius: 12px;
    border: 1px solid var(--a-border);
}

#jumpCanvas, #breakoutCanvas, #hongbaoCanvas, #planeCanvas { width: min(100%, 420px); }

.soko-board {
    display: grid;
    gap: 3px;
    background: #0d141b;
    padding: 8px;
    border-radius: 12px;
}

.soko-cell {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: #1a2430;
    color: var(--a-on-dark);
    font-size: 1.2rem;
}

.soko-cell.is-wall { background: #334155; }
.soko-cell.is-goal { box-shadow: inset 0 0 0 2px var(--a-amber); }
.soko-cell.is-box { background: #7c4a1e; }
.soko-cell.is-done { background: #14532d; }

.mahjong-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: min(100%, 380px);
}

.mahjong-card {
    aspect-ratio: 3/4;
    border: none;
    border-radius: 10px;
    background: linear-gradient(160deg, #1f2a36, #152029);
    border: 1px solid var(--a-border);
    color: transparent;
    font-size: 1.6rem;
    cursor: pointer;
}

.mahjong-card.is-flipped,
.mahjong-card.is-matched {
    color: #fff;
    background: linear-gradient(160deg, #0f3d38, #14532d);
    border-color: rgba(45, 212, 191, 0.4);
}

.mahjong-card.is-matched { opacity: 0.55; cursor: default; }

.idiom-card {
    width: min(100%, 440px);
    text-align: center;
}

.idiom-prompt {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 800;
    letter-spacing: 0.2em;
    margin-bottom: 1.25rem;
    color: #fff;
}

.idiom-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.idiom-options button {
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 700;
    padding: 0.9rem;
    border-radius: 12px;
    border: 1px solid var(--a-border);
    background: var(--a-panel);
    color: var(--a-text);
    cursor: pointer;
}

.idiom-options button:hover { border-color: var(--a-teal); }
.idiom-options button.is-correct { background: #14532d; border-color: #22c55e; color: #bbf7d0; }
.idiom-options button.is-wrong { background: #7f1d1d; border-color: #ef4444; color: #fecaca; }

.hanoi-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    width: min(100%, 320px);
}

.hanoi-cell {
    aspect-ratio: 1;
    border: none;
    border-radius: 10px;
    background: var(--a-stage-panel);
    color: var(--a-on-dark);
    font-family: var(--a-mono);
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    border: 1px solid rgba(232, 234, 237, 0.18);
}

.hanoi-cell.is-empty { opacity: 0.35; cursor: default; }
#pongCanvas, #tronCanvas, #airCanvas {
    display: block;
    width: min(100%, 640px);
    height: auto;
    background: #0d141b;
    border-radius: 12px;
    border: 1px solid var(--a-border);
}

#tronCanvas { width: min(100%, 480px); }

.c4-board {
    display: grid;
    gap: 6px;
    background: #0f2847;
    padding: 12px;
    border-radius: 14px;
}

.c4-cell {
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: #0d141b;
    cursor: pointer;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.06);
}

.c4-cell.is-p1 { background: radial-gradient(circle at 35% 30%, #fda4af, #e11d48); }
.c4-cell.is-p2 { background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b); }
.c4-cell:hover:not(.is-p1):not(.is-p2) { background: #1a2430; }

/* ── Arcade kit engines ── */
.kit-root {
    min-height: 220px;
    color: var(--a-on-dark);
    width: 100%;
    text-align: center;
}

.kit-q {
    font-family: var(--a-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.35;
    color: var(--a-on-dark);
}

.kit-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: center;
}

.kit-choice,
.kit-num,
.kit-hole,
.kit-light,
.kit-ttt-cell {
    appearance: none;
    border: 1px solid var(--a-border);
    background: var(--a-surface);
    color: var(--a-ink);
    font: inherit;
    font-weight: 600;
    padding: 0.65rem 0.9rem;
    cursor: pointer;
    border-radius: 0;
}

.kit-choice:hover,
.kit-num:hover,
.kit-hole:hover { border-color: var(--a-teal); }

.kit-choice.is-done { opacity: 0.45; }

.kit-big { font-size: 1.35rem; min-width: 3.5rem; }

.kit-input {
    display: block;
    width: min(100%, 240px);
    margin: 0.75rem auto;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--a-border);
    font: inherit;
    background: #fff;
    color: var(--a-ink);
}

.kit-math,
.kit-scramble,
.kit-quiz,
.kit-stroop,
.kit-span {
    color: var(--a-on-dark);
}

.kit-slider .kit-track {
    position: relative;
    height: 28px;
    background: var(--a-panel);
    border: 1px solid var(--a-border);
    margin-bottom: 1rem;
}

.kit-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(12, 107, 99, 0.35);
}

.kit-needle {
    position: absolute;
    top: -4px;
    width: 4px;
    height: 36px;
    background: var(--a-ink);
    transform: translateX(-50%);
}

.kit-catch,
.kit-aim {
    position: relative;
    height: 320px;
    background: #0a0f14;
    border: 1px solid var(--a-border);
    overflow: hidden;
}

.kit-fall {
    position: absolute;
    top: 0;
    border: none;
    background: transparent;
    font-size: 1.6rem;
    cursor: pointer;
}

.kit-target {
    position: absolute;
    border: none;
    background: transparent;
    font-size: 1.8rem;
    cursor: pointer;
    transform: translate(-50%, -50%);
}

.kit-canvas {
    display: block;
    max-width: 100%;
    background: #0a0f14;
    border: 1px solid var(--a-border);
}

.kit-word {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    color: var(--a-on-dark);
}

.kit-pad {
    display: grid;
    grid-template-columns: repeat(3, 64px);
    gap: 0.45rem;
}

.kit-lights {
    display: grid;
    gap: 6px;
}

.kit-light {
    width: 48px;
    height: 48px;
    background: #1a1f27;
    color: var(--a-on-dark);
}

.kit-light.is-on { background: #fbbf24; color: var(--a-ink); }

.kit-ttt {
    display: grid;
    grid-template-columns: repeat(3, 72px);
    gap: 6px;
}

.kit-ttt-cell {
    width: 72px;
    height: 72px;
    font-size: 1.6rem;
}

.kit-whack {
    display: grid;
    gap: 0.5rem;
    max-width: 320px;
}

.kit-hole {
    min-height: 72px;
    font-size: 1.6rem;
}

.kit-hole.is-up { background: rgba(12, 107, 99, 0.12); border-color: var(--a-teal); }

.kit-history {
    margin-top: 0.85rem;
    font-size: 0.9rem;
    color: var(--a-on-dark-muted);
    max-height: 160px;
    overflow: auto;
}

.kit-field {
    position: relative;
    height: 200px;
    background: var(--a-stage-panel);
    border: 1px solid rgba(232, 234, 237, 0.18);
    margin-bottom: 0.75rem;
}

.kit-field span {
    position: absolute;
    font-size: 1.1rem;
    transform: translate(-50%, -50%);
    color: var(--a-on-dark);
}

.kit-pulse {
    width: 88px;
    height: 88px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    border: 3px solid rgba(232, 234, 237, 0.28);
    background: var(--a-stage-panel);
    transition: transform 0.1s, background 0.1s;
}

.kit-pulse.is-on {
    background: var(--a-teal);
    transform: scale(1.08);
}

.kit-maze {
    display: grid;
    gap: 2px;
    width: max-content;
    outline: none;
    background: var(--a-border);
    padding: 2px;
}

.kit-maze-cell {
    width: 18px;
    height: 18px;
    background: #fff;
}

.kit-maze-cell.is-wall { background: #12151a; }
.kit-maze-cell.is-player { background: var(--a-teal); }
.kit-maze-cell.is-exit { background: #fbbf24; }

.kit-mm-row {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    min-height: 2rem;
    color: var(--a-on-dark);
}

/* Dark stage: light labels; keep paper controls dark-ink */
.play-stage .kit-slider .kit-track {
    background: var(--a-stage-panel);
    border-color: rgba(232, 234, 237, 0.18);
}

.play-stage .kit-needle {
    background: var(--a-on-dark);
}

.play-stage .kit-zone {
    background: rgba(45, 212, 191, 0.35);
}
