/* ===========================
   CHALLENGE SCREEN
   =========================== */
.challenge-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    box-shadow: 0 2px 8px var(--shadow);
    z-index: 10;
    backdrop-filter: blur(8px);
}

.challenge-progress {
    display: flex;
    gap: 4px;
    align-items: center;
}

.challenge-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-round);
    background: #D0D0D0;
    transition: all 0.3s ease;
}

.challenge-dot-done {
    background: var(--success);
    box-shadow: 0 0 6px rgba(102, 187, 106, 0.4);
}

.challenge-dot-current {
    background: var(--accent);
    width: 12px;
    height: 12px;
    box-shadow: 0 0 8px rgba(255, 112, 67, 0.5);
}

/* Difficulty-themed challenge body backgrounds */
.challenge-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    gap: 20px;
    overflow-y: auto;
    position: relative;
    background: linear-gradient(180deg, #E0F7FA 0%, #B2EBF2 50%, #80DEEA 100%);
}

.challenge-body[data-difficulty="easy"],
.challenge-body.difficulty-easy {
    background: var(--bg-easy);
}

.challenge-body[data-difficulty="medium"],
.challenge-body.difficulty-medium {
    background: var(--bg-medium);
}

.challenge-body[data-difficulty="hard"],
.challenge-body.difficulty-hard {
    background: var(--bg-hard);
    color: var(--text-white);
}

.challenge-question {
    font-size: 1.45rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.5;
    padding: 14px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: var(--radius);
    backdrop-filter: blur(4px);
}

.speak-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: 10px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.65);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    vertical-align: middle;
    transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.speak-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.speak-btn:active {
    transform: scale(0.92);
}

.speak-btn:focus-visible {
    outline: 3px solid rgba(233, 30, 99, 0.55);
    outline-offset: 2px;
}

.challenge-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

/* ===========================
   MULTIPLE CHOICE
   =========================== */
.choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    max-width: 400px;
}

/* Hint area */
.hint-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
}

.hint-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(180deg, #E3F2FD 0%, #BBDEFB 100%);
    border: 2px solid var(--primary-light);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-dark);
    cursor: pointer;
    min-height: 48px;
    touch-action: manipulation;
    transition: all var(--transition);
}

.hint-btn:active {
    transform: scale(0.95);
}

/* ===========================
   NUMBER BUILDER
   =========================== */
.number-builder-slots {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}

.nb-slot-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.nb-slot {
    width: 64px;
    height: 72px;
    border: 3px dashed var(--primary-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.7);
    transition: all var(--transition);
    backdrop-filter: blur(4px);
}

.nb-slot-filled {
    border-style: solid;
    border-color: var(--primary);
    color: var(--text);
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.nb-slot-correct {
    border-color: var(--success);
    background: linear-gradient(135deg, #C8E6C9 0%, var(--success-light) 100%);
    color: #2E7D32;
    animation: golden-glow 1.2s ease-in-out infinite;
}

.nb-slot-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
}

.nb-digits {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 320px;
    margin-bottom: 16px;
}

/* Colorful gem/block digit tiles with gradients */
.nb-digit {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    background: linear-gradient(145deg, #42A5F5 0%, #1E88E5 50%, #1565C0 100%);
    color: var(--text-white);
    font-size: 1.6rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    touch-action: none;
    transition: opacity var(--transition), transform var(--transition);
    box-shadow:
        0 3px 0 #0D47A1,
        0 6px 12px rgba(13, 71, 161, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Gem shine highlight */
.nb-digit::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 4px;
    width: 16px;
    height: 8px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 50%;
}

/* Alternate gem colors */
.nb-digit:nth-child(odd) {
    background: linear-gradient(145deg, #EF5350 0%, #E53935 50%, #C62828 100%);
    box-shadow:
        0 3px 0 #B71C1C,
        0 6px 12px rgba(183, 28, 28, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.nb-digit:nth-child(3n) {
    background: linear-gradient(145deg, #AB47BC 0%, #8E24AA 50%, #6A1B9A 100%);
    box-shadow:
        0 3px 0 #4A148C,
        0 6px 12px rgba(74, 20, 140, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.nb-digit:nth-child(4n) {
    background: linear-gradient(145deg, #66BB6A 0%, #43A047 50%, #2E7D32 100%);
    box-shadow:
        0 3px 0 #1B5E20,
        0 6px 12px rgba(27, 94, 32, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.nb-digit.drag-disabled {
    opacity: 0.3;
    cursor: default;
    filter: grayscale(0.5);
}

/* Drop zone hover state */
.drop-zone-hover {
    border-color: var(--accent) !important;
    border-style: solid !important;
    background: rgba(255, 243, 224, 0.8) !important;
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(255, 112, 67, 0.3) !important;
}

/* Drag clone */
.drag-clone {
    border-radius: var(--radius);
}

/* ===========================
   BALANCE SCALE
   =========================== */
.scale-container {
    width: 100%;
    max-width: 360px;
    padding: 16px 0;
}

.scale-beam {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: transform 0.4s ease;
    transform-origin: center center;
}

.scale-pan {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F3F8FF 100%);
    border-radius: var(--radius);
    border: 2px solid var(--primary-light);
    min-height: 80px;
    box-shadow: 0 4px 12px var(--shadow);
}

.scale-pan-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.scale-pan-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
}

.scale-fulcrum {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.scale-drop-zones {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.scale-drop {
    width: 56px;
    height: 56px;
    border: 3px dashed var(--primary-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.7);
    transition: all var(--transition);
}

.scale-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 320px;
    margin-bottom: 16px;
}

/* Gold coin style scale numbers */
.scale-num {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-round);
    background: linear-gradient(145deg, #FFD54F 0%, #FFC107 30%, #FFB300 60%, #FF8F00 100%);
    color: #5D4037;
    font-size: 1.45rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    touch-action: none;
    transition: opacity var(--transition), transform var(--transition);
    box-shadow:
        0 3px 0 #E65100,
        0 6px 12px rgba(230, 81, 0, 0.25),
        inset 0 2px 0 rgba(255, 255, 255, 0.5),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 2px solid #F57F17;
    position: relative;
}

/* Coin shine effect */
.scale-num::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 6px;
    width: 14px;
    height: 8px;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 50%;
}

.scale-num:active {
    transform: scale(0.95);
}

/* ===========================
   SEQUENCE
   =========================== */
.sequence-display {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 12px;
}

/* Bigger, more playful circular sequence items */
.seq-item {
    width: 66px;
    height: 66px;
    border-radius: var(--radius-round);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    font-weight: 800;
    transition: all 0.3s ease;
}

.seq-item-filled {
    background: linear-gradient(145deg, #42A5F5 0%, #1E88E5 50%, #1565C0 100%);
    color: var(--text-white);
    box-shadow:
        0 3px 0 #0D47A1,
        0 6px 12px rgba(13, 71, 161, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.seq-item-blank {
    background: rgba(255, 255, 255, 0.7);
    border: 3px dashed var(--accent);
    color: var(--accent);
    animation: glow-pulse 2s ease-in-out infinite;
    backdrop-filter: blur(4px);
}

.seq-item-correct {
    background: linear-gradient(145deg, #66BB6A 0%, #43A047 50%, #2E7D32 100%);
    color: var(--text-white);
    box-shadow:
        0 3px 0 #1B5E20,
        0 0 16px rgba(102, 187, 106, 0.4);
    animation: golden-glow 1.5s ease-in-out infinite;
}

.seq-arrow {
    color: var(--text-light);
    font-size: 1.2rem;
}

/* ===========================
   CHALLENGE FOOTER
   =========================== */
.challenge-footer {
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.95) 100%);
    box-shadow: 0 -2px 8px var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(8px);
}

/* ===========================
   RESULTS SCREEN
   =========================== */
.results-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 24px;
    text-align: center;
    background: linear-gradient(180deg, #E0F7FA 0%, #B2EBF2 40%, #80DEEA 100%);
}

.results-stars {
    display: flex;
    gap: 12px;
    font-size: 3rem;
}

.results-message {
    font-size: 1.3rem;
    font-weight: 600;
}

.results-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 280px;
}

.auto-advance-note {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 600;
}
.auto-advance-bar {
    width: 100%;
    max-width: 220px;
    height: 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    overflow: hidden;
}
.auto-advance-bar-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--profile-color, var(--primary)));
    border-radius: 999px;
}

/* ===========================
   CHALLENGE SCREEN WRAPPER
   =========================== */
.challenge-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: background 0.5s ease;
}

/* Difficulty-themed backgrounds */
.challenge-bg-1 { background: linear-gradient(180deg, #E0F7FA 0%, #B2EBF2 40%, #80DEEA 100%); }
.challenge-bg-2 { background: linear-gradient(180deg, #E8F5E9 0%, #A5D6A7 40%, #66BB6A 100%); }
.challenge-bg-3 { background: linear-gradient(180deg, #FFF3E0 0%, #FFCC80 40%, #FFA726 100%); }
.challenge-bg-4 { background: linear-gradient(180deg, #F3E5F5 0%, #CE93D8 40%, #AB47BC 100%); }
.challenge-bg-5 { background: linear-gradient(180deg, #FCE4EC 0%, #F48FB1 40%, #EC407A 100%); }

/* Challenge illustration */
.challenge-illustration {
    font-size: 3.8rem;
    margin-bottom: 12px;
}

/* ===========================
   RESULT STARS
   =========================== */
.result-star {
    display: inline-block;
    font-size: 3rem;
    opacity: 0;
    animation: result-star-pop 0.5s ease forwards;
}

.result-star-filled {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

.result-star-empty {
    color: #D0D0D0;
    filter: none;
}

@keyframes result-star-pop {
    0% { opacity: 0; transform: scale(0) rotate(-30deg); }
    60% { opacity: 1; transform: scale(1.3) rotate(10deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* ===========================
   RESULTS REWARDS
   =========================== */
.results-rewards {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.reward-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    animation: result-star-pop 0.5s ease forwards;
    opacity: 0;
}

.reward-coins {
    background: linear-gradient(135deg, #FFD740, #FFA000);
    color: #5D4037;
    box-shadow: 0 2px 8px rgba(255, 160, 0, 0.4);
}

.reward-streak {
    background: linear-gradient(135deg, #FF6F00, #FFB300);
    color: #FFF;
    box-shadow: 0 2px 8px rgba(255, 111, 0, 0.4);
}

/* ===========================
   BADGE - COINS
   =========================== */
.badge-coins {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #FFD740, #FFA000);
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #5D4037;
}

/* ===========================
   GUIDE CELEBRATE
   =========================== */
.guide-celebrate {
    animation: guide-cheer 0.8s ease;
}

/* ===========================
   TIMER + HEART ROW
   =========================== */
.challenge-timer-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.challenge-timer {
    font-size: 0.85rem;
    font-weight: 700;
    color: #37474F;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 2px 8px;
    letter-spacing: 0.5px;
}

/* ===========================
   COMBO FLAME
   =========================== */
.streak-badge {
    transition: transform 0.2s, box-shadow 0.3s;
}

.combo-lvl-1 {
    background: linear-gradient(135deg, #FF8A65, #FF5722);
    box-shadow: 0 2px 8px rgba(255, 87, 34, 0.4);
}

.combo-lvl-2 {
    background: linear-gradient(135deg, #FF5722, #E64A19);
    box-shadow: 0 4px 14px rgba(230, 74, 25, 0.55);
    transform: scale(1.05);
    animation: combo-pulse 1.6s ease-in-out infinite;
}

.combo-lvl-3 {
    background: linear-gradient(135deg, #FF1744, #FF9100);
    box-shadow: 0 6px 22px rgba(255, 23, 68, 0.7), 0 0 20px rgba(255, 145, 0, 0.6);
    transform: scale(1.12);
    animation: combo-flame 0.8s ease-in-out infinite alternate;
    color: #FFF;
}

.combo-flame {
    display: inline-block;
    font-size: 1.15em;
    filter: drop-shadow(0 2px 4px rgba(255, 87, 34, 0.7));
}

@keyframes combo-pulse {
    0%, 100% { transform: scale(1.05); }
    50% { transform: scale(1.1); }
}

@keyframes combo-flame {
    from { transform: scale(1.1) rotate(-1deg); filter: drop-shadow(0 0 6px #FF9100); }
    to   { transform: scale(1.16) rotate(1deg); filter: drop-shadow(0 0 14px #FF1744); }
}

@media (prefers-reduced-motion: reduce) {
    .combo-lvl-2, .combo-lvl-3 { animation: none; }
}

/* ===========================
   POWER-UP TRAY
   =========================== */
.power-up-tray {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.power-up-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: linear-gradient(135deg, #FFF, #FFE082);
    border: 2px solid #FFB300;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(255, 179, 0, 0.35);
    transition: transform 0.1s;
    color: #5D4037;
}

.power-up-btn:active {
    transform: translateY(1px) scale(0.96);
}

.power-up-btn:disabled,
.power-up-btn-active {
    opacity: 0.55;
    cursor: default;
}

.pu-icon { font-size: 1.2rem; }

.pu-count {
    background: #FF6F00;
    color: #FFF;
    border-radius: 10px;
    padding: 0 6px;
    font-size: 0.7rem;
}

.reveal-solution-btn {
    background: linear-gradient(135deg, #CE93D8, #7B1FA2);
    color: #FFF;
    border: none;
    border-radius: 14px;
    padding: 8px 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(123, 31, 162, 0.4);
}

/* ===========================
   SOLUTION PANEL
   =========================== */
.solution-panel {
    margin-top: 16px;
    padding: 14px 16px;
    background: #F3E5F5;
    border: 3px dashed #BA68C8;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(186, 104, 200, 0.25);
}

.solution-title {
    font-weight: 800;
    color: #6A1B9A;
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.solution-steps {
    margin: 0 0 8px;
    padding-left: 22px;
    color: #4A148C;
    line-height: 1.5;
}

.solution-final {
    margin: 8px 0 4px;
    color: #4A148C;
    font-size: 1.05rem;
}

.solution-final-note {
    font-size: 0.9rem;
    color: #6A1B9A;
    font-style: italic;
    margin: 0;
}

/* ===========================
   DAILY BANNER
   =========================== */
.daily-banner {
    text-align: center;
    padding: 6px 10px;
    margin: 6px auto 0;
    max-width: 320px;
    background: linear-gradient(135deg, #FFE082, #FFA000);
    color: #5D4037;
    font-weight: 800;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(255, 160, 0, 0.4);
}

/* ===========================
   SPEED STAR / RESULTS
   =========================== */
.result-star-speed {
    color: #FFEB3B;
    text-shadow: 0 0 12px #FFC107, 0 0 24px rgba(255, 193, 7, 0.6);
    animation: star-appear 0.55s ease-out backwards, speed-throb 1.2s ease-in-out infinite 0.6s;
}

@keyframes speed-throb {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.18); }
}

.results-speed-note {
    color: #F57F17;
    font-weight: 800;
    margin: 4px 0 2px;
}

.results-daily-note {
    color: #E65100;
    font-weight: 800;
    margin: 0 0 4px;
}

.achievement-unlocks {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
}

.achievement-toast {
    padding: 10px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #FFD740, #FF6F00);
    color: #4E342E;
    font-size: 0.95rem;
    line-height: 1.35;
    box-shadow: 0 4px 14px rgba(255, 111, 0, 0.45);
    animation: toast-in 0.5s ease-out;
}

.achievement-desc {
    font-size: 0.8rem;
    color: #5D4037;
    opacity: 0.9;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===========================
   SHOP
   =========================== */
.shop-container {
    max-width: 440px;
    margin: 0 auto;
    padding: 18px 14px;
}

.shop-intro {
    text-align: center;
    color: #455A64;
    margin: 0 0 14px;
}

.shop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.shop-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 10px;
    background: #FFF;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid #ECEFF1;
}

.shop-card-icon { font-size: 2.2rem; margin-bottom: 4px; }
.shop-card-name { font-weight: 800; color: #263238; }
.shop-card-desc { font-size: 0.8rem; color: #546E7A; text-align: center; margin: 4px 0 6px; min-height: 32px; }
.shop-card-owned { font-size: 0.75rem; color: #78909C; margin-bottom: 6px; }

.shop-buy-btn {
    width: 100%;
    padding: 6px 8px;
    font-size: 0.95rem;
}

/* ===========================
   TROPHIES SCREEN
   =========================== */
.trophies-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 18px 14px;
}

.trophies-heading {
    margin: 12px 0 8px;
    color: #37474F;
    font-size: 1.1rem;
    font-weight: 800;
}

.trophies-progress {
    font-size: 0.9rem;
    color: #78909C;
    font-weight: 600;
}

.achievement-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.achievement-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    background: #ECEFF1;
    border-radius: 14px;
    opacity: 0.55;
    text-align: center;
}

.achievement-card-unlocked {
    opacity: 1;
    background: linear-gradient(135deg, #FFF59D, #FFB74D);
    box-shadow: 0 4px 10px rgba(255, 152, 0, 0.35);
}

.achievement-icon { font-size: 2rem; }
.achievement-name { font-weight: 800; color: #263238; font-size: 0.9rem; }
.achievement-desc { font-size: 0.75rem; color: #546E7A; }

.trophy-islands-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.trophy-island {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    background: #ECEFF1;
    border-radius: 14px;
    text-align: center;
    opacity: 0.6;
}

.trophy-island-earned {
    opacity: 1;
    background: linear-gradient(135deg, #FFD54F, #FF8F00);
    color: #4E342E;
    box-shadow: 0 4px 10px rgba(255, 143, 0, 0.45);
}

.trophy-island-icon { font-size: 2rem; }
.trophy-island-name { font-weight: 800; font-size: 0.9rem; }
.trophy-island-meta { font-size: 0.75rem; opacity: 0.85; }

.trophies-stats {
    margin-top: 18px;
    background: #FFF;
    padding: 12px 16px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.trophy-stat {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px dashed #E0E0E0;
    font-size: 0.95rem;
    color: #455A64;
}

.trophy-stat:last-child { border-bottom: none; }
.trophy-stat span { font-size: 1.1rem; }

/* ===========================
   FRACTION VISUAL
   =========================== */
.fraction-visual-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.fraction-visual-svg {
    width: 160px;
    height: 160px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.15));
}

.fv-slice-filled {
    fill: #FF7043;
    stroke: #FFF;
    stroke-width: 2;
    transition: fill 0.2s;
}

.fv-slice-empty {
    fill: #FFE0B2;
    stroke: #FFF;
    stroke-width: 2;
}

.fraction-visual-bar {
    display: flex;
    width: 260px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border: 3px solid #FFF;
}

.fv-cell {
    flex: 1;
    border-right: 2px solid #FFF;
}

.fv-cell:last-child {
    border-right: none;
}

.fv-cell-filled {
    background: linear-gradient(135deg, #42A5F5, #1E88E5);
}

.fv-cell-empty {
    background: #E3F2FD;
}

.fraction-visual-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #5D4037;
    opacity: 0.75;
}

.choice-btn-fraction {
    min-width: 88px;
    padding: 14px 12px;
}

.frac {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    font-weight: 800;
}

.frac-num,
.frac-den {
    font-size: 1.4rem;
}

.frac-bar {
    display: block;
    width: 100%;
    min-width: 28px;
    height: 3px;
    background: currentColor;
    margin: 3px 0;
    border-radius: 2px;
}

/* ===========================
   WORD PROBLEM
   =========================== */
.wp-story {
    background: rgba(255, 255, 255, 0.75);
    border-radius: 14px;
    padding: 8px 14px;
    margin-bottom: 12px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.06);
}

.wp-steps {
    margin: 0;
    padding-left: 22px;
    font-size: 0.95rem;
    color: #37474F;
    line-height: 1.45;
}

.wp-steps li + li {
    margin-top: 4px;
}

.wp-display {
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: 4px;
    text-align: center;
    padding: 12px 20px;
    min-height: 64px;
    background: #FFF;
    border: 3px dashed #B0BEC5;
    border-radius: 16px;
    color: #263238;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wp-display-correct {
    border-color: #66BB6A;
    background: #E8F5E9;
    color: #1B5E20;
}

.wp-display-wrong {
    border-color: #EF5350;
    background: #FFEBEE;
    color: #B71C1C;
}

.wp-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 260px;
    margin: 0 auto 12px;
}

.wp-key {
    padding: 14px 0;
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #FFF, #ECEFF1);
    color: #263238;
    border: 2px solid #CFD8DC;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.1s, background 0.15s;
    touch-action: manipulation;
}

.wp-key:active {
    transform: translateY(1px) scale(0.96);
    background: #CFD8DC;
}

.wp-key-wide {
    background: linear-gradient(135deg, #FFE0B2, #FFCC80);
    border-color: #FFB74D;
    color: #E65100;
}

.wp-scratch-toggle {
    display: block;
    margin: 0 auto 8px;
    padding: 6px 12px;
    font-size: 0.85rem;
    background: transparent;
    border: 2px dashed #90A4AE;
    border-radius: 10px;
    color: #455A64;
    cursor: pointer;
}

.wp-scratch {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 12px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 1rem;
    border: 2px solid #B0BEC5;
    border-radius: 10px;
    background: #FFFDE7;
    resize: vertical;
}

@media (prefers-reduced-motion: reduce) {
    .wp-key:active { transform: none; }
    .fv-slice-filled { transition: none; }
}

/* ===========================
   TIER: JUNIOR (ages 5–6, e.g. Ava)
   Audio-first, finger-friendly, decision-light. Scoped under
   .tier-junior so older tiers (Ziva) keep the compact layout.
   =========================== */
.tier-junior .challenge-question p {
    font-size: 1.7rem;
    line-height: 1.45;
    font-weight: 700;
}

.tier-junior .challenge-illustration {
    font-size: 4.4rem;
    margin-bottom: 6px;
}

/* Big pulsing audio button — the primary affordance for junior */
.speak-btn-large {
    width: auto;
    height: 64px;
    padding: 0 22px;
    border-radius: 32px;
    font-size: 1.4rem;
    font-weight: 800;
    margin-left: 12px;
    margin-top: 8px;
    background: linear-gradient(180deg, #FFFFFF 0%, #FFF3E0 100%);
    box-shadow: 0 4px 0 rgba(255, 152, 0, 0.45), 0 6px 14px rgba(0, 0, 0, 0.16);
    border: 3px solid #FFB74D;
    color: #E65100;
    gap: 8px;
}

.speak-btn-large .speak-btn-label {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.speak-btn-large:hover {
    background: linear-gradient(180deg, #FFFFFF 0%, #FFE0B2 100%);
}

@keyframes speak-btn-pulse-anim {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 0 rgba(255, 152, 0, 0.45), 0 6px 14px rgba(0, 0, 0, 0.16),
                    0 0 0 0 rgba(255, 152, 0, 0.6);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 4px 0 rgba(255, 152, 0, 0.45), 0 6px 14px rgba(0, 0, 0, 0.16),
                    0 0 0 14px rgba(255, 152, 0, 0);
    }
}

.speak-btn-pulse {
    animation: speak-btn-pulse-anim 1.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .speak-btn-pulse { animation: none; }
}

/* Bigger answer chips, simpler grid */
.tier-junior .choices {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 440px;
}

.tier-junior .choice-btn {
    min-height: 96px;
    padding: 22px 16px;
    font-size: 2rem;
    border-width: 4px;
    border-radius: 24px;
}

.tier-junior .choice-btn-fraction {
    min-height: 110px;
}

.tier-junior .choice-btn {
    flex-direction: column;
    line-height: 1;
}

.tier-junior .choice-btn .choice-num {
    display: block;
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
}

.tier-junior .choice-btn .choice-dots {
    display: block;
    font-size: 1.4rem;
    line-height: 1;
    margin-top: 8px;
    color: #455A64;
    letter-spacing: 0.16em;
}

/* Hint button — bigger, friendlier */
.tier-junior .hint-btn {
    min-height: 60px;
    font-size: 1.1rem;
    padding: 14px 22px;
    border-radius: 22px;
}

.tier-junior .hint-area {
    font-size: 1.15rem;
    padding: 16px 18px;
}

/* Sequence challenge — larger items so the pattern is obvious */
.tier-junior .seq-item {
    width: 72px;
    height: 72px;
    font-size: 2rem;
}

.tier-junior .seq-arrow {
    font-size: 1.6rem;
}

/* Fraction visual — make it dominate the screen */
.tier-junior .fraction-visual-stage {
    transform: scale(1.25);
    transform-origin: center top;
    margin-bottom: 24px;
}

.tier-junior .fraction-visual-label {
    font-size: 1.4rem;
    font-weight: 800;
}

/* Number-builder — friendlier slot sizes */
.tier-junior .nb-slot {
    width: 78px;
    height: 88px;
    font-size: 2.6rem;
}

.tier-junior .nb-slot-label {
    font-size: 0.85rem;
}

/* Word problem — drop the scratchpad, super-size the keys */
.tier-junior .wp-scratch,
.tier-junior .wp-scratch-toggle {
    display: none !important;
}

.tier-junior .wp-keypad {
    grid-template-columns: repeat(3, 1fr);
    max-width: 320px;
    gap: 12px;
}

.tier-junior .wp-key {
    padding: 22px 0;
    font-size: 1.8rem;
    border-width: 3px;
    border-radius: 16px;
    min-height: 72px;
}

.tier-junior .wp-display {
    font-size: 2.6rem;
    min-height: 64px;
    line-height: 64px;
    border-radius: 18px;
}

.tier-junior #wp-check.btn {
    font-size: 1.4rem;
    padding: 18px 32px;
    min-height: 64px;
    border-radius: 24px;
}

/* Junior auto-advance — slower bar, bigger continue button */
.tier-junior .auto-advance-note {
    font-size: 1.1rem;
}

.tier-junior #continue-btn,
.tier-junior #next-island-btn {
    font-size: 1.45rem;
    padding: 20px 32px;
    min-height: 72px;
    border-radius: 28px;
}
