:root {
    --bg: #111823;
    --bg-soft: #1a2433;
    --bg-card: rgba(255, 255, 255, 0.06);
    --bg-card-strong: rgba(255, 255, 255, 0.1);
    --line: rgba(255, 255, 255, 0.14);
    --text: #f7f8fb;
    --muted: #b0bfd2;
    --accent: #ff8d5b;
    --accent-2: #52d6c5;
    --accent-3: #ffe07a;
    --shadow: 0 20px 45px rgba(8, 12, 20, 0.32);
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 14px;
    --font-display: "Avenir Next", "Hiragino Sans", "Yu Gothic", sans-serif;
    --font-body: "Avenir Next", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    background:
        radial-gradient(circle at top, rgba(82, 214, 197, 0.16), transparent 42%),
        linear-gradient(180deg, #111823 0%, #0b1119 100%);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: var(--font-body);
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

button,
input {
    font: inherit;
    touch-action: manipulation;
}

a {
    color: inherit;
}

.game-page {
    padding: 8px 8px 12px;
}

.game-page__wrap {
    width: min(1180px, 100%);
    margin: 0 auto;
    min-height: calc(100dvh - 16px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 6px;
}

.topbar,
.hud-grid article,
.side-card,
.overlay__panel {
    background: var(--bg-card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 5px 6px;
    border-radius: 18px;
    position: sticky;
    top: 6px;
    z-index: 10;
}

.topbar__title {
    font-family: var(--font-display);
    min-width: 0;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-button,
.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}

.nav-button--home {
    min-width: 0;
    padding: 0 14px;
    font-size: 0.9rem;
    font-weight: 700;
}

.nav-button--primary,
.action-button--primary {
    background: var(--accent);
    color: #15202b;
    border-color: rgba(255, 255, 255, 0.04);
    font-weight: 700;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.tag {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
}

.hud-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 6px;
}

.hud-grid article {
    padding: 8px 10px 7px;
    border-radius: 16px;
}

.hud-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hud-grid strong {
    display: block;
    margin-top: 3px;
    font-size: 0.98rem;
}

.play-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 6px;
    flex: 1;
}

.play-grid--solo {
    grid-template-columns: 1fr;
}

.play-card,
.side-card {
    border-radius: var(--radius-lg);
}

.play-card {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
}

.play-card--immersive {
    min-height: 0;
}

.side-card {
    display: none;
    padding: 18px;
}

.stage {
    position: relative;
    min-height: 0;
    height: 100%;
    border-radius: 24px;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.1), transparent 38%),
        rgba(7, 11, 17, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    touch-action: none;
}

.stage--immersive {
    min-height: 0;
}

.play-controls {
    display: grid;
    gap: 10px;
}

.side-card__section + .side-card__section {
    margin-top: 18px;
}

.side-card h2,
.side-card h3 {
    margin: 0 0 10px;
    font-size: 1.05rem;
}

.side-card p,
.side-card li {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.side-card ul {
    padding-left: 18px;
    margin: 0;
}

.control-grid {
    display: grid;
    gap: 10px;
}

.control-grid--stack {
    grid-template-columns: 1fr;
}

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

.control-grid--dpad {
    grid-template-columns: repeat(3, minmax(0, 72px));
    justify-content: center;
}

.control-button {
    min-height: 56px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    cursor: pointer;
}

.control-button:disabled {
    opacity: 0.8;
    cursor: default;
}

.control-button.is-hidden {
    visibility: hidden;
}

.persistent-actions {
    display: flex;
    gap: 10px;
}

.overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(7, 10, 16, 0.6);
    backdrop-filter: blur(10px);
    z-index: 30;
}

.overlay[hidden] {
    display: none;
}

.overlay__panel {
    width: min(420px, 100%);
    padding: 20px;
    border-radius: var(--radius-lg);
}

.overlay__eyebrow {
    margin: 0;
    color: var(--accent-2);
    font-size: 0.85rem;
    font-weight: 700;
}

.overlay__panel h2 {
    margin: 8px 0 8px;
    font-size: 1.65rem;
}

.overlay__panel p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.overlay__actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.board-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    width: 100%;
    padding: 0;
}

.board-canvas {
    width: min(100%, 440px);
    height: auto;
    display: block;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.05);
}

.target-button {
    position: absolute;
    width: 72px;
    height: 72px;
    border: none;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #fff4ea, #ff8d5b 52%, #d85b23 100%);
    box-shadow: 0 16px 28px rgba(255, 141, 91, 0.3);
    cursor: pointer;
}

.target-button::after {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: 999px;
    border: 3px solid rgba(255, 255, 255, 0.7);
}

.holes-grid,
.memory-grid,
.simon-grid,
.maze-pad {
    display: grid;
    gap: 12px;
    min-height: 100%;
    align-content: center;
}

.holes-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 16px;
}

.hole-button,
.memory-card,
.simon-pad {
    min-height: 88px;
    border: none;
    border-radius: 22px;
    cursor: pointer;
}

.hole-button {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(10, 15, 22, 0.96));
    box-shadow: inset 0 -14px 22px rgba(0, 0, 0, 0.4);
}

.hole-button span {
    position: absolute;
    inset: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: transparent;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.12s ease, transform 0.12s ease;
    font-size: 2rem;
}

.hole-button.is-up span {
    opacity: 1;
    transform: scale(1);
}

.hole-button.is-gold span {
    color: #ffe07a;
}

.hole-button.is-bomb span {
    color: #ff9c9c;
}

.memory-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(100%, 460px);
    margin: 0 auto;
    padding: 10px;
}

.memory-card {
    position: relative;
    min-height: 104px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.memory-card.is-open,
.memory-card.is-matched {
    background: rgba(82, 214, 197, 0.16);
}

.memory-card__face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.memory-card__back {
    color: rgba(255, 255, 255, 0.4);
}

.memory-card.is-open .memory-card__back,
.memory-card.is-matched .memory-card__back {
    display: none;
}

.memory-card:not(.is-open):not(.is-matched) .memory-card__front {
    display: none;
}

.simon-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px;
}

.simon-pad {
    min-height: 170px;
    opacity: 0.86;
}

.simon-pad.is-lit {
    opacity: 1;
    transform: scale(0.98);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18) inset;
}

.grid-2048 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    width: min(100%, 460px);
    margin: 0 auto;
    padding: 10px;
}

.tile-2048 {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 800;
}

.maze-board {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 2px;
    width: min(100%, 460px);
    margin: 0 auto;
    padding: 4px;
}

.maze-cell {
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
}

.maze-cell.wall {
    background: rgba(255, 255, 255, 0.12);
}

.maze-cell.exit {
    background: rgba(255, 224, 122, 0.42);
}

.maze-board.is-scanning .maze-cell.exit,
.maze-board.is-scanning .maze-cell.star {
    box-shadow: 0 0 0 2px rgba(255, 224, 122, 0.3) inset;
    background: rgba(255, 224, 122, 0.34);
}

.maze-cell.star::after,
.maze-cell.player::after {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 0.95rem;
    content: "";
}

.maze-cell.player::after {
    content: "😀";
}

.maze-cell.star::after {
    content: "★";
    color: #ffe07a;
}

@media (max-width: 900px) {
    .play-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .game-page {
        padding: 4px 4px 6px;
    }

    .game-page__wrap {
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-height: calc(100dvh - 8px);
    }

    .topbar {
        top: 4px;
        gap: 8px;
        padding: 4px 6px;
        border-radius: 14px;
    }

    .hud-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: 0;
        gap: 5px;
    }

    .hud-grid article {
        padding: 6px 8px 5px;
        border-radius: 12px;
    }

    .hud-grid span {
        font-size: 0.62rem;
    }

    .hud-grid strong {
        margin-top: 3px;
        font-size: 0.88rem;
    }

    .play-grid {
        margin-top: 0;
        gap: 6px;
    }

    .play-card,
    .play-card--immersive {
        border-radius: 18px;
    }

    .stage,
    .stage--immersive {
        border-radius: 18px;
    }

    .side-card {
        padding: 12px;
        border-radius: 22px;
    }

    .side-card__section:first-child {
        display: none;
    }

    .side-card__section + .side-card__section {
        margin-top: 0;
    }

    .side-card h3 {
        margin-bottom: 8px;
        font-size: 0.95rem;
    }

    .overlay__actions,
    .persistent-actions {
        flex-direction: column;
    }

    .overlay {
        align-items: flex-start;
        padding: 14px 8px 8px;
        background: rgba(7, 10, 16, 0.52);
    }

    .overlay__panel {
        width: 100%;
        padding: 16px;
        border-radius: 20px;
    }

    .board-canvas,
    .grid-2048,
    .maze-board {
        width: min(100%, calc(100dvw - 10px), 420px);
    }

    .holes-grid,
    .memory-grid,
    .simon-grid {
        gap: 10px;
        padding: 8px;
    }

    .hole-button,
    .memory-card,
    .simon-pad {
        min-height: 82px;
        border-radius: 18px;
    }

    .simon-pad {
        min-height: 138px;
    }

    .target-button {
        width: 72px;
        height: 72px;
    }

    .control-grid--dpad {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .nav-button,
    .action-button {
        min-height: 38px;
        padding: 0 12px;
    }

    .control-button {
        min-height: 48px;
        border-radius: 16px;
    }

    .topbar__title {
        font-size: 0.92rem;
    }
}

.overlay__text { color: var(--muted); line-height: 1.65; }
.overlay__meta { margin: 0 0 8px; color: var(--accent-3); font-size: 0.82rem; font-weight: 700; }
.overlay__lead { margin: 0 0 8px; color: var(--text); font-size: 1rem; font-weight: 700; }
.overlay__tip { color: var(--muted); }
.hud-grid--compact { margin-top: 8px; }

[data-game-id="breakout"] .board-canvas {
    width: min(100%, 430px);
}

[data-game-id="snake"] .board-canvas,
[data-game-id="2048"] .grid-2048,
[data-game-id="maze"] .maze-board {
    width: min(100%, 420px);
}

.memory-board,
.simon-board,
.target-board,
.number-board,
.spot-board,
.tempo-board {
    display: grid;
    gap: 12px;
    width: min(100%, 460px);
    margin: 0 auto;
    padding: 12px;
    align-content: center;
}

.memory-board {
    width: min(100%, 430px);
}

.memory-info,
.simon-info,
.target-ribbon {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.memory-info {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.memory-info article,
.simon-info article,
.target-ribbon article {
    padding: 10px 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.memory-info span,
.simon-info span,
.target-ribbon span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
}

.memory-info strong,
.simon-info strong,
.target-ribbon strong {
    display: block;
    margin-top: 4px;
    font-size: 1.02rem;
}

.memory-timer {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.memory-timer span {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #8cb4ff, #52d6c5);
    transform-origin: left center;
}

.memory-note,
.simon-note,
.number-note,
.spot-note,
.tempo-judge {
    margin: 0;
    min-height: 22px;
    color: var(--muted);
    text-align: center;
    font-size: 0.92rem;
}

.memory-note[data-tone="good"],
.simon-note[data-tone="good"],
.tempo-judge[data-tone="good"],
.number-note[data-tone="good"],
.spot-note[data-tone="good"] {
    color: #c5fff5;
}

.memory-note[data-tone="bad"],
.simon-note[data-tone="bad"],
.tempo-judge[data-tone="bad"],
.number-note[data-tone="bad"],
.spot-note[data-tone="bad"] {
    color: #ffb19b;
}

.number-grid,
.spot-grid,
.flip-grid {
    display: grid;
    gap: 10px;
    width: min(100%, 430px);
    margin: 0 auto;
    padding: 10px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.number-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.number-tile,
.spot-tile {
    min-height: 0;
    aspect-ratio: 1 / 1;
    border: none;
    border-radius: 20px;
    color: #16212c;
    font-size: clamp(1rem, 4vw, 1.15rem);
    font-weight: 800;
    box-shadow: 0 12px 22px rgba(8, 12, 20, 0.16);
}

.number-tile {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(19, 28, 42, 0.9)),
        rgba(255, 255, 255, 0.08);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.number-tile.is-done {
    opacity: 0.35;
}

.number-tile.is-next {
    background: rgba(126, 231, 135, 0.2);
    box-shadow: inset 0 0 0 2px rgba(126, 231, 135, 0.34);
}

.spot-tile {
    box-shadow: 0 10px 18px rgba(8, 12, 20, 0.15);
}

.flip-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.flip-tile {
    aspect-ratio: 1 / 1;
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        0 12px 22px rgba(8, 12, 20, 0.12);
}

.flip-tile.is-on {
    background: linear-gradient(180deg, rgba(255, 216, 94, 0.9), rgba(255, 184, 0, 0.84));
    box-shadow:
        inset 0 0 0 2px rgba(255, 250, 210, 0.3),
        0 14px 24px rgba(255, 216, 94, 0.18);
}

.flip-tile.is-hot {
    background: linear-gradient(180deg, rgba(143, 200, 255, 0.92), rgba(82, 146, 255, 0.84));
    box-shadow:
        inset 0 0 0 2px rgba(220, 238, 255, 0.3),
        0 14px 24px rgba(143, 200, 255, 0.18);
}

.tempo-pad {
    position: relative;
    width: min(100%, 320px);
    aspect-ratio: 1 / 1;
    justify-self: center;
    border: none;
    border-radius: 999px;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.12), transparent 50%),
        linear-gradient(180deg, rgba(121, 216, 255, 0.2), rgba(10, 18, 30, 0.96));
    overflow: hidden;
}

.tempo-zone,
.tempo-core,
.tempo-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    border-radius: 999px;
    transform: translate(-50%, -50%);
}

.tempo-zone {
    width: 46%;
    height: 46%;
    border: 3px solid rgba(255, 255, 255, 0.28);
}

.tempo-core {
    width: 18%;
    height: 18%;
    background: rgba(255, 255, 255, 0.92);
}

.tempo-ring {
    width: 84%;
    height: 84%;
    border: 8px solid rgba(121, 216, 255, 0.82);
    box-shadow: 0 0 28px rgba(121, 216, 255, 0.2);
}

.wave-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
    min-height: 260px;
}

.wave-pad {
    min-height: 220px;
    border: none;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(10,18,30,0.96));
}

.wave-pad.is-hot {
    background: linear-gradient(180deg, rgba(116, 217, 255, 0.92), rgba(44, 130, 255, 0.82));
    box-shadow: 0 18px 30px rgba(116, 217, 255, 0.18);
}

.cascade-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.cascade-column {
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
}

.cascade-card,
.choice-card {
    min-height: 60px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    background: rgba(255,255,255,0.06);
    color: var(--text);
    font-size: 1.3rem;
    font-weight: 800;
}

.choice-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.choice-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    font-size: 2.6rem;
}

.memory-grid {
    width: 100%;
    margin: 0;
    padding: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.memory-card {
    min-height: 0;
    aspect-ratio: 0.88 / 1;
    background: transparent;
    perspective: 900px;
}

.memory-card__inner {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    transition: transform 0.28s ease;
    transform-style: preserve-3d;
}

.memory-card__face {
    backface-visibility: hidden;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.memory-card__back {
    background:
        linear-gradient(180deg, rgba(140, 180, 255, 0.2), rgba(20, 30, 48, 0.92)),
        rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.75);
    font-size: clamp(1.1rem, 4vw, 1.35rem);
    font-weight: 800;
}

.memory-card__front {
    transform: rotateY(180deg);
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.18), transparent 55%),
        linear-gradient(180deg, rgba(82, 214, 197, 0.22), rgba(16, 22, 34, 0.95));
    font-size: clamp(1.55rem, 6vw, 2.15rem);
}

.memory-card .memory-card__back,
.memory-card .memory-card__front,
.memory-card.is-open .memory-card__back,
.memory-card.is-matched .memory-card__back,
.memory-card:not(.is-open):not(.is-matched) .memory-card__front {
    display: flex;
}

.memory-card.is-open .memory-card__inner,
.memory-card.is-matched .memory-card__inner {
    transform: rotateY(180deg);
}

.memory-card.is-matched .memory-card__front {
    box-shadow:
        inset 0 0 0 2px rgba(82, 214, 197, 0.36),
        0 14px 30px rgba(82, 214, 197, 0.14);
}

.target-board {
    width: min(100%, 480px);
}

.target-arena {
    position: relative;
    min-height: clamp(340px, 56dvh, 560px);
    border-radius: 28px;
    overflow: hidden;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.14), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(6, 10, 18, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.target-arena.is-shaking {
    animation: target-shake 0.18s linear;
}

.target-arena.is-fever {
    box-shadow:
        inset 0 0 0 2px rgba(255, 224, 122, 0.18),
        0 0 34px rgba(255, 224, 122, 0.14);
}

.target-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.82);
    pointer-events: none;
    transition: transform 0.09s ease, opacity 0.09s ease;
    border: none;
    background: radial-gradient(circle at 35% 35%, #fff3eb, #ff8d5b 52%, #cb4b17 100%);
    box-shadow: 0 18px 30px rgba(255, 141, 91, 0.28);
}

.target-button.is-visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.target-button.is-fast {
    background: radial-gradient(circle at 35% 35%, #eef9ff, #8cb4ff 48%, #4778dd 100%);
    box-shadow: 0 18px 30px rgba(140, 180, 255, 0.28);
}

.target-button.is-bonus {
    background: radial-gradient(circle at 35% 35%, #fffbe0, #ffe07a 48%, #d89900 100%);
    box-shadow: 0 18px 32px rgba(255, 224, 122, 0.3);
}

.target-button.is-hit {
    transform: scale(0.9);
}

.target-button::after {
    inset: 20%;
    border-width: 3px;
}

.target-button__label {
    position: relative;
    z-index: 1;
    color: rgba(18, 26, 37, 0.8);
    font-size: 1.1rem;
    font-weight: 800;
}

.target-feedback {
    position: absolute;
    left: 50%;
    bottom: 16px;
    margin: 0;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(11, 16, 25, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--muted);
    transform: translate(-50%, 14px);
    opacity: 0;
    transition: transform 0.16s ease, opacity 0.16s ease;
}

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

.target-feedback[data-tone="good"] {
    color: #c9fff0;
}

.target-feedback[data-tone="bad"] {
    color: #ffb19b;
}

.simon-board {
    width: min(100%, 470px);
}

.simon-note {
    padding: 6px 0 2px;
}

.simon-grid {
    width: 100%;
    padding: 0;
    gap: 12px;
}

.simon-pad {
    position: relative;
    min-height: 156px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 -18px 26px rgba(0, 0, 0, 0.14);
    transition: transform 0.12s ease, opacity 0.12s ease, box-shadow 0.12s ease;
    opacity: 0.92;
}

.simon-pad__label,
.simon-pad__hint {
    position: relative;
    z-index: 1;
}

.simon-pad__label {
    display: block;
    font-size: 2rem;
    font-weight: 800;
}

.simon-pad__hint {
    display: block;
    margin-top: 6px;
    opacity: 0.55;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.simon-pad::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 55%);
    opacity: 0.85;
    pointer-events: none;
}

.simon-pad.is-lit {
    opacity: 1;
    transform: scale(0.98);
    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.18) inset,
        0 22px 34px rgba(8, 12, 20, 0.24);
}

.simon-pad.is-correct {
    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.24) inset,
        0 0 24px rgba(255, 255, 255, 0.18);
}

.simon-pad.is-wrong {
    box-shadow: 0 0 0 4px rgba(255, 96, 96, 0.35) inset;
}

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

@media (max-width: 720px) {
    .memory-board,
    .simon-board,
    .target-board,
    .number-board,
    .spot-board,
    .tempo-board {
        padding: 8px;
        gap: 10px;
    }

    .memory-info article,
    .simon-info article,
    .target-ribbon article {
        padding: 9px 10px;
        border-radius: 16px;
    }

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

    .memory-card__inner {
        border-radius: 18px;
    }

    .number-tile,
    .spot-tile {
        border-radius: 16px;
    }

    .number-grid,
    .spot-grid,
    .flip-grid {
        gap: 8px;
        padding: 8px;
        border-radius: 20px;
    }

    .target-arena {
        min-height: clamp(290px, 46dvh, 440px);
        border-radius: 22px;
    }

    .simon-pad {
        min-height: 124px;
    }
}
