/* ============================================================
   Ten Buddies - a make-a-ten game for young mathematicians
   ============================================================ */

:root {
    --pink: #ff6b9d;
    --orange: #ff9f45;
    --yellow: #ffd93d;
    --green: #5fdd8d;
    --blue: #4fc3f7;
    --purple: #b388ff;
    --minus: #6b8cae;
    --gold: #ffc42e;
    --ink: #35306b;
    --ink-soft: #6f6aa8;
    --card: #ffffff;
    --shadow: 0 10px 0 rgba(53, 48, 107, 0.12), 0 18px 30px rgba(53, 48, 107, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: 'Baloo 2', 'Trebuchet MS', sans-serif;
    color: var(--ink);
    background: linear-gradient(165deg, #7fdcff 0%, #a8b4ff 42%, #ffb0dd 100%);
    background-attachment: fixed;
    overflow-x: hidden;
    padding: 0.8rem;
}

/* ---------- floating background bubbles ---------- */
.bubbles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bubbles span {
    position: absolute;
    bottom: -140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    box-shadow: inset 0 -6px 12px rgba(255, 255, 255, 0.6);
    animation: rise linear infinite;
}

@keyframes rise {
    0% {
        transform: translateY(0) scale(0.6);
        opacity: 0;
    }

    12% {
        opacity: 0.9;
    }

    100% {
        transform: translateY(-118vh) scale(1.15);
        opacity: 0;
    }
}

/* ---------- screens ---------- */
.screen {
    display: none;
    position: relative;
    z-index: 1;
    max-width: 980px;
    margin: 0 auto;
}

.screen.active {
    display: block;
    animation: popIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(14px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ============================================================
   Tenny the mascot (pure CSS blob friend)
   ============================================================ */
.tenny {
    position: relative;
    width: 92px;
    height: 92px;
    flex: 0 0 auto;
    animation: tennyIdle 3s ease-in-out infinite;
}

.tenny.big {
    width: 150px;
    height: 150px;
}

@keyframes tennyIdle {

    0%,
    100% {
        transform: translateY(0) rotate(-2deg);
    }

    50% {
        transform: translateY(-8px) rotate(2deg);
    }
}

.tenny-body {
    position: absolute;
    inset: 8% 6% 14% 6%;
    background: radial-gradient(circle at 32% 28%, #b6f36f, #7bd13f 62%, #5fb02d);
    border: 4px solid #3f7a1c;
    border-radius: 50% 50% 46% 46%;
    box-shadow: inset -6px -8px 0 rgba(0, 0, 0, 0.08);
}

.tenny-eye {
    position: absolute;
    top: 30%;
    width: 15%;
    height: 20%;
    background: #2b3d14;
    border-radius: 50%;
    animation: blinky 4.5s infinite;
}

.tenny-eye.left {
    left: 27%;
}

.tenny-eye.right {
    right: 27%;
}

.tenny-eye::after {
    content: '';
    position: absolute;
    top: 14%;
    left: 18%;
    width: 42%;
    height: 34%;
    background: #fff;
    border-radius: 50%;
}

@keyframes blinky {

    0%,
    92%,
    100% {
        transform: scaleY(1);
    }

    95% {
        transform: scaleY(0.1);
    }
}

.tenny-cheek {
    position: absolute;
    top: 52%;
    width: 16%;
    height: 10%;
    background: rgba(255, 108, 157, 0.55);
    border-radius: 50%;
    filter: blur(1px);
}

.tenny-cheek.left {
    left: 15%;
}

.tenny-cheek.right {
    right: 15%;
}

.tenny-mouth {
    position: absolute;
    left: 50%;
    top: 56%;
    width: 40%;
    height: 24%;
    transform: translateX(-50%);
    border: 4px solid #2b3d14;
    border-top-color: transparent;
    border-left-color: transparent;
    border-right-color: transparent;
    border-radius: 0 0 60% 60%;
    transition: all 0.25s;
}

.tenny-arm,
.tenny-leg {
    position: absolute;
    background: #3f7a1c;
    border-radius: 4px;
}

.tenny-arm {
    width: 26%;
    height: 5px;
    top: 52%;
}

.tenny-arm.left {
    left: -14%;
    transform: rotate(18deg);
    transform-origin: right center;
}

.tenny-arm.right {
    right: -14%;
    transform: rotate(-18deg);
    transform-origin: left center;
}

.tenny-leg {
    width: 5px;
    height: 16%;
    bottom: 0;
}

.tenny-leg.left {
    left: 34%;
    transform: rotate(6deg);
}

.tenny-leg.right {
    right: 34%;
    transform: rotate(-6deg);
}

/* mood: happy = wider grin + arms up */
.tenny.happy {
    animation: tennyCheer 0.5s ease-in-out 3;
}

.tenny.happy .tenny-mouth {
    height: 34%;
    width: 48%;
    background: #2b3d14;
    border-radius: 0 0 50% 50%;
    border-color: transparent;
}

.tenny.happy .tenny-arm.left {
    transform: rotate(-40deg);
}

.tenny.happy .tenny-arm.right {
    transform: rotate(40deg);
}

@keyframes tennyCheer {

    0%,
    100% {
        transform: translateY(0) rotate(0);
    }

    50% {
        transform: translateY(-16px) rotate(-6deg) scale(1.06);
    }
}

.tenny.think .tenny-mouth {
    height: 8%;
    width: 22%;
    border-radius: 40%;
    border-top-color: #2b3d14;
    border-bottom-color: transparent;
}

/* ============================================================
   START SCREEN
   ============================================================ */
.start-card {
    background: var(--card);
    border-radius: 34px;
    padding: 1.6rem 1.4rem 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 5px solid #fff;
    margin: 1.2rem auto;
    max-width: 720px;
}

.start-mascot {
    display: flex;
    justify-content: center;
}

.game-title {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(2.4rem, 9vw, 3.8rem);
    line-height: 1;
    color: var(--purple);
    text-shadow: 0 4px 0 #fff, 0 7px 0 rgba(53, 48, 107, 0.18);
    letter-spacing: 1px;
    margin: 0.4rem 0 0.2rem;
}

.game-title span {
    color: var(--pink);
}

.tagline {
    font-size: clamp(1rem, 3.4vw, 1.25rem);
    color: var(--ink-soft);
    font-weight: 500;
    margin-bottom: 1.3rem;
}

.how-to {
    display: grid;
    gap: 0.7rem;
    text-align: left;
    margin: 0 auto 1.4rem;
    max-width: 520px;
}

.how-step {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    background: #f4f2ff;
    border: 3px solid #e6e1ff;
    border-radius: 20px;
    padding: 0.7rem 0.9rem;
    font-size: 1rem;
    font-weight: 500;
}

.how-num {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--purple);
    color: #fff;
    font-family: 'Fredoka One', cursive;
    display: grid;
    place-items: center;
    box-shadow: 0 3px 0 #8a5fe0;
}

.tiny-note {
    margin-top: 0.9rem;
    font-size: 0.85rem;
    color: #a09bc8;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    font-family: 'Baloo 2', sans-serif;
    font-weight: 800;
    border: none;
    cursor: pointer;
    border-radius: 999px;
    padding: 0.7rem 1.5rem;
    font-size: 1.1rem;
    color: #fff;
    background: var(--purple);
    box-shadow: 0 5px 0 #8a5fe0;
    transition: transform 0.12s, box-shadow 0.12s, filter 0.2s;
}

.btn:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #8a5fe0;
}

.btn-huge {
    font-size: clamp(1.2rem, 4.5vw, 1.6rem);
    padding: 0.85rem 2.2rem;
    background: linear-gradient(#ff86b0, #ff5f95);
    box-shadow: 0 6px 0 #d93d70;
}

.btn-huge:active {
    box-shadow: 0 2px 0 #d93d70;
}

.btn-gold {
    background: linear-gradient(#ffd95e, #ffb62e);
    color: #7a4a00;
    box-shadow: 0 5px 0 #d98f00;
    font-size: 1.15rem;
}

.btn-gold:disabled {
    background: #e2e0ee;
    color: #a9a5c4;
    box-shadow: 0 5px 0 #cdcade;
    cursor: not-allowed;
}

.btn-gold:not(:disabled) {
    animation: goldPulse 1.1s ease-in-out infinite;
}

@keyframes goldPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.07);
    }
}

.btn-soft {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 4px 0 #d9d5f0;
    border: 3px solid #eceaf9;
    font-size: 1rem;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.85);
    border: 3px solid #fff;
    border-radius: 50%;
    width: 46px;
    height: 46px;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 0 rgba(53, 48, 107, 0.15);
    flex: 0 0 auto;
    line-height: 1;
}

.icon-btn:active {
    transform: translateY(3px);
    box-shadow: none;
}

.icon-btn.muted {
    filter: grayscale(1) opacity(0.6);
}

/* ============================================================
   GAME LAYOUT
   ============================================================ */
.topbar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.7rem;
}

.level-rail {
    flex: 1;
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    flex-wrap: wrap;
}

.pip {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    font-weight: 800;
    font-size: 0.8rem;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-family: 'Baloo 2', sans-serif;
    padding: 0;
    transition: transform 0.15s;
}

.pip:hover {
    transform: scale(1.12);
}

.pip.done {
    background: var(--yellow);
    color: #8a5a00;
    border-color: #fff;
}

.pip.current {
    background: #fff;
    color: var(--purple);
    transform: scale(1.2);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.4);
}

.stage {
    background: rgba(255, 255, 255, 0.94);
    border-radius: 30px;
    padding: 1rem;
    box-shadow: var(--shadow);
    border: 5px solid #fff;
}

/* ---------- coach + speech ---------- */
.coach {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.speech {
    position: relative;
    flex: 1;
    background: #f4f2ff;
    border: 3px solid #e2ddff;
    border-radius: 18px;
    padding: 0.7rem 0.9rem;
    font-size: clamp(0.95rem, 3vw, 1.15rem);
    font-weight: 600;
    color: var(--ink);
    min-height: 60px;
    display: flex;
    align-items: center;
}

.speech::before {
    content: '';
    position: absolute;
    left: -13px;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-right-color: #e2ddff;
}

.speech.pop {
    animation: speechPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes speechPop {
    from {
        transform: scale(0.9);
    }

    to {
        transform: scale(1);
    }
}

/* ---------- level head ---------- */
.level-head {
    text-align: center;
    margin-bottom: 0.7rem;
}

.level-head h2 {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(1.2rem, 4.5vw, 1.7rem);
    color: var(--purple);
}

.strip {
    font-size: clamp(0.85rem, 2.8vw, 1.05rem);
    color: #9a95c4;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 0.15rem;
    word-spacing: 2px;
}

/* ---------- number tiles ---------- */
.tray-wrap {
    background: #f7f6ff;
    border: 3px dashed #ded9ff;
    border-radius: 22px;
    padding: 0.8rem 0.5rem;
    min-height: 96px;
    display: grid;
    place-items: center;
}

.tray {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: center;
}

.tile {
    position: relative;
    font-family: 'Fredoka One', cursive;
    min-width: 74px;
    height: 70px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 1.75rem;
    display: grid;
    place-items: center;
    padding: 0 0.6rem;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.18);
}

.tile .tile-sign {
    position: absolute;
    top: 4px;
    left: 8px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    padding: 0 5px;
    line-height: 1.25;
    text-shadow: none;
}

.tile.c0 {
    background: linear-gradient(#ff8ab4, var(--pink));
    box-shadow: 0 6px 0 #d94d7c;
}

.tile.c1 {
    background: linear-gradient(#ffb96b, var(--orange));
    box-shadow: 0 6px 0 #d97a20;
}

.tile.c2 {
    background: linear-gradient(#ffe574, var(--yellow));
    box-shadow: 0 6px 0 #d9a900;
    color: #7a5200;
    text-shadow: none;
}

.tile.c3 {
    background: linear-gradient(#8ceaad, var(--green));
    box-shadow: 0 6px 0 #34b064;
}

.tile.c4 {
    background: linear-gradient(#86d9fb, var(--blue));
    box-shadow: 0 6px 0 #1f96cc;
}

.tile.c5 {
    background: linear-gradient(#c9aaff, var(--purple));
    box-shadow: 0 6px 0 #8a5fe0;
}

.tile.neg {
    background: linear-gradient(#8fabc7, var(--minus));
    box-shadow: 0 6px 0 #4b6c8c;
    color: #fff;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.25);
}

.tile:hover {
    transform: translateY(-4px) rotate(-2deg);
}

.tile.picked {
    opacity: 0.35;
    transform: scale(0.86);
    pointer-events: none;
    filter: grayscale(0.4);
}

.tile.gone {
    display: none;
}

.tile.wiggle {
    animation: wiggle 0.45s;
}

@keyframes wiggle {

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

    20% {
        transform: translateX(-7px) rotate(-4deg);
    }

    45% {
        transform: translateX(7px) rotate(4deg);
    }

    70% {
        transform: translateX(-4px);
    }
}

.tile.glow {
    animation: hintGlow 0.9s ease-in-out 3;
}

@keyframes hintGlow {

    0%,
    100% {
        box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(255, 217, 61, 0.9);
    }

    50% {
        box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2), 0 0 0 14px rgba(255, 217, 61, 0);
        transform: scale(1.1);
    }
}

/* ---------- mixing bowl ---------- */
.bowl-row {
    margin: 0.8rem 0;
}

.bowl {
    position: relative;
    background: linear-gradient(#fffdf2, #fff6d8);
    border: 4px solid #ffe08a;
    border-radius: 24px;
    padding: 1.4rem 0.8rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    transition: box-shadow 0.25s, border-color 0.25s, background 0.25s;
}

.bowl.ready {
    border-color: #ffb62e;
    background: linear-gradient(#fff6d0, #ffe9a8);
    box-shadow: 0 0 0 6px rgba(255, 182, 46, 0.25), 0 0 34px rgba(255, 182, 46, 0.55);
}

.bowl-label {
    position: absolute;
    top: -2px;
    left: 16px;
    transform: translateY(-50%);
    background: #ffb62e;
    color: #fff;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 0.1rem 0.7rem;
    border-radius: 999px;
    letter-spacing: 0.5px;
}

.bowl-chips {
    flex: 1;
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.bowl-empty {
    color: #c2b48a;
    font-weight: 600;
    font-style: italic;
}

.chip {
    font-family: 'Fredoka One', cursive;
    background: #fff;
    border: 3px solid #ffd76a;
    color: var(--ink);
    border-radius: 14px;
    padding: 0.25rem 0.6rem;
    font-size: 1.25rem;
    cursor: pointer;
    animation: chipIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chip:hover {
    border-color: var(--pink);
}

@keyframes chipIn {
    from {
        transform: scale(0.3) translateY(-26px);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

.chip-plus {
    font-family: 'Fredoka One', cursive;
    color: #d9a900;
    font-size: 1.1rem;
}

.bowl-side {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.bowl-total {
    font-family: 'Fredoka One', cursive;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    background: #eceaf9;
    color: #9a95c4;
    border: 4px solid #fff;
    box-shadow: 0 4px 0 #ddd9f2;
    transition: all 0.25s;
}

.bowl.ready .bowl-total {
    background: linear-gradient(#ffe574, #ffb62e);
    color: #7a4a00;
    box-shadow: 0 4px 0 #d98f00;
    animation: totalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes totalPop {
    0% {
        transform: scale(0.7) rotate(-12deg);
    }

    60% {
        transform: scale(1.18) rotate(6deg);
    }

    100% {
        transform: none;
    }
}

/* ---------- tens shelf ---------- */
.shelf-wrap {
    margin-bottom: 0.8rem;
}

.shelf-label {
    font-weight: 800;
    color: var(--ink-soft);
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.shelf-hint {
    font-weight: 500;
    font-size: 0.8rem;
    color: #b6b1d6;
}

.shelf {
    min-height: 78px;
    background: #f3fbff;
    border: 3px solid #d6f0ff;
    border-radius: 20px;
    padding: 0.6rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.coin {
    position: relative;
    font-family: 'Fredoka One', cursive;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    color: #7a4a00;
    background: radial-gradient(circle at 34% 28%, #fff3b0, #ffd23d 58%, #f0a500);
    border: 4px solid #fff;
    box-shadow: 0 5px 0 #d18b00, 0 8px 14px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    animation: coinDrop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.coin small {
    position: absolute;
    bottom: 3px;
    font-size: 0.55rem;
    color: #a86f00;
    font-family: 'Baloo 2', sans-serif;
    font-weight: 700;
}

.coin.zero {
    background: radial-gradient(circle at 34% 28%, #d9f6ff, #8ad9ff 58%, #35b0e8);
    color: #05506e;
    box-shadow: 0 5px 0 #1f8dbf, 0 8px 14px rgba(0, 0, 0, 0.12);
}

.coin:hover {
    transform: translateY(-3px) rotate(6deg);
}

@keyframes coinDrop {
    0% {
        transform: translateY(-70px) scale(0.4) rotate(-160deg);
        opacity: 0;
    }

    70% {
        transform: translateY(6px) scale(1.12) rotate(8deg);
        opacity: 1;
    }

    100% {
        transform: none;
    }
}

.controls {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================
   OVERLAYS
   ============================================================ */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(53, 48, 107, 0.55);
    backdrop-filter: blur(4px);
    z-index: 50;
    padding: 1rem;
    overflow-y: auto;
}

.overlay.active {
    display: grid;
    place-items: center;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.win-card {
    background: #fff;
    border-radius: 30px;
    padding: 1.6rem 1.3rem;
    max-width: 540px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow);
    border: 5px solid #fff;
    animation: winIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes winIn {
    from {
        transform: scale(0.6) translateY(40px);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

.win-burst {
    font-size: 3.2rem;
    animation: burst 1.1s ease-in-out infinite;
}

@keyframes burst {

    0%,
    100% {
        transform: scale(1) rotate(-6deg);
    }

    50% {
        transform: scale(1.18) rotate(6deg);
    }
}

.win-card h2 {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(1.5rem, 6vw, 2.1rem);
    color: var(--pink);
    margin-bottom: 0.5rem;
}

.stars {
    font-size: 2.2rem;
    letter-spacing: 0.3rem;
    margin-bottom: 0.7rem;
    min-height: 2.6rem;
}

.stars span {
    display: inline-block;
    animation: starPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.big-stars {
    font-size: 2.8rem;
}

@keyframes starPop {
    from {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }

    70% {
        transform: scale(1.4) rotate(12deg);
    }

    to {
        transform: none;
        opacity: 1;
    }
}

.win-math {
    background: #f7f6ff;
    border: 3px solid #e6e1ff;
    border-radius: 18px;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
}

.win-eq {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    color: var(--ink-soft);
    line-height: 1.5;
}

.win-eq b {
    color: #d98f00;
}

.win-total {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(1.8rem, 8vw, 2.6rem);
    color: var(--green);
    margin-top: 0.2rem;
}

.win-total span {
    color: #2fa864;
    display: inline-block;
    animation: totalReveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.45s both;
}

@keyframes totalReveal {
    from {
        transform: scale(0.2) rotate(-20deg);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

.win-note {
    color: var(--ink-soft);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.win-btns {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------- quiz ---------- */
.quiz-q {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 1rem;
}

.quiz-opts {
    display: grid;
    gap: 0.55rem;
}

.quiz-opt {
    font-family: 'Baloo 2', sans-serif;
    font-size: 1.02rem;
    font-weight: 700;
    text-align: left;
    background: #f7f6ff;
    border: 3px solid #e6e1ff;
    border-radius: 18px;
    padding: 0.75rem 0.9rem;
    cursor: pointer;
    color: var(--ink);
    transition: transform 0.12s, border-color 0.2s, background 0.2s;
}

.quiz-opt:hover {
    transform: translateX(4px);
    border-color: var(--purple);
}

.quiz-opt.right {
    background: #e4fbec;
    border-color: var(--green);
    animation: rightPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quiz-opt.wrong {
    background: #ffeef2;
    border-color: var(--pink);
    animation: wiggle 0.45s;
}

@keyframes rightPop {
    50% {
        transform: scale(1.06);
    }
}

.quiz-feedback {
    margin-top: 0.9rem;
    font-weight: 700;
    color: var(--green);
    min-height: 1.5rem;
    font-size: 1.05rem;
}

/* ============================================================
   CONFETTI + FLOATING PRAISE
   ============================================================ */
.confetti-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 90;
    overflow: hidden;
}

.confetti-bit {
    position: absolute;
    width: 12px;
    height: 12px;
    opacity: 0;
    animation: fall linear forwards;
}

.confetti-bit.round {
    border-radius: 50%;
}

.confetti-bit.strip {
    width: 7px;
    height: 18px;
    border-radius: 3px;
}

@keyframes fall {
    0% {
        opacity: 1;
        transform: translateY(-10vh) rotate(0);
    }

    100% {
        opacity: 0.9;
        transform: translateY(110vh) rotate(720deg);
    }
}

.praise {
    position: fixed;
    z-index: 95;
    pointer-events: none;
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    color: #fff;
    text-shadow: 0 3px 0 var(--pink), 0 0 18px rgba(255, 107, 157, 0.7);
    animation: praiseUp 1.1s ease-out forwards;
}

@keyframes praiseUp {
    0% {
        transform: translate(-50%, 0) scale(0.5);
        opacity: 0;
    }

    25% {
        transform: translate(-50%, -20px) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -110px) scale(1);
        opacity: 0;
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 560px) {
    body {
        padding: 0.5rem;
    }

    .stage {
        padding: 0.7rem;
        border-radius: 24px;
    }

    .tile {
        min-width: 62px;
        height: 60px;
        font-size: 1.45rem;
        border-radius: 16px;
    }

    .tenny {
        width: 70px;
        height: 70px;
    }

    .bowl-total {
        width: 62px;
        height: 62px;
        font-size: 1.3rem;
    }

    .coin {
        width: 56px;
        height: 56px;
        font-size: 1.15rem;
    }

    .bowl {
        padding-top: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
