﻿/* =========================================================
   01 - DESIGN TOKENS
   ========================================================= */

:root {
    --wb-bg: #f5f7fb;
    --wb-bg-deep: #062f33;
    --wb-surface: #ffffff;
    --wb-surface-soft: #f3f7f8;
    --wb-surface-mint: #edfafa;
    --wb-text: #10222b;
    --wb-muted: #647482;
    --wb-soft-text: #84919c;
    --wb-line: #dce6ea;
    --wb-primary: #0f8b8d;
    --wb-primary-dark: #075f63;
    --wb-primary-soft: #dff5f4;
    --wb-accent: #f25f5c;
    --wb-accent-soft: #fff0ef;
    --wb-reward: #f2c14e;
    --wb-reward-soft: #fff6d8;
    --wb-success: #36a66a;
    --wb-danger: #ef4444;
    --wb-purple: #7c3aed;
    --wb-radius-sm: 10px;
    --wb-radius-md: 16px;
    --wb-radius-lg: 24px;
    --wb-radius-xl: 32px;
    --wb-shadow-sm: 0 8px 22px rgba(16, 34, 43, 0.08);
    --wb-shadow-md: 0 18px 48px rgba(16, 34, 43, 0.12);
    --wb-shadow-lg: 0 28px 80px rgba(16, 34, 43, 0.18);
    --wb-space-1: 4px;
    --wb-space-2: 8px;
    --wb-space-3: 12px;
    --wb-space-4: 16px;
    --wb-space-5: 24px;
    --wb-space-6: 32px;
    --wb-space-7: 48px;
    --wb-font-xs: 0.76rem;
    --wb-font-sm: 0.88rem;
    --wb-font-md: 1rem;
    --wb-font-lg: 1.15rem;
    --wb-font-xl: 1.55rem;
    --wb-font-2xl: 2.2rem;
    --wb-font-3xl: 3rem;
}


/* =========================================================
   02 - ROOT / ISOLATION
   ========================================================= */

.wb-game-shell,
.wb-game-shell *,
.wb-leaderboard-section,
.wb-leaderboard-section * {
    box-sizing: border-box;
}

.wb-game-shell {
    position: relative;
    isolation: isolate;
    width: 100%;
    margin: 0 auto;
    border: 1px solid rgba(16, 34, 43, 0.1);
    border-radius: var(--wb-radius-xl);
    padding: var(--wb-space-6);
    overflow: hidden;
    color: var(--wb-text);
    background: radial-gradient(circle at 42% 48%, rgba(242, 193, 78, 0.16), transparent 28%), radial-gradient(circle at 80% 12%, rgba(15, 139, 141, 0.12), transparent 28%), linear-gradient(180deg, #ffffff 0%, #fbfdfd 100%);
    box-shadow: var(--wb-shadow-lg);
}

    .wb-game-shell::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        pointer-events: none;
        background: radial-gradient(circle at 3% 20%, rgba(15, 139, 141, 0.1), transparent 18%), radial-gradient(circle at 97% 82%, rgba(242, 95, 92, 0.08), transparent 18%);
    }

    .wb-game-shell a,
    .wb-sound-toggle,
    .wb-restart-button,
    .wb-game-shell .primary-button,
    .wb-game-shell .ghost-button {
        font-family: inherit;
    }

.word-burst {
    color: inherit;
}

.antiforgery-token {
    display: none;
}


/* =========================================================
   03 - GAME HEADER
   ========================================================= */

.wb-game-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--wb-space-5);
    align-items: start;
    margin-bottom: var(--wb-space-4);
}

.wb-game-title-block {
    min-width: 0;
}

.wb-eyebrow,
.wb-panel-kicker,
.wb-chip-label {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 10px;
    background: var(--wb-reward-soft);
    color: #8a6100;
    font-size: var(--wb-font-xs);
    font-weight: 900;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.wb-game-title {
    margin: 10px 0 8px;
    color: var(--wb-text);
    font-size: clamp(2rem, 3vw, var(--wb-font-3xl));
    line-height: 0.98;
    letter-spacing: -0.045em;
    font-weight: 950;
}

.wb-game-goal {
    max-width: 720px;
    margin: 0;
    color: var(--wb-muted);
    font-size: var(--wb-font-lg);
    line-height: 1.55;
}


/* =========================================================
   04 - STAT CARDS
   ========================================================= */

.wb-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(104px, 1fr));
    gap: var(--wb-space-3);
}

.wb-stat-card {
    min-width: 112px;
    min-height: 86px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "icon label"
        "icon value";
    align-items: center;
    gap: 2px 10px;
    border: 1px solid rgba(16, 34, 43, 0.09);
    border-radius: var(--wb-radius-lg);
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--wb-shadow-sm);
}

.wb-stat-icon {
    grid-area: icon;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--wb-primary-soft);
    font-size: 1.25rem;
}

.wb-stat-label {
    grid-area: label;
    color: var(--wb-muted);
    font-size: var(--wb-font-sm);
    font-weight: 800;
}

.wb-stat-value {
    grid-area: value;
    color: var(--wb-primary-dark);
    font-size: 1.38rem;
    line-height: 1;
    font-weight: 950;
}

.wb-stat-score {
    color: var(--wb-accent);
}

.wb-stat-combo {
    color: var(--wb-purple);
}

.wb-stat-muted {
    color: var(--wb-soft-text);
}


/* =========================================================
   05 - HELPER BAR
   ========================================================= */

.wb-helper-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 54px;
    margin-bottom: var(--wb-space-5);
    border: 1px solid rgba(15, 139, 141, 0.18);
    border-radius: var(--wb-radius-md);
    padding: 10px 12px;
    background: linear-gradient(90deg, rgba(223, 245, 244, 0.92), rgba(255, 255, 255, 0.88));
}

    .wb-helper-bar span {
        display: inline-flex;
        align-items: center;
        min-height: 32px;
        color: #2b5e63;
        font-size: var(--wb-font-sm);
        font-weight: 850;
    }

        .wb-helper-bar span + span::before {
            content: "•";
            margin-right: 10px;
            color: rgba(15, 139, 141, 0.45);
        }

.wb-sound-toggle {
    margin-left: auto;
    min-height: 36px;
    border: 1px solid rgba(15, 139, 141, 0.2);
    border-radius: 999px;
    padding: 0 14px;
    background: #ffffff;
    color: var(--wb-primary-dark);
    font-size: var(--wb-font-sm);
    font-weight: 900;
    cursor: pointer;
}

    .wb-sound-toggle[aria-pressed="false"] {
        color: var(--wb-muted);
        background: var(--wb-surface-soft);
    }


/* =========================================================
   06 - MAIN STAGE
   ========================================================= */

.wb-main-stage {
    display: grid;
    grid-template-columns: minmax(420px, 1.45fr) minmax(320px, 0.85fr);
    gap: 18px;
    align-items: start;
}

.wb-board-area {
    min-width: 0;
}

.wb-board-frame {
    position: relative;
    min-height: 100%;
    border-radius: var(--wb-radius-xl);
    padding: clamp(16px, 2vw, 28px);
    background: radial-gradient(circle at 76% 50%, rgba(242, 193, 78, 0.12), transparent 26%), linear-gradient(180deg, #ffffff 0%, #f7fbfb 100%);
}


/* =========================================================
   07 - BOARD WRAP / SELECTION LINE
   ========================================================= */

.wb-board-wrap {
    position: relative;
    width: min(100%, 600px);
    min-height: 1px;
}

.wb-selection-svg {
    position: absolute;
    inset: 0;
    z-index: 30;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.wb-selection-line {
    fill: none;
    stroke: var(--wb-path-color, var(--wb-primary));
    stroke-width: 13;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
    filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.58)) drop-shadow(0 8px 14px rgba(15, 139, 141, 0.2));
    transition: opacity 120ms ease, stroke 120ms ease, stroke-width 120ms ease;
}

    .wb-selection-line.is-active {
        opacity: 0.62;
    }

    .wb-selection-line.is-success {
        opacity: 0.9;
        stroke-width: 15;
        filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.5)) drop-shadow(0 10px 18px rgba(54, 166, 106, 0.32));
    }

    .wb-selection-line.is-invalid {
        opacity: 0.95;
        stroke: var(--wb-danger);
        stroke-width: 15;
        filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.5)) drop-shadow(0 10px 18px rgba(239, 68, 68, 0.28));
    }


/* =========================================================
   08 - LETTER BOARD / CELLS
   ========================================================= */

.letter-board {
    position: relative;
    z-index: 2;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(8px, 1.25vw, 14px);
    touch-action: none;
    user-select: none;
}

.letter-cell {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 2px solid #d6e3e6;
    border-radius: clamp(12px, 1.5vw, 18px);
    background: linear-gradient(180deg, #ffffff 0%, #f4f7f8 100%);
    color: #082832;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(2rem, 4.6vw, 3.25rem);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.035em;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 0 #d9e5e8, 0 15px 24px rgba(16, 34, 43, 0.08);
    cursor: pointer;
    transition: transform 120ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

    .letter-cell:hover:not(:disabled) {
        transform: translateY(-2px);
        border-color: rgba(15, 139, 141, 0.42);
    }

    .letter-cell.is-selected {
        border-color: var(--wb-primary);
        background: radial-gradient(circle at 70% 25%, rgba(255, 255, 255, 0.9), transparent 34%), linear-gradient(180deg, #dcfbf7 0%, #a8eee5 100%);
        transform: translateY(4px);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 4px 0 rgba(15, 139, 141, 0.35), 0 12px 24px rgba(15, 139, 141, 0.18);
    }

    .letter-cell.is-burst {
        border-color: var(--wb-reward);
        background: radial-gradient(circle at 70% 25%, rgba(255, 255, 255, 0.86), transparent 34%), linear-gradient(180deg, #fff6d8 0%, #ffd96a 100%);
        animation: wb-pop 360ms ease;
    }

    .letter-cell.is-found {
        border-color: var(--hit-color);
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.62)), var(--hit-color);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 8px 0 rgba(16, 34, 43, 0.12), 0 16px 28px rgba(16, 34, 43, 0.14);
    }

    .letter-cell:disabled {
        cursor: default;
        opacity: 0.76;
    }


/* =========================================================
   09 - LIVE REWARD
   ========================================================= */

.wb-live-reward[hidden] {
    display: none;
}

.wb-live-reward {
    position: absolute;
    top: 44%;
    right: clamp(4px, 3vw, 28px);
    z-index: 40;
    display: grid;
    justify-items: center;
    gap: 4px;
    pointer-events: none;
    transform: rotate(-2deg);
    animation: wb-live-reward-pop 760ms ease forwards;
}

    .wb-live-reward strong {
        color: var(--wb-reward);
        font-size: clamp(2rem, 4vw, 4rem);
        line-height: 0.9;
        font-weight: 950;
        text-shadow: 0 8px 20px rgba(242, 193, 78, 0.28);
    }

    .wb-live-reward span {
        color: #9b6800;
        font-size: var(--wb-font-lg);
        font-weight: 950;
    }


/* =========================================================
   10 - SIDE PANEL
   ========================================================= */

.wb-side-panel {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.wb-current-card,
.wb-progress-card,
.wb-found-card,
.wb-leaderboard-section {
    border: 1px solid rgba(16, 34, 43, 0.09);
    border-radius: var(--wb-radius-lg);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--wb-shadow-sm);
}

.wb-current-card,
.wb-progress-card,
.wb-found-card {
    padding: 16px;
}

.wb-current-card {
    min-height: 124px;
}

.wb-current-word {
    min-height: 46px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--wb-line);
    margin-top: 8px;
    color: var(--wb-primary-dark);
    font-size: clamp(1.8rem, 2.5vw, 2.7rem);
    line-height: 1;
    font-weight: 950;
    letter-spacing: 0.02em;
}

.wb-feedback-line {
    min-height: 28px;
    display: flex;
    align-items: center;
    margin-top: 8px;
    color: var(--wb-muted);
    font-size: var(--wb-font-sm);
    font-weight: 850;
}

    .wb-feedback-line.is-good {
        color: var(--wb-success);
    }

    .wb-feedback-line.is-bad {
        color: var(--wb-danger);
    }


/* =========================================================
   11 - PROGRESS CARD
   ========================================================= */

.wb-progress-head,
.wb-progress-foot,
.wb-found-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.wb-progress-head {
    color: var(--wb-text);
    font-size: var(--wb-font-sm);
    font-weight: 850;
}

.wb-target-left {
    color: var(--wb-muted);
}

.wb-progress-track {
    height: 18px;
    margin: 12px 0 10px;
    border-radius: 999px;
    overflow: hidden;
    background: #e7eff1;
}

    .wb-progress-track span {
        display: block;
        height: 100%;
        width: 0;
        border-radius: inherit;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.16) 50%, rgba(255, 255, 255, 0.16) 75%, transparent 75%, transparent), linear-gradient(90deg, var(--wb-primary), var(--wb-success), var(--wb-reward));
        background-size: 20px 20px, 100% 100%;
        transition: width 180ms ease;
    }

.wb-game-shell.is-target-reached .wb-progress-track span {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.18) 50%, rgba(255, 255, 255, 0.18) 75%, transparent 75%, transparent), linear-gradient(90deg, var(--wb-success), var(--wb-reward));
    background-size: 20px 20px, 100% 100%;
}

.wb-progress-foot {
    color: var(--wb-muted);
    font-size: var(--wb-font-sm);
    font-weight: 850;
}


/* =========================================================
   12 - FOUND WORDS
   ========================================================= */

.wb-found-head {
    margin-bottom: 12px;
}

    .wb-found-head > div {
        display: grid;
        gap: 6px;
    }

    .wb-found-head strong {
        color: var(--wb-text);
        font-size: var(--wb-font-lg);
    }

.wb-found-list {
    min-height: 92px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 8px;
}

    .wb-found-list span {
        min-height: 44px;
        display: grid;
        place-items: center;
        border: 1px solid var(--hit-color);
        border-radius: 14px;
        padding: 6px 10px;
        background: rgba(255, 255, 255, 0.72);
        color: var(--hit-color);
        font-size: var(--wb-font-sm);
        font-weight: 950;
        text-align: center;
    }

        .wb-found-list span.is-bonus {
            box-shadow: inset 0 0 0 2px rgba(242, 193, 78, 0.28), 0 8px 20px rgba(242, 193, 78, 0.16);
        }


/* =========================================================
   13 - BUTTONS
   ========================================================= */

.wb-game-shell .primary-button,
.wb-game-shell .ghost-button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--wb-radius-md);
    padding: 0 18px;
    font-weight: 950;
    text-decoration: none;
    cursor: pointer;
}

.wb-game-shell .primary-button {
    border: 0;
    background: linear-gradient(180deg, #ff766e, var(--wb-accent));
    color: #ffffff;
    box-shadow: 0 16px 32px rgba(242, 95, 92, 0.25);
}

.wb-game-shell .ghost-button {
    border: 1px solid rgba(16, 34, 43, 0.12);
    background: #ffffff;
    color: var(--wb-primary-dark);
}

    .wb-game-shell .ghost-button:hover {
        background: var(--wb-primary-soft);
    }

.wb-restart-button {
    width: 100%;
    min-height: 50px;
    border: 1px solid rgba(15, 139, 141, 0.28) !important;
    border-radius: var(--wb-radius-md);
    background: linear-gradient(180deg, #ffffff 0%, #f4fbfb 100%);
    color: var(--wb-primary-dark);
    box-shadow: 0 8px 18px rgba(16, 34, 43, 0.06);
    font-weight: 900;
}

    .wb-restart-button:hover {
        border-color: rgba(15, 139, 141, 0.48) !important;
        background: var(--wb-primary-soft);
    }

    .wb-restart-button:focus,
    .wb-restart-button:focus-visible {
        outline: 3px solid rgba(15, 139, 141, 0.18);
        outline-offset: 2px;
    }


/* =========================================================
   14 - RESULT CARD
   ========================================================= */

.wb-result-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--wb-space-4);
    margin-top: var(--wb-space-5);
    border: 1px solid rgba(242, 193, 78, 0.22);
    border-radius: var(--wb-radius-lg);
    padding: var(--wb-space-4);
    background: radial-gradient(circle at 10% 50%, rgba(242, 193, 78, 0.26), transparent 22%), linear-gradient(135deg, #063f43, #082c32);
    color: #ffffff;
    box-shadow: var(--wb-shadow-md);
}

    .wb-result-card[hidden] {
        display: none;
    }

.wb-result-trophy {
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 3.2rem;
}

.wb-result-copy h2 {
    margin: 8px 0 4px;
    font-size: var(--wb-font-xl);
    line-height: 1.1;
}

.wb-result-copy p {
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
    line-height: 1.5;
}

.wb-result-score {
    min-width: 130px;
    display: grid;
    justify-items: end;
}

    .wb-result-score strong {
        color: var(--wb-reward);
        font-size: var(--wb-font-2xl);
        line-height: 1;
    }

    .wb-result-score span {
        color: rgba(255, 255, 255, 0.72);
        font-weight: 850;
    }

.wb-result-actions {
    grid-column: 2 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.wb-result-card.is-loading {
    opacity: 0.82;
}

.wb-result-card.is-error {
    background: linear-gradient(135deg, #4a1114, #341012);
}

.wb-result-actions button:disabled {
    cursor: wait;
    opacity: 0.68;
}


/* =========================================================
   15 - LEADERBOARD
   ========================================================= */

.wb-leaderboard-section {
    display: block;
    margin-top: var(--wb-space-5);
    padding: var(--wb-space-5);
}

.wb-leaderboard-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--wb-space-4);
    margin-bottom: var(--wb-space-4);
}

    .wb-leaderboard-head h2 {
        margin: 8px 0 0;
        color: var(--wb-text);
        font-size: var(--wb-font-xl);
        line-height: 1.1;
    }

.wb-leaderboard-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

    .wb-leaderboard-list li {
        min-height: 58px;
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px;
        border: 1px solid var(--wb-line);
        border-radius: var(--wb-radius-md);
        padding: 9px 12px;
        background: #ffffff;
    }

.leaderboard-rank {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--wb-primary-soft);
    color: var(--wb-primary-dark);
    font-weight: 950;
}

.wb-leaderboard-list li:nth-child(1) .leaderboard-rank {
    background: #ffe58b;
    color: #6b4b00;
}

.wb-leaderboard-list li:nth-child(2) .leaderboard-rank {
    background: #e4eaee;
    color: #44515a;
}

.wb-leaderboard-list li:nth-child(3) .leaderboard-rank {
    background: #f6d2b5;
    color: #73431e;
}

.wb-leaderboard-list li.is-current-player {
    border-color: rgba(15, 139, 141, 0.5);
    background: #f0fbfa;
    box-shadow: inset 4px 0 0 var(--wb-primary);
}

.leaderboard-player {
    min-width: 0;
    display: grid;
    gap: 3px;
}

    .leaderboard-player strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .leaderboard-player small {
        color: var(--wb-muted);
        font-size: var(--wb-font-xs);
        font-weight: 800;
    }

.leaderboard-score {
    color: var(--wb-accent);
    white-space: nowrap;
    font-weight: 950;
}

.wb-leaderboard-empty {
    margin: 0;
    padding: var(--wb-space-4) 0 0;
    color: var(--wb-muted);
}


/* =========================================================
   16 - GENERATED EFFECTS
   ========================================================= */

.score-pop {
    position: absolute;
    top: 46%;
    left: 50%;
    z-index: 50;
    pointer-events: none;
    color: var(--hit-color);
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1;
    font-weight: 950;
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7), 0 10px 28px rgba(16, 34, 43, 0.2);
    animation: wb-score-pop 720ms ease forwards;
}

.confetti-dot {
    position: absolute;
    top: 16px;
    z-index: 51;
    width: 10px;
    height: 16px;
    border-radius: 4px;
    background: var(--hit-color);
    pointer-events: none;
    animation: wb-confetti-drop 980ms ease-out forwards;
}

.wb-game-shell.is-shaking {
    animation: wb-shake 180ms ease;
}


/* =========================================================
   17 - ANIMATIONS
   ========================================================= */

@keyframes wb-pop {
    0% {
        transform: scale(1);
    }

    55% {
        transform: scale(1.12) rotate(2deg);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes wb-score-pop {
    0% {
        opacity: 0;
        transform: translate(-50%, 10px) scale(0.82);
    }

    34% {
        opacity: 1;
        transform: translate(-50%, -10px) scale(1.08);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -58px) scale(1);
    }
}

@keyframes wb-live-reward-pop {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.86) rotate(-2deg);
    }

    18% {
        opacity: 1;
        transform: translateY(-4px) scale(1.04) rotate(-2deg);
    }

    72% {
        opacity: 1;
        transform: translateY(-10px) scale(1) rotate(-2deg);
    }

    100% {
        opacity: 0;
        transform: translateY(-28px) scale(1) rotate(-2deg);
    }
}

@keyframes wb-confetti-drop {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        opacity: 0;
        transform: translate(var(--fall-x), 220px) rotate(320deg);
    }
}

@keyframes wb-shake {
    0%, 100% {
        transform: translateX(0);
    }

    35% {
        transform: translateX(-5px);
    }

    70% {
        transform: translateX(5px);
    }
}


/* =========================================================
   18 - RESPONSIVE: TABLET
   ========================================================= */

@media (max-width: 1120px) {
    .wb-game-header {
        grid-template-columns: 1fr;
    }

    .wb-stat-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .wb-main-stage {
        grid-template-columns: minmax(0, 1fr);
    }

    .wb-board-wrap {
        margin: 0 auto;
    }

    .wb-live-reward {
        right: 8%;
    }
}


/* =========================================================
   19 - RESPONSIVE: MOBILE
   ========================================================= */

@media (max-width: 760px) {
    .wb-game-shell {
        border-radius: var(--wb-radius-lg);
        padding: var(--wb-space-4);
    }

    .wb-game-title {
        font-size: clamp(2rem, 8vw, 2.65rem);
    }

    .wb-game-goal {
        font-size: var(--wb-font-md);
    }

    .wb-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wb-stat-card {
        min-height: 76px;
        padding: 12px;
    }

    .wb-helper-bar {
        align-items: stretch;
        flex-direction: column;
    }

        .wb-helper-bar span + span::before {
            display: none;
        }

    .wb-sound-toggle {
        margin-left: 0;
        width: 100%;
    }

    .wb-board-frame {
        padding: 10px 0 18px;
    }

    .wb-live-reward {
        right: 50%;
        top: 42%;
        transform: translateX(50%) rotate(-2deg);
    }

    .wb-result-card {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .wb-result-trophy {
        width: 68px;
        height: 68px;
        font-size: 2.6rem;
    }

    .wb-result-score {
        justify-items: start;
    }

    .wb-result-actions {
        grid-column: 1;
        justify-content: stretch;
    }

        .wb-result-actions .primary-button,
        .wb-result-actions .ghost-button {
            width: 100%;
        }
}


/* =========================================================
   20 - RESPONSIVE: SMALL MOBILE
   ========================================================= */

@media (max-width: 520px) {
    .wb-game-shell {
        padding: 12px;
        border-radius: 18px;
    }

    .wb-stat-grid {
        gap: 8px;
    }

    .wb-stat-card {
        min-width: 0;
        grid-template-columns: 1fr;
        grid-template-areas:
            "icon"
            "label"
            "value";
        justify-items: center;
        text-align: center;
    }

    .wb-stat-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .wb-stat-value {
        font-size: 1.12rem;
    }

    .letter-board {
        gap: 7px;
    }

    .letter-cell {
        font-size: clamp(1.55rem, 10vw, 2.35rem);
        font-weight: 800;
        border-radius: 12px;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 5px 0 #d9e5e8, 0 10px 18px rgba(16, 34, 43, 0.08);
    }

    .wb-current-word {
        min-height: 54px;
        font-size: 2rem;
    }

    .wb-found-list {
        grid-template-columns: 1fr;
        min-height: 72px;
    }

    .wb-leaderboard-section {
        padding: var(--wb-space-4);
    }

    .wb-leaderboard-list li {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .leaderboard-score {
        grid-column: 2;
    }
}

/* =========================================================
   21 - JS STATE HELPERS
   ========================================================= */

.wb-game-shell [hidden],
.wb-leaderboard-section [hidden] {
    display: none !important;
}

.wb-game-shell .wb-js-hidden,
.wb-leaderboard-section .wb-js-hidden {
    display: none !important;
}

.wb-result-actions .primary-button,
.wb-result-actions .ghost-button {
    pointer-events: auto;
}

    .wb-result-actions .primary-button:disabled,
    .wb-result-actions .ghost-button:disabled {
        cursor: wait;
        opacity: 0.68;
    }

    .wb-result-actions .primary-button:not(:disabled),
    .wb-result-actions .ghost-button:not(:disabled) {
        cursor: pointer;
        opacity: 1;
    }
