#game-root {
    --mq-accent: #10B981;
    --mq-accent-dark: #0e9c6f;
    --mq-accent-light: #e3f9ef;
    --mq-accent-border: #a7f3d0;
    border-radius: var(--kw-radius, 16px);
}

.mq-wrap {
    max-width: 520px;
    margin: 0 auto;
    padding: 20px 16px 28px;
}

/* Loading / error */
.mq-loading,
.mq-error {
    text-align: center;
    padding: 48px 16px;
}

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

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

.mq-loading-text {
    font-size: 15px;
    color: #666;
}

.mq-error-text {
    font-size: 15px;
    font-weight: 700;
    color: #EF4444;
}

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

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

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

.mq-header-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--mq-accent);
}

/* Level select */
.mq-levels {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.mq-level-card {
    display: flex;
    flex-direction: column;
    border: none;
    border-radius: var(--kw-radius, 16px);
    background: #fff;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    transition: transform .15s ease, box-shadow .15s ease;
}

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

.mq-level-card:hover .mq-level-thumb {
    transform: scale(1.06);
}

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

.mq-level-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 88px;
    font-size: 36px;
    background: linear-gradient(135deg, var(--mq-accent-light), var(--mq-accent-border));
    background-size: 88px 88px;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform .2s ease;
}

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

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

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

/* In-game level indicator */
.mq-level-row {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.mq-level-pill {
    background: var(--mq-accent-light);
    color: var(--mq-accent-dark);
    border-radius: 999px;
    padding: 5px 12px;
    font-weight: 700;
    font-size: 12px;
}

.mq-change-level-btn {
    border: none;
    background: none;
    color: var(--mq-accent-dark);
    text-decoration: underline;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    padding: 4px;
}

.mq-change-level-btn:hover {
    color: var(--mq-accent);
}

/* Progress bar */
.mq-progress {
    height: 8px;
    border-radius: 999px;
    background: var(--mq-accent-light);
    overflow: hidden;
    margin-bottom: 12px;
}

.mq-progress-fill {
    height: 100%;
    width: 0;
    background: var(--mq-accent);
    border-radius: 999px;
    transition: width .3s ease;
}

.mq-stat-row {
    justify-content: center;
    margin-bottom: 14px;
}

.mq-stat {
    background: var(--mq-accent-light);
    color: var(--mq-accent-dark);
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 700;
    font-size: 14px;
}

/* Question card */
.mq-card {
    background: #fff;
    border-radius: var(--kw-radius, 16px);
    padding: 20px 18px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .07);
    animation: mq-fade-in .25s ease;
}

.mq-question {
    font-size: 21px;
    font-weight: 800;
    margin: 0 0 16px;
    color: var(--mq-accent-dark);
    text-align: center;
    line-height: 1.35;
}

.mq-audio-btn {
    display: block;
    margin: 0 auto 16px;
    background: var(--mq-accent-light);
    color: var(--mq-accent-dark);
    border: 2px solid var(--mq-accent-border);
    padding: 8px 18px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.mq-audio-btn:hover {
    background: var(--mq-accent-border);
}

.mq-audio-btn[hidden],
.mq-next-btn[hidden] {
    display: none;
}

.mq-choices {
    display: grid;
    gap: 10px;
}

.mq-choice {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    padding: 12px 16px;
    border: 2px solid #E5E1F0;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--kw-text, #2D2A32);
    transition: transform .1s ease, border-color .15s ease, background .15s ease;
}

.mq-choice-badge {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--mq-accent-light);
    color: var(--mq-accent-dark);
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mq-choice-label {
    flex: 1;
}

.mq-choice:hover:not(:disabled) {
    border-color: var(--mq-accent);
    transform: translateY(-1px);
}

.mq-choice:disabled {
    cursor: default;
}

.mq-choice:disabled:not(.correct):not(.incorrect) {
    opacity: .5;
}

.mq-choice.correct {
    background: #DCFCE7;
    border-color: #10B981;
    animation: mq-pop .25s ease;
}

.mq-choice.correct .mq-choice-badge {
    background: #10B981;
    color: #fff;
}

.mq-choice.correct::after {
    content: "✓";
    font-weight: 800;
    color: #10B981;
    font-size: 18px;
}

.mq-choice.incorrect {
    background: #FEE2E2;
    border-color: #EF4444;
    animation: mq-shake .3s ease;
}

.mq-choice.incorrect .mq-choice-badge {
    background: #EF4444;
    color: #fff;
}

.mq-choice.incorrect::after {
    content: "✗";
    font-weight: 800;
    color: #EF4444;
    font-size: 18px;
}

.mq-next-btn {
    display: block;
    margin: 18px auto 0;
    background: var(--mq-accent);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 3px 0 var(--mq-accent-dark);
    animation: mq-fade-in .2s ease;
}

.mq-next-btn:hover {
    transform: translateY(-1px);
}

.mq-next-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 var(--mq-accent-dark);
}

/* Done screen */
.mq-done-card {
    text-align: center;
    background: #fff;
    border-radius: var(--kw-radius, 16px);
    padding: 32px 20px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .07);
    animation: mq-pop .3s ease;
}

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

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

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

.mq-done-stars {
    font-size: 24px;
    letter-spacing: 4px;
}

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

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

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

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

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

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

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

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

@keyframes mq-pop {
    0% { transform: scale(.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes mq-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

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

@media (max-width: 380px) {
    .mq-levels {
        grid-template-columns: 1fr;
    }
}
