:root {
    --bg-1: #070b23;
    --bg-2: #0b1038;
    --panel: rgba(12, 18, 74, 0.88);
    --panel-border: #32b9ff;
    --panel-line: #ffe438;
    --text: #eff7ff;
    --dim: #c6dcff;
    --cyan: #44d2ff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Montserrat", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(42, 83, 180, 0.28), transparent 38%),
        radial-gradient(circle at bottom, rgba(0, 247, 255, 0.12), transparent 30%),
        linear-gradient(180deg, var(--bg-2), var(--bg-1));
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 20% 25%, rgba(255, 255, 255, 0.9) 0 1px, transparent 2px),
        radial-gradient(circle at 75% 15%, rgba(255, 255, 255, 0.6) 0 1px, transparent 2px),
        radial-gradient(circle at 30% 80%, rgba(255, 255, 255, 0.65) 0 1px, transparent 2px),
        radial-gradient(circle at 85% 75%, rgba(255, 255, 255, 0.7) 0 1px, transparent 2px);
    opacity: 0.55;
}

.game-shell {
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 32px;
}

.game-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(50, 185, 255, 0.55);
    border-radius: 999px;
    color: var(--cyan);
    text-decoration: none;
    font-family: "Orbitron", sans-serif;
    letter-spacing: 0.08em;
    background: rgba(8, 14, 48, 0.72);
}

.game-copy h1,
.game-notes h2 {
    margin: 0;
    font-family: "Orbitron", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.game-copy p,
.game-notes p {
    color: var(--dim);
}

.game-copy p {
    margin: 8px 0 0;
    max-width: 720px;
}

.game-stage {
    display: grid;
    grid-template-columns: minmax(0, 840px) 1fr;
    gap: 22px;
    align-items: start;
}

.canvas-wrap,
.game-notes {
    border: 1px solid rgba(50, 185, 255, 0.22);
    border-radius: 24px;
    background: rgba(6, 12, 42, 0.68);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
}

.canvas-wrap {
    padding: 16px;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 18px;
    background: #090d2c;
    touch-action: none;
}

.touch-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.touch-btn {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(50, 185, 255, 0.5);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(20, 30, 98, 0.95), rgba(8, 14, 48, 0.98));
    color: var(--text);
    font: 700 0.8rem "Orbitron", sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.touch-btn:active {
    transform: translateY(1px) scale(0.99);
}

.game-notes {
    padding: 22px;
}

.game-notes p {
    margin: 0 0 12px;
}

@media (max-width: 1080px) {
    .game-stage {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .game-shell {
        width: min(100%, calc(100% - 20px));
        padding-top: 16px;
    }

    .game-topbar {
        flex-direction: column;
    }

    .canvas-wrap {
        padding: 10px;
    }

    .game-copy h1 {
        font-size: 1.4rem;
    }

    .game-copy p,
    .game-notes p {
        font-size: 0.95rem;
    }

    .touch-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .touch-btn {
        min-height: 48px;
        font-size: 0.72rem;
        padding: 10px;
    }
}
