/* ═══════════════════════════════════════════════
   Word Tag Vocab — game.css
   Aesthetic: Urban-playful. Graffiti meets
   a bright learning app. Bold ink on concrete.
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;700;800;900&display=swap');

/* ── Tokens ── */
#wtv-app {
    --c-bg:       #1a1a2e;
    --c-surface:  #16213e;
    --c-card:     #0f3460;
    --c-primary:  #e94560;
    --c-yellow:   #ffd460;
    --c-green:    #4ecca3;
    --c-purple:   #a855f7;
    --c-text:     #f0f0f0;
    --c-muted:    #8892a4;
    --c-wall:     #2d2d2d;
    --r:          18px;
    --shadow:     0 8px 32px rgba(0,0,0,.4);

    font-family: 'Nunito', sans-serif;
    max-width: 580px;
    margin: 30px auto;
    background: var(--c-bg);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow), 0 0 0 3px var(--c-primary);
    color: var(--c-text);
    position: relative;
    min-height: 520px;
}

/* ── Screens ── */
.wtv-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 28px 24px 32px;
    animation: wtv-fadein .35s ease;
    min-height: 480px;
    justify-content: center;
}

.wtv-screen-active { display: flex !important; }

@keyframes wtv-fadein {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══ PROFILE SCREEN ═══ */
.wtv-logo {
    font-family: 'Fredoka One', cursive;
    font-size: 2.4rem;
    color: var(--c-yellow);
    text-shadow: 3px 3px 0 var(--c-primary);
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.wtv-screen-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 0 20px;
    color: var(--c-text);
}

.wtv-avatars {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 16px;
}

.wtv-avatar-card {
    background: var(--c-surface);
    border: 2.5px solid transparent;
    border-radius: 16px;
    padding: 14px 18px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, transform .15s;
    min-width: 90px;
}

.wtv-avatar-card:hover,
.wtv-avatar-card.active {
    border-color: var(--c-primary);
    transform: scale(1.06);
}

.wtv-avatar-card .av-icon { font-size: 2rem; display: block; }
.wtv-avatar-card .av-name { font-size: .8rem; font-weight: 700; margin-top: 4px; color: var(--c-muted); }
.wtv-avatar-card .av-cans { font-size: .75rem; color: var(--c-yellow); }

.wtv-avatar-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 12px;
}

.wtv-avatar-opt {
    font-size: 1.5rem;
    background: var(--c-surface);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
    transition: border-color .15s, transform .1s;
}

.wtv-avatar-opt:hover, .wtv-avatar-opt.selected {
    border-color: var(--c-yellow);
    transform: scale(1.15);
}

/* ═══ HUB SCREEN ═══ */
.wtv-hub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
}

.wtv-player-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--c-surface);
    border-radius: 30px;
    padding: 6px 14px 6px 10px;
    font-weight: 800;
    font-size: .9rem;
}

.wtv-cans-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,212,96,.12);
    border: 1.5px solid var(--c-yellow);
    border-radius: 30px;
    padding: 5px 14px;
    font-size: .9rem;
    font-weight: 800;
    color: var(--c-yellow);
}

.wtv-hub-title {
    font-family: 'Fredoka One', cursive;
    font-size: 1.6rem;
    color: var(--c-yellow);
    margin: 0 0 4px;
}

.wtv-hub-subtitle {
    color: var(--c-muted);
    font-size: .9rem;
    margin: 0 0 20px;
}

.wtv-word-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    width: 100%;
    margin-bottom: 24px;
}

.wtv-word-chip {
    background: var(--c-surface);
    border: 2px solid #2a3a55;
    border-radius: 12px;
    padding: 10px 8px;
    text-align: center;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    position: relative;
    overflow: hidden;
}

.wtv-word-chip:hover { border-color: var(--c-green); transform: translateY(-2px); }
.wtv-word-chip.stage-1 { border-color: var(--c-yellow); }
.wtv-word-chip.stage-2 { border-color: var(--c-purple); }
.wtv-word-chip.tagged  { border-color: var(--c-green); background: rgba(78,204,163,.1); }

.wtv-word-chip .chip-emoji { font-size: 1.4rem; display: block; margin-bottom: 4px; }
.wtv-word-chip .chip-name  { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.wtv-word-chip .chip-badge {
    position: absolute;
    top: 4px; right: 4px;
    font-size: .65rem;
    background: var(--c-green);
    color: #000;
    border-radius: 6px;
    padding: 1px 4px;
    font-weight: 900;
}

.wtv-hub-actions { display: flex; gap: 12px; }

/* ═══ BUTTONS ═══ */
.wtv-btn {
    border: none;
    border-radius: var(--r);
    padding: 12px 28px;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform .1s, box-shadow .15s, background .15s;
    letter-spacing: .3px;
}

.wtv-btn:active { transform: scale(.95); }

.wtv-btn-primary {
    background: var(--c-primary);
    color: #fff;
    box-shadow: 0 5px 0 #9c1a30;
}

.wtv-btn-primary:hover {
    background: #ff6680;
    box-shadow: 0 7px 0 #9c1a30;
    transform: translateY(-2px);
}

.wtv-btn-ghost {
    background: transparent;
    color: var(--c-muted);
    border: 2px solid #2a3a55;
}

.wtv-btn-ghost:hover { border-color: var(--c-green); color: var(--c-green); }

.wtv-btn-spray {
    background: linear-gradient(135deg, var(--c-yellow), var(--c-primary));
    color: #fff;
    font-size: 1.2rem;
    padding: 14px 36px;
    box-shadow: 0 6px 0 #9c1a30;
    animation: wtv-glow 1.5s ease infinite alternate;
}

@keyframes wtv-glow {
    from { box-shadow: 0 6px 0 #9c1a30, 0 0 0 rgba(255,212,96,0); }
    to   { box-shadow: 0 6px 0 #9c1a30, 0 0 20px rgba(255,212,96,.5); }
}

/* ═══ PROGRESS BAR ═══ */
.wtv-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--c-surface);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.wtv-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--c-primary), var(--c-yellow));
    border-radius: 8px;
    width: 33%;
    transition: width .5s ease;
}

.wtv-stage-label {
    font-size: .8rem;
    color: var(--c-muted);
    margin-bottom: 20px;
    align-self: flex-start;
}

.wtv-stage-label span { color: var(--c-yellow); font-weight: 800; }

/* ═══ FLASHCARD ═══ */
.wtv-card {
    background: linear-gradient(145deg, var(--c-card), #0a2545);
    border: 2px solid #1e4a7a;
    border-radius: 24px;
    padding: 30px 28px;
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.wtv-card::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(233,69,96,.15), transparent);
    border-radius: 50%;
}

.wtv-card-emoji {
    font-size: 4rem;
    margin-bottom: 10px;
    display: block;
    animation: wtv-float 3s ease infinite;
}

@keyframes wtv-float {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

.wtv-card-word {
    font-family: 'Fredoka One', cursive;
    font-size: 2.2rem;
    color: var(--c-yellow);
    text-shadow: 2px 2px 0 rgba(0,0,0,.3);
    margin-bottom: 10px;
}

.wtv-card-def {
    font-size: 1.05rem;
    color: var(--c-text);
    line-height: 1.5;
    margin-bottom: 12px;
}

.wtv-card-example {
    font-size: .9rem;
    color: var(--c-muted);
    font-style: italic;
    background: rgba(255,255,255,.04);
    border-left: 3px solid var(--c-primary);
    padding: 8px 12px;
    border-radius: 0 8px 8px 0;
    text-align: left;
}

.wtv-ai-hint {
    background: var(--c-surface);
    border: 1.5px solid var(--c-purple);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: .9rem;
    line-height: 1.6;
    color: var(--c-text);
    width: 100%;
    margin-top: 12px;
    position: relative;
}

.wtv-ai-hint::before { content: '🤖 '; }

.wtv-ai-loading { color: var(--c-muted); font-style: italic; }

/* ═══ MATCH GAME ═══ */
.wtv-match-word {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    color: var(--c-yellow);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wtv-match-emoji { font-size: 2.2rem; }

.wtv-match-prompt {
    color: var(--c-muted);
    font-size: .9rem;
    margin-bottom: 16px;
}

.wtv-match-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    margin-bottom: 16px;
}

.wtv-match-opt {
    background: var(--c-surface);
    border: 2px solid #2a3a55;
    border-radius: 14px;
    padding: 14px 12px;
    font-family: 'Nunito', sans-serif;
    font-size: .88rem;
    font-weight: 700;
    color: var(--c-text);
    cursor: pointer;
    text-align: left;
    line-height: 1.4;
    transition: border-color .15s, background .15s, transform .1s;
}

.wtv-match-opt:hover   { border-color: var(--c-primary); transform: scale(1.02); }
.wtv-match-opt.correct { border-color: var(--c-green); background: rgba(78,204,163,.15); color: var(--c-green); }
.wtv-match-opt.wrong   { border-color: var(--c-primary); background: rgba(233,69,96,.12); animation: wtv-shake .3s; }
.wtv-match-opt:disabled { cursor: default; }

.wtv-match-feedback {
    font-size: 1rem;
    font-weight: 800;
    min-height: 28px;
    text-align: center;
}

.wtv-match-feedback.win  { color: var(--c-green); }
.wtv-match-feedback.fail { color: var(--c-primary); }

/* ═══ SPELL GAME ═══ */
.wtv-spell-clue {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
    text-align: center;
}

.wtv-spell-emoji { font-size: 3rem; margin-bottom: 8px; }

#wtv-spell-def {
    color: var(--c-text);
    font-size: 1rem;
    line-height: 1.5;
    max-width: 340px;
}

.wtv-spell-prompt { color: var(--c-muted); font-size: .9rem; margin-bottom: 10px; }

.wtv-spell-input-row {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 380px;
    margin-bottom: 14px;
}

.wtv-spell-input {
    flex: 1;
    font-size: 1.2rem;
    font-family: 'Fredoka One', cursive;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
}

.wtv-spell-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 14px;
}

.wtv-letter-tile {
    background: var(--c-card);
    border: 2px solid #1e4a7a;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka One', cursive;
    font-size: 1rem;
    color: var(--c-yellow);
    cursor: pointer;
    user-select: none;
    transition: background .15s, transform .1s;
}

.wtv-letter-tile:hover    { background: var(--c-surface); transform: scale(1.1); }
.wtv-letter-tile.used     { opacity: .3; pointer-events: none; }

.wtv-spell-feedback {
    font-size: 1rem;
    font-weight: 800;
    min-height: 26px;
    text-align: center;
}

.wtv-spell-feedback.win  { color: var(--c-green); }
.wtv-spell-feedback.fail { color: var(--c-primary); animation: wtv-shake .3s; }

/* ═══ TAG WALL SCREEN ═══ */
.wtv-tag-title {
    font-family: 'Fredoka One', cursive;
    font-size: 1.8rem;
    color: var(--c-yellow);
    margin-bottom: 16px;
}

.wtv-wall {
    position: relative;
    background: var(--c-wall);
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
    max-width: 520px;
    height: 220px;
    margin-bottom: 14px;
    border: 3px solid #444;
    box-shadow: inset 0 0 40px rgba(0,0,0,.5);
}

#wtv-graffiti-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 14px;
}

.wtv-wall-word {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka One', cursive;
    font-size: 3.5rem;
    color: transparent;
    -webkit-text-stroke: 3px rgba(255,255,255,.08);
    text-shadow: none;
    letter-spacing: 4px;
    text-transform: uppercase;
    pointer-events: none;
    transition: color .4s, text-shadow .4s;
}

.wtv-wall-word.sprayed {
    color: var(--c-yellow);
    -webkit-text-stroke: 2px rgba(0,0,0,.3);
    text-shadow: 0 0 30px rgba(255,212,96,.6), 4px 4px 0 rgba(233,69,96,.6);
}

.wtv-tag-sub { color: var(--c-muted); font-size: .9rem; margin-bottom: 16px; }

.wtv-cans-earned {
    font-family: 'Fredoka One', cursive;
    font-size: 1.5rem;
    color: var(--c-yellow);
    animation: wtv-pop .4s ease;
    margin-bottom: 14px;
}

/* ═══ WALL GALLERY ═══ */
.wtv-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
    margin-bottom: 24px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px;
}

.wtv-gallery-tag {
    background: linear-gradient(135deg, #0f3460, #16213e);
    border: 2px solid var(--c-green);
    border-radius: 12px;
    padding: 10px 16px;
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
    color: var(--c-yellow);
    text-shadow: 2px 2px 0 rgba(233,69,96,.4);
    animation: wtv-pop .3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ═══ INPUT ═══ */
.wtv-input {
    background: var(--c-surface);
    border: 2px solid #2a3a55;
    border-radius: 12px;
    padding: 11px 16px;
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
    color: var(--c-text);
    outline: none;
    width: 100%;
    transition: border-color .2s;
}

.wtv-input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(233,69,96,.2); }
.wtv-input::placeholder { color: var(--c-muted); }

/* ═══ ANIMATIONS ═══ */
@keyframes wtv-shake {
    0%,100% { transform: translateX(0); }
    20%,60% { transform: translateX(-6px); }
    40%,80% { transform: translateX(6px); }
}

@keyframes wtv-pop {
    from { transform: scale(0.5); opacity: 0; }
    70%  { transform: scale(1.1); }
    to   { transform: scale(1);   opacity: 1; }
}

@keyframes wtv-spray-particle {
    from { transform: translate(0,0) scale(1); opacity: 1; }
    to   { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

/* ═══ MUTE BUTTON ═══ */
.wtv-mute-btn {
    position: absolute;
    top: 12px;
    right: 14px;
    background: rgba(255,255,255,.07);
    border: 1.5px solid #2a3a55;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1rem;
    cursor: pointer;
    z-index: 10;
    transition: background .15s, transform .1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wtv-mute-btn:hover { background: rgba(255,255,255,.14); transform: scale(1.1); }

/* ═══ SPEAK BUTTONS ═══ */
.wtv-speak-btn {
    background: rgba(78,204,163,.15);
    border: 2px solid var(--c-green);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: .85rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    color: var(--c-green);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    transition: background .15s, transform .1s;
    flex-shrink: 0;
    line-height: 1;
}

.wtv-speak-btn:hover  { background: rgba(78,204,163,.3); transform: scale(1.05); }
.wtv-speak-btn:active { transform: scale(.93); }

.wtv-speak-label { font-size: .8rem; }

/* Layout helpers for the new rows */
.wtv-card-word-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.wtv-card-example-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.wtv-card-example-row .wtv-card-example { flex: 1; min-width: 0; }

/* Spell clue speak btn */
#wtv-spell-speak-btn {
    margin-top: 8px;
}

/* Match screen speak btn */
#wtv-match-speak-btn {
    margin-left: 6px;
}
@media (max-width: 520px) {
    #wtv-app { margin: 10px; border-radius: 18px; }
    .wtv-screen { padding: 20px 16px 24px; }
    .wtv-card-word { font-size: 1.7rem; }
    .wtv-match-options { grid-template-columns: 1fr; }
    .wtv-wall { height: 160px; }
    .wtv-wall-word { font-size: 2.2rem; }
}
