/* ═══════════════════════════════════════════════════════════════
   ENGLISH IN THE WILD — Design System Theme
   Palette: bg #fff8f3 · surface #ffffff · surface-container-high #f9e5c9
            primary-light #ffebcf · ink #241a08 · ink-muted #887364
   ═══════════════════════════════════════════════════════════════ */

/* ── Dash — flex layout with sidebar ──────────────────────────── */
.wild-dash {
    display: flex;
    min-height: 100vh;
    background: var(--bg, #fff8f3);
    font-family: var(--font-body, 'Nunito', sans-serif);
    overflow: hidden;
    position: relative;
}

/* ── Main content area ────────────────────────────────────────── */
.wild-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 2rem 2.5rem;
    gap: 1rem;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.wild-main-stage {
    max-width: 760px;
    width: 100%;
}

/* ── Header ───────────────────────────────────────────────────── */
#eitw-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .6rem;
    max-width: 760px;
    width: 100%;
    margin: 0 auto .5rem;
    background: var(--paper, #ffffff);
    border: 1.5px solid rgba(36, 26, 8, .07);
    border-radius: 18px;
    padding: .6rem 1.1rem;
    box-shadow: 0 2px 12px rgba(36, 26, 8, .06);
}

.eitw-badge {
    font-size: .82rem;
    font-weight: 800;
    border-radius: 20px;
    padding: .25rem .85rem;
}

.eitw-badge--cat {
    color: var(--ink, #241a08);
    background: rgba(143, 78, 0, .10);
    border: 1px solid rgba(143, 78, 0, .20);
}

.eitw-badge--streak {
    color: #AE5600;
    background: rgba(253, 153, 55, .12);
    border: 1px solid rgba(253, 153, 55, .25);
}

.eitw-badge--score {
    color: var(--ink, #241a08);
    background: rgba(253, 153, 55, .15);
    border: 1px solid rgba(143, 78, 0, .15);
}

#eitw-progress-wrap {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex: 1;
    min-width: 140px;
}

#eitw-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(36, 26, 8, .08);
    border-radius: 99px;
    overflow: hidden;
}

#eitw-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-container, #fd9937);
    border-radius: 99px;
    transition: width .5s cubic-bezier(.4, 0, .2, 1);
}

#eitw-progress-label {
    font-size: .72rem;
    font-weight: 700;
    color: var(--ink-muted, #887364);
    white-space: nowrap;
}

/* ── Activity container ───────────────────────────────────────── */
[data-english-in-the-wild-target="activityContainer"] {
    transition: opacity .3s ease;
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════ */
.wild-sidebar {
    width: 260px;
    min-height: 100vh;
    /* background: #ffffff;*/
    border-left: 1.5px solid rgba(36, 26, 8, .10);
    display: flex;
    flex-direction: column;
    padding: 1.75rem 1.1rem;
    gap: 1rem;
    position: relative;
    z-index: 1;
   /*   box-shadow: -4px 0 24px rgba(36, 26, 8, .06);*/
}

.wild-sidebar-header h2 {
    font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--ink, #241a08);
    margin-bottom: .15rem;
}

.wild-sidebar-header p {
    font-size: .8rem;
    color: var(--ink-muted, #887364);
}

.wild-sections-label {
    font-size: .65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--ink-muted, #887364);
    padding: 0 .25rem;
}

.wild-section-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(36, 26, 8, .15) transparent;
}

.eitw-section-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem .85rem;
    border-radius: 999px;
    color: var(--ink-secondary, #544336);
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    border: 1px solid transparent;
}

.eitw-section-item:hover {
    background: var(--primary-light, #ffebcf);
    border-color: rgba(143, 78, 0, .3);
    color: var(--primary-dark, #693700);
    transform: translateX(4px);
}

.eitw-section-item.active {
    background: var(--ink, #241a08);
    border-color: transparent;
    color: #ffffff;
    font-weight: 700;
}

.eitw-section-emoji {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

.eitw-section-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eitw-section-count {
    font-size: .7rem;
    font-weight: 700;
    opacity: .65;
    flex-shrink: 0;
}

.eitw-section-item.active .eitw-section-count {
    opacity: 1;
}

.wild-sidebar-tip {
    font-size: .75rem;
    color: var(--ink-muted, #887364);
    text-align: center;
    padding: .5rem;
    border-top: 1px solid rgba(36, 26, 8, .08);
}

/* ==============================================================
   RESPONSIVE
   ============================================================== */
@media (max-width: 680px) {
    .wild-dash { flex-direction: column; }

    .wild-sidebar {
        width: 100%;
        min-height: auto;
        border-left: none;
        border-top: 1px solid rgba(36, 26, 8, .10);
        padding: 1.25rem 1.1rem;
    }

    .wild-section-list { max-height: 160px; }

    .eitw-section-item:hover { transform: translateX(0); }

    .wild-container {
        padding: 1.25rem 1rem;
        min-height: auto;
    }
}

/* ── GIF + sentence overlay ───────────────────────────────────── */
.eitw-gif-wrap {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 6px 28px rgba(36, 26, 8, .14);
}

.eitw-gif {
    width: 100%;
    height: 360px;
    object-fit: cover;
    display: block;
}

.eitw-gif-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: .75rem 1.25rem;
    background: rgba(36, 26, 8, .60);
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .4);
}

/* ── Question ─────────────────────────────────────────────────── */
#eitw-question {
    margin-top: 1.25rem;
    text-align: center;
}

.eitw-question-text {
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 700;
    color: var(--ink, #241a08);
    margin-bottom: .5rem;
}

#eitw-feedback {
    min-height: 1.4rem;
    font-size: .95rem;
    font-weight: 700;
    margin-bottom: .4rem;
    transition: opacity .25s;
}

/* ── Option buttons — large cards ────────────────────────────── */
#eitw-options {
    display: flex;
    justify-content: center;
    gap: .85rem;
    flex-wrap: wrap;
    margin: .8rem auto;
    max-width: 520px;
}

.eitw-opt-btn {
    background: var(--paper, #ffffff);
    border: 1.5px solid rgba(36, 26, 8, .1);
    border-radius: 20px;
    padding: 1rem 1.2rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .45rem;
    transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s, border-color .2s;
    box-shadow: 0 3px 12px rgba(36, 26, 8, .07);
    min-width: 100px;
}

.eitw-opt-btn:hover:not(:disabled) {
    border-color: rgba(143, 78, 0, .35);
    transform: translateY(-5px);
    box-shadow: 0 10px 24px rgba(143, 78, 0, .15);
}

.eitw-opt-btn:disabled {
    cursor: default;
    opacity: .55;
}

.eitw-opt-emoji {
    font-size: 3.5rem;
    line-height: 1;
    display: block;
}

.eitw-opt-word {
    font-size: .85rem;
    font-weight: 800;
    color: var(--ink, #241a08);
    text-transform: capitalize;
}

.eitw-opt--correct {
    border-color: rgba(71, 184, 161, .5) !important;
    background: rgba(71, 184, 161, .09) !important;
    transform: scale(1.1) !important;
    box-shadow: 0 8px 24px rgba(71, 184, 161, .2) !important;
}

.eitw-opt--wrong {
    border-color: rgba(186, 26, 26, .45) !important;
    background: rgba(186, 26, 26, .07) !important;
    animation: eShake .35s ease;
}

/* ── Shared feedback colours ─────────────────────────────────── */
.eitw-fb-correct {
    color: #47b8a1;
    animation: feedIn .25s ease;
}

.eitw-fb-wrong {
    color: #ba1a1a;
    animation: feedIn .25s ease;
}

@keyframes feedIn {
    from {
        transform: scale(.85);
        opacity: 0;
    }

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

@keyframes eShake {

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

    25% {
        transform: translateX(-6px);
    }

    75% {
        transform: translateX(6px);
    }
}

/* ── Stage card (Say It / Fill Blank / Word Order / Grammar) ─── */
.eitw-stage-card {
    background: var(--paper, #ffffff);
    border: 1.5px solid rgba(36, 26, 8, .07);
    border-radius: 24px;
    padding: 2rem 1.75rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .9rem;
    box-shadow: 0 4px 24px rgba(36, 26, 8, .08);
    margin-top: .5rem;
    animation: feedIn .3s ease;
}

.eitw-stage-card--center {
    max-width: 500px;
    margin: 1rem auto;
}

.eitw-stage-icon {
    font-size: 2.8rem;
    line-height: 1;
}

.eitw-stage-label {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--ink, #241a08);
}

.eitw-stage-sentence {
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: clamp(1.1rem, 3vw, 1.45rem);
    font-weight: 600;
    color: var(--ink-muted, #887364);
    font-style: italic;
}

.eitw-stage-feedback {
    min-height: 1.4rem;
    font-size: .9rem;
    font-weight: 700;
}

/* ── Grammar card ─────────────────────────────────────────────── */
.eitw-grammar-card {
    background: rgba(253, 153, 55, .15);
    border: 1.5px solid rgba(143, 78, 0, .275);
    border-radius: 24px;
    padding: 2rem 1.75rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    box-shadow: 0 4px 20px rgba(143, 78, 0, .10);
    margin-top: .5rem;
    animation: feedIn .3s ease;
}

.eitw-grammar-icon {
    font-size: 2.8rem;
}

.eitw-grammar-title {
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--ink-muted, #887364);
}

.eitw-grammar-rule {
    font-family: var(--font-body, 'Nunito', sans-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink, #241a08);
    max-width: 560px;
}

.eitw-grammar-example {
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ink-muted, #887364);
    font-style: italic;
}

.eitw-grammar-actions {
    margin-top: .25rem;
}

/* ── Primary / ghost / skip buttons ──────────────────────────── */
.eitw-primary-btn {
    background: var(--ink, #241a08);
    color: var(--cream, #fff8f3);
    border: none;
    border-radius: 13px;
    padding: .7rem 1.8rem;
    font-family: var(--font-body, 'Nunito', sans-serif);
    font-size: .95rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), box-shadow .18s;
    box-shadow: 0 4px 14px rgba(36, 26, 8, .18);
}

.eitw-primary-btn:hover {
    transform: translateY(-3px) scale(1.02);
}

.eitw-mic-btn {
    background: var(--primary-light, #ffebcf);
    color: var(--ink, #241a08);
    border: none;
    border-radius: 13px;
    padding: .7rem 1.8rem;
    font-family: var(--font-body, 'Nunito', sans-serif);
    font-size: .95rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s cubic-bezier(.34, 1.56, .64, 1);
}

.eitw-mic-btn:hover:not(:disabled) {
    transform: translateY(-3px);
}

.eitw-mic-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.eitw-ghost-btn {
    background: rgba(36, 26, 8, .06);
    border: 1.5px solid rgba(36, 26, 8, .12);
    border-radius: 10px;
    padding: .45rem 1rem;
    font-size: .85rem;
    font-weight: 700;
    color: var(--ink-muted, #887364);
    cursor: pointer;
    transition: background .15s;
}

.eitw-ghost-btn:hover {
    background: rgba(143, 78, 0, .10);
}

.eitw-skip-btn {
    background: none;
    border: 1px solid rgba(36, 26, 8, .12);
    border-radius: 10px;
    padding: .38rem .95rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--ink-muted, #887364);
    cursor: pointer;
    transition: background .15s, color .15s;
    margin-top: .25rem;
}

.eitw-skip-btn:hover {
    background: rgba(36, 26, 8, .05);
    color: var(--ink, #241a08);
}

/* ── Fill the blank ───────────────────────────────────────────── */
.eitw-blanked {
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: clamp(1.1rem, 3vw, 1.45rem);
    font-weight: 700;
    color: var(--ink, #241a08);
}

.eitw-fill-row {
    display: flex;
    justify-content: center;
    gap: .6rem;
    flex-wrap: wrap;
}

.eitw-blank-input {
    padding: .6rem 1rem;
    border: 1.5px solid rgba(36, 26, 8, .12);
    border-radius: 12px;
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink, #241a08);
    background: var(--cream, #fff8f3);
    text-align: center;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    min-width: 200px;
}

.eitw-blank-input:focus {
    border-color: rgba(143, 78, 0, .35);
    box-shadow: 0 0 0 3px rgba(143, 78, 0, .09);
}

.eitw-input--wrong {
    border-color: rgba(186, 26, 26, .45) !important;
    animation: eShake .35s ease;
}

/* ── Word Order ───────────────────────────────────────────────── */
.eitw-word-order-built {
    width: 100%;
    min-height: 54px;
    background: rgba(143, 78, 0, .05);
    border: 2px dashed rgba(143, 78, 0, .25);
    border-radius: 14px;
    padding: .65rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: center;
    justify-content: center;
    transition: background .2s, border-color .2s;
}

.eitw-built--correct {
    background: rgba(71, 184, 161, .1) !important;
    border-color: rgba(71, 184, 161, .5) !important;
}

.eitw-built--wrong {
    background: rgba(186, 26, 26, .08) !important;
    border-color: rgba(186, 26, 26, .4) !important;
}

.eitw-wo-placeholder {
    font-size: .82rem;
    color: var(--ink-muted, #887364);
    font-style: italic;
}

.eitw-wo-built-word {
    background: var(--ink, #241a08);
    color: var(--cream, #fff8f3);
    font-weight: 700;
    font-size: .9rem;
    padding: .3rem .8rem;
    border-radius: 20px;
}

.eitw-word-order-bank {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
    width: 100%;
}

.eitw-wo-chip {
    background: var(--cream, #fff8f3);
    border: 1.5px solid rgba(36, 26, 8, .12);
    border-radius: 20px;
    padding: .35rem .85rem;
    font-family: var(--font-body, 'Nunito', sans-serif);
    font-size: .9rem;
    font-weight: 700;
    color: var(--ink, #241a08);
    cursor: pointer;
    transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), opacity .2s;
}

.eitw-wo-chip:hover:not(:disabled) {
    transform: translateY(-3px);
}

.eitw-wo-chip--used {
    opacity: .3;
    pointer-events: none;
}

.eitw-wo-actions {
    display: flex;
    gap: .55rem;
    align-items: center;
}

/* ── Category chooser ─────────────────────────────────────────── */
#eitw-chooser {
    text-align: center;
    padding: 1rem 0;
}

#eitw-chooser h2 {
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 800;
    color: var(--ink, #241a08);
    margin-bottom: .25rem;
}

#eitw-chooser p {
    color: var(--ink-muted, #887364);
    margin-bottom: 1.25rem;
}

#eitw-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .85rem;
    max-width: 620px;
    margin: 0 auto;
}

.eitw-cat-card {
    background: var(--paper, #ffffff);
    border: 1.5px solid rgba(36, 26, 8, .07);
    border-radius: 20px;
    padding: 0 0 1.1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), box-shadow .22s;
    box-shadow: 0 2px 10px rgba(36, 26, 8, .07);
    overflow: hidden;
}

.eitw-cat-card::before {
    content: "";
    display: block;
    width: 100%;
    height: 6px;
    background: var(--cat-color, #ffebcf);
    margin-bottom: .65rem;
}

.eitw-cat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(36, 26, 8, .12);
}

.eitw-cat-emoji {
    font-size: 2.8rem;
    display: block;
    line-height: 1;
}

.eitw-cat-label {
    font-size: .88rem;
    font-weight: 800;
    color: var(--ink, #241a08);
}

.eitw-cat-count {
    font-size: .72rem;
    color: var(--ink-muted, #887364);
}

/* ── Review screen ────────────────────────────────────────────── */
.eitw-review-wrap {
    text-align: center;
    padding: 1rem 0;
}

.eitw-review-header {
    margin-bottom: 1rem;
}

.eitw-review-header h2 {
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: 2rem;
    font-weight: 800;
    color: var(--ink, #241a08);
    margin: .4rem 0 .2rem;
}

.eitw-review-header p {
    color: var(--ink-muted, #887364);
}

#eitw-review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: .65rem;
    max-width: 700px;
    margin: 0 auto 1.25rem;
}

.eitw-review-card {
    background: var(--paper, #ffffff);
    border: 1.5px solid rgba(36, 26, 8, .07);
    border-radius: 14px;
    padding: .75rem 1rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    text-align: left;
}

.eitw-review-card--missed {
    background: rgba(186, 26, 26, .05);
    border-color: rgba(186, 26, 26, .3);
}

.eitw-review-emoji {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.eitw-review-sentence {
    font-size: .88rem;
    font-weight: 600;
    color: var(--ink, #241a08);
    flex: 1;
}

.eitw-review-tag {
    font-size: .7rem;
    font-weight: 800;
    padding: .15rem .55rem;
    border-radius: 20px;
    background: rgba(186, 26, 26, .1);
    color: #ba1a1a;
    flex-shrink: 0;
}

.eitw-review-tag--ok {
    background: rgba(71, 184, 161, .1);
    color: #47b8a1;
}

.eitw-review-btns {
    margin-top: .5rem;
}
