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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

/* Main game container - responsive height */
.game-container {
    width: 100%;
    height: 450px; /* Default iframe height */
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    position: relative;
    overflow: hidden;
}

/* Responsive height for full browser */
@media (min-height: 600px) and (min-width: 800px) {
    .game-container {
        height: 90vh;
    }
}

/* Game header with stats */
.game-header {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    min-height: 50px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 16px;
    color: white;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Main game area */
.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 10px;
}

/* Character section */
.character-section {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    min-height: 60px;
}

.character {
    font-size: 32px;
    animation: bounce 2s infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

.story-text {
    flex: 1;
    color: white;
    font-size: 14px;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Question area */
.question-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.question-display {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 3px solid #ffd700;
    animation: glow 2s ease-in-out infinite alternate;
    width: 100%;
    max-width: 300px;
    text-align: center;
}

@keyframes glow {
    from { box-shadow: 0 8px 32px rgba(255, 215, 0, 0.3); }
    to { box-shadow: 0 8px 32px rgba(255, 215, 0, 0.6); }
}

.question-text {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Answer grid */
.answer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.answer-btn {
    background: linear-gradient(145deg, #ff6b6b, #ee5a52);
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(145deg, #ff7979, #fd79a8);
}

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

.answer-btn.correct {
    background: linear-gradient(145deg, #00b894, #00a085);
    animation: correctPulse 0.6s ease;
}

.answer-btn.incorrect {
    background: linear-gradient(145deg, #d63031, #b71c1c);
    animation: shake 0.6s ease;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Progress section */
.progress-section {
    margin-top: 10px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.feedback-message {
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    min-height: 20px;
}

/* Game controls */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.control-btn {
    background: linear-gradient(145deg, #6c5ce7, #5f3dc4);
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-height: 40px;
    flex: 1;
    max-width: 120px;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.start-btn {
    background: linear-gradient(145deg, #00b894, #00a085);
}

.pause-btn {
    background: linear-gradient(145deg, #fdcb6e, #e17055);
}

.hint-btn {
    background: linear-gradient(145deg, #fd79a8, #e84393);
}

/* Achievement popup */
.achievement-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: transform 0.3s ease;
    text-align: center;
    border: 3px solid #ffd700;
}

.achievement-popup.show {
    transform: translate(-50%, -50%) scale(1);
}

.achievement-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.achievement-text {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
    max-width: 200px;
    text-align: center;
}

.tooltip.show {
    opacity: 1;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 480px) {
    .game-header {
        padding: 6px 12px;
    }
    
    .stat-label {
        font-size: 9px;
    }
    
    .stat-value {
        font-size: 14px;
    }
    
    .question-text {
        font-size: 20px;
    }
    
    .answer-btn {
        font-size: 16px;
        padding: 10px;
    }
    
    .control-btn {
        font-size: 11px;
        padding: 8px 12px;
    }
}