/* ========================================
   BATTLE CITY — Floating Button & Modal
   ======================================== */

/* Floating Launch Button */
#bcg-launch-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99998;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1a1a2e;
    border: 2px solid #e8c84a;
    color: #e8c84a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 0 0 rgba(232,200,74,0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    padding: 0;
    animation: bcg-pulse 2.5s infinite;
}

#bcg-launch-btn:hover {
    transform: scale(1.12);
    background: #2a2a4e;
    box-shadow: 0 6px 28px rgba(0,0,0,0.6), 0 0 16px rgba(232,200,74,0.5);
    animation: none;
}

#bcg-launch-btn:active {
    transform: scale(0.95);
}

#bcg-launch-btn svg {
    display: block;
    filter: drop-shadow(0 0 4px rgba(232,200,74,0.6));
}

@keyframes bcg-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 0 0 rgba(232,200,74,0.4); }
    50%       { box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 0 8px rgba(232,200,74,0); }
}

/* Modal Overlay */
#bcg-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#bcg-modal.open {
    display: flex;
}

/* Modal Inner Box */
#bcg-modal-inner {
    background: #0d0d1a;
    border: 2px solid #e8c84a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(232,200,74,0.15), 0 20px 60px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    max-width: 100vw;
    max-height: 100dvh;
}

/* Header */
#bcg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #111127;
    border-bottom: 1px solid rgba(232,200,74,0.3);
    gap: 12px;
    flex-wrap: wrap;
}

#bcg-title {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    color: #e8c84a;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(232,200,74,0.5);
    white-space: nowrap;
}

#bcg-stats {
    display: flex;
    gap: 16px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #aaa;
    flex-wrap: wrap;
}

#bcg-stats b {
    color: #e8c84a;
}

#bcg-close-btn {
    background: transparent;
    border: 1px solid rgba(232,200,74,0.4);
    color: #e8c84a;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    padding: 0;
    flex-shrink: 0;
}

#bcg-close-btn:hover {
    background: rgba(232,200,74,0.15);
    border-color: #e8c84a;
}

/* Canvas Wrapper */
#bcg-canvas-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 0;
}

#bcg-canvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    max-width: 100%;
    max-height: calc(100dvh - 130px);
    width: auto;
    height: auto;
}

/* Game Overlay (start/gameover/win) */
#bcg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.78);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

#bcg-overlay.hidden {
    display: none;
}

#bcg-overlay-text {
    font-family: 'Courier New', monospace;
    font-size: 22px;
    font-weight: bold;
    color: #e8c84a;
    text-align: center;
    text-shadow: 0 0 16px rgba(232,200,74,0.7);
    line-height: 1.5;
    padding: 0 20px;
}

#bcg-overlay-btn {
    font-family: 'Courier New', monospace;
    font-size: 15px;
    font-weight: bold;
    color: #0d0d1a;
    background: #e8c84a;
    border: none;
    padding: 12px 32px;
    border-radius: 6px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: transform 0.15s, background 0.15s;
}

#bcg-overlay-btn:hover {
    transform: scale(1.05);
    background: #f5d968;
}

/* Controls bar */
#bcg-controls {
    padding: 8px 16px;
    background: #111127;
    border-top: 1px solid rgba(232,200,74,0.2);
}

.bcg-ctrl-row {
    display: flex;
    gap: 20px;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #666;
    flex-wrap: wrap;
}

.bcg-ctrl-row span {
    white-space: nowrap;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    #bcg-launch-btn {
        bottom: 16px;
        right: 16px;
        width: 50px;
        height: 50px;
    }
    #bcg-modal-inner {
        border-radius: 8px;
        margin: 4px;
    }
    #bcg-title { font-size: 13px; }
    #bcg-stats { font-size: 11px; gap: 10px; }
    #bcg-overlay-text { font-size: 16px; }
}