/* ===================================
   CATCH GAME STYLES
   =================================== */

/* Game Container */
.game-view {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(180deg, #e1f0ff 0%, #f0f9ff 100%);
}

/* Game Canvas/Container */
.game-container {
    position: relative;
    width: 100%;
    min-height: 500px;
    height: calc(100vh - 250px);
    /* Fixed viewport height */
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

/* HUD (Heads-Up Display) */
.game-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Lives Display */
.lives-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.life-heart {
    font-size: 2rem;
    transition: all 0.3s;
}

.life-heart.lost {
    opacity: 0.2;
    filter: grayscale(100%);
}

/* Score Display */
.score-container {
    text-align: center;
}

.score-label {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.score-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: #4c99e6;
}

/* Target Prompt */
.target-prompt {
    background: linear-gradient(135deg, #4c99e6 0%, #60a5fa 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(76, 153, 230, 0.3);
}

/* Game Control Buttons */
.game-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.game-control-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #4c99e6 0%, #60a5fa 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(76, 153, 230, 0.3);
    transition: all 0.2s;
}

.game-control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(76, 153, 230, 0.4);
}

.game-control-btn:active {
    transform: scale(0.95);
}

.game-control-btn.stop-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.game-control-btn.stop-btn:hover {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.game-control-btn .material-symbols-outlined {
    font-size: 1.5rem;
}

/* Speed Up Notification */
.speed-up-notification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 2rem 3rem;
    border-radius: 1.5rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    box-shadow: 0 8px 32px rgba(251, 191, 36, 0.5);
    z-index: 50;
    animation: speedUpAnimation 2s ease-out forwards;
    pointer-events: none;
    white-space: nowrap;
}

@keyframes speedUpAnimation {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    20% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }

    80% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}

/* High Score Bar */
.high-score-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

.high-score-label {
    font-size: 1rem;
    font-weight: 600;
}

.high-score-value {
    font-size: 1.5rem;
    font-weight: 800;
}

.high-score-player {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Falling Objects */
.falling-object {
    position: absolute;
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.1s;
    user-select: none;
    animation: popIn 0.3s ease-out;
    z-index: 10;
    /* Ensure visibility */
}

.falling-object:hover {
    transform: scale(1.1);
}

.falling-object.target {
    background: linear-gradient(135deg, #13ec6d 0%, #10d661 100%);
    color: white;
}

.falling-object.distractor {
    background: linear-gradient(135deg, #e1f0ff 0%, #d0e7ff 100%);
    color: #4c99e6;
}

/* Catch Animation */
@keyframes catchSuccess {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5) rotate(10deg);
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

.falling-object.caught {
    animation: catchSuccess 0.5s ease-out forwards;
}

/* Miss Animation */
@keyframes missShake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.falling-object.missed {
    animation: missShake 0.4s ease-out;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

/* Pop-in Animation */
@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Game Overlays */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.game-overlay.hidden {
    display: none;
}

/* Start Screen */
.start-screen {
    text-align: center;
    color: white;
}

.start-screen h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.start-screen p {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.start-game-btn {
    padding: 1rem 3rem;
    background: linear-gradient(135deg, #13ec6d 0%, #10d661 100%);
    color: white;
    border: none;
    border-radius: 2rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(19, 236, 109, 0.4);
    transition: all 0.3s;
}

.start-game-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(19, 236, 109, 0.5);
}

.start-game-btn:active {
    transform: translateY(-2px);
}

/* Game Over Screen */
.game-over-screen {
    text-align: center;
    color: white;
}

.game-over-screen h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.final-score {
    font-family: 'Montserrat', sans-serif;
    font-size: 4rem;
    font-weight: 800;
    color: #fbbf24;
    margin: 1rem 0;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.play-again-btn {
    padding: 1rem 3rem;
    background: linear-gradient(135deg, #4c99e6 0%, #60a5fa 100%);
    color: white;
    border: none;
    border-radius: 2rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(76, 153, 230, 0.4);
    transition: all 0.3s;
    margin-top: 2rem;
}

.play-again-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(76, 153, 230, 0.5);
}

/* Score Popup Animation */
@keyframes scorePopup {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-50px) scale(1.5);
        opacity: 0;
    }
}

.score-popup {
    position: absolute;
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: #13ec6d;
    pointer-events: none;
    animation: scorePopup 1s ease-out forwards;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* High Score Modal */
.high-score-modal {
    background: white;
    border-radius: 2rem;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.4s ease-out;
    overflow: hidden;
}

@keyframes modalSlideIn {
    0% {
        transform: translateY(-50px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.high-score-modal-header {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.high-score-trophy {
    font-size: 4rem;
    display: block;
    margin-bottom: 0.5rem;
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.high-score-modal-header h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 1rem 0;
}

.new-score-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    margin: 0;
}

.high-score-modal-body {
    padding: 2rem;
}

.high-score-modal-body label {
    display: block;
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
    color: #374151;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.player-name-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    font-family: 'Open Sans', sans-serif;
    font-size: 1.125rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

.player-name-input:focus {
    outline: none;
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

.high-score-modal-footer {
    padding: 0 2rem 2rem 2rem;
}

.high-score-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #13ec6d 0%, #10d661 100%);
    color: white;
    border: none;
    border-radius: 1rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(19, 236, 109, 0.3);
}

.high-score-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(19, 236, 109, 0.4);
}

.high-score-btn:active {
    transform: translateY(0);
}