/* 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 container - responsive height */
.game-container {
    width: 100%;
    height: 450px; /* Default iframe height */
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

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

/* Game header with progress and stats */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-weight: 600;
}

.progress-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

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

.progress-fill {
    height: 100%;
    background: #fff;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 8.33%; /* Start at 1/12 */
}

.question-counter {
    font-size: 14px;
    white-space: nowrap;
}

.stats-section {
    display: flex;
    gap: 16px;
    font-size: 14px;
}

.timer {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 40px;
    text-align: center;
}

/* Main game area */
.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    gap: 20px;
}

/* Question section */
.question-section {
    text-align: center;
    margin-bottom: 10px;
}

.base-word {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 16px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.word-construction {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 24px;
    font-weight: 600;
    color: #666;
}

.affix-placeholder {
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 8px 12px;
    min-width: 60px;
    text-align: center;
    color: #999;
}

.base-word-small {
    color: #333;
}

/* Hint section */
.hint-section {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(253, 203, 110, 0.3);
}

.hint-label {
    font-weight: bold;
    color: #d63031;
    margin-bottom: 8px;
    font-size: 16px;
}

.hint-text {
    font-size: 18px;
    color: #2d3436;
    font-weight: 500;
}

/* Options section */
.options-section {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.option-btn {
    flex: 1;
    max-width: 140px;
    padding: 16px 12px;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-height: 70px;
}

.prefix-btn {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
}

.suffix-btn {
    background: linear-gradient(135deg, #fd79a8, #e84393);
    color: white;
}

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

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

.affix-text {
    font-size: 20px;
    font-weight: bold;
}

.affix-type {
    font-size: 12px;
    opacity: 0.8;
    font-weight: normal;
}

/* Feedback section */
.feedback-section {
    text-align: center;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.feedback-message {
    font-size: 18px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feedback-message.correct {
    color: #00b894;
    opacity: 1;
}

.feedback-message.incorrect {
    color: #e17055;
    opacity: 1;
}

.correct-word {
    font-size: 16px;
    color: #636e72;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.correct-word.show {
    opacity: 1;
}

/* Game controls */
.game-controls {
    padding: 16px 20px;
    text-align: center;
}

.control-btn {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.3);
}

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

.restart-btn {
    background: linear-gradient(135deg, #fd79a8, #e84393);
    box-shadow: 0 4px 12px rgba(232, 67, 147, 0.3);
}

.restart-btn:hover {
    box-shadow: 0 6px 20px rgba(232, 67, 147, 0.4);
}

/* Celebration overlay */
.celebration-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.celebration-overlay.show {
    opacity: 1;
    visibility: visible;
}

.celebration-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.celebration-overlay.show .celebration-content {
    transform: scale(1);
}

.celebration-emoji {
    font-size: 48px;
    margin-bottom: 16px;
}

.celebration-message {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
}

.final-score {
    font-size: 18px;
    color: #666;
}

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

/* Button states */
.option-btn.correct {
    background: linear-gradient(135deg, #00b894, #00cec9) !important;
    animation: pulse-correct 0.6s ease;
}

.option-btn.incorrect {
    background: linear-gradient(135deg, #e17055, #d63031) !important;
    animation: shake 0.6s ease;
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Animations */
@keyframes pulse-correct {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

/* Mobile optimizations */
@media (max-width: 480px) {
    .game-header {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .progress-bar {
        width: 80px;
    }
    
    .game-area {
        padding: 16px;
        gap: 16px;
    }
    
    .base-word {
        font-size: 28px;
    }
    
    .word-construction {
        font-size: 20px;
    }
    
    .hint-section {
        padding: 12px;
    }
    
    .hint-text {
        font-size: 16px;
    }
    
    .option-btn {
        padding: 14px 8px;
        font-size: 16px;
        min-height: 65px;
    }
    
    .affix-text {
        font-size: 18px;
    }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    .option-btn:hover {
        transform: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .control-btn:hover {
        transform: none;
    }
}