/* ==========================================
   SalmasFlix — Games · Hangman
   Extracted from games.css in Phase 7.9 (2026-04-23).
   Originally at lines 1271-1410 + 1860-1982 of the monolith
   ("HANGMAN GAME STYLES" + "HANGMAN STYLES (Fix)" — the Fix
   block redeclares many rules to override the base set; both
   are merged here in the same order so the overrides still
   win.)

   Puzzle-gate hangman on `/:slug/puzzles/hangman` has its own
   standalone stylesheet; this file is the in-app hangman gate
   used by the main `index.html` before login.

   Uses `@keyframes popIn` defined in games.css (shared with
   TTT pieces); do NOT redeclare here.
   ========================================== */

@layer features {


/* ==== HANGMAN GAME STYLES (original) ==== */

.hangman-game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
}

.hangman-svg-wrap {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    overflow: visible;
}

.hangman-svg {
    width: 100%;
    height: auto;
    overflow: visible;
    filter: drop-shadow(0 0 10px rgba(var(--secondary-rgb),0.3));
}

.hm-part {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hm-part.hidden {
    opacity: 0;
}

.hm-part.reveal-anim {
    opacity: 1;
    animation: hmReveal 0.5s ease;
}

@keyframes hmReveal {
    0% {
        opacity: 0;
        stroke: #e74c3c;
        stroke-width: 5;
    }

    50% {
        stroke: #e74c3c;
        stroke-width: 5;
    }

    100% {
        opacity: 1;
        stroke: #e8e8e8;
        stroke-width: 3;
    }
}

.hangman-lives {
    font-size: 0.95rem;
    margin: var(--spacing-sm) 0;
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
}

.lives-count {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: #e74c3c;
    margin-left: 6px;
    background: rgba(231, 76, 60, 0.15);
    padding: 2px 10px;
    border-radius: var(--radius-sm);
}

.hangman-phrase {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: var(--spacing-sm) var(--spacing-md);
    min-height: 40px;
    max-width: 400px;
    margin: 0 auto;
}

.hangman-word {
    display: flex;
    gap: 6px;
}

.hangman-space {
    width: 16px;
}

.hangman-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(28px, 7vw, 42px);
    height: clamp(36px, 9vw, 52px);
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 3px solid rgba(var(--secondary-rgb),0.5);
    transition: background 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease, filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    font-family: 'Outfit', sans-serif;
}

.hangman-letter.revealed {
    background: linear-gradient(135deg, #fff700, #e0c2ff);
    background-clip: text; -webkit-background-clip: text;
    background-clip: text; /* standard */
    -webkit-text-fill-color: transparent;
    border-bottom-color: #fff700;
    animation: letterReveal 0.4s ease;
    filter: drop-shadow(0 0 8px rgba(255, 247, 0, 1)) drop-shadow(0 0 20px rgba(var(--secondary-alt-rgb),0.9));
    text-shadow: 0 0 10px rgba(255, 247, 0, 0.4);
}

@keyframes letterReveal {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    60% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==== HANGMAN STYLES (Fix) — overrides the base block above ==== */

.hangman-game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.hangman-svg-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: clamp(5px, 1dvh, var(--spacing-sm));
    flex-shrink: 1;
    min-height: 0;
}

.hangman-svg {
    height: clamp(80px, 20dvh, 250px);
    width: auto;
    filter: drop-shadow(0 0 10px rgba(var(--secondary-rgb),0.3));
}

.hangman-phrase {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: var(--spacing-sm);
}

.hangman-word {
    display: flex;
    margin: 0 5px;
}

.hangman-letter {
    width: 30px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.4);
    margin: 0 2px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    min-height: 40px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 2px;
}

.hangman-letter.revealed {
    border-bottom-color: var(--secondary-alt);
    color: var(--secondary-alt);
    text-shadow: 0 0 12px rgba(var(--secondary-alt-rgb),0.5);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hangman-space {
    width: 15px;
}

.hangman-lives {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-style: italic;
}

/* SVG Line Animations */
.hm-part {
    transition: opacity 0.5s ease;
}

.hm-part.hidden {
    opacity: 0;
}

.hm-part.reveal-anim {
    animation: drawLine 1s ease forwards;
}

@keyframes drawLine {
    from {
        stroke-dashoffset: 100%;
        opacity: 0;
    }

    to {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

/* Tear Drop Animation */
.tear-drop-anim {
    animation: tearDrop 2s ease-in infinite;
    transform-origin: center;
}

@keyframes tearDrop {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        transform: translateY(20px) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translateY(30px) scale(0.5);
        opacity: 0;
    }
}


} /* end @layer features */
