:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #91d8ff;
    color: #102033;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    touch-action: none;
}

button {
    border: 0;
    font: inherit;
}

.game-shell {
    position: fixed;
    inset: 0;
    background: #91d8ff;
}

#game {
    display: block;
    width: 100vw;
    height: 100vh;
}

.hud {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    left: 50%;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(3, minmax(70px, 1fr));
    gap: 8px;
    width: min(440px, calc(100vw - 24px));
    transform: translateX(-50%);
    pointer-events: none;
}

.hud div {
    min-height: 58px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 28px rgba(31, 91, 131, 0.14);
    backdrop-filter: blur(14px);
}

.hud-label {
    display: block;
    color: #3c637a;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hud strong {
    display: block;
    margin-top: 1px;
    color: #122b41;
    font-size: clamp(1.05rem, 4.8vw, 1.55rem);
    line-height: 1;
}

.sound-toggle {
    position: fixed;
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 8;
    width: 72px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    color: #163047;
    box-shadow: 0 10px 26px rgba(20, 64, 96, 0.14);
    font-size: 0.82rem;
    font-weight: 800;
}

.start-panel {
    position: fixed;
    left: 50%;
    bottom: max(26px, env(safe-area-inset-bottom));
    z-index: 7;
    width: min(460px, calc(100vw - 28px));
    padding: 18px;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 22px 56px rgba(14, 55, 83, 0.2);
    backdrop-filter: blur(18px);
}

.start-panel.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 18px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.eyebrow {
    margin: 0 0 4px;
    color: #2f6b80;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    color: #102033;
    font-size: clamp(2.4rem, 12vw, 4.7rem);
    line-height: 0.9;
}

.start-panel p:not(.eyebrow) {
    margin: 12px 0 16px;
    color: #314b5d;
    font-size: 0.98rem;
    line-height: 1.45;
}

.start-panel button {
    width: 100%;
    min-height: 48px;
    border-radius: 8px;
    background: #ffcf4f;
    color: #25210d;
    box-shadow: inset 0 -3px 0 rgba(68, 49, 0, 0.18);
    font-weight: 900;
}

.toast {
    position: fixed;
    left: 50%;
    top: calc(max(14px, env(safe-area-inset-top)) + 76px);
    z-index: 6;
    min-width: 120px;
    padding: 8px 12px;
    transform: translate(-50%, -8px);
    border-radius: 8px;
    background: rgba(15, 42, 61, 0.78);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 800;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 520px) {
    .hud {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hud div {
        min-height: 52px;
        padding: 7px 8px;
    }
}
