/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #98FB98 100%);
    overflow: hidden;
    user-select: none;
    cursor: crosshair;
}

/* Main game container - responsive height based on environment */
.game-container {
    width: 100%;
    height: 450px; /* Default iframe height */
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Adjust height for full browser tab */
@media (min-height: 500px) {
    .game-container {
        height: 90vh;
    }
}

/* HUD (Heads Up Display) - shows score, timer, progress */
.hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border-radius: 0 0 15px 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.score-display, .timer-display {
    font-size: 1.2em;
    font-weight: bold;
    color: #2c3e50;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

/* Progress bar styling */
.progress-container {
    flex: 1;
    margin: 0 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #3498db;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 8px;
}

/* Main game area where all the action happens */
.game-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
}

/* Action display - shows the current action to identify */
.action-display {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    border: 3px solid #3498db;
    z-index: 50;
}

.character {
    font-size: 4em;
    margin-bottom: 10px;
    animation: bounce 2s infinite;
}

.action-text {
    font-size: 1.4em;
    color: #2c3e50;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

/* Bounce animation for character */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Crosshair for aiming */
.crosshair {
    position: absolute;
    font-size: 2em;
    color: #e74c3c;
    font-weight: bold;
    pointer-events: none;
    z-index: 1000;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -50%);
}

/* Container for floating verb options */
.verb-options {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Individual verb option styling */
.verb-option {
    position: absolute;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border: 3px solid #3498db;
    border-radius: 15px;
    padding: 15px 20px;
    font-size: 1.3em;
    font-weight: bold;
    color: #2c3e50;
    cursor: crosshair;
    pointer-events: all;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    min-width: 80px;
    text-align: center;
}

.verb-option:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: #e74c3c;
    background: linear-gradient(145deg, #fff5f5, #ffe6e6);
}

/* Correct answer styling */
.verb-option.correct {
    background: linear-gradient(145deg, #d4edda, #c3e6cb);
    border-color: #28a745;
    color: #155724;
    animation: correctPulse 0.6s ease;
}

/* Incorrect answer styling */
.verb-option.incorrect {
    background: linear-gradient(145deg, #f8d7da, #f5c6cb);
    border-color: #dc3545;
    color: #721c24;
    animation: shake 0.6s ease;
}

/* Animation for correct answers */
@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Shake animation for incorrect answers */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Floating animation for verb options */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(1deg);
    }
    50% {
        transform: translateY(-5px) rotate(-1deg);
    }
    75% {
        transform: translateY(-15px) rotate(0.5deg);
    }
}

.verb-option {
    animation: float 4s ease-in-out infinite;
}

/* Feedback display for immediate response */
.feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2em;
    font-weight: bold;
    text-align: center;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.feedback.show {
    opacity: 1;
}

.feedback.correct {
    color: #28a745;
}

.feedback.incorrect {
    color: #dc3545;
}

/* Game controls styling */
.controls {
    padding: 15px;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border-radius: 15px 15px 0 0;
}

.btn {
    background: linear-gradient(145deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 24px;
    margin: 0 10px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    min-height: 44px; /* Touch-friendly minimum height */
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    background: linear-gradient(145deg, #2980b9, #3498db);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
}

/* Results screen styling */
.results-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 300;
}

.results-screen h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.final-score {
    font-size: 2em;
    color: #3498db;
    margin-bottom: 15px;
    font-weight: bold;
}

.performance-message {
    font-size: 1.3em;
    color: #27ae60;
    margin-bottom: 30px;
    font-weight: bold;
}

/* Hint tooltip styling */
.hint-tooltip {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 193, 7, 0.95);
    color: #856404;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 1em;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 150;
    text-align: center;
    border: 2px solid #ffc107;
}

.hint-tooltip.show {
    opacity: 1;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .hud {
        padding: 8px 15px;
        flex-wrap: wrap;
    }
    
    .score-display, .timer-display {
        font-size: 1em;
    }
    
    .progress-container {
        margin: 5px 10px;
        order: 3;
        flex-basis: 100%;
    }
    
    .character {
        font-size: 3em;
    }
    
    .action-text {
        font-size: 1.2em;
    }
    
    .verb-option {
        font-size: 1.1em;
        padding: 12px 16px;
        min-width: 70px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 1em;
        margin: 5px;
    }
    
    .results-screen h2 {
        font-size: 2em;
    }
    
    .final-score {
        font-size: 1.6em;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .verb-option {
        min-height: 44px;
        min-width: 88px;
    }
    
    .verb-option:hover {
        transform: none;
    }
    
    .verb-option:active {
        transform: scale(0.95);
        background: linear-gradient(145deg, #e6f3ff, #cce7ff);
    }
}