/* CSS for Sign Language Spelling Game - Optimized for iframe and mobile-first design */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Main game container with responsive height */
.game-container {
    width: 100%;
    height: 450px; /* Default iframe height */
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

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

/* Status bar with progress tracking */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    color: white;
    font-size: 12px;
    font-weight: bold;
    min-height: 35px;
}

.level-display, .score-display {
    flex: 1;
    text-align: center;
}

.progress-bar {
    flex: 2;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin: 0 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #FFC107;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Main game area */
.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 8px;
    overflow-y: auto;
}

/* Word section with image and blanks */
.word-section {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    min-height: 60px;
}

.word-image {
    width: 60px;
    height: 60px;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    margin-right: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.image-placeholder {
    font-size: 30px;
}

.word-display {
    flex: 1;
}

.word-blanks {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.word-blank {
    width: 25px;
    height: 25px;
    border: 2px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.2s ease;
}

.word-blank.filled {
    background: #E8F5E8;
    border-color: #4CAF50;
    color: #2E7D32;
}

.word-blank.current {
    border-color: #2196F3;
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.3);
}

.word-hint {
    font-size: 11px;
    color: #666;
    font-style: italic;
}

/* Letter grid with sign language representations - INCREASED SIZE FOR ACCESSIBILITY */
.letter-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    margin-bottom: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.letter-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px; /* Increased from 4px */
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 65px; /* Increased from 50px for better accessibility */
    font-size: 12px; /* Increased from 10px */
}

.letter-btn:hover {
    background: #f0f8ff;
    border-color: #2196F3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.letter-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.letter-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* INCREASED SIGN SIZE FOR BETTER ACCESSIBILITY */
.sign-image {
    font-size: 24px; /* Increased from 16px for better visibility */
    margin-bottom: 3px; /* Increased from 2px */
}

/* INCREASED LETTER TEXT SIZE FOR BETTER ACCESSIBILITY */
.letter-text {
    font-weight: bold;
    color: #333;
    font-size: 14px; /* Increased from inherited size for better readability */
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
}

.action-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: #2196F3;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    min-height: 36px;
}

.action-btn:hover {
    background: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

.action-btn#clearBtn {
    background: #FF9800;
}

.action-btn#clearBtn:hover {
    background: #F57C00;
}

.action-btn#skipBtn {
    background: #9E9E9E;
}

.action-btn#skipBtn:hover {
    background: #757575;
}

/* Avatar section */
.avatar-section {
    position: absolute;
    top: 40px;
    right: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.avatar-display {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.avatar {
    font-size: 20px;
}

.avatar-accessories {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 12px;
}

.inventory-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #FF9800;
    color: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.inventory-btn:hover {
    background: #F57C00;
    transform: scale(1.1);
}

/* Feedback modal */
.feedback-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.feedback-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    max-width: 280px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

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

.feedback-message {
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: bold;
}

.feedback-message.correct {
    color: #4CAF50;
}

.feedback-message.incorrect {
    color: #F44336;
}

.feedback-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    background: #4CAF50;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-btn:hover {
    background: #45a049;
}

/* Inventory modal */
.inventory-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.inventory-content {
    background: white;
    border-radius: 12px;
    max-width: 320px;
    max-height: 80%;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.inventory-header h3 {
    margin: 0;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #333;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.inventory-item {
    aspect-ratio: 1;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    font-size: 20px;
}

.inventory-item:hover {
    border-color: #2196F3;
    transform: scale(1.05);
}

.inventory-item.equipped {
    border-color: #4CAF50;
    background: #E8F5E8;
}

.inventory-item.locked {
    opacity: 0.3;
    cursor: not-allowed;
    background: #f5f5f5;
}

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

.tooltip.show {
    opacity: 1;
}

/* Mobile optimizations - UPDATED FOR LARGER LETTERS AND SIGNS */
@media (max-width: 480px) {
    .letter-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .letter-btn {
        min-height: 60px; /* Increased from 45px for better accessibility */
        font-size: 11px; /* Increased from 9px */
    }
    
    /* MAINTAINED LARGER SIGN SIZE ON MOBILE */
    .sign-image {
        font-size: 20px; /* Increased from 14px for better mobile accessibility */
    }
    
    /* MAINTAINED LARGER LETTER TEXT ON MOBILE */
    .letter-text {
        font-size: 12px; /* Increased for better mobile readability */
    }
    
    .word-blank {
        width: 22px;
        height: 22px;
        font-size: 12px;
    }
    
    .action-btn {
        font-size: 11px;
        padding: 6px 8px;
        min-height: 32px;
    }
}

/* Touch device optimizations - UPDATED FOR ACCESSIBILITY */
@media (hover: none) and (pointer: coarse) {
    .letter-btn {
        min-height: 60px; /* Increased from 48px for better touch accessibility */
    }
    
    .action-btn {
        min-height: 44px;
    }
    
    .inventory-btn {
        width: 36px;
        height: 36px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .letter-btn {
        border-width: 2px;
    }
    
    .word-blank {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}