/* ========================================
   GAMES HEADER - Slide-Down System
   Unified header component for all games
   ======================================== */

/* ========================================
   1. SLIDE-DOWN HEADER
   ======================================== */
.game-header {
    position: fixed;
    top: -250px; /* Increased to fully hide tall headers (was -160px) */
    left: 0;
    right: 0;
    background: var(--header-bg);
    padding: 0.8rem 1rem;
    border-bottom: 3px solid var(--header-border);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1);
    z-index: 1000;
    transition: top 0.35s ease;
}

.game-header.visible {
    top: 0;
}

/* Hide header by default on touch devices */
@media (hover: none) and (pointer: coarse) {
    .game-header {
        top: -250px; /* Increased to fully hide tall headers (was -160px) */
    }
    .game-header.visible {
        top: 0;
    }
}

/* ========================================
   2. CLOSE BUTTON (X in corner)
   ======================================== */
.header-close-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1001;
    padding: 0;
    margin: 0;
}

.header-close-btn:hover {
    background: var(--bg-secondary);
    transform: scale(1.1);
}

.header-close-btn:active {
    transform: scale(0.95);
}

/* ========================================
   3. HEADER TOP ROW (Title | CEFR | Dark Mode)
   ======================================== */
.header-top-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
    padding-left: 3rem; /* Space for X button in corner */
}

.game-title {
    font-family: var(--font-primary);
    font-size: clamp(1.1rem, 4vw, 1.8rem);
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
    justify-self: start;
    white-space: nowrap;
}

/* ========================================
   4. RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (max-width: 768px) {
    .header-top-row {
        padding-left: 2.5rem;
        gap: 0.4rem;
    }
    
    .game-title {
        font-size: clamp(1rem, 3.5vw, 1.5rem);
    }
    
    .header-close-btn {
        width: 36px;
        height: 36px;
        font-size: 1.6rem;
    }
}

