/* ==========================================================================
   Snake — desktop backdrop & framing
   Wraps the engine's fixed portrait screen in a themed arcade-style stage.
   Does not touch game logic — only page-level presentation.
   ========================================================================== */

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0c08;
}

body {
    /* Layered backdrop: faint pixel grid (echoes the in-game grid)
       over a deep radial glow that lifts the centred screen. */
    background-color: #0a0c08;
    background-image:
        repeating-linear-gradient(0deg,   rgba(168, 200, 42, 0.035) 0 1px, transparent 1px 40px),
        repeating-linear-gradient(90deg,  rgba(168, 200, 42, 0.035) 0 1px, transparent 1px 40px),
        radial-gradient(ellipse 70% 80% at 50% 45%, #20290f 0%, #12160c 45%, #070805 100%);
    background-attachment: fixed;
}

/* Soft ambient vignette so the bright screen reads as the focal point. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(ellipse 55% 70% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* The actual game screen — engine sets position/size inline; we add the
   frame. box-shadow + border-radius only, so layout/centering is untouched. */
#game_container {
    border-radius: 14px;
    box-shadow:
        0 0 0 1px rgba(168, 200, 42, 0.35),          /* crisp edge line   */
        0 0 0 6px rgba(10, 12, 8, 0.9),              /* dark bezel        */
        0 0 0 7px rgba(168, 200, 42, 0.12),          /* outer rim         */
        0 28px 80px rgba(0, 0, 0, 0.7),              /* depth / lift      */
        0 0 90px rgba(140, 190, 50, 0.22);           /* green ambient glow*/
    z-index: 2 !important;
}

/* The engine's canvases sit inside the rounded container — clip them. */
#game_container canvas {
    border-radius: 13px;
}

/* Stray 300x154 background canvas the framework parks in the top-left.
   It's empty and would show as a black box on the themed backdrop. */
#viewport {
    display: none !important;
}

/* Decorative wordmark flanking the screen on wide displays only. */
body::after {
    content: "SNAKE";
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    font-family: "Courier New", monospace;
    font-weight: 700;
    letter-spacing: 0.3em;
    font-size: clamp(60px, 14vw, 220px);
    color: rgba(168, 200, 42, 0.04);
    pointer-events: none;
    white-space: nowrap;
}

/* On narrow screens (mobile / tall windows) drop the frame back to
   edge-to-edge so it still feels native. */
@media (max-aspect-ratio: 3/4) {
    #game_container {
        border-radius: 0;
        box-shadow: none;
    }
    #game_container canvas { border-radius: 0; }
    body::after { display: none; }
    body { background-image: none; background-color: #000; }
}
