/*
 * [Reading Challenge] The read-aloud ad funnel: hook (/reading-preview), reading
 * (/reading-challenge/read) and result (/reading-challenge/result). Drawn after the three
 * Kalimaaty mockups in public/images/reading_loudly/kalimaaty_loudly_{1,2,3}.png.
 *
 * Positions that the mockups draw on a fixed side (back button, progress row, ribbon seal, stat
 * cards, CTA chevron) are PHYSICAL on purpose (dir="ltr" wrappers), so every language shows the
 * same picture as the ad.
 */

:root {
    --rc-ink: #2a1b5c;
    --rc-ink-soft: #5d4c8f;
    --rc-orange-1: #ffd23f;
    --rc-orange-2: #ff9a00;
    --rc-orange-3: #f25a00;
    --rc-gold: #ffc928;
    --rc-ok-bg: #c9f8b0;
    --rc-ok-bg-2: #a4ee86;
    --rc-ok-ink: #1f5f12;
    --rc-bad-bg: #ffd9d4;
    --rc-bad-ink: #c62828;
    --rc-skip-bg: #ebe8f3;
    --rc-skip-ink: #a19bb3;
    --rc-now-bg: #ffec3d;
    --rc-now-line: #ffbf00;
    --rc-display: 'Baloo Bhaijaan 2', 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
    --rc-passage: 'Noto Naskh Arabic', 'Baloo Bhaijaan 2', 'Cairo', serif;
    --rc-ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
body {
    min-height: 100svh;
    font-family: var(--rc-display);
    color: var(--rc-ink);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; }
button { font: inherit; }

/* The CTA pill shared by the hook and the result. */
.rc-cta {
    position: relative;
    display: flex; align-items: center; justify-content: center; gap: 14px;
    width: 100%; min-height: 72px; padding: 12px 28px;
    border: 3px solid #ffe7a1; border-radius: 999px;
    background: linear-gradient(180deg, var(--rc-orange-1) 0%, var(--rc-orange-2) 42%, var(--rc-orange-3) 100%);
    box-shadow: 0 0 0 4px rgba(255, 176, 30, .25), 0 10px 0 #c4470a, 0 18px 34px rgba(255, 112, 0, .45), inset 0 3px 0 rgba(255, 255, 255, .55);
    color: #fff; text-decoration: none; text-align: center; cursor: pointer;
    font-weight: 800; font-size: clamp(1.25rem, 5.6vw, 1.7rem); line-height: 1.25;
    text-shadow: 0 2px 0 rgba(176, 56, 0, .55);
    transition: transform .14s var(--rc-ease), box-shadow .14s var(--rc-ease);
}
.rc-cta:active { transform: translateY(6px); box-shadow: 0 0 0 4px rgba(255, 176, 30, .25), 0 4px 0 #c4470a, 0 8px 18px rgba(255, 112, 0, .4), inset 0 3px 0 rgba(255, 255, 255, .55); }
.rc-cta:focus-visible { outline: 4px solid #fff; outline-offset: 5px; }

/* ===================================================================== hook */
.rc-hook-page {
    background: #1c1d78;
    color: #fff;
    overflow-x: hidden;
}
.rc-hook {
    position: relative;
    min-height: 100svh; height: 100svh; min-height: 520px;
    max-width: 560px; margin: 0 auto;
    padding: max(24px, env(safe-area-inset-top)) 22px max(26px, env(safe-area-inset-bottom));
    display: flex; flex-direction: column; align-items: center;
    isolation: isolate; overflow: hidden;
}
/* The night sky: navy to violet, stars, the clouds' warm glow at the bottom. */
.rc-hook-page::before {
    content: ''; position: fixed; inset: 0; z-index: -2;
    background:
        radial-gradient(120% 60% at 50% 105%, rgba(255, 164, 70, .55) 0%, rgba(176, 108, 214, .45) 30%, rgba(60, 50, 160, 0) 62%),
        radial-gradient(90% 60% at 50% 40%, rgba(70, 70, 200, .55) 0%, rgba(28, 29, 120, 0) 70%),
        linear-gradient(180deg, #141563 0%, #1d1f86 40%, #34329f 70%, #5b47b2 100%);
}
.rc-hook-page::after {
    content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background-image:
        radial-gradient(1.6px 1.6px at 12% 18%, #fff 50%, transparent 51%),
        radial-gradient(1.2px 1.2px at 28% 8%, #fff 50%, transparent 51%),
        radial-gradient(1.4px 1.4px at 72% 14%, #fff 50%, transparent 51%),
        radial-gradient(1.2px 1.2px at 88% 30%, #fff 50%, transparent 51%),
        radial-gradient(1.8px 1.8px at 8% 44%, #ffe9a8 50%, transparent 51%),
        radial-gradient(1.2px 1.2px at 64% 36%, #fff 50%, transparent 51%),
        radial-gradient(1.4px 1.4px at 92% 52%, #fff 50%, transparent 51%),
        radial-gradient(1.2px 1.2px at 40% 26%, #fff 50%, transparent 51%),
        radial-gradient(1.6px 1.6px at 18% 66%, #fff 50%, transparent 51%),
        radial-gradient(1.2px 1.2px at 84% 70%, #fff 50%, transparent 51%);
    opacity: .85;
}
.rc-hook__planet {
    position: absolute; z-index: -1; pointer-events: none; border-radius: 50%;
}
.rc-hook__planet--big {
    width: 210px; height: 210px; top: -58px; right: -92px;
    background: radial-gradient(circle at 30% 70%, #ffb46a 0%, #e9875a 30%, #9a5fb4 62%, #4a3a9e 100%);
    box-shadow: 0 0 60px rgba(255, 170, 110, .45), inset -16px 10px 30px rgba(40, 20, 90, .55);
}
.rc-hook__planet--ring {
    width: 74px; height: 74px; top: 41%; left: 9%;
    background: radial-gradient(circle at 35% 35%, #b9a8ff 0%, #7b67d8 55%, #4a3aa5 100%);
    box-shadow: 0 0 26px rgba(150, 130, 255, .45);
}
.rc-hook__planet--ring::after {
    content: ''; position: absolute; left: -26px; right: -26px; top: 50%; height: 20px; margin-top: -10px;
    border: 3px solid rgba(255, 196, 120, .85); border-radius: 50%;
    transform: rotate(-14deg);
    box-shadow: 0 0 10px rgba(255, 180, 90, .6);
}
.rc-hook__sparkle { position: absolute; z-index: -1; width: 14px; opacity: .9; pointer-events: none; }

.rc-logo { display: block; width: 116px; height: auto; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .35)); }
.rc-hook .rc-logo { width: clamp(108px, 30vw, 140px); }

.rc-hook__headline { margin: 14px 0 0; text-align: center; line-height: 1.25; font-weight: 800; }
.rc-hook__line1 { display: block; font-size: clamp(1.6rem, 7.4vw, 2.45rem); color: #fff; text-shadow: 0 3px 12px rgba(10, 8, 60, .55); }
.rc-hook__line2 {
    position: relative; display: inline-flex; align-items: center; gap: 12px;
    margin-top: 2px; padding-bottom: 16px;
    font-size: clamp(1.6rem, 7.4vw, 2.6rem); color: var(--rc-gold); white-space: nowrap;
    text-shadow: 0 3px 0 rgba(150, 70, 0, .45), 0 0 22px rgba(255, 196, 40, .45);
}
.rc-hook__rays { width: 28px; flex: 0 0 auto; }
.rc-hook__rays--mirror { transform: scaleX(-1); }
/* The gold swoosh under the second line. */
.rc-hook__line2::after {
    content: ''; position: absolute; left: 14%; right: 14%; bottom: 0; height: 18px;
    border-bottom: 4px solid #ffb21e; border-radius: 0 0 50% 50% / 0 0 100% 100%;
    filter: drop-shadow(0 0 6px rgba(255, 178, 30, .8));
}

.rc-hook__scene {
    position: relative; direction: ltr;
    width: 100%; flex: 1 1 auto; min-height: 210px; max-height: 620px;
    margin-top: 6px;
}
.rc-hook__glow {
    position: absolute; left: 30%; top: 58%; width: 62%; height: 36%;
    background: radial-gradient(closest-side, rgba(255, 226, 140, .95), rgba(255, 170, 60, .45) 45%, rgba(255, 150, 40, 0) 100%);
    filter: blur(6px); pointer-events: none;
}
.rc-hook__trail { position: absolute; left: 44%; top: 6%; width: 52%; height: 64%; overflow: visible; pointer-events: none; }
.rc-hook__child {
    position: absolute; left: -6%; bottom: 7%; width: 92%; height: 90%;
    object-fit: contain; object-position: left bottom;
    filter: drop-shadow(0 18px 30px rgba(10, 5, 60, .45));
}
.rc-hook__waves { position: absolute; left: 50%; top: 48%; width: 40px; height: 56px; pointer-events: none; }
.rc-hook__waves i {
    position: absolute; top: 50%; left: 0; border: 4px solid transparent; border-right-color: #ffe9b0; border-radius: 50%;
    filter: drop-shadow(0 0 6px rgba(255, 210, 120, .9));
    animation: rc-wave 1.8s ease-in-out infinite;
}
.rc-hook__waves i:nth-child(1) { width: 18px; height: 18px; margin-top: -9px; }
.rc-hook__waves i:nth-child(2) { width: 34px; height: 34px; margin-top: -17px; left: -8px; animation-delay: .2s; }
.rc-hook__waves i:nth-child(3) { width: 50px; height: 50px; margin-top: -25px; left: -16px; animation-delay: .4s; }
@keyframes rc-wave { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

.rc-tile {
    position: absolute; padding: 8px 18px 10px;
    border: 2px solid rgba(255, 214, 140, .9); border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 236, 214, .32), rgba(196, 150, 160, .3));
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    box-shadow: 0 0 18px rgba(255, 196, 110, .75), inset 0 0 14px rgba(255, 230, 190, .45);
    color: #fff7e6; font-family: var(--rc-passage); font-weight: 700; font-size: clamp(1.35rem, 6vw, 1.8rem); line-height: 1.5;
    text-shadow: 0 0 10px rgba(255, 200, 120, .9);
    animation: rc-float 4.5s ease-in-out infinite;
}
.rc-tile--1 { right: 10%; top: 4%; }
.rc-tile--2 { right: 30%; top: 24%; animation-delay: .8s; }
.rc-tile--3 { right: 3%; top: 41%; animation-delay: 1.6s; }
@keyframes rc-float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }

.rc-hook__clouds {
    position: absolute; left: -10%; right: -10%; bottom: 0; height: 26%; z-index: 1; pointer-events: none;
    background:
        radial-gradient(40% 60% at 12% 80%, rgba(255, 196, 150, .95), rgba(255, 196, 150, 0) 70%),
        radial-gradient(45% 70% at 50% 100%, rgba(225, 170, 210, .95), rgba(225, 170, 210, 0) 72%),
        radial-gradient(40% 60% at 88% 82%, rgba(255, 186, 140, .9), rgba(255, 186, 140, 0) 70%);
    filter: blur(2px);
}
.rc-hook__action { position: relative; z-index: 2; width: 100%; margin-top: -8px; }
.rc-hook__action .rc-cta { min-height: 84px; }
/* Second hook button (under the green CTA): a lighter WhatsApp pill, so the green one stays the
   main action. */
.rc-wa-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; min-height: 52px; margin-top: 18px; padding: 8px 22px;
    border: 2px solid rgba(255, 255, 255, .85); border-radius: 999px;
    background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; text-align: center;
    font-weight: 800; font-size: clamp(1rem, 4.4vw, 1.2rem); line-height: 1.25;
    -webkit-tap-highlight-color: transparent;
}
.rc-wa-btn:active { background: rgba(255, 255, 255, .22); }
.rc-wa-btn:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.rc-wa-btn__icon { width: 26px; height: 26px; flex: 0 0 auto; color: #25d366; }
@media (max-height: 700px) {
    .rc-wa-btn { min-height: 46px; margin-top: 14px; }
}
.rc-cta__play { width: 30px; height: 30px; flex: 0 0 auto; filter: drop-shadow(0 2px 0 rgba(176, 56, 0, .5)); }

/* Green CTA (hook + result), like the result mockup's button. */
.rc-cta--green {
    border-color: #d9ffb8;
    background: linear-gradient(180deg, #9cf05a 0%, #4cc622 45%, #2c9f12 100%);
    box-shadow: 0 0 0 4px rgba(110, 220, 60, .28), 0 10px 0 #1d760b, 0 18px 34px rgba(40, 150, 20, .45), inset 0 3px 0 rgba(255, 255, 255, .55);
    text-shadow: 0 2px 0 rgba(20, 90, 5, .55);
}
.rc-cta--green:active { box-shadow: 0 0 0 4px rgba(110, 220, 60, .28), 0 4px 0 #1d760b, 0 8px 18px rgba(40, 150, 20, .4), inset 0 3px 0 rgba(255, 255, 255, .55); }
.rc-cta--green .rc-cta__play { filter: drop-shadow(0 2px 0 rgba(20, 90, 5, .5)); }

/* "Tap me" nudge: a soft bounce, an expanding halo, a light sweep and a tapping hand. */
.rc-cta--nudge { overflow: visible; animation: rc-cta-bounce 2.4s var(--rc-ease) infinite; }
.rc-cta--nudge:active { animation: none; }
.rc-cta__halo {
    position: absolute; inset: -4px; border-radius: inherit; pointer-events: none;
    border: 4px solid rgba(150, 245, 90, .9);
    animation: rc-cta-halo 2.4s ease-out infinite;
}
.rc-cta__shine {
    position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none;
}
.rc-cta__shine::before {
    content: ''; position: absolute; top: -20%; bottom: -20%; left: -40%; width: 30%;
    background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0));
    transform: skewX(-18deg);
    animation: rc-cta-shine 2.4s ease-in-out infinite;
}
.rc-cta__hand {
    position: absolute; left: 16%; bottom: -18px; width: 44px; height: 52px; pointer-events: none; z-index: 2;
    filter: drop-shadow(0 4px 6px rgba(10, 5, 60, .45));
    animation: rc-cta-tap 1.2s ease-in-out infinite;
}
@keyframes rc-cta-bounce {
    0%, 62%, 100% { transform: translateY(0) scale(1); }
    70% { transform: translateY(-6px) scale(1.04); }
    78% { transform: translateY(0) scale(.98); }
    86% { transform: translateY(-3px) scale(1.02); }
}
@keyframes rc-cta-halo { 0% { transform: scale(1); opacity: .95; } 70%, 100% { transform: scale(1.05, 1.3); opacity: 0; } }
@keyframes rc-cta-shine { 0%, 45% { left: -40%; } 85%, 100% { left: 120%; } }
@keyframes rc-cta-tap { 0%, 100% { transform: translate(0, 0) rotate(-8deg); } 50% { transform: translate(-4px, -10px) rotate(-8deg) scale(.92); } }

/* =============================================================== light pages */
.rc-light-page {
    background: #e7e3ff;
    overflow-x: hidden;
}
.rc-light-page::before {
    content: ''; position: fixed; inset: 0; z-index: -2;
    background:
        radial-gradient(60% 18% at 12% 6%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 70%),
        radial-gradient(55% 16% at 92% 10%, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 70%),
        linear-gradient(180deg, #efedff 0%, #e4dfff 30%, #cdbfff 58%, #b09af5 80%, #9b80ec 100%);
}
/* Leaves in the two bottom corners. */
.rc-light-page::after {
    content: ''; position: fixed; left: 0; right: 0; bottom: 0; height: 120px; z-index: -1; pointer-events: none;
    background:
        radial-gradient(70px 46px at 4% 92%, rgba(108, 176, 78, .75), rgba(108, 176, 78, 0) 70%),
        radial-gradient(60px 40px at 14% 104%, rgba(80, 150, 60, .7), rgba(80, 150, 60, 0) 70%),
        radial-gradient(70px 46px at 96% 92%, rgba(108, 176, 78, .75), rgba(108, 176, 78, 0) 70%),
        radial-gradient(60px 40px at 86% 104%, rgba(80, 150, 60, .7), rgba(80, 150, 60, 0) 70%);
    filter: blur(1px);
}
.rc-screen {
    position: relative;
    max-width: 520px; min-height: 100svh; margin: 0 auto;
    padding: max(16px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom));
    display: flex; flex-direction: column; align-items: center;
}

/* ================================================================== reading */
/* One screen like the mockup: header, card, mic dock. A long passage scrolls INSIDE the card and
   the page keeps the current word in view. */
.rc-read { height: 100svh; min-height: 560px; }
.rc-read .rc-card { flex: 1 1 auto; min-height: 150px; display: flex; flex-direction: column; overflow: hidden; }
.rc-read .rc-card__scroll { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 10px 4px 12px; scroll-behavior: smooth; }
.rc-top { position: relative; width: 100%; display: flex; justify-content: center; direction: ltr; }
.rc-back {
    position: absolute; left: 0; top: 10px;
    width: 56px; height: 56px; border: 0; border-radius: 50%; padding: 0; cursor: pointer;
    background: #ece9fb url('../images/reading_loudly/ui-svg/icon-back.svg') center / 100% no-repeat;
    box-shadow: 0 6px 14px rgba(80, 60, 160, .18);
}
.rc-back:focus-visible { outline: 3px solid var(--rc-orange-2); outline-offset: 3px; }
.rc-read .rc-logo { width: clamp(78px, 22vw, 104px); }
@media (max-height: 760px) {
    .rc-read .rc-logo { width: 70px; }
    .rc-pill-title__badge { width: 60px; height: 60px; }
    .rc-back { width: 46px; height: 46px; top: 4px; }
}

.rc-pill-title {
    position: relative; direction: ltr;
    display: flex; align-items: center; margin-top: 6px; max-width: calc(100% - 40px);
}
.rc-pill-title__badge { width: 76px; height: 76px; flex: 0 0 auto; position: relative; z-index: 1; filter: drop-shadow(0 6px 10px rgba(255, 110, 0, .35)); }
.rc-pill-title__text {
    margin-left: -26px; padding: 10px 26px 10px 38px;
    border: 2px solid #ffe2b0; border-radius: 0 999px 999px 0;
    background: linear-gradient(180deg, #fff7e8, #ffeccc);
    box-shadow: 0 6px 14px rgba(120, 80, 30, .12);
    font-size: clamp(1.2rem, 5.4vw, 1.5rem); font-weight: 800; color: #3a2468; white-space: nowrap;
}
.rc-pill-title__rays { position: absolute; right: -30px; top: -12px; width: 34px; }

.rc-progress {
    direction: ltr; width: 100%; margin-top: 12px;
    display: flex; align-items: center; gap: 12px;
}
.rc-progress__book { width: 58px; flex: 0 0 auto; filter: drop-shadow(0 4px 8px rgba(80, 60, 160, .25)); }
.rc-progress__track {
    position: relative; flex: 1 1 auto; height: 24px; border-radius: 999px; overflow: hidden;
    background: #f4f2ff; border: 3px solid #fff; box-shadow: inset 0 2px 4px rgba(80, 60, 160, .15), 0 2px 6px rgba(80, 60, 160, .12);
}
.rc-progress__fill {
    position: absolute; left: 0; top: 0; bottom: 0; width: 0%; border-radius: 999px;
    background: linear-gradient(180deg, #ffd23f 0%, #ff9a00 55%, #ff6a00 100%);
    box-shadow: 0 0 8px rgba(255, 140, 0, .5);
    transition: width .25s linear;
}
.rc-progress__fill.is-level { background: linear-gradient(90deg, #ffc84a, #ff8a00); transition: width .08s linear; }
.rc-progress__count {
    flex: 0 0 auto; min-width: 82px; height: 48px; padding: 0 14px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 3px solid #fff; border-radius: 999px; background: linear-gradient(180deg, #fbfaff, #ece8ff);
    box-shadow: 0 4px 10px rgba(80, 60, 160, .16);
    font-size: 1.25rem; font-weight: 800; color: #3a2468; font-variant-numeric: tabular-nums;
}

.rc-card {
    position: relative; width: 100%; margin-top: 12px;
    padding: 8px 10px; border-radius: 30px;
    background: rgba(255, 255, 255, .9);
    border: 2px solid rgba(255, 255, 255, .95);
    box-shadow: 0 14px 34px rgba(80, 60, 160, .18);
}
.rc-passage {
    margin: 0;
    font-family: var(--rc-passage); font-weight: 600;
    font-size: clamp(1.32rem, 5.8vw, 1.8rem); line-height: 2.05; color: #2b1d55;
    text-align: center; word-spacing: .05em;
}
.rc-passage[dir="ltr"] { font-family: var(--rc-display); line-height: 1.9; }
.rc-w {
    position: relative; display: inline-block; padding: 0 .22em; margin: .08em 0; border-radius: 14px;
    border: 2px solid transparent;
    transition: background-color .3s var(--rc-ease), color .3s var(--rc-ease), border-color .18s var(--rc-ease), transform .22s var(--rc-ease);
}
.rc-w.is-ok { background: linear-gradient(180deg, var(--rc-ok-bg), var(--rc-ok-bg-2)); color: var(--rc-ok-ink); }
.rc-w.is-bad { background: var(--rc-bad-bg); color: var(--rc-bad-ink); border-color: #ffb3aa; }
.rc-w.is-skip { background: var(--rc-skip-bg); color: var(--rc-skip-ink); }
/* Live: read (behind the cursor) but not coloured yet. The colours land on the child's pause. */
.rc-w.is-trail { background: rgba(255, 214, 60, .2); box-shadow: inset 0 -3px 0 rgba(255, 176, 0, .5); }
/* The cursor: a big bright pill that glows, lifted above its neighbours. */
.rc-w.is-now {
    z-index: 1;
    background: var(--rc-now-bg); color: #2a1b5c; border-color: #ff9a00; border-width: 3px;
    box-shadow: 0 0 0 4px rgba(255, 190, 0, .45), 0 8px 18px rgba(255, 160, 0, .5);
    transform: scale(1.14);
    animation: rc-now-glow .9s ease-in-out infinite alternate;
}
@keyframes rc-now-glow {
    from { box-shadow: 0 0 0 3px rgba(255, 190, 0, .4), 0 6px 14px rgba(255, 160, 0, .45); }
    to { box-shadow: 0 0 0 8px rgba(255, 190, 0, .22), 0 10px 22px rgba(255, 150, 0, .6); }
}
/* The three little sound bars above the word being read. */
.rc-w.is-now::before {
    content: ''; position: absolute; left: 50%; top: -18px; width: 22px; height: 16px; margin-left: -11px;
    background:
        linear-gradient(#ffb000, #ff8a00) 0 100% / 5px 70% no-repeat,
        linear-gradient(#ffb000, #ff8a00) 50% 100% / 5px 100% no-repeat,
        linear-gradient(#ffb000, #ff8a00) 100% 100% / 5px 55% no-repeat;
    border-radius: 3px;
    animation: rc-bars .7s ease-in-out infinite alternate;
}
@keyframes rc-bars { from { transform: scaleY(.65); } to { transform: scaleY(1); } }

.rc-card__busy {
    position: absolute; inset: 0; border-radius: 30px; z-index: 3;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
    background: rgba(255, 255, 255, .86); text-align: center; padding: 20px;
    font-weight: 800; font-size: 1.15rem; color: #3a2468;
}
.rc-spinner {
    width: 48px; height: 48px; border-radius: 50%;
    border: 5px solid rgba(255, 154, 0, .22); border-top-color: var(--rc-orange-2);
    animation: rc-spin .9s linear infinite;
}
@keyframes rc-spin { to { transform: rotate(360deg); } }

.rc-note {
    width: 100%; margin: 12px 0 0; padding: 12px 16px; border-radius: 18px;
    background: #fff8e1; border: 2px solid #ffd98a; color: #7a4a00;
    font-weight: 700; font-size: 1rem; text-align: center; line-height: 1.45;
}
.rc-link-btn {
    margin-top: 10px; min-height: 44px; padding: 8px 18px; border: 0; border-radius: 999px; cursor: pointer;
    background: rgba(255, 255, 255, .7); color: #4b3a86; font-weight: 800; font-size: .98rem;
    box-shadow: 0 3px 8px rgba(80, 60, 160, .14);
}

/* The dock: the listening fennec on the physical left (its own column, never under the status pill),
   the mic + status in the rest. */
.rc-dock {
    --buddy-w: clamp(112px, 32vw, 176px);
    position: relative; width: 100%; flex: 0 0 auto; padding-top: 10px;
    display: grid; grid-template-columns: var(--buddy-w) minmax(0, 1fr); align-items: end; direction: ltr;
}
.rc-dock__controls { position: relative; z-index: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; margin-left: -12px; }
html[dir="rtl"] .rc-dock__controls { direction: rtl; }
.rc-dock__controls .rc-status { max-width: 100%; padding-left: 18px; padding-right: 18px; }

/* The fennec: five poses stacked, the one named by data-pose fades in. */
.rc-buddy { position: relative; width: var(--buddy-w); margin-left: -18px; margin-bottom: -4px; pointer-events: none; }
.rc-buddy__stack {
    position: relative; width: 100%; aspect-ratio: 1; transform-origin: 50% 92%;
    filter: drop-shadow(0 10px 16px rgba(60, 40, 140, .28));
    animation: rc-buddy-breathe 3.2s ease-in-out infinite;
}
.rc-buddy__img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; opacity: 0; transition: opacity .22s ease; }
.rc-buddy[data-pose="calm"] .rc-buddy__img[data-pose="calm"],
.rc-buddy[data-pose="happy"] .rc-buddy__img[data-pose="happy"],
.rc-buddy[data-pose="focus"] .rc-buddy__img[data-pose="focus"],
.rc-buddy[data-pose="point"] .rc-buddy__img[data-pose="point"],
.rc-buddy[data-pose="cheer"] .rc-buddy__img[data-pose="cheer"] { opacity: 1; }
/* Hearing: the head nods to the voice and sound arcs come out of the headphone. */
.rc-buddy.is-hearing .rc-buddy__stack { animation: rc-buddy-nod 1.1s ease-in-out infinite; }
.rc-buddy[data-pose="point"] .rc-buddy__stack, .rc-buddy[data-pose="cheer"] .rc-buddy__stack { animation: rc-buddy-hop .7s var(--rc-ease) infinite alternate; }
.rc-buddy__waves { position: absolute; left: 74%; top: 26%; width: 34px; height: 44px; opacity: 0; transition: opacity .2s; }
.rc-buddy.is-hearing .rc-buddy__waves { opacity: 1; }
.rc-buddy__waves i {
    position: absolute; top: 50%; left: 0; border: 3px solid transparent; border-right-color: #ff9a00; border-radius: 50%;
    filter: drop-shadow(0 0 3px rgba(255, 170, 40, .8));
    animation: rc-buddy-wave 1.1s ease-out infinite;
}
.rc-buddy__waves i:nth-child(1) { width: 14px; height: 14px; margin-top: -7px; }
.rc-buddy__waves i:nth-child(2) { width: 26px; height: 26px; margin-top: -13px; left: -6px; animation-delay: .18s; }
.rc-buddy__waves i:nth-child(3) { width: 38px; height: 38px; margin-top: -19px; left: -12px; animation-delay: .36s; }
@keyframes rc-buddy-breathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.015); } }
@keyframes rc-buddy-nod { 0%, 100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(3deg) translateY(-4px); } }
@keyframes rc-buddy-hop { from { transform: translateY(0); } to { transform: translateY(-8px) rotate(-2deg); } }
@keyframes rc-buddy-wave { 0% { opacity: 0; transform: translateX(-4px); } 35% { opacity: 1; } 100% { opacity: 0; transform: translateX(6px); } }

.rc-mic-row { position: relative; z-index: 1; direction: ltr; display: flex; align-items: center; justify-content: center; gap: 6px; max-width: 100%; }
.rc-wave { width: clamp(30px, 11vw, 84px); height: 40px; flex: 0 1 auto; min-width: 0; opacity: .7; filter: drop-shadow(0 0 2px rgba(110, 80, 210, .9)); transform: scaleY(var(--lvl, .5)); transition: transform .08s linear, opacity .2s; }
.rc-read.is-recording .rc-wave { opacity: 1; }
.rc-mic {
    position: relative; width: clamp(112px, 30vw, 136px); height: clamp(112px, 30vw, 136px); flex: 0 0 auto; border-radius: 50%; padding: 0; cursor: pointer;
    border: 7px solid #fff;
    background: radial-gradient(circle at 50% 30%, #ffb43a 0%, #ff7a00 55%, #ef4900 100%);
    box-shadow: 0 0 0 14px rgba(255, 160, 90, .22), 0 0 46px rgba(255, 110, 0, .55), 0 12px 24px rgba(200, 60, 0, .35);
}
.rc-mic img { width: 58px; height: 58px; display: block; margin: auto; pointer-events: none; }
.rc-mic:focus-visible { outline: 4px solid #3a2468; outline-offset: 6px; }
.rc-mic:disabled { cursor: default; filter: saturate(.7) brightness(.95); }
.rc-mic::before, .rc-mic::after {
    content: ''; position: absolute; inset: -7px; border-radius: 50%; border: 3px solid rgba(255, 140, 40, .55);
    opacity: 0; pointer-events: none;
}
.rc-read.is-recording .rc-mic::before { animation: rc-ring 1.6s ease-out infinite; }
.rc-read.is-recording .rc-mic::after { animation: rc-ring 1.6s ease-out .8s infinite; }
@keyframes rc-ring { from { transform: scale(1); opacity: .9; } to { transform: scale(1.45); opacity: 0; } }

.rc-status {
    position: relative; z-index: 1; margin-top: 14px;
    display: inline-flex; align-items: center; gap: 10px;
    min-height: 54px; padding: 10px 30px; border-radius: 999px;
    border: 2px solid #fff; background: linear-gradient(180deg, #fbfaff, #eeebff);
    box-shadow: 0 6px 14px rgba(80, 60, 160, .18);
    font-weight: 800; font-size: clamp(1.02rem, 4.4vw, 1.2rem); color: #3a2468; text-align: center;
}
.rc-status__dot { width: 13px; height: 13px; border-radius: 50%; background: #ff3b2f; box-shadow: 0 0 8px rgba(255, 59, 47, .7); animation: rc-pulse 1.1s ease-in-out infinite; }
@keyframes rc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.rc-hint { position: relative; z-index: 1; margin: 8px 0 0; font-weight: 700; font-size: .92rem; color: var(--rc-ink-soft); text-align: center; }
/* [Admin] Consent line: the recording is kept. Quiet, never competes with the mic. */
.rc-consent { position: relative; z-index: 1; margin: 6px 0 0; font-size: .74rem; line-height: 1.35; color: var(--rc-ink-soft); opacity: .8; text-align: center; }

/* Grade popup */
/* Drawn after "اختيار الصف الدراسي للأطفال.png": fennec over a frosted card, 3 + 2 grade tiles
   (physical left-to-right like the mockup), orange Continue pill with the chevron on the LEFT. */
.rc-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.rc-popup {
    position: fixed; inset: 0; z-index: 30; overflow-y: auto;
    display: flex; align-items: center; justify-content: center;
    padding: 150px 16px 24px;
    background: rgba(90, 70, 170, .34);
    -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
}
.rc-popup__card {
    position: relative; width: 100%; max-width: 440px; margin: auto;
    padding: 14px 22px 22px; border-radius: 36px; text-align: center;
    background:
        radial-gradient(150px 80px at 2% 100%, rgba(186, 170, 255, .5), transparent 72%),
        radial-gradient(170px 90px at 100% 96%, rgba(186, 170, 255, .45), transparent 72%),
        linear-gradient(180deg, rgba(255, 255, 255, .97) 0%, #f3f0ff 100%);
    border: 3px solid rgba(255, 255, 255, .95);
    box-shadow: 0 24px 60px rgba(60, 40, 140, .34), inset 0 2px 0 #fff;
}
.rc-popup__card:focus { outline: none; }
.rc-popup__head { position: relative; height: 34px; }
.rc-popup__fennec {
    position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
    width: 178px; height: auto; max-width: none;
    filter: drop-shadow(0 12px 18px rgba(60, 40, 140, .28));
}
/* Three short yellow strokes ("sparkle rays") beside the fennec and above the first tile. */
.rc-popup__rays { position: absolute; width: 34px; height: 34px; pointer-events: none; direction: ltr; }
.rc-popup__rays i { position: absolute; left: 50%; bottom: 0; width: 5px; height: 14px; border-radius: 3px; background: #ffc928; transform-origin: 50% 100%; }
.rc-popup__rays i:nth-child(1) { transform: translateX(-50%) rotate(-48deg) translateY(-4px); }
.rc-popup__rays i:nth-child(2) { transform: translateX(-50%) translateY(-6px); height: 16px; }
.rc-popup__rays i:nth-child(3) { transform: translateX(-50%) rotate(48deg) translateY(-4px); }
.rc-popup__head .rc-popup__rays { left: calc(50% + 66px); top: -132px; transform: rotate(22deg); }
.rc-popup__rays--grid { left: -14px; top: -22px; transform: rotate(-30deg); }
.rc-popup__title { margin: 8px 0 0; font-size: clamp(1.45rem, 6.6vw, 1.9rem); font-weight: 800; color: #2a1b5c; line-height: 1.3; }
.rc-popup__swoosh { display: block; width: 72px; height: 6px; margin: 4px auto 0; border-radius: 0 0 60px 60px / 0 0 6px 6px; background: #ffc928; box-shadow: 0 2px 0 rgba(230, 150, 0, .35); }
.rc-popup__sub {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin: 8px 0 16px; font-weight: 700; font-size: 1.02rem; color: var(--rc-ink-soft);
}
.rc-popup__sub img { width: 40px; height: 40px; flex: 0 0 auto; transform: rotate(-8deg); filter: drop-shadow(0 3px 4px rgba(60, 40, 140, .2)); }
.rc-popup__grades {
    position: relative;
    display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
    direction: ltr; /* 1 2 3 / 4 5 left-to-right, as drawn */
}
.rc-grade {
    position: relative; flex: 0 0 calc((100% - 24px) / 3); min-width: 0; min-height: 106px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: 10px 6px 8px; border: 2px solid #ffdcb0; border-radius: 24px; cursor: pointer;
    background: linear-gradient(180deg, #fffdf8 0%, #fff0df 100%);
    box-shadow: 0 0 0 3px rgba(255, 205, 140, .28), 0 8px 16px rgba(255, 140, 40, .16), inset 0 2px 0 #fff;
    color: #2a1b5c; font: inherit;
    transition: transform .12s var(--rc-ease), box-shadow .12s var(--rc-ease), border-color .12s, background .12s;
    -webkit-tap-highlight-color: transparent;
}
.rc-grade__book { width: 52px; height: 41px; filter: drop-shadow(0 3px 3px rgba(230, 100, 0, .25)); }
.rc-grade__label { display: flex; align-items: baseline; justify-content: center; gap: 6px; line-height: 1; direction: rtl; }
html[dir="ltr"] .rc-grade__label { direction: ltr; }
html[dir="ltr"] .rc-grade__num { order: 2; } /* "Grade 1" / "Année 1" */
.rc-grade__num { font-size: 2.3rem; font-weight: 800; color: #2a1b5c; }
.rc-grade__word { font-size: 1.02rem; font-weight: 800; color: #2a1b5c; }
.rc-grade:active { transform: scale(.96); }
.rc-grade[aria-pressed="true"] {
    border-color: #ff9a00;
    background: linear-gradient(180deg, #fff6e2 0%, #ffe2b8 100%);
    box-shadow: 0 0 0 4px rgba(255, 154, 0, .35), 0 10px 20px rgba(255, 120, 0, .28), inset 0 2px 0 #fff;
    transform: translateY(-3px);
}
.rc-grade[aria-pressed="true"]::after {
    content: ""; position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%;
    background: #ff8a00 url("../images/reading_loudly/ui-svg/icon-check.svg") center / 100% no-repeat;
    border: 3px solid #fff; box-shadow: 0 3px 8px rgba(200, 80, 0, .35);
}
.rc-grade:disabled { opacity: .6; cursor: default; }
.rc-grade:focus-visible { outline: 3px solid #3a2468; outline-offset: 4px; }
.rc-popup__go { margin-top: 22px; direction: ltr; padding-left: 74px; padding-right: 74px; }
.rc-popup__chev { position: absolute; left: 10px; top: 50%; width: 52px; height: 52px; transform: translateY(-50%); filter: drop-shadow(0 2px 3px rgba(176, 56, 0, .35)); }
.rc-popup__go:disabled { cursor: default; filter: saturate(.55); opacity: .7; }
.rc-popup__go:disabled:active { transform: none; }
.rc-popup__go.is-loading { opacity: .8; }
.rc-popup__back { display: inline-block; margin-top: 10px; min-height: 44px; padding: 10px 14px; color: var(--rc-ink-soft); font-weight: 800; text-underline-offset: 4px; }
.rc-popup .rc-note { margin-top: 14px; }

/* Instructions popup (after the grade). Drawn after "ChatGPT Image Nov 21, 2026, 11_04_14 AM.png":
   fennec over the card, title, a big glowing orange mic, three tip rows, an info pill. */
.rc-tips__card { padding-bottom: 20px; }
.rc-tips__title { margin: 10px 0 0; font-size: clamp(1.4rem, 6.4vw, 1.85rem); font-weight: 800; line-height: 1.35; color: #2a1b5c; }
.rc-tips__stage { position: relative; display: flex; align-items: center; justify-content: center; margin: 18px 0 16px; direction: ltr; }
.rc-tips__stage::before {
    content: ''; position: absolute; left: 50%; top: 50%; width: 210px; height: 210px; margin: -105px 0 0 -105px; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 196, 110, .5), rgba(255, 220, 170, .28) 60%, rgba(255, 230, 200, 0));
    pointer-events: none;
}
.rc-tips__mic {
    position: relative; width: 140px; height: 140px; border-radius: 50%; padding: 0; cursor: pointer;
    border: 6px solid #ffe08a;
    background: radial-gradient(circle at 45% 30%, #ffc04a 0%, #ff8a00 50%, #ee5200 100%);
    box-shadow: 0 0 0 12px rgba(255, 190, 110, .28), 0 0 40px rgba(255, 120, 0, .55), 0 12px 22px rgba(200, 70, 0, .35), inset 0 6px 10px rgba(255, 255, 255, .35);
    animation: rc-tips-breathe 1.6s ease-in-out infinite;
}
.rc-tips__mic img { width: 64px; height: 64px; display: block; margin: auto; pointer-events: none; }
.rc-tips__mic::before {
    content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 4px solid rgba(255, 150, 40, .6); pointer-events: none;
    animation: rc-ring 1.6s ease-out infinite;
}
.rc-tips__mic:focus-visible { outline: 4px solid #3a2468; outline-offset: 8px; }
.rc-tips__mic:disabled { cursor: default; filter: saturate(.7); animation: none; }
@keyframes rc-tips-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.rc-tips__rays { position: absolute; top: 4px; width: 40px; height: 40px; }
.rc-tips__rays i { width: 6px; height: 17px; }
.rc-tips__rays--l { left: calc(50% - 128px); transform: rotate(-40deg); }
.rc-tips__rays--r { right: calc(50% - 128px); transform: rotate(40deg); }
.rc-tips__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rc-tips__item {
    display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 6px 8px 6px 18px;
    border-radius: 22px; background: linear-gradient(180deg, #f8f6ff, #efebff);
    box-shadow: 0 3px 8px rgba(80, 60, 160, .1); text-align: start;
    font-weight: 800; font-size: clamp(1.05rem, 4.6vw, 1.22rem); color: #2a1b5c;
}
html[dir="ltr"] .rc-tips__item { padding: 6px 18px 6px 8px; }
.rc-tips__item img { width: 66px; height: 56px; flex: 0 0 auto; }
.rc-tips__info {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin: 14px 0 0; padding: 10px 14px; border-radius: 999px;
    background: #eeeafc; color: #3a2468; font-weight: 700; font-size: .98rem;
}
.rc-tips__info svg { width: 22px; height: 22px; flex: 0 0 auto; color: #3a2468; }

/* 3, 2, 1, Go */
.rc-count {
    position: fixed; inset: 0; z-index: 40;
    display: flex; align-items: center; justify-content: center;
    background: rgba(48, 32, 120, .55);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.rc-count__inner { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 0 20px; }
.rc-count__num {
    display: flex; align-items: center; justify-content: center;
    min-width: 190px; height: 190px; padding: 0 28px; border-radius: 999px;
    background: radial-gradient(circle at 45% 30%, #ffd54a 0%, #ff9a00 55%, #f26200 100%);
    border: 8px solid #fff;
    box-shadow: 0 0 0 14px rgba(255, 190, 90, .35), 0 0 60px rgba(255, 140, 0, .7), 0 16px 30px rgba(60, 20, 0, .35);
    color: #fff; font-size: 7rem; font-weight: 800; line-height: 1;
    text-shadow: 0 4px 0 rgba(170, 60, 0, .55);
}
.rc-count.is-go .rc-count__num {
    font-size: clamp(3.2rem, 15vw, 4.6rem);
    background: radial-gradient(circle at 45% 30%, #b6f56d 0%, #4cc622 55%, #2c9f12 100%);
    box-shadow: 0 0 0 14px rgba(120, 220, 70, .35), 0 0 60px rgba(70, 200, 30, .7), 0 16px 30px rgba(0, 60, 0, .35);
    text-shadow: 0 4px 0 rgba(20, 90, 5, .55);
}
.rc-count__num.is-pop { animation: rc-count-pop .9s var(--rc-ease); }
@keyframes rc-count-pop { 0% { transform: scale(.3); opacity: 0; } 30% { transform: scale(1.12); opacity: 1; } 55% { transform: scale(1); } 100% { transform: scale(1); opacity: 1; } }
.rc-count__sub { min-height: 1.5em; font-size: clamp(1.3rem, 6vw, 1.7rem); font-weight: 800; color: #fff; text-shadow: 0 3px 10px rgba(20, 10, 60, .6); }

@media (max-height: 700px) {
    .rc-tips__title { font-size: 1.25rem; margin-top: 4px; }
    .rc-tips__stage { margin: 10px 0 10px; }
    .rc-tips__stage::before { width: 150px; height: 150px; margin: -75px 0 0 -75px; }
    .rc-tips__mic { width: 100px; height: 100px; border-width: 5px; }
    .rc-tips__mic img { width: 46px; height: 46px; }
    .rc-tips__rays--l { left: calc(50% - 96px); }
    .rc-tips__rays--r { right: calc(50% - 96px); }
    .rc-tips__list { gap: 7px; }
    .rc-tips__item { min-height: 50px; font-size: 1rem; }
    .rc-tips__item img { width: 52px; height: 44px; }
    .rc-tips__info { margin-top: 10px; padding: 8px 12px; font-size: .88rem; }
    .rc-count__num { min-width: 150px; height: 150px; font-size: 5.6rem; }
}

/* =================================================================== result */
.rc-result .rc-logo { width: 98px; }
.rc-hero { position: relative; width: 100%; height: clamp(200px, 56vw, 250px); margin-top: -4px; direction: ltr; }
.rc-hero__fennec { position: absolute; left: 50%; bottom: -14px; width: clamp(210px, 62vw, 270px); height: auto; transform: translateX(-50%); filter: drop-shadow(0 12px 20px rgba(60, 40, 140, .28)); }
.rc-hero__star { position: absolute; width: 40px; filter: drop-shadow(0 4px 8px rgba(255, 180, 0, .5)); }
.rc-hero__star--l { left: 10%; top: 38%; }
.rc-hero__star--r { right: 10%; top: 54%; }
.rc-hero__sparkle { position: absolute; left: 22%; top: 70%; width: 18px; }
.rc-hero__rays { position: absolute; right: 18%; top: 22%; width: 44px; }

.rc-panel {
    position: relative; width: 100%;
    padding: 50px 14px 18px; border-radius: 32px;
    background: rgba(255, 255, 255, .62);
    border: 2px solid rgba(255, 255, 255, .95);
    box-shadow: 0 14px 34px rgba(80, 60, 160, .16);
}
.rc-ribbon {
    position: absolute; left: 50%; top: -30px; transform: translateX(-50%); direction: ltr;
    width: min(96%, 430px); height: 62px;
    display: flex; align-items: center;
}
.rc-ribbon__band {
    flex: 1 1 auto; height: 52px; margin-left: -30px;
    display: flex; align-items: center; justify-content: center; padding: 0 22px 0 40px;
    background: linear-gradient(180deg, #ffe066 0%, #ffbf1f 55%, #ff9d00 100%);
    clip-path: polygon(0 0, 100% 0, 96% 50%, 100% 100%, 0 100%);
    box-shadow: 0 6px 12px rgba(200, 110, 0, .3);
    font-size: clamp(1.3rem, 6vw, 1.6rem); font-weight: 800; color: #3a2468; white-space: nowrap;
}
.rc-ribbon__seal { position: relative; z-index: 1; width: 72px; height: 72px; flex: 0 0 auto; filter: drop-shadow(0 4px 8px rgba(200, 90, 0, .35)); }

.rc-score { position: relative; direction: ltr; display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 4px; }
.rc-laurel { width: 56px; height: auto; opacity: .95; }
.rc-laurel--r { transform: scaleX(-1); }
.rc-ring { position: relative; width: clamp(180px, 52vw, 214px); aspect-ratio: 1; }
.rc-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.rc-ring__track { fill: #fff; stroke: #ecebf3; stroke-width: 16; }
.rc-ring__bar { fill: none; stroke: url(#rcRingGrad); stroke-width: 16; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(90, 210, 40, .55)); transition: stroke-dashoffset 1.2s var(--rc-ease); }
.rc-ring__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rc-ring__value { font-size: clamp(2.6rem, 12vw, 3.3rem); font-weight: 800; line-height: 1; color: var(--rc-ink); direction: ltr; }
.rc-ring__value small { font-size: .6em; }
.rc-ring__label { margin-top: 6px; font-weight: 800; font-size: 1.05rem; color: #3a2468; }

.rc-stats { direction: ltr; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.rc-stat {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 12px 6px 14px; border-radius: 22px; border: 2px solid #fff;
    box-shadow: 0 6px 14px rgba(80, 60, 160, .1); text-align: center;
}
.rc-stat--purple { background: linear-gradient(180deg, #f8f2ff, #efe4ff); }
.rc-stat--blue { background: linear-gradient(180deg, #eef8ff, #dcefff); }
.rc-stat--cream { background: linear-gradient(180deg, #fffaf0, #fff0d2); }
.rc-stat__icon { width: 46px; height: 46px; }
.rc-stat__value { font-size: clamp(1.8rem, 8vw, 2.2rem); font-weight: 800; line-height: 1.15; color: var(--rc-ink); direction: ltr; }
.rc-stat__value small { font-size: .62em; }
.rc-stat__label { font-weight: 700; font-size: clamp(.9rem, 3.8vw, 1.02rem); color: #3a2468; }

.rc-feedback {
    position: relative; direction: ltr; margin-top: 14px;
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-radius: 24px;
    background: linear-gradient(180deg, #f2fde9, #e4f9d6); border: 2px solid #fff;
    box-shadow: 0 6px 14px rgba(80, 140, 60, .12);
}
.rc-feedback__icon { width: 74px; flex: 0 0 auto; }
.rc-feedback__text { flex: 1 1 auto; min-width: 0; text-align: center; }
.rc-feedback__title { margin: 0; font-size: clamp(1.25rem, 5.6vw, 1.5rem); font-weight: 800; color: var(--rc-ink); }
.rc-feedback__line { margin: 2px 0 0; font-weight: 600; font-size: clamp(.95rem, 4vw, 1.05rem); color: #3a2468; }
.rc-feedback__rays { position: absolute; right: 18px; top: -14px; width: 34px; }

/* Result v2 (2026-11-21): two big cards, accuracy (green) and words read (cream). */
.rc-duo { direction: ltr; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 6px; }
.rc-duo__card {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 14px 10px 14px; border-radius: 26px; border: 3px solid #fff; text-align: center;
    box-shadow: 0 8px 18px rgba(80, 60, 160, .12);
}
.rc-duo__card--green { background: linear-gradient(180deg, #f3fde9, #e3f8d2); }
.rc-duo__card--cream { background: linear-gradient(180deg, #fff9ee, #ffefd2); }
.rc-duo__icon { width: 72px; height: 72px; filter: drop-shadow(0 4px 6px rgba(60, 40, 140, .18)); }
.rc-duo__value { font-size: clamp(2.6rem, 13vw, 3.6rem); font-weight: 800; line-height: 1.05; color: #2a1b5c; direction: ltr; }
.rc-duo__value small { font-size: .7em; }
.rc-duo__label {
    display: block; width: 100%; padding: 6px 8px; border-radius: 999px;
    font-weight: 800; font-size: clamp(.92rem, 4vw, 1.06rem); line-height: 1.3; color: #2a1b5c;
}
.rc-duo__card--green .rc-duo__label { background: rgba(160, 225, 120, .45); }
.rc-duo__card--cream .rc-duo__label { background: rgba(255, 205, 140, .45); }
.rc-duo__note { margin-top: 12px; padding: 10px 14px; border-radius: 20px; background: #fff8e1; border: 2px solid #ffe2a0; text-align: center; }

.rc-result__action { position: relative; width: 100%; margin-top: 22px; }
.rc-result__action .rc-cta--green .rc-cta__chevron { filter: drop-shadow(0 3px 4px rgba(20, 90, 5, .35)); }
.rc-result__action .rc-cta { min-height: 84px; justify-content: space-between; direction: ltr; padding: 12px 18px 12px 28px; }
.rc-result__action .rc-cta span { flex: 1 1 auto; }
.rc-cta__chevron { width: 58px; height: 58px; flex: 0 0 auto; order: 2; }
.rc-result__rays { position: absolute; right: -6px; top: -24px; width: 40px; }
.rc-result__again { display: inline-block; margin-top: 14px; min-height: 44px; padding: 10px 16px; font-weight: 800; color: #4b3a86; text-underline-offset: 4px; }
.rc-notfound { margin: 40px 0 10px; text-align: center; font-size: 1.4rem; font-weight: 800; color: var(--rc-ink); }

@media (max-height: 700px) {
    .rc-hook { padding-top: max(14px, env(safe-area-inset-top)); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
    .rc-hook .rc-logo { width: 84px; }
    .rc-hook__headline { margin-top: 6px; }
    .rc-hook__line1 { font-size: clamp(1.35rem, 6.6vw, 1.9rem); }
    .rc-hook__line2 { font-size: clamp(1.4rem, 6.8vw, 2rem); padding-bottom: 12px; }
    .rc-hook__action .rc-cta { min-height: 68px; }
    .rc-tile { font-size: clamp(1.1rem, 5vw, 1.5rem); padding: 4px 14px 6px; }
}
@media (max-width: 340px) {
    .rc-hook__line2 { font-size: 1.32rem; gap: 6px; }
    .rc-hook__rays { width: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    .rc-buddy__stack, .rc-buddy.is-hearing .rc-buddy__stack, .rc-buddy__waves i,
    .rc-cta--nudge, .rc-cta__halo, .rc-cta__shine::before, .rc-cta__hand, .rc-tips__mic, .rc-tips__mic::before, .rc-count__num,
    .rc-tile, .rc-hook__waves i, .rc-w.is-now::before, .rc-status__dot, .rc-spinner,
    .rc-read.is-recording .rc-mic::before, .rc-read.is-recording .rc-mic::after { animation: none !important; }
    .rc-w.is-now { animation: none !important; }
    .rc-w, .rc-progress__fill, .rc-ring__bar, .rc-cta, .rc-grade { transition: none !important; }
}

/* ------------------------------------------------ reading screen: shorter phones */
/* The passage card takes what is left between the header and the mic dock, so on short screens
   the header and the dock shrink first and the card keeps room for several lines. */
@media (max-height: 820px) {
    .rc-read .rc-logo { width: 76px; }
    .rc-pill-title__badge { width: 62px; height: 62px; }
    .rc-pill-title__text { font-size: clamp(1.08rem, 5vw, 1.35rem); padding: 8px 22px 8px 32px; }
    .rc-progress { margin-top: 8px; }
    .rc-progress__book { width: 46px; }
    .rc-progress__count { height: 42px; min-width: 70px; font-size: 1.12rem; }
    .rc-mic { width: 108px; height: 108px; }
    .rc-mic img { width: 48px; height: 48px; }
    .rc-status { margin-top: 10px; min-height: 48px; }
    .rc-dock { --buddy-w: clamp(104px, 29vw, 150px); }
}
@media (max-height: 700px) {
    .rc-screen { padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
    .rc-read .rc-logo { width: 54px; }
    .rc-back { width: 42px; height: 42px; top: 4px; }
    .rc-pill-title { margin-top: 2px; }
    .rc-pill-title__badge { width: 48px; height: 48px; }
    .rc-pill-title__text { margin-left: -18px; padding: 6px 18px 6px 26px; font-size: 1.02rem; }
    .rc-pill-title__rays { width: 24px; right: -22px; top: -8px; }
    .rc-progress { margin-top: 6px; gap: 8px; }
    .rc-progress__book { width: 36px; }
    .rc-progress__track { height: 18px; }
    .rc-progress__count { height: 36px; min-width: 62px; font-size: 1rem; border-width: 2px; }
    .rc-card { margin-top: 8px; padding: 4px 8px; border-radius: 24px; }
    .rc-passage { font-size: clamp(1.18rem, 5.4vw, 1.5rem); line-height: 1.95; }
    .rc-note { margin-top: 6px; padding: 8px 12px; font-size: .9rem; }
    .rc-link-btn { margin-top: 6px; min-height: 36px; padding: 4px 14px; font-size: .9rem; }
    .rc-dock { padding-top: 8px; }
    .rc-mic { width: 88px; height: 88px; border-width: 5px; box-shadow: 0 0 0 8px rgba(255, 160, 90, .22), 0 0 30px rgba(255, 110, 0, .5); }
    .rc-mic img { width: 40px; height: 40px; }
    .rc-wave { height: 30px; }
    .rc-status { margin-top: 8px; min-height: 42px; padding: 6px 20px; font-size: .98rem; }
    .rc-hint { display: none; }
    .rc-dock { --buddy-w: clamp(92px, 26vw, 124px); }
    .rc-popup { padding-top: 104px; }
    .rc-popup__card { padding: 10px 16px 12px; }
    .rc-popup__head { height: 22px; }
    .rc-popup__fennec { width: 120px; }
    .rc-popup__head .rc-popup__rays { left: calc(50% + 44px); top: -90px; }
    .rc-popup__title { font-size: 1.3rem; margin-top: 2px; }
    .rc-popup__sub { margin: 4px 0 10px; font-size: .92rem; }
    .rc-popup__sub img { width: 30px; height: 30px; }
    .rc-popup__grades { gap: 9px; }
    .rc-grade { flex-basis: calc((100% - 18px) / 3); min-height: 80px; border-radius: 20px; }
    .rc-grade__book { width: 40px; height: 31px; }
    .rc-grade__num { font-size: 1.8rem; }
    .rc-grade__word { font-size: .92rem; }
    .rc-popup__go { margin-top: 14px; min-height: 58px; }
    .rc-popup__chev { width: 42px; height: 42px; }
    .rc-popup__back { margin-top: 2px; }
}
@media (max-height: 600px) {
    .rc-read .rc-logo { width: 40px; }
    .rc-passage { font-size: 1.12rem; }
}

/* ------------------------------------------------------------ result: narrow phones */
@media (max-width: 360px) {
    .rc-panel { padding: 46px 10px 14px; }
    .rc-laurel { width: 40px; }
    .rc-stats { gap: 6px; }
    .rc-stat { padding: 10px 4px 12px; border-radius: 18px; }
    .rc-stat__icon { width: 38px; height: 38px; }
    .rc-stat__label { font-size: .8rem; line-height: 1.25; }
    .rc-feedback { padding: 12px; gap: 8px; }
    .rc-feedback__icon { width: 56px; }
    .rc-result__action .rc-cta { font-size: 1.08rem; padding: 10px 12px 10px 18px; gap: 8px; }
    .rc-cta__chevron { width: 46px; height: 46px; }
    .rc-duo { gap: 10px; }
    .rc-duo__card { padding: 12px 6px; border-radius: 22px; }
    .rc-duo__icon { width: 58px; height: 58px; }
}

@media (max-height: 700px) {
    .rc-consent { margin-top: 2px; font-size: .7rem; }
}

/* ------------------------------------------------ 2026-11-21 mobile fit pass */
/* Result: the green button stays on the first screen on short phones (≤ 760 px tall). */
@media (max-height: 760px) {
    .rc-result .rc-logo { width: 72px; }
    .rc-hero { height: clamp(150px, 42vw, 190px); }
    .rc-hero__fennec { width: clamp(170px, 48vw, 215px); bottom: -10px; }
    .rc-hero__star { width: 32px; }
    .rc-panel { padding-top: 42px; }
    .rc-duo__card { padding: 10px 8px; gap: 2px; }
    .rc-duo__icon { width: 54px; height: 54px; }
    .rc-duo__value { font-size: clamp(2.2rem, 11vw, 2.8rem); }
    .rc-result__action { margin-top: 16px; }
    .rc-result__action .rc-cta { min-height: 70px; }
    .rc-result__again { margin-top: 6px; }
}
@media (max-height: 620px) {
    .rc-result .rc-logo { width: 54px; }
    .rc-hero { height: 128px; margin-top: -6px; }
    .rc-hero__fennec { width: 150px; }
    .rc-hero__star { width: 26px; }
    .rc-ribbon { top: -26px; height: 54px; }
    .rc-ribbon__seal { width: 58px; height: 58px; }
    .rc-ribbon__band { height: 44px; font-size: 1.2rem; }
    .rc-panel { padding: 36px 10px 12px; border-radius: 26px; }
    .rc-duo { gap: 8px; }
    .rc-duo__icon { width: 42px; height: 42px; }
    .rc-duo__value { font-size: 2rem; }
    .rc-duo__label { padding: 4px 6px; font-size: .86rem; }
    .rc-result__action { margin-top: 14px; }
    .rc-result__action .rc-cta { min-height: 62px; font-size: 1.05rem; }
    .rc-cta__chevron { width: 42px; height: 42px; }
}

/* Tips popup: fits a 320×568 / 360×600 screen without scrolling. */
@media (max-height: 620px) {
    .rc-tips.rc-popup { padding-top: 88px; padding-bottom: 12px; }
    .rc-tips .rc-popup__fennec { width: 104px; }
    .rc-tips .rc-popup__head { height: 14px; }
    .rc-tips .rc-popup__head .rc-popup__rays { left: calc(50% + 36px); top: -76px; }
    .rc-tips__card { padding: 8px 12px 12px; }
    .rc-tips__title { font-size: 1.08rem; }
    .rc-tips__stage { margin: 8px 0; }
    .rc-tips__stage::before { width: 120px; height: 120px; margin: -60px 0 0 -60px; }
    .rc-tips__mic { width: 84px; height: 84px; border-width: 4px; box-shadow: 0 0 0 8px rgba(255, 190, 110, .28), 0 0 26px rgba(255, 120, 0, .5); }
    .rc-tips__mic img { width: 38px; height: 38px; }
    .rc-tips__rays--l { left: calc(50% - 82px); }
    .rc-tips__rays--r { right: calc(50% - 82px); }
    .rc-tips__list { gap: 6px; }
    .rc-tips__item { min-height: 42px; padding-top: 3px; padding-bottom: 3px; gap: 10px; font-size: .95rem; border-radius: 16px; }
    .rc-tips__item img { width: 44px; height: 38px; }
    .rc-tips__info { margin-top: 8px; padding: 6px 10px; font-size: .82rem; }
}
@media (max-width: 340px) {
    .rc-tips__item { font-size: .95rem; gap: 8px; }
    .rc-tips__info { border-radius: 16px; }
}

/* Reading: the fennec stays a readable size on short phones. */
@media (max-height: 700px) {
    .rc-dock { --buddy-w: clamp(108px, 32vw, 132px); }
    .rc-buddy { margin-left: -14px; }
}

/* [Follow-up game] Title over the game's cards on the combined reading + game result. */
.rc-game__title { margin: 14px 0 6px; text-align: center; font-weight: 800; font-size: 1.05rem; color: #3b2a7a; }
