:root {
    --blue-1: #063b5b;
    --blue-2: #0b7dbd;
    --blue-3: #77d7ff;
    --sand: #fff2b8;
    --orange: #ff9f1c;
    --pink: #ff5ca8;
    --green: #8de34e;
    --dark: #062436;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(180deg, #7ee2ff 0%, #0b7dbd 55%, #063b5b 100%);
    font-family: Arial, Helvetica, sans-serif;
    touch-action: none;
    user-select: none;
}

.game-shell {
    position: fixed;
    inset: 0;
    overflow: hidden;
}

#gameCanvas {
    display: block;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 30% 18%, rgba(255,255,255,.45), transparent 18%),
                linear-gradient(180deg, #7ee2ff 0%, #0b7dbd 62%, #074568 100%);
}

.hud {
    position: fixed;
    top: env(safe-area-inset-top, 0);
    left: 0;
    right: 0;
    z-index: 10;
    padding: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.hud-card,
.hud-button {
    border: 4px solid rgba(255,255,255,.88);
    background: rgba(255,255,255,.88);
    color: var(--dark);
    border-radius: 22px;
    box-shadow: 0 10px 28px rgba(0,0,0,.18);
}

.hud-card {
    min-width: 96px;
    padding: 8px 14px;
    text-align: center;
}

.hud-label {
    display: block;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    color: #277193;
}

.hud-card strong {
    display: block;
    font-size: 30px;
    line-height: 1;
}

.hud-button {
    pointer-events: auto;
    padding: 13px 18px;
    font-weight: 900;
    font-size: 16px;
    cursor: pointer;
}

.touch-zones {
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.touch-button {
    position: absolute;
    bottom: calc(18px + env(safe-area-inset-bottom, 0));
    width: min(37vw, 180px);
    height: 96px;
    border: 4px solid rgba(255,255,255,.75);
    border-radius: 28px;
    background: rgba(255,255,255,.22);
    color: white;
    text-shadow: 0 3px 8px rgba(0,0,0,.35);
    box-shadow: 0 12px 28px rgba(0,0,0,.18);
    display: grid;
    place-items: center;
    pointer-events: auto;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.touch-button span {
    font-size: 38px;
    line-height: 1;
}

.touch-button small {
    display: block;
    margin-top: -14px;
    font-size: 14px;
    font-weight: 900;
}

.touch-left {
    left: 16px;
}

.touch-right {
    right: 16px;
}

.touch-button:active {
    transform: scale(.96);
    background: rgba(255,255,255,.38);
}

.start-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(3, 35, 57, .55);
    backdrop-filter: blur(8px);
}

.start-overlay.hidden {
    display: none;
}

.start-card {
    width: min(92vw, 460px);
    padding: 28px 24px;
    border-radius: 34px;
    background: white;
    color: var(--dark);
    text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,.30);
    border: 6px solid #a9ecff;
}

.start-emoji {
    font-size: 64px;
}

.start-card h1 {
    margin: 10px 0 8px;
    font-size: clamp(28px, 8vw, 42px);
    line-height: 1;
    color: #0b6ea8;
}

.start-card p {
    margin: 0 0 18px;
    font-size: 18px;
    font-weight: 700;
    color: #366175;
}

.start-card button {
    width: 100%;
    border: 0;
    border-radius: 22px;
    padding: 17px 20px;
    background: linear-gradient(135deg, #ff9f1c, #ff5ca8);
    color: white;
    font-size: 22px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(255, 92, 168, .35);
}

@media (max-width: 520px) {
    .hud {
        justify-content: space-between;
    }

    .hud-card {
        min-width: 76px;
        padding: 7px 10px;
    }

    .hud-card strong {
        font-size: 24px;
    }

    .hud-button {
        padding: 10px 12px;
        font-size: 14px;
    }

    .touch-button {
        height: 84px;
        width: 42vw;
    }
}
