/* game.css - Styles for Vietnamese Hangman game */
/* Vietnamese Keyboard with groups */
.letter-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    max-height: 300px;
    padding: 0.5rem;
    margin-bottom: 1rem;
}

.letter-group {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 0.5rem;
    background-color: #f9f9f9;
}

.letter-group-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.25rem;
    font-weight: bold;
}

.letter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.letter-button {
    height: 35px;
    min-width: 35px;
    border: 1px solid #ddd;
    background-color: #fff;
    border-radius: 5px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0 0.25rem;
    font-size: 0.85rem;
}

.letter-button:hover {
    background-color: #e9ecef;
}

.letter-button.used {
    opacity: 0.7;
    cursor: not-allowed;
}

.letter-button.correct {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.letter-button.incorrect {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .letter-buttons-container {
        max-height: 250px;
    }
    
    .letter-button {
        height: 30px;
        min-width: 30px;
        font-size: 0.75rem;
    }
    
    .letter-group {
        padding: 0.3rem;
    }
}

/* For landscape orientation on small screens */
@media (max-height: 500px) and (orientation: landscape) {
    .letter-buttons-container {
        max-height: 150px;
    }
    
    .letter-group {
        padding: 0.2rem;
    }
    
    .letter-row {
        gap: 0.2rem;
    }
    
    .letter-button {
        height: 28px;
        min-width: 28px;
        font-size: 0.7rem;
    }
}
/* Full screen game styles */
html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

.full-screen {
    height: 100vh;
    overflow: hidden;
}

.full-screen-game {
    height: calc(100vh - 50px); /* Account for mini nav */
    max-height: 100vh;
    overflow: hidden;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

/* Game mini navigation */
.game-mini-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
    padding: 0 1rem;
    background-color: #2c3e50;
    color: white;
}

.back-to-home {
    color: white;
    font-size: 1.2rem;
    text-decoration: none;
}

.game-title {
    font-weight: bold;
    font-size: 1.1rem;
}

.user-info-mini {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar-mini {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

/* Game container */
.game-container {
    display: flex;
    flex-direction: column;
    background-color: #f9f9f9;
    padding: 0.5rem;
}

/* Game header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 0.5rem;
}

.game-info, .game-score {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
}

.game-category, .game-difficulty {
    margin-bottom: 0.25rem;
}

.game-status-container {
    text-align: center;
    flex-grow: 1;
}

.game-status {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
}

.turn-display {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.game-score {
    font-weight: bold;
    color: #2c3e50;
    text-align: right;
}

/* Game content */
.game-content {
    display: flex;
    gap: 0.5rem;
    flex-grow: 1;
    height: calc(100% - 60px); /* Subtract header height */
    overflow: hidden;
}

/* Left panel (Hangman visualization) */
.game-left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
    height: 100%;
}

.hangman-scene-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.traditional-hangman {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.traditional-hangman img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#view-toggle {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    z-index: 10;
}

/* Right panel (Word and controls) */
.game-right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    height: 100%;
    overflow: hidden;
}

/* Word container */
.word-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    min-height: 60px;
    align-items: center;
}

.word-letter {
    width: 30px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    border-bottom: 2px solid #333;
    text-transform: uppercase;
}

/* Hint section */
.hint-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
}

.hint-button {
    margin-bottom: 0.5rem;
}

.hint-display {
    padding: 0.75rem;
    background-color: #f0f8ff;
    border: 1px solid #cce5ff;
    border-radius: 5px;
    font-style: italic;
    color: #0c5460;
    width: 100%;
    text-align: center;
}

/* Letter buttons */
.letter-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
    gap: 0.4rem;
    margin-bottom: 1rem;
    overflow-y: auto;
    flex-grow: 1;
    padding: 0.5rem;
}

.letter-button {
    height: 38px;
    border: 1px solid #ddd;
    background-color: #f8f9fa;
    border-radius: 5px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.letter-button:hover {
    background-color: #e9ecef;
}

.letter-button.used {
    opacity: 0.7;
    cursor: not-allowed;
}

.letter-button.correct {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.letter-button.incorrect {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Game controls */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: auto;
    padding: 0.5rem;
}

/* Game result container */
.game-result-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.game-result-container.hidden {
    display: none;
}

.result-content {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.result-message {
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

.result-details {
    margin-bottom: 1.5rem;
}

.result-score {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Game error container */
.game-error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 50px);
    padding: 1rem;
}

.error-message {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Button styles */
.btn {
    padding: 0.5rem 1rem;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-outline {
    background-color: transparent;
    color: #3498db;
    border: 1px solid #3498db;
}

.btn-outline:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .game-content {
        flex-direction: column;
    }
    
    .game-left-panel, .game-right-panel {
        height: 50%;
    }
    
    .letter-buttons {
        grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
        gap: 0.3rem;
    }
    
    .word-letter {
        width: 25px;
        height: 35px;
        font-size: 1.2rem;
    }
    
    .hint-display {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .game-content {
        flex-direction: row;
    }
    
    .game-header {
        padding: 0.25rem;
    }
    
    .game-left-panel {
        flex: 0.8;
    }
    
    .game-right-panel {
        flex: 1.2;
    }
    
    .letter-buttons {
        grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
        gap: 0.2rem;
    }
    
    .hint-section {
        margin-bottom: 0.5rem;
    }
    
    .word-container {
        margin-bottom: 0.5rem;
    }
}