/**
 * Game Worlds — shared shell for snake games (Sky Shooter play height, in-gamebox HUD).
 *
 * Embeds use .gw-snake-embed on .game-worlds-play-shell: no shell/playfield inset.
 */

@media screen and (max-height: 640px) {
    .container.container-single {
        padding-top: 3px !important;
    }
}

.gw-snake-scope {
    width: 100%;
    box-sizing: border-box;
}

.game-worlds-play-shell #gw-snake-app.gw-snake-scope {
    flex: 0 0 auto;
    width: 100%;
    min-height: 0;
    height: fit-content;
}

.gw-snake-frame {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: fit-content;
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    border: none;
    border-radius: 0;
    background: var(--ga-bg-mid, #111b2d);
    overflow: hidden;
}

.game-worlds-body .game-worlds-play-shell #gamebox.gw-snake-gamebox,
.game-worlds-body .game-worlds-play-shell .gw-snake-gamebox#gamebox {
    flex: 0 1 auto;
    align-self: stretch;
    min-height: 0;
}

.gw-snake-toolbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    padding: 5px 12px;
    min-height: 2.5rem;
    box-sizing: border-box;
    font-family: 'DM Sans', system-ui, sans-serif;
    background: var(--ga-surface, rgba(15, 23, 42, 0.78));
    border-bottom: 1px solid rgba(56, 189, 248, 0.12);
}

.gw-snake-stat {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35em 0.5em;
    min-width: 0;
}

.gw-snake-stat--center {
    justify-content: center;
    text-align: center;
}

.gw-snake-stat--end {
    justify-content: flex-end;
    text-align: right;
}

.gw-snake-stat__label {
    font-size: 65%;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ga-muted, #94a3b8);
    white-space: nowrap;
}

.gw-snake-stat__value {
    font-size: 1.05rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ga-text, #f1f5f9);
    line-height: 1.1;
}

.gw-snake-stat__value--muted {
    color: #cbd5e1;
}

.game-worlds-play-shell.gw-snake-embed {
    padding: 0;
    margin-left: 0;
    margin-right: 0;
}

.game-worlds-play-shell.gw-snake-embed #gw-snake-app.gw-snake-scope {
    margin: 0;
    padding: 0;
}

.gw-snake-playfield {
    position: relative;
    flex: 0 0 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    background: var(--ga-bg-abyss, #070b14);
}

/* Same visible play height as sky-shooter.css #gamebox */
.gw-snake-gamebox#gamebox,
#gamebox.gw-snake-gamebox {
    position: relative;
    width: 100%;
    height: calc(768px * 5 / 7);
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: linear-gradient(180deg, #0c1220 0%, #0a0f18 100%);
}

.gw-snake-scale-root {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

/* Score / best overlay inside #gamebox (replaces top toolbar) */
.gw-snake-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 6;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px 16px;
    padding: 8px 12px 12px;
    pointer-events: none;
    box-sizing: border-box;
    font-family: 'DM Sans', system-ui, sans-serif;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0) 100%);
}

.gw-snake-hud__group {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35em 0.5em;
    min-width: 0;
}

.gw-snake-hud__group--end {
    justify-content: flex-end;
    text-align: right;
    margin-left: auto;
}

.gw-snake-hud .gw-snake-stat__label {
    font-size: 62%;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ga-muted, #94a3b8);
    white-space: nowrap;
}

.gw-snake-hud .gw-snake-stat__value {
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ga-text, #f1f5f9);
    line-height: 1.1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.gw-snake-hud .gw-snake-stat__value--muted {
    color: #e2e8f0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

/* Game over / pause panels (shared) */
.gw-snake-panel {
    pointer-events: auto;
    width: min(100%, 320px);
    margin-top: 0;
    padding: 24px 22px 22px;
    border-radius: var(--ga-radius-lg, 16px);
    border: 1px solid rgba(56, 189, 248, 0.28);
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow:
        0 20px 48px rgba(2, 6, 23, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    text-align: center;
    font-family: 'DM Sans', system-ui, sans-serif;
}

.gw-snake-panel__title {
    margin: 0 0 10px;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ga-text, #f1f5f9);
}

.gw-snake-panel__hint {
    margin: 0 0 18px;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--ga-muted, #94a3b8);
}

.gw-snake-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
    padding: 11px 18px;
    border: none;
    border-radius: var(--ga-radius-md, 12px);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #0f172a;
    cursor: pointer;
    background: linear-gradient(135deg, #7dd3fc 0%, #38bdf8 45%, #0ea5e9 100%);
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition:
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.gw-snake-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(14, 165, 233, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.gw-snake-btn:focus-visible {
    outline: 2px solid var(--ga-sky, #38bdf8);
    outline-offset: 3px;
}

.gw-snake-toolbar--single {
    justify-content: center;
}

.gw-snake-stat--solo {
    justify-content: center;
    text-align: center;
}

@media (max-width: 480px) {
    .gw-snake-toolbar {
        flex-wrap: wrap;
        row-gap: 8px;
    }

    .gw-snake-stat--center {
        order: 3;
        flex: 1 1 100%;
        justify-content: space-between;
    }
}
