#game-root {
    --eb-accent: #10B981;
    --eb-accent-dark: #0c8d64;
    --eb-accent-light: #e3f9ef;
    --eb-accent-border: #a7f3d0;
    --eb-glass-bg: rgba(255, 255, 255, .62);
    --eb-glass-border: rgba(255, 255, 255, .45);
    /* Palette chrome modeled on Minecraft's gray inventory UI. */
    --eb-slot-bg: #8b8b8b;
    --eb-slot-light: #ffffff;
    --eb-slot-dark: #373737;
    --eb-panel: #c6c6c6;
    --eb-gold: #facc15;
}

/*
 * The kwi-* modifier classes game.js passes to KidWorldIcons.svg() are only
 * ever *named* by the shared icon helper, never defined by it, so the
 * tier/status colors are given real values here, scoped to this game.
 */
#game-root .kwi-accent { color: var(--eb-accent); }
#game-root .kwi-success { color: #10B981; }
#game-root .kwi-danger { color: #EF4444; }
#game-root .kwi-trophy { color: #F59E0B; }
#game-root .kwi-stars { color: #8B5CF6; }
#game-root .kwi-thumbsup { color: #10B981; }
#game-root .kwi-lightning { color: #3B82F6; }
#game-root .kwi-smile { color: #F472B6; }
#game-root .kwi-muted { color: #cbd5e1; }

.kwg-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 14px;
}

.eb-wrap {
    max-width: 860px;
    margin: 0 auto;
}

.eb-wrap-narrow {
    max-width: 480px;
}

.eb-loading,
.eb-error {
    text-align: center;
    padding: 48px 16px;
}

.eb-loading-icon,
.eb-error-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.eb-loading-icon {
    animation: eb-pulse 1.2s ease-in-out infinite;
}

.eb-loading-text {
    font-size: 15px;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

.eb-error-text {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: #EF4444;
    display: inline-block;
    padding: 6px 16px;
    border-radius: 999px;
}

.eb-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
}

.eb-header-icon {
    display: flex;
    font-size: 30px;
    line-height: 1;
}

.eb-header-icon img {
    display: block;
    height: 38px;
    width: auto;
}

.eb-header-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

.eb-levels {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.eb-level-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--eb-glass-border);
    border-radius: var(--kw-radius, 12px);
    background: var(--eb-glass-bg);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    transition: transform .15s ease, box-shadow .15s ease;
}

.eb-level-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 18px rgba(0, 0, 0, .14);
}

.eb-level-card:active {
    transform: translateY(-1px);
}

.eb-level-thumb {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 70px;
    font-size: 36px;
    background: linear-gradient(135deg, var(--eb-accent-light), var(--eb-accent-border));
    background-size: 70px 70px;
    background-repeat: no-repeat;
    background-position: center;
}

.eb-level-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 10px 16px;
}

.eb-level-name {
    font-size: 17px;
    font-weight: 800;
    color: var(--kw-text, #2D2A32);
    text-align: center;
}

.eb-level-age {
    font-size: 14px;
    font-weight: 700;
    color: var(--eb-accent-dark);
    background: var(--eb-accent-light);
    padding: 2px 10px;
    border-radius: 999px;
}

.eb-level-row {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.eb-level-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--eb-accent-light);
    color: var(--eb-accent-dark);
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 700;
    font-size: 12px;
}

.eb-level-pill-icon {
    display: inline-flex;
    line-height: 1;
}

.eb-level-pill-icon img {
    display: block;
    width: 14px;
    height: 14px;
    object-fit: cover;
    border-radius: 50%;
}

.eb-change-level-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--eb-glass-border);
    background: var(--eb-glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--eb-accent-dark);
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    padding: 6px 12px 6px 10px;
    transition: transform .1s ease, background .15s ease;
}

.eb-change-level-btn svg {
    width: 12px;
    height: 12px;
}

.eb-change-level-btn:hover {
    background: rgba(255, 255, 255, .8);
    transform: translateY(-1px);
}

/* ---- quest card & village chips ---- */

.eb-quest {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--eb-glass-bg);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid var(--eb-glass-border);
    border-radius: var(--kw-radius, 12px);
    padding: 8px 12px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}

.eb-quest-pic {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
}

.eb-quest-emoji {
    font-size: 34px;
    line-height: 1;
    flex: 0 0 auto;
}

.eb-quest-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1 1 auto;
    min-width: 0;
}

.eb-quest-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--eb-accent-dark);
}

.eb-quest-text {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--kw-text, #2D2A32);
}

.eb-quest-bar {
    display: block;
    height: 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .1);
    overflow: hidden;
}

.eb-quest-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--eb-accent);
    transition: width .3s ease;
}

.eb-quest-count {
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: 900;
    color: var(--eb-accent-dark);
    font-variant-numeric: tabular-nums;
}

.eb-quest-unlock {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: #777;
    border-left: 1px dashed rgba(0, 0, 0, .15);
    padding-left: 10px;
}

.eb-quest-unlock img {
    width: 36px;
    height: 36px;
    filter: grayscale(.6);
    opacity: .85;
}

.eb-quest-done {
    background: var(--eb-accent);
    border-color: var(--eb-accent-dark);
}

.eb-quest-done .eb-quest-title,
.eb-quest-done .eb-quest-text {
    color: #fff;
}

.eb-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}

.eb-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--eb-glass-bg);
    border: 1px solid var(--eb-glass-border);
    color: var(--kw-text, #2D2A32);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
}

/* ---- island stage ---- */

.eb-stage {
    position: relative;
    border-radius: var(--kw-radius, 12px);
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .2);
    background: #2f86d0;
}

.eb-canvas {
    display: block;
    width: 100%;
    cursor: pointer;
    /* Drags paint pieces (or pan with the Move tool), so the page must not
       scroll or zoom under the finger. */
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.eb-view-btns {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.eb-view-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: rgba(0, 0, 0, .3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s ease;
}

.eb-view-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, .45);
}

.eb-view-btn:disabled {
    opacity: .35;
    cursor: default;
}

.eb-view-btn svg {
    width: 17px;
    height: 17px;
}

.eb-toast {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 110px);
    background: rgba(20, 20, 20, .78);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    padding: 7px 14px;
    border-radius: 10px;
    pointer-events: none;
}

.eb-toast[hidden] {
    display: none;
}

.eb-toast-show {
    animation: eb-toast-in .25s ease;
}

/* ---- palette ---- */

.eb-palette {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: 4px;
    margin-top: 10px;
    padding: 5px;
    background: var(--eb-panel);
    border: 3px solid;
    border-color: var(--eb-slot-light) var(--eb-slot-dark) var(--eb-slot-dark) var(--eb-slot-light);
    border-radius: 6px;
}

.eb-slot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-height: 64px;
    padding: 3px 2px;
    background: var(--eb-slot-bg);
    border: 3px solid;
    border-color: var(--eb-slot-dark) var(--eb-slot-light) var(--eb-slot-light) var(--eb-slot-dark);
    border-radius: 2px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.eb-slot-pic {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.eb-slot-pic img {
    width: 40px;
    height: 40px;
}

.eb-slot-emoji {
    font-size: 26px;
    line-height: 1;
}

.eb-slot-label {
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    text-shadow: 1px 1px 0 #3f3f3f;
    white-space: nowrap;
}

.eb-slot-selected {
    border-color: #fff;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--eb-accent);
    background: #a3a3a3;
    z-index: 1;
}

.eb-slot-lock,
.eb-slot-new {
    display: none;
    position: absolute;
    pointer-events: none;
}

.eb-slot-locked {
    cursor: help;
}

.eb-slot-locked .eb-slot-pic,
.eb-slot-locked .eb-slot-label {
    filter: grayscale(1) brightness(.55);
    opacity: .6;
}

.eb-slot-locked .eb-slot-lock {
    display: block;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    font-size: 20px;
}

.eb-slot-fresh .eb-slot-new {
    display: block;
    top: -6px;
    right: -6px;
    background: #F59E0B;
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    padding: 1px 5px;
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}

.eb-slot-fresh {
    animation: eb-wiggle 1s ease-in-out 3;
}

/* ---- controls ---- */

.eb-control-row {
    justify-content: center;
    margin-top: 12px;
    margin-bottom: 0;
}

.eb-btn {
    border: none;
    background: var(--eb-accent-light);
    color: var(--eb-accent-dark);
    border-radius: 999px;
    padding: 9px 16px;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    transition: transform .1s ease, background .15s ease;
}

.eb-btn:hover:not(:disabled) {
    background: var(--eb-accent-border);
    transform: translateY(-1px);
}

.eb-btn:disabled {
    opacity: .5;
    cursor: default;
}

.eb-btn-finish {
    background: var(--eb-accent);
    color: #fff;
    box-shadow: 0 3px 0 var(--eb-accent-dark);
}

.eb-btn-finish:hover:not(:disabled) {
    background: var(--eb-accent);
}

.eb-tip {
    min-height: 20px;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}

/* ---- result screen ---- */

.eb-done-card {
    text-align: center;
    background: var(--eb-glass-bg);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid var(--eb-glass-border);
    border-radius: var(--kw-radius, 12px);
    padding: 28px 20px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .12);
    animation: eb-pop .3s ease;
}

.eb-done-emoji {
    font-size: 56px;
    margin-bottom: 8px;
}

.eb-done-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--eb-accent-dark);
    margin-bottom: 12px;
}

.eb-done-shot-wrap {
    margin: 0 auto 12px;
}

.eb-done-shot {
    display: block;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 8px;
    border: 3px solid #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .2);
    image-rendering: pixelated;
}

.eb-done-score {
    font-size: 16px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
}

.eb-done-meta {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.eb-done-meta-item {
    background: var(--eb-accent-light);
    color: var(--eb-accent-dark);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
}

.eb-done-stars {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    font-size: 24px;
}

.eb-done-share {
    justify-content: center;
    margin-top: 16px;
}

.eb-done-actions {
    justify-content: center;
    margin-top: 20px;
}

.eb-btn-primary,
.eb-btn-secondary {
    border: none;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: transform .1s ease;
}

.eb-btn-primary {
    background: var(--eb-accent);
    color: #fff;
    box-shadow: 0 3px 0 var(--eb-accent-dark);
}

.eb-btn-primary:hover {
    transform: translateY(-1px);
}

.eb-btn-secondary {
    background: var(--eb-accent-light);
    color: var(--eb-accent-dark);
}

.eb-btn-secondary:hover {
    background: var(--eb-accent-border);
}

/* ---- English materials bar (earn by answering; tap a chip to earn more) ---- */

.eb-materials {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 8px;
}

.eb-mat {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 6px 8px;
    background: var(--eb-glass-bg);
    border: 1px solid var(--eb-glass-border);
    border-radius: var(--kw-radius, 12px);
    color: var(--kw-text, #2D2A32);
    text-align: left;
    cursor: pointer;
    transition: transform .1s ease, background .15s ease;
}

.eb-mat:hover {
    background: rgba(255, 255, 255, .85);
    transform: translateY(-1px);
}

.eb-mat-emoji {
    flex: 0 0 auto;
    font-size: 22px;
    line-height: 1;
}

.eb-mat-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.eb-mat-count {
    font-size: 14px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.eb-mat-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--eb-accent-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eb-mat-plus {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--eb-accent);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
}

/* Cost of a palette piece; amber when there isn't enough to build one. */
.eb-slot-cost {
    position: absolute;
    top: -6px;
    left: -6px;
    background: var(--eb-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    padding: 1px 4px;
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    pointer-events: none;
    white-space: nowrap;
}

.eb-slot-short .eb-slot-cost {
    background: var(--eb-gold);
    color: #713f12;
}

.eb-slot-locked .eb-slot-cost {
    display: none;
}

/* ---- English question card: over the island on wide screens, a full-screen
   card on phones where the island is short ---- */

.eb-quiz {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    background: rgba(15, 23, 42, .45);
    overflow-y: auto;
    animation: eb-fade .2s ease;
}

.eb-done-kinds {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.eb-done-kind {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--eb-accent-dark);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
}

.eb-quiz[hidden] {
    display: none;
}

.eb-quiz-card {
    width: 100%;
    max-width: 460px;
    max-height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
    background: var(--eb-panel);
    border: 3px solid;
    border-color: var(--eb-slot-light) var(--eb-slot-dark) var(--eb-slot-dark) var(--eb-slot-light);
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    animation: eb-pop .25s ease;
}

.eb-quiz-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.eb-quiz-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--eb-slot-bg);
    color: #fff;
    border-radius: 999px;
    padding: 4px 12px 4px 5px;
    font-size: 13px;
    font-weight: 800;
    text-shadow: 1px 1px 0 #3f3f3f;
}

.eb-quiz-tag-img {
    width: 22px;
    height: 22px;
}

.eb-quiz-close {
    flex: 0 0 auto;
    border: none;
    background: var(--eb-slot-bg);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.eb-quiz-close svg {
    width: 15px;
    height: 15px;
}

.eb-quiz-body {
    background: #fff;
    border-radius: 8px;
    padding: 12px 10px;
    text-align: center;
    margin-bottom: 10px;
}

.eb-quiz-emoji {
    font-size: 56px;
    line-height: 1.1;
}

.eb-quiz-emoji-small {
    font-size: 32px;
}

.eb-quiz-word {
    font-size: 30px;
    font-weight: 900;
    color: var(--eb-accent-dark);
    margin-top: 2px;
}

.eb-quiz-sentence {
    font-size: 20px;
    font-weight: 800;
    color: var(--kw-text, #2D2A32);
    line-height: 1.5;
    margin-top: 4px;
}

.eb-quiz-blank {
    display: inline-block;
    min-width: 2.6em;
    padding: 0 6px;
    margin: 0 2px;
    border-bottom: 3px dashed var(--eb-accent);
    color: var(--eb-accent-dark);
    background: var(--eb-accent-light);
    border-radius: 4px 4px 0 0;
}

.eb-quiz-blank-filled {
    border-bottom-style: solid;
    animation: eb-pop .3s ease;
}

.eb-quiz-hint {
    font-size: 14px;
    font-style: italic;
    color: #555;
    margin-top: 4px;
}

.eb-quiz-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 15px;
    font-weight: 800;
    color: #444;
}

.eb-quiz-speak {
    border: none;
    background: var(--eb-accent);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 0 var(--eb-accent-dark);
}

.eb-quiz-speak svg {
    width: 16px;
    height: 16px;
}

.eb-quiz-speak[hidden] {
    display: none;
}

.eb-quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.eb-quiz-options-long {
    grid-template-columns: 1fr;
}

.eb-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    background: var(--eb-slot-bg);
    border: 3px solid;
    border-color: var(--eb-slot-light) var(--eb-slot-dark) var(--eb-slot-dark) var(--eb-slot-light);
    border-radius: 6px;
    padding: 6px 10px;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    text-align: left;
    text-shadow: 1px 1px 0 #3f3f3f;
    cursor: pointer;
    transition: transform .1s ease, background .15s ease;
}

.eb-opt:hover:not(:disabled) {
    background: #9d9d9d;
    transform: translateY(-1px);
}

.eb-opt:disabled {
    cursor: default;
}

.eb-opt-key {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: rgba(0, 0, 0, .25);
    font-size: 12px;
}

.eb-opt-text {
    flex: 1 1 auto;
    overflow-wrap: anywhere;
}

.eb-quiz-options-long .eb-opt {
    font-size: 15px;
}

.eb-opt-right {
    background: var(--eb-accent);
    border-color: #6ee7b7 var(--eb-accent-dark) var(--eb-accent-dark) #6ee7b7;
    animation: eb-pop .3s ease;
}

.eb-opt-wrong {
    background: #EF4444;
    border-color: #fca5a5 #991b1b #991b1b #fca5a5;
    animation: eb-shake .4s ease;
}

.eb-opt-dim {
    opacity: .55;
}

.eb-quiz-feedback {
    min-height: 0;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
    line-height: 1.4;
}

.eb-quiz-feedback:empty {
    margin-top: 0;
}

.eb-quiz-feedback-right {
    color: var(--eb-accent-dark);
}

.eb-quiz-feedback-wrong {
    color: #b91c1c;
}

.eb-quiz-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.eb-quiz-actions[hidden] {
    display: none;
}

.eb-done-kind {
    background: #fff;
    border: 1px solid var(--eb-accent-border);
}

.eb-done-kinds:empty {
    display: none;
}

.eb-done-words {
    margin: 0 0 12px;
}

.eb-done-words-title {
    font-size: 13px;
    font-weight: 800;
    color: #444;
    margin-bottom: 6px;
}

.eb-words {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}

.eb-word {
    background: var(--eb-accent);
    color: #fff;
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 13px;
    font-weight: 700;
}

.eb-word-missed {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.eb-word-more {
    background: transparent;
    color: #555;
}

.eb-btn-go {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--eb-accent);
    color: #fff;
    box-shadow: 0 3px 0 var(--eb-accent-dark);
}

.eb-btn-go:hover:not(:disabled) {
    background: var(--eb-accent);
}

.eb-btn-go svg {
    width: 14px;
    height: 14px;
}

@keyframes eb-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes eb-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@media (max-width: 576px) {
    .eb-materials {
        grid-template-columns: repeat(2, 1fr);
    }

    .eb-quiz {
        position: fixed;
        z-index: 1000;
        padding: 10px;
    }

    .eb-quiz-card {
        padding: 10px;
    }

    .eb-quiz-emoji {
        font-size: 44px;
    }

    .eb-quiz-sentence {
        font-size: 17px;
    }

    .eb-opt {
        font-size: 15px;
        min-height: 44px;
    }
}

@keyframes eb-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes eb-toast-in {
    from { opacity: 0; transform: translate(-50%, -6px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes eb-pop {
    0% { transform: scale(.85); }
    100% { transform: scale(1); }
}

@keyframes eb-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: .7; }
}

@keyframes eb-wiggle {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-6deg) scale(1.06); }
    75% { transform: rotate(6deg) scale(1.06); }
}

@media (max-width: 576px) {
    .eb-toast {
        max-width: calc(100% - 64px);
        font-size: 12px;
    }

    .eb-view-btns {
        top: 6px;
        right: 6px;
        gap: 4px;
    }

    .eb-view-btn {
        width: 32px;
        height: 32px;
    }

    .eb-quest {
        padding: 8px 10px;
        gap: 8px;
    }

    .eb-quest-pic {
        width: 38px;
        height: 38px;
    }

    .eb-quest-text {
        font-size: 13px;
    }

    .eb-quest-unlock {
        display: none;
    }

    .eb-palette {
        grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    }
}
