/* HANGMAN SPECIFIC STYLES */

.game-viewport {
    background: #0a0a1a;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#game-ui {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
}

/* HUD */
#hud-top {
    display: flex;
    justify-content: space-between;
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

.hud-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hud-label {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

#mistakes-display, #streak-display, #best-display {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    font-family: 'Outfit', sans-serif;
}

.highlight-text {
    color: #10b981 !important;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Canvas Container */
#canvas-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

#hangman-canvas {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.1) inset;
}

/* Word Reveal */
#word-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 5px;
    min-height: 45px;
}

.letter-box {
    width: 35px;
    height: 45px;
    border-bottom: 3px solid #f8fafc;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    padding-bottom: 5px;
    text-transform: uppercase;
}

#category-display {
    font-size: 0.95rem;
    color: #cbd5e1;
    margin-bottom: 15px;
    text-align: center;
    font-style: italic;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 10px;
    padding: 10px 15px;
    line-height: 1.5;
    width: 100%;
    box-sizing: border-box;
}

#category-text {
    color: #e2e8f0;
    font-weight: 500;
}

/* Tap Hint */
#tap-hint {
    font-size: 0.85rem;
    color: #64748b;
    text-align: center;
    margin-bottom: 10px;
}

/* Overlay */
.overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 10, 26, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 16px;
    transition: opacity 0.3s ease;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    max-width: 90%;
    width: 320px;
}

.overlay-content h2 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    background: linear-gradient(to right, #10b981, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.overlay-content p {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.stats-row {
    display: flex;
    justify-content: space-around;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 25px;
}

.stat-box {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
}

.stat-lbl {
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
}

.primary-btn {
    background: linear-gradient(135deg, #10b981, #3b82f6);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Outfit', sans-serif;
    width: 100%;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .game-viewport {
        padding: 10px;
    }
    
    #hud-top {
        margin-bottom: 10px;
        padding: 8px 15px;
    }
    
    #hangman-canvas {
        width: 160px;
        height: 160px;
    }
    
    .letter-box {
        width: 25px;
        height: 35px;
        font-size: 1.5rem;
    }
    
    .key {
        height: 40px;
    }
}

/* For very small devices */
@media (max-width: 360px) {
    .key {
        height: 35px;
        font-size: 0.9rem;
    }
    .letter-box {
        width: 20px;
        font-size: 1.2rem;
    }
}
