:root {
    --bg: #090b0f;
    --panel: #10141a;
    --panel-light: #171c24;
    --border: #252c36;

    --text: #f1f5f9;
    --muted: #8993a3;

    --accent: #70e000;
    --accent-dark: #4cae00;

    --danger: #ff595e;

    --radius: 18px;
}


* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


html {
    min-height: 100%;
    background: var(--bg);
}


body {
    min-height: 100vh;

    background:
        radial-gradient(
            circle at 50% -20%,
            rgba(112, 224, 0, 0.08),
            transparent 45%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    overflow-x: hidden;
}


button {
    font: inherit;
}


.page {
    width: min(1100px, 100%);
    margin: 0 auto;

    padding:
        max(24px, env(safe-area-inset-top))
        24px
        max(40px, env(safe-area-inset-bottom));
}


/* HEADER */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 20px 0 24px;
}


.brand {
    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.14em;
}


.brand-icon {
    font-size: 26px;
}


.stats {
    display: flex;
    gap: 28px;
}


.stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}


.stat-label {
    color: var(--muted);

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
}


.stat-value {
    margin-top: 2px;

    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}


/* GAME */

.game-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}


.game-wrapper {
    position: relative;

    width: min(760px, 100%);
    aspect-ratio: 1 / 1;

    background: #050706;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    overflow: hidden;

    box-shadow:
        0 20px 80px rgba(0, 0, 0, 0.35),
        inset 0 0 60px rgba(112, 224, 0, 0.025);

    touch-action: none;
}


#game {
    display: block;

    width: 100%;
    height: 100%;

    touch-action: none;
}


/* OVERLAY */

.overlay {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px;

    background:
        radial-gradient(
            circle,
            rgba(9, 11, 15, 0.72),
            rgba(9, 11, 15, 0.94)
        );

    backdrop-filter: blur(4px);

    transition:
        opacity 180ms ease,
        visibility 180ms ease;
}


.overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}


.overlay-content {
    text-align: center;
}


.snake-emoji {
    margin-bottom: 16px;

    font-size: 64px;

    filter:
        drop-shadow(
            0 0 20px rgba(112, 224, 0, 0.25)
        );
}


.overlay h1 {
    font-size: clamp(38px, 8vw, 68px);
    line-height: 1;

    letter-spacing: 0.08em;
}


.overlay p {
    margin-top: 18px;

    color: var(--muted);

    line-height: 1.6;
}


.primary-button {
    margin-top: 28px;

    min-width: 150px;
    padding: 13px 24px;

    border: 0;
    border-radius: 10px;

    background: var(--accent);
    color: #071000;

    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.08em;

    cursor: pointer;

    transition:
        transform 120ms ease,
        background 120ms ease;
}


.primary-button:hover {
    background: #82f51a;
    transform: translateY(-1px);
}


.primary-button:active {
    transform: translateY(1px);
}


.keyboard-hint {
    margin-top: 18px !important;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.18em;
}


/* MOBILE CONTROLS */

.mobile-controls {
    display: none;

    flex-direction: column;
    align-items: center;

    margin-top: 18px;

    gap: 8px;

    user-select: none;
}


.control-row {
    display: flex;
    gap: 8px;
}


.control-button {
    width: 58px;
    height: 48px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--panel);
    color: var(--text);

    font-size: 18px;

    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}


.control-button:active {
    background: var(--accent);
    color: #071000;

    transform: scale(0.95);
}


.controls-hint {
    margin-top: 14px;

    color: var(--muted);

    font-size: 12px;
}


/* VIDEO */

.video-section {
    width: min(760px, 100%);

    margin: 90px auto 0;
}


.section-heading {
    margin-bottom: 18px;
}


.section-kicker {
    color: var(--accent);

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 0.18em;
}


.section-heading h2 {
    margin-top: 7px;

    font-size: 26px;
}


.video-card {
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--panel);
}


.video-card video {
    display: block;

    width: 100%;
    aspect-ratio: 16 / 9;

    background: #000;
}


.video-caption {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 14px 16px;

    color: var(--muted);

    font-size: 13px;
}


/* FOOTER */

.footer {
    display: flex;
    justify-content: center;
    gap: 9px;

    margin-top: 70px;

    color: #505967;

    font-size: 11px;
}


/* MOBILE */

@media (max-width: 700px) {

    .page {
        padding-left: 12px;
        padding-right: 12px;
    }


    .header {
        padding-top: 12px;
        padding-bottom: 14px;
    }


    .brand {
        font-size: 16px;
    }


    .brand-icon {
        font-size: 22px;
    }


    .stats {
        gap: 18px;
    }


    .stat-value {
        font-size: 17px;
    }


    .game-wrapper {
        width: 100%;

        border-radius: 14px;
    }


    .mobile-controls {
        display: flex;
    }


    .controls-hint {
        display: none;
    }


    .video-section {
        margin-top: 55px;
    }


    .section-heading h2 {
        font-size: 21px;
    }


    .footer {
        margin-top: 45px;
    }

}


/* SMALL PHONES */

@media (max-height: 700px) and (max-width: 700px) {

    .header {
        padding-top: 6px;
        padding-bottom: 8px;
    }


    .mobile-controls {
        margin-top: 8px;
    }


    .control-button {
        width: 48px;
        height: 40px;
    }

}
