/* === Floating Button === */
#buggy-open-btn {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99990;
    background: #4caf50;
    border: none;
    border-radius: 0 12px 12px 0;
    width: 52px;
    height: 52px;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 2px 2px 10px rgba(0,0,0,.3);
    transition: background .2s, transform .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
#buggy-open-btn:hover {
    background: #43a047;
    transform: translateY(-50%) scale(1.12);
}

/* === Overlay === */
#buggy-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99991;
    align-items: center;
    justify-content: center;
}
#buggy-overlay.buggy-visible {
    display: flex;
}

/* === Modal === */
#buggy-modal {
    background: #fff;
    border-radius: 16px;
    padding: 28px 28px 20px;
    box-shadow: 0 8px 40px rgba(0,0,0,.35);
    position: relative;
    text-align: center;
    max-width: 460px;
    width: 95vw;
    animation: buggyPop .22s ease;
}
@keyframes buggyPop {
    from { transform: scale(.85); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

#buggy-title {
    margin: 0 0 14px;
    font-size: 1.3rem;
    color: #333;
}

/* === Close button === */
#buggy-close-btn {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #888;
    line-height: 1;
    padding: 2px 6px;
}
#buggy-close-btn:hover { color: #333; }

/* === Arena === */
#buggy-arena-wrap {
    border: 2px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    display: inline-block;
    line-height: 0;
    background: #f0f8e8;
}
#buggy-canvas {
    display: block;
    max-width: 100%;
}

/* === Controls === */
#buggy-controls {
    margin-top: 16px;
}
.buggy-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 6px;
}
.buggy-dir {
    width: 48px;
    height: 48px;
    font-size: 20px;
    border-radius: 10px;
    border: 2px solid #ccc;
    background: #f9f9f9;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.buggy-dir:hover  { background: #e8f5e9; border-color: #4caf50; }
.buggy-dir:active { background: #c8e6c9; transform: scale(.93); }

#buggy-hint {
    font-size: 12px;
    color: #aaa;
    margin: 10px 0 0;
}
