/* ==========================================
   SalmasFlix — Games · Login Splash (Wordle/Hangman Gate)
   Extracted from games.css in Phase 7.9 (2026-04-24, Wave 6).
   Originally at lines 9-665 of the monolith ("WORDLE SECTION"
   through the end of "SUCCESS POPUP").

   This is the SITE ENTRY splash — not an in-game screen. It powers:
   - `#hangman-section.wordle-section` — the "solve a word to enter"
     gate that sits on top of the SPA before auth fires
   - `#login-section.wordle-section` — the password login card
     (same visual chrome as the hangman gate, different body content)
   - `#success-popup` — the "Ashtar Katkoooot" celebration card that
     appears after the gate puzzle is solved
   - `#message.game-over` — the end-of-session failure card

   Classes in this file are only consumed by:
   - `public/index.html` (the SPA shell, which paints the gate directly)
   - `public/js/games/hangman.js` (the ONLY game JS that touches `.tile`,
     `.keyboard`, `.key`, `.game-board`, `.board-row` — verified via grep)
   - `public/js/bootstrap/app-init.js` (gates the SPA behind
     `.wordle-section` before initializing the rest of the app)

   The `.success-*` family is also referenced by `public/css/components.css`
   (one small override block for the celebration popup position) —
   that file stays put; this one just ships the base definitions.

   Theme tokens: uses `var(--primary)` / `var(--primary-rgb)` /
   `var(--secondary)` / `var(--secondary-rgb)` / `var(--tile-*)` /
   `var(--correct)` / `var(--present)` / `var(--absent)` — no hardcoded
   accent hex values. The muted-grey keyboard shades (#4a4a6a, #3a3a5a,
   #565676) are deliberate non-accent chrome and stay literal.
   ========================================== */

@layer features {


/* ==========================================
   WORDLE SECTION
   ========================================== */

.wordle-section {
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* Wordle/Hangman Container */
.wordle-container {
    text-align: center;
    max-width: 700px;
    width: 100%;
    max-height: 100dvh;
    background: var(--bg-card);
    padding: clamp(var(--spacing-sm), 1.5dvh, var(--spacing-md));
    border-radius: var(--radius-xl);
    border: 1px solid rgba(var(--primary-rgb),0.15);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden; /* No scrolling for hangman */
}

.wordle-header {
    margin-bottom: clamp(var(--spacing-xs), 1.5dvh, var(--spacing-md));
    flex-shrink: 0;
}

.wordle-header .logo-modern {
    font-size: clamp(1.2rem, 4dvh, 2rem);
}

.wordle-header .tagline {
    font-size: clamp(0.7rem, 2dvh, 0.9rem);
    margin-top: 5px;
}

/* Login Form (inside wordle-container) */
.sfx-login-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(var(--primary-rgb),0.2);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 10px;
    outline: none;
    transition: border-color 0.2s;
}
.sfx-login-input:focus {
    border-color: rgba(var(--primary-rgb),0.5);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb),0.08);
}
.sfx-login-input::placeholder { color: #555; }

.sfx-login-google {
    width: 100%;
    padding: 14px;
    background: rgba(255,255,255,0.06);
    color: #e3e3e3;
    /* Secondary theme color — the sign-in card's primary accents (inputs,
       Sign-in gradient button) already use --primary, so Google gets the
       complementary --secondary for a visually balanced palette that still
       retints with every theme swap. */
    border: 1px solid rgba(var(--secondary-rgb),0.35);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
    transition: background 0.2s, background-color 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s, filter 0.2s, opacity 0.2s, transform 0.2s;
}
.sfx-login-google:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(var(--secondary-rgb),0.65);
    box-shadow: 0 2px 12px rgba(var(--secondary-rgb),0.2);
}

.sfx-login-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    transition: background 0.25s, background-color 0.25s, border-color 0.25s, box-shadow 0.25s, color 0.25s, filter 0.25s, opacity 0.25s, transform 0.25s;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb),0.35);
}
.sfx-login-primary:hover { box-shadow: 0 6px 20px rgba(var(--primary-rgb),0.5); transform: translateY(-1px); }

.sfx-login-link {
    background: none;
    border: none;
    color: var(--secondary-alt);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
}
.sfx-login-link:hover { text-decoration: underline; }

.sfx-login-error {
    color: #ef4444;
    text-align: center;
    margin-bottom: 12px;
    min-height: 20px;
    font-size: 0.85rem;
}

.sfx-login-footer {
    margin-top: 16px;
    text-align: center;
    color: #888;
    font-size: 0.85rem;
}

/* Game Board */
.game-board {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    gap: clamp(2px, 1vw, var(--spacing-xs));
    margin: 0 auto var(--spacing-lg);
    max-width: 100%;
    width: fit-content;
}

.board-row {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: clamp(2px, 1vw, var(--spacing-xs));
    justify-content: center;
}

.tile {
    aspect-ratio: 1;
    width: clamp(20px, 6vw, 45px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.9rem, 3vw, 1.5rem);
    font-weight: 700;
    text-transform: uppercase;
    border: 2px solid var(--tile-border);
    background: var(--tile-empty);
    border-radius: var(--radius-sm);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.tile.filled {
    border-color: var(--accent-secondary);
    animation: pop 0.1s ease;
}

.tile.correct {
    background: var(--correct);
    border-color: var(--correct);
    animation: flip 0.5s ease forwards;
}

.tile.present {
    background: var(--present);
    border-color: var(--present);
    animation: flip 0.5s ease forwards;
}

.tile.absent {
    background: var(--absent);
    border-color: var(--absent);
    animation: flip 0.5s ease forwards;
}

@keyframes pop {
    50% {
        transform: scale(1.1);
    }
}

@keyframes flip {
    0% {
        transform: rotateX(0deg);
    }

    50% {
        transform: rotateX(90deg);
    }

    100% {
        transform: rotateX(0deg);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

.board-row.shake {
    animation: shake 0.5s ease;
}

/* Message */
.message {
    min-height: 2rem;
    margin-bottom: var(--spacing-md);
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    font-weight: 600;
    color: var(--accent-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.message.show {
    opacity: 1;
}

/* Mobile Input - invisible but focusable for native keyboard */
.mobile-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 1px;
    width: 1px;
}

/* Keyboard */
.keyboard {
    display: flex;
    flex-direction: column;
    gap: clamp(4px, 1vw, var(--spacing-xs));
    margin-bottom: var(--spacing-md);
    width: 100%;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: clamp(3px, 1vw, var(--spacing-xs));
}

.key {
    min-width: clamp(28px, 8vw, 45px);
    height: clamp(32px, 7dvh, 55px);
    padding: 0 clamp(4px, 1vw, var(--spacing-sm));
    font-family: inherit;
    font-size: clamp(0.75rem, 1.8dvh, 1rem);
    font-weight: 600;
    text-transform: uppercase;
    background: linear-gradient(145deg, #4a4a6a, #3a3a5a);
    color: var(--text-primary);
    border: 1px solid rgba(var(--secondary-rgb),0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast), filter var(--transition-fast), opacity var(--transition-fast), transform var(--transition-fast);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    flex-shrink: 1;
}

/* Mobile keyboard - fits below grid, full width */
/* breakpoint snap 600px -> 768px (Phase 7.6 ladder) */
@media (max-width: 768px),
(hover: none) and (pointer: coarse) {
    .wordle-section {
        transform: none;
        padding-bottom: var(--spacing-md);
    }

    .wordle-container {
        padding: var(--spacing-sm);
        max-width: 100%;
    }

    /* ... omitted keyboard styles for brevity ... */

    .keyboard {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
        padding: clamp(2px, 1dvh, var(--spacing-sm)) 2px;
        gap: clamp(2px, 1dvh, 5px);
        flex-shrink: 0;
    }

    .keyboard-row {
        gap: 4px;
        padding: 0 2px;
        justify-content: center;
    }

    /* Row 2 (ASDFGHJKL) - indent for pyramid effect */
    .keyboard-row:nth-child(2) {
        padding: 0 4%;
    }

    /* Row 3 (ZXCVBNM) - indent more for pyramid effect */
    .keyboard-row:nth-child(3) {
        padding: 0 2%;
    }

    .key {
        flex: 0 1 auto;
        width: clamp(28px, 8.5vw, 40px);
        min-width: 0;
        height: 48px;
        padding: 0;
        font-size: 0.85rem;
        font-weight: 700;
        background: #565676;
        border: 1px solid rgba(var(--secondary-rgb),0.4);
        border-radius: 5px;
        color: white;
    }

    .key:active {
        background: #7a7a9a;
        transform: none;
    }

    .key.correct {
        background: var(--correct);
        border-color: var(--correct);
    }

    .key.present {
        background: var(--present);
        border-color: var(--present);
    }

    .key.absent {
        background: #3a3a4c;
        border-color: #3a3a4c;
    }

    .key-wide {
        flex: 0 1 auto;
        width: clamp(40px, 12vw, 65px);
        font-size: 0.65rem;
    }

    .tile {
        width: clamp(14px, 7.5vw, 28px);
        height: clamp(14px, 7.5vw, 28px);
        font-size: clamp(0.7rem, 3.5vw, 1.1rem);
    }

    .board-row {
        grid-template-columns: repeat(8, minmax(0, 1fr));
        gap: 2px;
        justify-content: center;
    }
}

.key:hover,
.key:active {
    background: linear-gradient(145deg, #5a5a7a, #4a4a6a);
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}

.key-wide {
    min-width: clamp(45px, 12vw, 70px);
    font-size: clamp(0.6rem, 1.8vw, 0.75rem);
}

.key.correct {
    background: var(--correct);
    border-color: var(--correct);
}

.key.present {
    background: var(--present);
    border-color: var(--present);
}

.key.absent {
    background: var(--absent);
    border-color: var(--absent);
}

.hint {
    color: var(--accent-primary);
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    font-style: italic;
    opacity: 0.8;
}

/* Game Over Message */
#message {
    text-align: center;
    min-height: 30px;
    opacity: 0;
    transition: opacity 0.3s;
}

#message.show {
    opacity: 1;
}

#message.game-over {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    padding: var(--spacing-md);
    backdrop-filter: blur(4px);
}

.game-over-message {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    text-align: center;
    padding: 2rem 2.5rem;
    background: linear-gradient(135deg, rgba(25, 20, 50, 0.95), rgba(15, 12, 30, 0.98));
    border-radius: 16px;
    border: 1px solid rgba(var(--secondary-alt-rgb),0.35);
    backdrop-filter: blur(20px);
    box-shadow: 0 0 40px rgba(var(--secondary-alt-rgb),0.15), 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 380px;
    width: 90vw;
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.game-over-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ff6b6b;
}

.game-over-text {
    font-size: 1rem;
    color: var(--text-secondary);
}

.game-over-hint {
    font-size: 0.9rem;
    color: rgba(var(--secondary-alt-rgb),0.9);
    font-style: italic;
    padding: var(--spacing-sm);
    background: rgba(var(--secondary-alt-rgb),0.1);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(var(--secondary-alt-rgb),0.2);
}

.refresh-btn {
    padding: 10px 24px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, filter 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb),0.3);
}

.refresh-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb),0.4);
}

/* ==========================================
   SUCCESS POPUP
   ========================================== */

#success-popup, .success-popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--spacing-md);
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(4px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.success-content {
    text-align: center;
    padding: 2rem 2.5rem;
    background: linear-gradient(135deg, rgba(25, 20, 50, 0.95), rgba(15, 12, 30, 0.98));
    border-radius: 16px;
    border: 1px solid rgba(var(--secondary-alt-rgb),0.35);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
    box-shadow: 0 0 40px rgba(var(--secondary-alt-rgb),0.15), 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 380px;
    width: 90vw;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-icon {
    font-size: clamp(3rem, 10vw, 4rem);
    margin-bottom: var(--spacing-md);
    animation: bounce 1s ease infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.success-content h2 {
    font-size: clamp(1.5rem, 5vw, 2rem);
    margin-bottom: var(--spacing-xs);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    background-clip: text; -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.success-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-lg);
}

.success-content p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
}

.enter-btn {
    padding: var(--spacing-md) var(--spacing-xl);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background var(--transition-normal), background-color var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal), color var(--transition-normal), filter var(--transition-normal), opacity var(--transition-normal), transform var(--transition-normal);
    box-shadow: 0 4px 20px rgba(var(--primary-rgb),0.35);
    -webkit-tap-highlight-color: transparent;
}

.pulse-btn {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(var(--primary-rgb),0.35);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 8px 35px rgba(var(--primary-rgb),0.5);
    }
}

.enter-btn:hover,
.enter-btn:active {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(var(--primary-rgb),0.5);
    animation: none;
}

/* Confetti */
.confetti-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    to {
        top: 100%;
        transform: rotate(720deg);
    }
}


} /* end @layer features */
