/* Game Container */
.game-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    padding: 1.5rem;
    background: linear-gradient(180deg, #87CEEB 0%, #90EE90 100%);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

[data-bs-theme="dark"] .game-container {
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    position: relative;
    z-index: 1;
}

/* Hole Container */
.hole-container {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: crosshair;
}

/* Hole */
.hole {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 25%;
    background: radial-gradient(ellipse at center, #2c1810 0%, #1a0f0a 100%);
    border-radius: 50%;
    box-shadow:
        inset 0 -2px 8px rgba(0, 0, 0, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

/* Grass/Mound */
.hole-container::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 30%;
    background: linear-gradient(180deg, #228B22 0%, #006400 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

[data-bs-theme="dark"] .hole-container::before {
    background: linear-gradient(180deg, #1a5c1a 0%, #0d3d0d 100%);
}

/* Mole */
.mole {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 60%;
    height: 70%;
    transition: transform 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 3;
    cursor: pointer;
    pointer-events: none;
}

.mole.active {
    transform: translateX(-50%) translateY(0%);
    pointer-events: auto;
}

.mole.hit {
    animation: moleHit 0.2s ease-out;
}

@keyframes moleHit {
    0% { transform: translateX(-50%) translateY(0) scale(1); }
    50% { transform: translateX(-50%) translateY(-10px) scale(0.9); }
    100% { transform: translateX(-50%) translateY(100%) scale(0.8); }
}

/* Mole Head */
.mole-head {
    width: 100%;
    height: 100%;
    background-color: #8B4513;
    border-radius: 50% 50% 40% 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow:
        0 -4px 8px rgba(0, 0, 0, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
}

.mole-head::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 30%;
    width: 15%;
    height: 15%;
    background: white;
    border-radius: 50%;
    opacity: 0.3;
}

/* 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: 100;
    border-radius: 1rem;
    backdrop-filter: blur(8px);
}

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

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

/* Stat Box */
.stat-box {
    padding: 1rem;
    background: var(--bs-body-bg);
    border: 2px solid var(--bs-border-color);
    border-radius: 0.5rem;
    transition: all 0.3s;
}

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

.stat-label {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    line-height: 1;
}

/* Stat Card */
.stat-card {
    padding: 1.5rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    transition: all 0.2s;
}

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

.stat-card .stat-value {
    font-size: 2.5rem;
}

.stat-card .stat-label {
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Combo Meter */
.combo-meter {
    max-width: 400px;
    margin: 0 auto;
}

.combo-bar {
    width: 100%;
    height: 20px;
    background: var(--bs-border-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.combo-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff9800 0%, #f44336 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
    animation: comboGlow 1s ease-in-out infinite;
}

@keyframes comboGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 152, 0, 0.8);
    }
}

/* Particles */
.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat 0.6s ease-out forwards;
    z-index: 1000;
}

@keyframes particleFloat {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--vx), var(--vy)) scale(0);
        opacity: 0;
    }
}

/* Score Popup */
.score-popup {
    position: absolute;
    font-size: 1.5rem;
    font-weight: 700;
    pointer-events: none;
    animation: scorePopup 1s ease-out forwards;
    z-index: 1000;
    text-shadow:
        1px 1px 2px rgba(0, 0, 0, 0.8),
        -1px -1px 2px rgba(255, 255, 255, 0.3);
}

@keyframes scorePopup {
    0% {
        transform: translate(-50%, 0) scale(0.5);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -30px) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -60px) scale(0.8);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        padding: 1.5rem;
    }

    .game-grid {
        gap: 0.75rem;
    }

    .mole-head {
        font-size: 1.5rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-card .stat-value {
        font-size: 2rem;
    }

    .score-popup {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .game-container {
        padding: 1rem;
    }

    .game-grid {
        gap: 0.5rem;
    }

    .mole-head {
        font-size: 1.2rem;
    }

    .stat-box {
        padding: 0.75rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.75rem;
    }

    .stat-card .stat-label {
        font-size: 0.8rem;
    }
}

/* Button Animations */
.btn {
    transition: all 0.2s ease;
}

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

.btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Dark Mode Specific Adjustments */
[data-bs-theme="dark"] .hole {
    background: radial-gradient(ellipse at center, #000000 0%, #0a0604 100%);
}

[data-bs-theme="dark"] .stat-box,
[data-bs-theme="dark"] .stat-card {
    background: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .combo-bar {
    background: rgba(255, 255, 255, 0.1);
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Focus States for Accessibility */
.mole:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

button:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Prevent text selection on game elements */
.game-container,
.game-grid,
.mole,
.stat-box {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Time Warning Animation */
@keyframes timeWarning {
    0%, 100% {
        color: #dc3545;
    }
    50% {
        color: #ff6b6b;
        transform: scale(1.1);
    }
}

#timeLeft.warning {
    animation: timeWarning 0.5s ease-in-out infinite;
}

/* Instructions List Styling */
.alert ul {
    margin-bottom: 0;
    padding-left: 1.5rem;
}

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

.alert ul li:last-child {
    margin-bottom: 0;
}

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

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

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

/* Overlay Button Styling */
.overlay-content .btn {
    min-width: 200px;
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
}

.overlay-content .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.3);
}

/* Mole Type Variations */
.mole[data-type="golden"] .mole-head {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    box-shadow:
        0 -4px 8px rgba(255, 215, 0, 0.5),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(255, 215, 0, 0.4);
    animation: goldenGlow 1s ease-in-out infinite;
}

@keyframes goldenGlow {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.2);
    }
}

.mole[data-type="bomb"] .mole-head {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    animation: bombShake 0.5s ease-in-out infinite;
}

@keyframes bombShake {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

/* Touch Feedback */
@media (hover: none) {
    .mole:active {
        transform: translateX(-50%) translateY(0) scale(0.95);
    }

    .btn:active:not(:disabled) {
        background-color: var(--bs-primary);
        color: white;
    }
}

/* High Score Celebration */
@keyframes celebrate {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.1) rotate(-5deg);
    }
    75% {
        transform: scale(1.1) rotate(5deg);
    }
}

.high-score-celebration {
    animation: celebrate 0.5s ease-in-out 3;
}
