/* Game Canvas Styling */
#gameCanvas {
    border: 2px solid var(--bs-border-color);
    border-radius: 0.375rem;
    max-width: 100%;
    height: auto;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
}

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

.overlay-content {
    color: white;
    padding: 2rem;
    animation: fadeInScale 0.3s ease-out;
}

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

/* Mobile Control Buttons */
.btn-control {
    width: 60px;
    height: 60px;
    padding: 0;
    font-size: 1.5rem;
    border-radius: 50%;
    border-width: 2px;
    transition: all 0.2s;
}

.btn-control:active {
    transform: scale(0.95);
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.5);
}

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

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

/* Score Animations */
#currentScore,
#snakeLength,
#currentLevel {
    transition: all 0.3s;
}

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

.score-update {
    animation: pulse 0.3s ease-in-out;
}

/* Dark Mode Adjustments */
[data-bs-theme="dark"] #gameCanvas {
    border-color: var(--bs-border-color);
    background-color: var(--bs-body-bg);
}

[data-bs-theme="dark"] .game-overlay {
    background: rgba(0, 0, 0, 0.9);
}

/* Button Styling */
.btn-control.btn-outline-primary:hover {
    background-color: var(--bs-primary);
    color: white;
}

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

    .btn-control {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .overlay-content {
        padding: 1rem;
    }

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

    .overlay-content p {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .btn-control {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}

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

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

/* Smooth transitions for all interactive elements */
button,
select,
.form-check-input {
    transition: all 0.2s ease;
}

/* Focus states for accessibility */
button:focus,
select:focus,
.form-check-input:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Canvas container positioning */
.card-body.p-0 {
    position: relative;
    overflow: hidden;
}

/* Power-up indicator animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(0, 255, 0, 0.8);
    }
}

.shield-active #gameCanvas {
    animation: glow 1s infinite;
}

/* Loading state */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* Game instructions list styling */
.card-body ul {
    padding-left: 1.2rem;
}

.card-body ul li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Emoji sizing in instructions */
.card-body ul li {
    font-size: 0.95rem;
}

/* Stat card number styling */
.card-body h4 {
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

/* Overlay button hover effect */
.overlay-content .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* Touch feedback for mobile */
@media (hover: none) {
    .btn-control:active {
        background-color: var(--bs-primary);
        color: white;
    }
}

/* Prevent text selection on game elements */
.card-body,
.overlay-content,
#mobileControls {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
