/* 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-x: hidden;
    /* Responsive height based on environment */
    height: 450px;
    min-height: 450px;
}

/* Check if running in new tab (larger viewport) */
@media (min-height: 600px) {
    body {
        height: 90vh;
        min-height: 90vh;
    }
}

/* Main game container */
.game-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

/* Progress bar */
.progress-bar {
    position: relative;
    height: 40px;
    background: #f0f0f0;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    transition: width 0.5s ease;
    width: 20%;
}

.progress-text {
    position: relative;
    z-index: 2;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

/* Content area */
.content-area {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 15px;
}

/* Question container */
.question-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e0e0;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sentence {
    font-size: 18px;
    line-height: 1.6;
    text-align: center;
    color: #333;
    font-weight: 500;
}

/* Noun phrase styling */
.noun-phrase {
    color: #2196F3;
    font-weight: normal;
}

.head-noun {
    color: #2196F3;
    font-weight: bold;
}

/* Verb phrase styling */
.verb-phrase {
    color: #FF9800;
    font-weight: normal;
}

.correct-verb {
    color: #FF9800;
    font-weight: bold;
}

/* Conjunction emphasis */
.conjunction-emphasis {
    color: #E91E63;
    font-weight: bold;
    font-size: 1.2em;
    animation: pulse 1s infinite;
}

/* Choices container */
.choices-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.verb-choice {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border: 2px solid #ddd;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    min-width: 100px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.verb-choice:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    border-color: #2196F3;
}

.verb-choice:active {
    transform: translateY(0);
}

.verb-choice.selected {
    background: linear-gradient(145deg, #2196F3, #1976D2);
    color: white;
    border-color: #1976D2;
}

.verb-choice.correct {
    background: linear-gradient(145deg, #4CAF50, #45a049);
    color: white;
    border-color: #45a049;
    animation: correctPulse 0.6s ease;
}

.verb-choice.incorrect {
    background: linear-gradient(145deg, #f44336, #d32f2f);
    color: white;
    border-color: #d32f2f;
    animation: shake 0.5s ease;
}

.verb-choice:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Hint container */
.hint-container {
    display: flex;
    justify-content: center;
}

.hint-btn {
    background: linear-gradient(145deg, #FFC107, #FF8F00);
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    min-height: 40px;
}

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

.hint-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Feedback area */
.feedback-area {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.feedback-correct {
    background: linear-gradient(145deg, #E8F5E8, #C8E6C9);
    color: #2E7D32;
    border: 2px solid #4CAF50;
}

.feedback-incorrect {
    background: linear-gradient(145deg, #FFEBEE, #FFCDD2);
    color: #C62828;
    border: 2px solid #f44336;
}

.feedback-hint {
    background: linear-gradient(145deg, #FFF3E0, #FFE0B2);
    color: #E65100;
    border: 2px solid #FF9800;
}

/* Next button */
.next-container {
    display: flex;
    justify-content: center;
}

.next-btn {
    background: linear-gradient(145deg, #4CAF50, #45a049);
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    min-height: 48px;
}

.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

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

.game-container:hover .tooltip {
    opacity: 1;
}

/* Particles for celebration */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #FFD700;
    border-radius: 50%;
    animation: fall 3s linear forwards;
}

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

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

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

@keyframes fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .content-area {
        padding: 15px;
        gap: 12px;
    }
    
    .sentence {
        font-size: 16px;
    }
    
    .verb-choice {
        font-size: 14px;
        padding: 10px 20px;
        min-width: 80px;
    }
    
    .choices-container {
        gap: 10px;
    }
}

/* Touch-friendly sizing for mobile */
@media (max-width: 480px) {
    .verb-choice {
        min-height: 44px;
        min-width: 120px;
        flex: 1;
        max-width: 150px;
    }
    
    .choices-container {
        flex-direction: column;
        align-items: center;
    }
}