:root {
    --oa-bg: #020b12;
    --oa-panel: #031923;
    --oa-panel-soft: rgba(3, 25, 35, .94);
    --oa-border: rgba(125, 211, 252, .21);
    --oa-text: #e0f2fe;
    --oa-muted: #94a3b8;
    --oa-cyan: #38bdf8;
    --oa-green: #34d399;
    --oa-orange: #fb923c;
    --oa-red: #fb7185;
    --oa-amber: #fbbf24;
    --oa-purple: #c084fc;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

body {
    min-height: 100vh;
    min-height: 100dvh;

    overflow-x: hidden;

    color: var(--oa-text);

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

    background:
        radial-gradient(
            circle at 50% -15%,
            rgba(56, 189, 248, .18),
            transparent 36rem
        ),
        linear-gradient(
            180deg,
            #073a50,
            var(--oa-panel) 46%,
            var(--oa-bg)
        );
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

.oa-shell {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;

    display: flex;
    flex-direction: column;
}

.oa-topbar {
    min-height: 66px;

    display: flex;
    align-items: center;
    gap: .6rem;

    padding:
        max(.7rem, env(safe-area-inset-top, 0px))
        clamp(.75rem, 3vw, 2rem)
        .7rem;

    border-bottom: 1px solid rgba(125, 211, 252, .11);

    background: rgba(2, 11, 18, .84);

    backdrop-filter: blur(18px);
}

.oa-brand {
    min-width: 0;

    display: inline-flex;
    align-items: center;
    gap: .7rem;

    color: inherit;

    text-decoration: none;
}

.oa-brand img {
    width: 40px;
    height: 40px;

    object-fit: contain;
}

.oa-brand span {
    min-width: 0;
    display: grid;
}

.oa-brand strong {
    font-size: .88rem;
}

.oa-brand small {
    color: var(--oa-muted);
    font-size: .68rem;
}

.oa-back {
    min-height: 40px;

    display: inline-flex;
    align-items: center;
    gap: .4rem;

    margin-left: auto;

    padding: .55rem .75rem;

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

    background: rgba(8, 47, 73, .58);

    color: inherit;

    font-size: .74rem;
    font-weight: 800;
    text-decoration: none;
}

.oa-icon-button {
    width: 40px;
    height: 40px;

    display: grid;
    place-items: center;

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

    background: rgba(8, 47, 73, .58);

    color: white;

    cursor: pointer;
}

.oa-main {
    width: 100%;

    flex: 1 1 auto;

    display: grid;
    place-items: center;

    padding: clamp(.5rem, 2vw, 1.2rem);
}

.oa-game-card {
    width: min(540px, 100%);

    overflow: hidden;

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

    background:
        linear-gradient(
            180deg,
            rgba(8, 47, 73, .9),
            rgba(3, 25, 35, .97)
        );

    box-shadow: 0 28px 80px rgba(0, 0, 0, .46);
}

.oa-hud {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));

    gap: 1px;

    background: rgba(125, 211, 252, .11);
}

.oa-hud > div {
    min-width: 0;
    min-height: 56px;

    display: grid;
    place-content: center;
    gap: .1rem;

    padding: .4rem;

    text-align: center;

    background: rgba(3, 25, 35, .98);
}

.oa-hud span,
.oa-results-grid span,
.oa-final-score span {
    color: var(--oa-muted);

    font-size: .54rem;
    font-weight: 900;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.oa-hud strong {
    overflow: hidden;

    font-size: .9rem;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.oa-canvas-wrap {
    position: relative;

    width: min(100%, 450px);

    aspect-ratio: 9 / 16;

    margin-inline: auto;

    overflow: hidden;

    touch-action: none;

    background:
        linear-gradient(
            180deg,
            #12617d,
            #07536b 46%,
            #04384a
        );
}

#oaCanvas {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    touch-action: none;
}

.oa-screen {
    position: absolute;
    inset: 0;
    z-index: 40;

    display: none;
    place-items: center;

    padding: .85rem;

    background: rgba(2, 11, 18, .78);

    backdrop-filter: blur(9px);
}

.oa-screen-active {
    display: grid;
}

.oa-screen-card {
    width: min(390px, 100%);
    max-height: calc(100% - .5rem);

    overflow-y: auto;

    padding: clamp(1rem, 4vw, 1.7rem);

    border: 1px solid rgba(125, 211, 252, .24);
    border-radius: 20px;

    background:
        linear-gradient(
            180deg,
            rgba(8, 47, 73, .98),
            rgba(3, 25, 35, .99)
        );

    text-align: center;

    box-shadow: 0 24px 65px rgba(0, 0, 0, .48);
}

.oa-screen-card-small {
    width: min(290px, 100%);
}

.oa-kicker {
    color: var(--oa-orange);

    font-size: .6rem;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.oa-screen-card h1,
.oa-screen-card h2 {
    margin: .55rem 0;
}

.oa-screen-card h1 {
    font-size: clamp(2rem, 9vw, 3.3rem);
}

.oa-screen-card h2 {
    font-size: 1.7rem;
}

.oa-screen-card p {
    margin: 0 auto 1rem;

    color: #cbd5e1;

    font-size: .78rem;
    line-height: 1.55;
}

.oa-controls-help {
    display: grid;
    gap: .35rem;

    margin: .8rem 0;
}

.oa-controls-help span {
    padding: .42rem;

    border: 1px solid rgba(125, 211, 252, .12);
    border-radius: 9px;

    background: rgba(2, 11, 18, .28);

    color: #cbd5e1;

    font-size: .66rem;
    font-weight: 700;
}

.oa-best {
    margin: .8rem 0;

    color: var(--oa-muted);

    font-size: .74rem;
}

.oa-best strong {
    color: var(--oa-text);
}

.oa-primary {
    min-height: 44px;

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

    padding: .65rem 1rem;

    border: 1px solid rgba(251, 146, 60, .45);
    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #f97316,
            #c2410c
        );

    color: white;

    font-weight: 900;

    cursor: pointer;
}

.oa-final-score {
    display: grid;
    gap: .1rem;

    margin: .8rem 0;

    padding: .7rem;

    border: 1px solid rgba(125, 211, 252, .13);
    border-radius: 12px;

    background: rgba(2, 11, 18, .3);
}

.oa-final-score strong {
    font-size: 1.65rem;
}

.oa-results-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: .45rem;

    margin-bottom: .8rem;
}

.oa-results-grid > div {
    display: grid;
    gap: .12rem;

    padding: .5rem;

    border: 1px solid rgba(125, 211, 252, .12);
    border-radius: 10px;

    background: rgba(2, 11, 18, .26);
}

.oa-banner {
    position: absolute;

    top: 92px;
    left: 50%;

    z-index: 25;

    min-width: 190px;

    display: grid;
    gap: .12rem;

    padding: .55rem .9rem;

    opacity: 0;

    border: 1px solid rgba(125, 211, 252, .22);
    border-radius: 13px;

    background: rgba(2, 24, 34, .88);

    text-align: center;

    transform:
        translate(-50%, -12px)
        scale(.94);

    transition:
        opacity 170ms ease,
        transform 170ms ease;

    pointer-events: none;

    backdrop-filter: blur(8px);
}

.oa-banner.oa-banner-show {
    opacity: 1;

    transform:
        translate(-50%, 0)
        scale(1);
}

.oa-banner span {
    color: var(--oa-cyan);

    font-size: .54rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.oa-banner strong {
    font-size: .88rem;
}

.oa-boss-ui {
    position: absolute;

    top: 8px;
    right: 10px;
    left: 10px;

    z-index: 20;

    padding: .45rem .55rem;

    border: 1px solid rgba(251, 113, 133, .3);
    border-radius: 11px;

    background: rgba(42, 8, 17, .76);

    backdrop-filter: blur(8px);
}

.oa-boss-ui > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: .6rem;

    margin-bottom: .28rem;

    font-size: .62rem;
}

.oa-boss-ui span {
    color: #fda4af;

    font-weight: 900;
    text-transform: uppercase;
}

.oa-boss-track {
    height: 7px;

    overflow: hidden;

    border-radius: 999px;

    background: rgba(255, 255, 255, .12);
}

.oa-boss-fill {
    width: 100%;
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            #fb7185,
            #f97316
        );
}

.oa-footer {
    min-height: 45px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;

    padding: .55rem .75rem;

    color: var(--oa-muted);

    font-size: .66rem;
}

.oa-badge {
    flex: 0 0 auto;

    padding: .25rem .45rem;

    border: 1px solid rgba(125, 211, 252, .14);
    border-radius: 999px;

    color: #bae6fd;

    font-weight: 800;
}

@media (max-width: 600px) {

    .oa-topbar {
        min-height: 56px;

        padding:
            max(.45rem, env(safe-area-inset-top, 0px))
            .55rem
            .45rem;
    }

    .oa-brand img {
        width: 34px;
        height: 34px;
    }

    .oa-brand small {
        display: none;
    }

    .oa-back {
        min-height: 36px;
        padding: .4rem .5rem;
    }

    .oa-back span:last-child {
        display: none;
    }

    .oa-icon-button {
        width: 36px;
        height: 36px;
    }

    .oa-main {
        display: block;

        padding: .3rem;
    }

    .oa-game-card {
        width: min(100%, 430px);

        margin-inline: auto;

        border-radius: 15px;
    }

    .oa-hud > div {
        min-height: 45px;

        padding: .25rem;
    }

    .oa-hud span {
        font-size: .47rem;
    }

    .oa-hud strong {
        font-size: .78rem;
    }

    .oa-canvas-wrap {
        width:
            min(
                100%,
                calc(
                    (
                        100dvh
                        - 56px
                        - 45px
                        - 43px
                        - 12px
                    )
                    * .5625
                )
            );

        max-width: 430px;
    }

    .oa-footer {
        min-height: 40px;

        padding:
            .45rem
            .55rem
            calc(
                .45rem
                + env(safe-area-inset-bottom, 0px)
            );
    }

    .oa-badge {
        display: none;
    }
}

/* ==========================================================================
   Oscar's Army final aquarium finish
   ========================================================================== */

.oa-canvas-wrap {
    box-shadow:
        inset 0 0 42px rgba(0, 0, 0, .32),
        inset 0 0 2px rgba(224, 242, 254, .48);
}

.oa-canvas-wrap::after {
    content: "";

    position: absolute;
    inset: 0;

    z-index: 8;

    pointer-events: none;

    background:
        linear-gradient(
            112deg,
            rgba(255,255,255,.055),
            transparent 24%,
            transparent 72%,
            rgba(186,230,253,.025)
        );

    box-shadow:
        inset 0 0 34px rgba(1, 8, 14, .22);
}

.oa-screen {
    z-index: 40;
}

.oa-banner {
    z-index: 25;
}

.oa-boss-ui {
    z-index: 20;
}
