/* Game Canvas */
#gameCanvas {
    border: 3px solid var(--bs-border-color);
    border-radius: 0.5rem;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1e 100%);
    max-width: 100%;
    height: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Game Overlays */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(8px);
    border-radius: 0.5rem;
}

.overlay-content {
    color: white;
    padding: 2rem;
    text-align: center;
    animation: fadeInScale 0.4s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Active Power-ups Display */
.active-powerups {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 5;
}

.powerup-active {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: powerupPulse 0.5s ease-in;
}

@keyframes powerupPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Power-up Info Cards */
.powerup-info {
    padding: 1rem;
    border: 2px solid var(--bs-border-color);
    border-radius: 0.5rem;
    transition: all 0.3s;
    background: var(--bs-body-bg);
}

.powerup-info:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-color: var(--bs-primary);
}

.powerup-icon {
    font-size: 2rem;
    display: inline-block;
    margin-right: 0.5rem;
    animation: float 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Stats Cards */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#currentScore, #currentLevel, #livesCount, #highScore {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    transition: all 0.3s;
}

@keyframes scoreUpdate {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.score-updated {
    animation: scoreUpdate 0.4s ease-in-out;
}

/* Alert Info */
.alert-info {
    border-left: 4px solid var(--bs-info);
    background: var(--bs-info-bg-subtle);
}

/* Control Hint */
.alert strong {
    color: var(--bs-primary);
}

/* Dark Mode */
[data-bs-theme="dark"] #gameCanvas {
    border-color: rgba(255, 255, 255, 0.2);
}

[data-bs-theme="dark"] .powerup-info {
    background: var(--bs-dark);
}

[data-bs-theme="dark"] .powerup-info:hover {
    background: var(--bs-body-bg);
}

/* Buttons */
.btn {
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.btn:active {
    transform: translateY(0);
}

/* Form Controls */
.form-select, .form-check-input {
    transition: all 0.2s;
}

.form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Responsive */
@media (max-width: 768px) {
    #gameCanvas {
        max-width: 100%;
        height: auto;
    }

    .overlay-content {
        padding: 1rem;
    }

    .overlay-content h2 {
        font-size: 1.5rem;
    }

    .powerup-info {
        padding: 0.75rem;
    }

    .powerup-icon {
        font-size: 1.5rem;
    }

    .active-powerups {
        top: 5px;
        right: 5px;
    }

    .powerup-active {
        font-size: 12px;
        padding: 4px 10px;
    }
}

@media (max-width: 576px) {
    .card-body h4 {
        font-size: 1.25rem;
    }

    .alert {
        font-size: 0.875rem;
        padding: 0.75rem;
    }
}

/* Loading Animation */
.loading {
    pointer-events: none;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Glow Effect for Canvas on Focus */
#gameCanvas:hover {
    box-shadow: 0 0 20px rgba(13, 110, 253, 0.3);
}

/* Card Headers */
.card-header h5 {
    color: var(--bs-primary-text-emphasis);
    font-weight: 600;
}

/* Smooth Transitions */
* {
    transition-property: color, background-color, border-color;
    transition-duration: 0.2s;
}

button, select, input {
    transition-property: all;
}

/* Particle Effects Indicator */
@keyframes sparkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}

.form-check-label i {
    transition: all 0.3s;
}

.form-check-input:checked + .form-check-label i {
    animation: sparkle 1s ease-in-out infinite;
}

/* Focus States */
button:focus,
select:focus,
input:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Prevent Text Selection on Game Elements */
.card-body.p-0,
.overlay-content,
.active-powerups {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
