/* UFO Shooter — casual shell; play area uses native 750×440 aspect (no empty bands) */

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

.us-root {
    --us-accent: var(--ga-accent-game, #38bdf8);
    width: 100%;
    box-sizing: border-box;
}

/* Do not stretch with tall flex ancestors (e.g. Game Worlds lg:items-stretch). */
.game-worlds-play-shell #us-app.us-root {
    flex: 0 0 auto;
    width: 100%;
    min-height: 0;
    height: fit-content;
}

.us-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.us-gamebox,
.game-worlds-body .game-worlds-play-shell .us-gamebox#gamebox {
    flex: 0 1 auto;
    align-self: stretch;
    min-height: 0;
}

.us-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);
}

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

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

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

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

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

.us-stat__value--muted {
    color: #cbd5e1;
}

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

/* Native 750×440 frame — box height matches canvas “contain” fit (no letterboxing vs fixed 5/7). */
.us-gamebox#gamebox,
#gamebox.us-gamebox {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 750 / 440;
    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%);
}

#gameCanvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    background: linear-gradient(180deg, #0c1220 0%, #0a0f18 100%);
    border-radius: 10px;
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.85),
        0 18px 40px rgba(0, 0, 0, 0.35);
    touch-action: none;
}

::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.us-overlay {
    position: absolute;
    inset: 0;
    z-index: 7;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--ga-screen-pad-x, 24px);
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
    font-family: 'DM Sans', system-ui, sans-serif;
}

.us-overlay:not([hidden]) {
    display: flex;
}

.us-overlay__panel {
    pointer-events: auto;
    width: min(100%, 340px);
    margin-top: 2rem;
    padding: 28px 24px 24px;
    border-radius: var(--ga-radius-lg, 16px);
    border: 1px solid rgba(56, 189, 248, 0.28);
    background: rgba(15, 23, 42, 0.82);
    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;
}

.us-overlay__title {
    margin: 0 0 8px;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--ga-text, #f1f5f9);
    letter-spacing: -0.02em;
}

.us-overlay__hint {
    margin: 0 0 8px;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--ga-muted, #94a3b8);
}

.us-overlay__sub {
    margin: 0 0 22px;
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #e2e8f0;
}

.us-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
    padding: 12px 20px;
    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 var(--ga-time-fast, 0.22s) var(--ga-ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
        box-shadow var(--ga-time-fast, 0.22s) var(--ga-ease-out, cubic-bezier(0.22, 1, 0.36, 1));
}

.us-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);
}

.us-btn:focus-visible {
    outline: 2px solid var(--us-accent);
    outline-offset: 3px;
}

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

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