@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Press+Start+2P&display=swap");

:root {
    --bg: #060815;
    --bg-deep: #02030a;
    --panel: rgba(10, 14, 28, 0.9);
    --panel-soft: rgba(18, 24, 46, 0.92);
    --line: #3cf6ff;
    --line-soft: rgba(60, 246, 255, 0.28);
    --accent: #ff4dcf;
    --accent-2: #ffe45c;
    --accent-3: #7dff78;
    --text: #f7fbff;
    --text-soft: #c7d8ff;
    --danger: #ff6a7c;
    --shadow: 0 0 0 2px rgba(60, 246, 255, 0.1), 0 0 36px rgba(60, 246, 255, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "IBM Plex Mono", monospace;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255, 77, 207, 0.16), transparent 28%),
        radial-gradient(circle at bottom right, rgba(60, 246, 255, 0.14), transparent 30%),
        linear-gradient(180deg, var(--bg) 0%, #081120 45%, var(--bg-deep) 100%);
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    background-image:
        linear-gradient(rgba(60, 246, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(60, 246, 255, 0.08) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.92));
}

body::after {
    background: repeating-linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.028) 0,
        rgba(255, 255, 255, 0.028) 1px,
        transparent 1px,
        transparent 5px
    );
    opacity: 0.22;
}

a {
    color: inherit;
}

.page {
    position: relative;
    z-index: 1;
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 36px;
}

.frame,
.panel,
.game-card,
.stat,
.control-button,
.button {
    border: 3px solid var(--line);
    box-shadow: var(--shadow);
    background: var(--panel);
}

.frame,
.panel,
.game-card,
.stat {
    position: relative;
}

.frame::after,
.panel::after,
.game-card::after,
.stat::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(255, 77, 207, 0.2);
    pointer-events: none;
}

.hero {
    padding: 30px;
    display: grid;
    gap: 24px;
    background:
        linear-gradient(135deg, rgba(255, 77, 207, 0.1), transparent 40%),
        linear-gradient(225deg, rgba(60, 246, 255, 0.12), transparent 36%),
        var(--panel);
}

.eyebrow,
.meta-label,
.hint-list strong {
    display: inline-block;
    margin: 0;
    color: var(--line);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(60, 246, 255, 0.35);
}

h1,
h2,
h3 {
    margin: 0;
    font-family: "Press Start 2P", monospace;
    line-height: 1.35;
}

h1 {
    color: var(--accent-2);
    font-size: clamp(1.8rem, 5vw, 3.6rem);
    text-shadow:
        0 0 18px rgba(255, 228, 92, 0.18),
        4px 4px 0 rgba(255, 77, 207, 0.2);
}

h2 {
    color: var(--accent-2);
    font-size: clamp(1.05rem, 2.3vw, 1.8rem);
}

h3 {
    color: var(--line);
    font-size: clamp(0.9rem, 1.6vw, 1.15rem);
}

p {
    margin: 0;
    line-height: 1.7;
    color: var(--text-soft);
}

.lead {
    max-width: 62ch;
    font-size: 1.02rem;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 18px;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.83rem;
    box-shadow: 5px 5px 0 rgba(255, 77, 207, 0.18);
}

.button-primary {
    background: var(--accent-2);
    color: #111423;
    border-color: var(--accent-2);
}

.button-secondary {
    background: rgba(60, 246, 255, 0.1);
    color: var(--text);
}

.section {
    margin-top: 26px;
}

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

.game-card {
    overflow: hidden;
    text-decoration: none;
    padding: 22px;
    min-height: 280px;
    display: grid;
    gap: 16px;
    align-content: space-between;
    background:
        radial-gradient(circle at top left, rgba(255, 77, 207, 0.14), transparent 34%),
        radial-gradient(circle at bottom right, rgba(60, 246, 255, 0.12), transparent 28%),
        var(--panel-soft);
}

.game-card:hover,
.game-card:focus-visible,
.button:hover,
.button:focus-visible,
.control-button:hover,
.control-button:focus-visible {
    transform: translate(-2px, -2px);
    box-shadow: 9px 9px 0 rgba(255, 77, 207, 0.2);
}

.game-card p {
    max-width: 32ch;
}

.marquee {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    padding: 10px 14px;
    border: 2px solid var(--accent);
    background: rgba(255, 77, 207, 0.1);
    color: #ffd7f5;
    font-size: 0.86rem;
    text-transform: uppercase;
}

.badge {
    width: 12px;
    height: 12px;
    background: var(--accent-3);
    box-shadow: 0 0 12px rgba(125, 255, 120, 0.72);
}

.game-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
    gap: 22px;
    margin-top: 26px;
}

.stage-wrap {
    padding: 20px;
}

.stage-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.stage-title p {
    font-size: 0.9rem;
}

.canvas-shell {
    padding: 18px;
    background: rgba(2, 5, 12, 0.92);
    border: 2px solid rgba(60, 246, 255, 0.24);
}

.game-canvas {
    display: block;
    width: min(100%, 440px);
    margin: 0 auto;
    background: #020309;
    image-rendering: pixelated;
    border: 2px solid rgba(255, 77, 207, 0.28);
}

.sidebar {
    display: grid;
    gap: 14px;
}

.panel {
    padding: 20px;
}

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

.stat {
    padding: 16px;
    text-align: center;
    background: rgba(17, 24, 42, 0.92);
}

.stat-value {
    display: block;
    color: var(--accent-2);
    font-family: "Press Start 2P", monospace;
    font-size: 1rem;
}

.stat-label {
    display: block;
    margin-top: 10px;
    color: var(--text-soft);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.status {
    color: var(--accent-3);
    min-height: 1.7em;
}

.hint-list {
    display: grid;
    gap: 10px;
    padding-left: 18px;
    color: var(--text-soft);
}

.touch-controls {
    display: grid;
    gap: 12px;
}

.control-row {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.control-button {
    min-width: 72px;
    min-height: 56px;
    padding: 0 16px;
    font-family: "Press Start 2P", monospace;
    font-size: 0.72rem;
    color: var(--text);
    background: rgba(255, 77, 207, 0.1);
}

.control-button-wide {
    min-width: 128px;
}

.footer-note {
    margin-top: 14px;
    font-size: 0.82rem;
    color: #9db4e3;
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill {
    padding: 9px 12px;
    border: 2px solid rgba(60, 246, 255, 0.28);
    background: rgba(60, 246, 255, 0.08);
    color: var(--text);
    font-size: 0.82rem;
    text-transform: uppercase;
}

@media (max-width: 980px) {
    .game-grid,
    .game-shell {
        grid-template-columns: 1fr;
    }

    .hero,
    .stage-wrap,
    .panel {
        padding: 22px;
    }
}

@media (max-width: 720px) {
    .page {
        width: min(100% - 24px, 1200px);
        padding-top: 18px;
    }

    h1 {
        font-size: 1.9rem;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
    }

    .game-canvas {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .control-button {
        min-width: 64px;
        min-height: 52px;
        font-size: 0.65rem;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .game-card {
        min-height: 240px;
    }
}
