*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0d1117;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', system-ui, sans-serif;
    overflow: hidden;
    touch-action: none;
}

#game-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.06),
        0 0 60px rgba(30,120,255,0.2),
        0 20px 60px rgba(0,0,0,0.6);
    /* Масштабирование под ширину экрана на мобильных */
    width: min(800px, 100vw);
}

canvas {
    display: block;
    width: 100%;
    height: auto;
}

/* ── Виртуальные кнопки (мобильные) ─────── */
.vbtn {
    position: absolute;
    bottom: 18px;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    border: 2.5px solid rgba(255,255,255,0.25);
    background: rgba(20, 30, 60, 0.55);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.08s, transform 0.08s, border-color 0.08s;
    z-index: 20;
    /* тень чтобы выделялась на фоне игры */
    box-shadow: 0 2px 16px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.1);
}

#vbtn-jump {
    left: 18px;
    background: rgba(30, 80, 180, 0.55);
    border-color: rgba(100,160,255,0.4);
    font-size: 34px;
}

#vbtn-shoot {
    right: 18px;
    background: rgba(160, 40, 40, 0.55);
    border-color: rgba(255,120,100,0.4);
    font-size: 22px;
    letter-spacing: -1px;
}

/* Состояние нажатия */
.vbtn.pressed,
.vbtn:active {
    transform: scale(0.88);
    background: rgba(255,255,255,0.22) !important;
    border-color: rgba(255,255,255,0.55) !important;
}

/* На широких экранах (ПК) — делаем кнопки чуть прозрачнее,
   чтобы не мешали клавиатурным игрокам */
@media (hover: hover) and (pointer: fine) {
    .vbtn { opacity: 0.45; }
    .vbtn:hover { opacity: 0.8; }
}

/* ── Overlay ─────────────────────────────── */
#overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: rgba(4, 8, 24, 0.80);
    backdrop-filter: blur(6px);
}

#overlay.hidden { display: none; }

#overlay-title {
    font-size: 3.4rem;
    font-weight: 900;
    letter-spacing: 3px;
    color: #FFDD00;
    text-shadow:
        0 0 40px rgba(255,220,0,0.55),
        0 3px 0 rgba(0,0,0,0.6);
}

#overlay-sub {
    font-size: 1.1rem;
    color: #90AECC;
    letter-spacing: 0.4px;
}

.controls {
    display: flex;
    gap: 24px;
}

.key-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #6888A8;
}

kbd {
    padding: 3px 10px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    border-bottom-width: 3px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #BCD;
    font-family: inherit;
}

#btn-start {
    margin-top: 8px;
    padding: 13px 52px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #1a0f00;
    background: linear-gradient(135deg, #FFD700 0%, #FF9900 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(255,190,0,0.4);
    transition: transform 0.12s, box-shadow 0.12s;
    user-select: none;
}

#btn-start:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 32px rgba(255,190,0,0.55);
}

#btn-start:active {
    transform: scale(0.97);
}
