:root {
    --bg-top: #d9eeff;
    --bg-bottom: #091521;
    --panel: rgba(7, 17, 28, 0.72);
    --panel-border: rgba(255, 255, 255, 0.14);
    --text: #eff9ff;
    --muted: rgba(239, 249, 255, 0.72);
    --accent: #ffb454;
    --accent-strong: #ff6a3d;
    --shadow: 0 30px 80px rgba(3, 10, 16, 0.34);
}

* {
    box-sizing: border-box;
}

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

body {
    overflow: hidden;
    font-family: "Syne", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.68), transparent 22%),
        radial-gradient(circle at 82% 16%, rgba(255, 180, 84, 0.34), transparent 18%),
        linear-gradient(180deg, var(--bg-top) 0%, #85b9dc 22%, #26435c 50%, var(--bg-bottom) 100%);
}

button {
    font: inherit;
}

.app-shell {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.ambient {
    position: fixed;
    border-radius: 50%;
    opacity: 0.52;
    filter: blur(72px);
    pointer-events: none;
}

.ambient-one {
    top: -10vw;
    left: -8vw;
    width: 24vw;
    height: 24vw;
    background: rgba(118, 211, 255, 0.34);
}

.ambient-two {
    right: -10vw;
    bottom: -14vw;
    width: 28vw;
    height: 28vw;
    background: rgba(255, 122, 61, 0.26);
}

.hud,
.screen-card {
    border: 1px solid var(--panel-border);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.hud {
    position: absolute;
    z-index: 4;
    border-radius: 24px;
}

.hud-top-left {
    top: 18px;
    left: 18px;
    width: min(360px, calc(100vw - 36px));
    padding: 18px;
}

.hud-top-right {
    top: 18px;
    right: 18px;
    width: min(360px, calc(100vw - 36px));
    padding: 18px;
}

.hud-bottom {
    left: 18px;
    right: 18px;
    bottom: 18px;
    display: grid;
    grid-template-columns: 180px 180px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
}

.eyebrow,
.label,
.control-list,
.status-pill {
    font-family: "IBM Plex Mono", monospace;
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 0.74rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

h1,
h2,
p,
strong,
ul {
    margin: 0;
}

h1 {
    font-size: clamp(2.6rem, 7vw, 5.6rem);
}

h2 {
    font-size: clamp(2rem, 5vw, 3.8rem);
}

.health-block {
    margin-top: 8px;
}

.health-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.health-bar-shell {
    margin-top: 10px;
    height: 16px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.health-bar-fill {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff6a3d 0%, #ffba58 100%);
    transition: width 120ms ease;
}

.hud-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.hud-grid div,
.status-pill {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
}

.control-list {
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.5;
    font-size: 0.82rem;
}

.wide {
    min-width: 0;
}

.screen {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: grid;
    place-items: center;
    padding: 20px;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.screen[hidden] {
    display: none;
}

.screen-card {
    width: min(620px, 100%);
    border-radius: 34px;
    padding: 30px;
}

.screen-card p + p,
.screen-card h1 + p,
.screen-card h2 + p {
    margin-top: 14px;
}

.screen-card p {
    color: var(--muted);
    line-height: 1.6;
}

.splash-card,
.death-card,
.menu-card {
    text-align: center;
}

.primary-button {
    margin-top: 24px;
    border: 0;
    border-radius: 999px;
    padding: 15px 22px;
    cursor: pointer;
    font-weight: 800;
    color: #08131b;
    background: linear-gradient(135deg, #ffe083 0%, var(--accent) 54%, var(--accent-strong) 100%);
    box-shadow: 0 18px 44px rgba(255, 106, 61, 0.32);
}

@media (max-width: 980px) {
    .hud-top-left,
    .hud-top-right,
    .hud-bottom {
        width: calc(100vw - 24px);
        left: 12px;
        right: 12px;
    }

    .hud-top-left {
        top: 12px;
    }

    .hud-top-right {
        top: auto;
        bottom: 112px;
    }

    .hud-bottom {
        bottom: 12px;
        grid-template-columns: 1fr;
    }

    .hud-grid {
        grid-template-columns: 1fr;
    }
}