#spaceship-game-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 99999;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

#spaceship-game-btn {
    pointer-events: all;
    margin: 8px auto;
    padding: 10px 28px;
    background: linear-gradient(135deg, #0a0a2e, #1a1a6e);
    color: #00eaff;
    border: 2px solid #00eaff;
    border-radius: 30px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    letter-spacing: 1px;
    box-shadow: 0 0 18px #00eaff88, 0 2px 8px #0008;
    transition: box-shadow 0.2s, transform 0.1s;
    font-family: 'Segoe UI', Arial, sans-serif;
}

#spaceship-game-btn:hover {
    box-shadow: 0 0 32px #00eaffcc, 0 2px 12px #000c;
    transform: scale(1.05);
}

#spaceship-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0,0,0,0.82);
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

#spaceship-modal-overlay.active {
    display: flex;
}

#spaceship-modal {
    position: relative;
    background: #05051a;
    border: 2px solid #00eaff55;
    border-radius: 16px;
    box-shadow: 0 0 60px #00eaff44;
    padding: 14px 14px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 98vw;
    margin: auto;
}

#spaceship-close-btn {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: #00eaffbb;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    z-index: 2;
}

#spaceship-close-btn:hover {
    color: #fff;
}

#spaceship-controls-hint {
    color: #00eaff99;
    font-size: 13px;
    font-family: 'Segoe UI', Arial, sans-serif;
    letter-spacing: 0.5px;
    user-select: none;
}

#spaceship-controls-hint kbd {
    background: #0a0a3e;
    border: 1px solid #00eaff55;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 12px;
    color: #00eaff;
}

#spaceship-canvas {
    display: block;
    border-radius: 10px;
    border: 1px solid #00eaff22;
    background: #000010;
}

/* ── Gamepad ── */
#spaceship-gamepad {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 4px 8px;
    box-sizing: border-box;
    gap: 12px;
    user-select: none;
    -webkit-user-select: none;
}

/* D-Pad */
.sg-dpad {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sg-dpad-row {
    display: flex;
    gap: 4px;
}

.sg-btn {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    border: 2px solid #00eaff44;
    background: rgba(0, 20, 60, 0.75);
    color: #00eaff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    line-height: 1;
    transition: background 0.1s, box-shadow 0.1s, transform 0.05s;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
}

.sg-btn:active,
.sg-btn.sg-pressed {
    background: rgba(0, 234, 255, 0.22);
    box-shadow: 0 0 14px #00eaff88;
    transform: scale(0.93);
}

.sg-btn.sg-empty {
    visibility: hidden;
    pointer-events: none;
}

/* Action buttons */
.sg-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sg-btn-boost {
    width: 80px;
    height: 52px;
    border-color: #ff880066;
    color: #ff8800;
    font-size: 18px;
}

.sg-btn-boost span {
    font-size: 10px;
    letter-spacing: 1px;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-weight: bold;
}

.sg-btn-boost:active,
.sg-btn-boost.sg-pressed {
    background: rgba(255, 136, 0, 0.2);
    box-shadow: 0 0 16px #ff880088;
}

.sg-btn-shoot {
    width: 80px;
    height: 52px;
    border-color: #ff224466;
    color: #ff4488;
    font-size: 18px;
}

.sg-btn-shoot span {
    font-size: 10px;
    letter-spacing: 1px;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-weight: bold;
}

.sg-btn-shoot:active,
.sg-btn-shoot.sg-pressed {
    background: rgba(255, 68, 136, 0.2);
    box-shadow: 0 0 16px #ff448888;
}
