
* {
    box-sizing: border-box;
}

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

body {
    overflow: hidden;
    background: #101419;
    color: #f5f7fb;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
    border: 0;
    border-radius: 8px;
    color: #101419;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.game-shell {
    position: relative;
    width: 100vw;
    height: 100vh;
    min-height: 480px;
    background:
        radial-gradient(circle at 28% 24%, rgba(105, 180, 176, 0.12), transparent 28%),
        linear-gradient(135deg, #14191f 0%, #171318 46%, #0f1518 100%);
}

#game {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.hud {
    position: absolute;
    top: 18px;
    left: 50%;
    display: flex;
    width: min(760px, calc(100vw - 28px));
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(17, 20, 25, 0.76);
    backdrop-filter: blur(12px);
}

.hud-group {
    display: grid;
    min-width: 96px;
    gap: 2px;
    padding: 6px 10px;
}

.hud-group span {
    color: rgba(245, 247, 251, 0.66);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hud-group strong {
    color: #ffffff;
    font-size: 1.08rem;
    line-height: 1;
}

#pause,
#restart,
#start {
    min-height: 38px;
    padding: 0 16px;
    background: #f3c84b;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

#pause:hover,
#restart:hover,
#start:hover {
    background: #ffd95d;
}

.overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 18px;
    padding: 24px;
    background: rgba(11, 13, 16, 0.64);
    text-align: center;
}

.overlay.hidden {
    display: none;
}

.overlay h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(2.3rem, 7vw, 6rem);
    letter-spacing: 0;
    line-height: 0.95;
    text-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.overlay #start {
    justify-self: center;
    min-width: 148px;
}

.upgrade-panel {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 18px;
    padding: 24px;
    background: rgba(11, 13, 16, 0.72);
}

.upgrade-panel.hidden {
    display: none;
}

.upgrade-panel h2 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    letter-spacing: 0;
    text-align: center;
}

.upgrade-options {
    display: grid;
    width: min(860px, calc(100vw - 32px));
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.upgrade-card {
    min-height: 168px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(244, 247, 251, 0.95);
    color: #111820;
    text-align: left;
}

.upgrade-card:hover {
    transform: translateY(-2px);
    background: #ffffff;
}

.upgrade-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.08rem;
    line-height: 1.15;
}

.upgrade-card span {
    display: block;
    color: #42505c;
    font-size: 0.94rem;
    font-weight: 650;
    line-height: 1.4;
}

@media (max-width: 620px) {
    .game-shell {
        min-height: 100vh;
    }

    .hud {
        top: 10px;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .hud-group {
        min-width: 72px;
        padding-inline: 6px;
    }

    #pause,
    #restart {
        flex: 1 1 100%;
    }

    .upgrade-options {
        grid-template-columns: 1fr;
    }

    .upgrade-card {
        min-height: 112px;
    }
}
