
/* Prevent white flash while theme CSS is applying */
html.theme-loading body {
  opacity: 0;
}

html:not(.theme-loading) body {
  opacity: 1;
  transition: opacity 120ms ease-out;
}






    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      font-family: "Baloo 2", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    html, body {
      height: 100%;
    }

    body {
      min-height: 100vh;
      min-height: 100svh; /* better fullscreen-ish on mobile browsers */
      display: flex;
      justify-content: center;
      align-items: stretch;
      background: radial-gradient(circle at top, var(--bg-gradient-top), var(--bg-gradient-bottom));
      background-size: 150% 150%;
      animation: bgDrift 20s ease-in-out infinite alternate;
      color: var(--text-main);
      overflow-y: auto; /* allow scrolling on small devices if needed */
    }

    @keyframes bgDrift {
      0% { background-position: 0% 0%; }
      100% { background-position: 100% 100%; }
    }

    #app {
      width: 100%;
      max-width: 1200px;
      height: 100%;
      display: flex;
      align-items: stretch;
      justify-content: center;
    }

body.mode-big #app {
  max-width: none;
  
}

body.intro-mode #app {
  max-width: none;
  width: 100%;
}






    .screen-card {
      background: var(--card-bg);
      width: 100%;
      min-height: 100vh;
      min-height: 100svh;
      display: flex;
      flex-direction: column;
      padding: 18px 14px 22px;
      position: relative;
      overflow: hidden;
      box-shadow: 0 0 30px var(--screen-card-shadow);
    }

    #title-screen.screen-card {
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }


    @media (min-width: 768px) {
      .screen-card {
        padding: 26px 32px 30px;
      }
    }

    #quiz-screen {
      position: relative;
      overflow: hidden;
      background: var(--quiz-screen-bg);
    }



    .hidden {
      display: none !important;
    }

    /* ---------- INTRO SCREEN ---------- */

    #intro-screen {
      background: var(--intro-bg);
      color: var(--intro-text);
      box-shadow: none;
      opacity: 1;
      transition: opacity 0.9s ease-out;
    }




    #intro-screen.intro-fade-out {
      opacity: 0;
    }


  body.intro-mode {
    background: var(--intro-bg) !important;
    animation: none !important;
  }




    .intro-content {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      gap: 8px;
    }

    .intro-line {
      opacity: 0;
      color: var(--intro-text);
    }



    .intro-line-1 {
      font-size: clamp(1rem, 2.5vw, 1.5rem);
      font-weight: 400;
      animation: introFadeIn 0.9s ease-out forwards;
      animation-delay: 0.2s;
    }

    .intro-line-2 {
      font-size: clamp(1.6rem, 4vw, 2.6rem);
      font-weight: 800;
      letter-spacing: 0.04em;
      animation: introFadeIn 0.9s ease-out forwards;
      animation-delay: 1.0s;
    }

    .intro-logo {
    margin-bottom: 1px;
    width: 160px;
    max-width: 60vw;
    opacity: 0;  /* start invisible */

    /* Fade in, then shake – in one combined animation declaration */
    animation:
        introFadeIn 0.9s ease-out 0.1s forwards,
        introLogoShake 0.4s ease-in-out 2s 1;

    }



    /* Logo shake effect (used before swapping to bitten version) */
    .intro-logo-shake {
    animation: introLogoShake 0.4s ease-in-out 2;
    }

    /* Logo shake keyframes */
    @keyframes introLogoShake {
    0%   { transform: rotate(0deg); }
    25%  { transform: rotate(-4deg); }
    50%  { transform: rotate(4deg); }
    75%  { transform: rotate(-3deg); }
    100% { transform: rotate(0deg); }
    }





    @keyframes introFadeIn {
      from {
        opacity: 0;
        transform: translateY(4px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }


    /* ---------- TITLE SCREEN ---------- */

    #title-screen-content {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 24px;
      text-align: center;
    }

    .lesson-image-wrapper {
      width: 140px;
      height: 140px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    @media (min-width: 900px) {
      .lesson-image-wrapper {
        width: 200px;
        height: 200px;
      }
    }

    .lesson-image {
      width: 100%;
      height: 100%;
      object-fit: contain;
      animation: float 4.5s ease-in-out infinite;
    }

    @keyframes float {
      0% { transform: translateY(0); }
      50% { transform: translateY(6px); }
      100% { transform: translateY(0); }
    }

    .card-title {
      font-size: clamp(1.8rem, 4vw, 2.6rem);
      font-weight: 800;
      letter-spacing: 0.02em;
    }

    .card-subtitle {
      font-size: clamp(1rem, 2vw, 1.2rem);
      color: var(--text-muted);
    }

    /* Title screen text colors */
    #title-screen .card-title {
    color: var(--title-main-text);
    }

    #title-screen .card-subtitle {
    color: var(--title-subtitle-text);
    }


    .mode-buttons {
      display: flex;
      flex-direction: column;
      gap: 10px;
      width: 100%;
      max-width: 420px;
    }

    @media (min-width: 600px) {
      .mode-buttons {
        flex-direction: row;
      }
    }

    .primary-button,
    .secondary-button {
      border-radius: 999px;
      border: none;
      padding: 12px 20px;
      font-size: clamp(1rem, 1.8vw, 1.2rem);
      font-weight: 600;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
    }

    .primary-button {
      background: linear-gradient(135deg, var(--accent), var(--accent-dark));
      color: var(--primary-text);
      box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
    }

    .secondary-button {
      background: var(--secondary-bg);
      color: var(--secondary-text);
      box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
    }


    .primary-button:hover,
    .secondary-button:hover {
      transform: translateY(-1px);
      filter: brightness(1.05);
      box-shadow: 0 14px 30px rgba(15, 23, 42, 0.35);
    }

    .primary-button:active,
    .secondary-button:active {
      transform: translateY(0);
      filter: brightness(0.95);
      box-shadow: 0 6px 12px rgba(15, 23, 42, 0.25);
    }

    .mode-note {
      font-size: 0.85rem;
      color: var(--text-muted);
      margin-top: 6px;
      max-width: 420px;
      margin-left: auto;
      margin-right: auto;
    }

    /* ---------- TOP BAR + PROGRESS ---------- */

    .top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    margin-bottom: 4px;
    color: var(--text-muted);
    }


    .sound-toggle {
    border-radius: 999px;
    border: none;
    background: var(--icon-chip-bg);
    color: var(--icon-chip-text);
    padding: 6px 9px;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 3px 9px rgba(15,23,42,0.2);
    transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.08s ease;
    }


    .sound-toggle:hover {
      transform: translateY(-1px);
      box-shadow: 0 6px 14px rgba(15,23,42,0.25);
      filter: brightness(1.06);
    }

    .sound-toggle:active {
      transform: translateY(0);
      box-shadow: 0 3px 8px rgba(15,23,42,0.2);
      filter: brightness(0.96);
    }

    .top-icon-button {
    border-radius: 999px;
    border: none;
    background: var(--icon-chip-bg);
    color: var(--icon-chip-text);
    padding: 6px 9px;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 3px 9px rgba(15,23,42,0.20);
    transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.08s ease;
    margin: 0 12px; /* spacing so it doesn't collide with text/sound button */
    }


    .top-icon-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15,23,42,0.25);
    filter: brightness(1.06);
    }

    .top-icon-button:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(15,23,42,0.20);
    filter: brightness(0.96);
    }


  /* --- Make the SVG icons actually show up --- */
  .top-icon-button,
  .sound-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    /* prevents “thin pill” collapse when content is SVG */
    min-width: 40px;
    min-height: 40px;

    /* optional: makes icon sit nicely */
    line-height: 0;
  }

  /* Size the SVG itself */
  .nav-icon {
    width: 22px;
    height: 22px;
    display: block;
  }


    .progress-track {
      width: 100%;
      height: 10px;
      border-radius: 999px;
      background: var(--progress-track-bg);
      overflow: hidden;
      margin-top: 6px;
    }

    .progress-fill {
      height: 100%;
      width: 0%;
      border-radius: inherit;
      background: var(--progress-fill-gradient);
      background-size: 200% 100%;
      animation: progressFlow 2.5s linear infinite;
      transition: width 0.25s ease;
    }

    @keyframes progressFlow {
      0% { background-position: 0% 0%; }
      100% { background-position: 100% 0%; }
    }

    /* Timer ring (big-screen only visually) */
    .timer-ring-wrapper {
      position: relative;
      width: 180px;    /* bigger ring */
      height: 180px;
      display: none;   /* phone mode hides it */
      border-radius: 50%;
      box-shadow: 0 14px 30px rgba(15, 23, 42, 0.28);
      background: var(--timer-bg);
    }

    body.mode-big .timer-ring-wrapper {
      display: flex;
      align-items: center;
      justify-content: center;
    }

    /* When time runs out, make the timer ring "explode" */
    .timer-ring-wrapper.timer-explode {
    animation: timerExplode 0.7s ease-out forwards;
    }

    @keyframes timerExplode {
    0% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 14px 30px rgba(15, 23, 42, 0.28);
    }
    40% {
        transform: scale(1.3);
        opacity: 1;
              box-shadow: 0 0 40px var(--timer-explosion-glow); /* bright flash */
    }
    100% {
        transform: scale(0.6);
        opacity: 0;
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }
    }

    /* BIGGER, HOTTER, MORE IMPRESSIVE PARTICLES */
    .timer-particle {
    position: fixed;
    width: 22px;       /* was 10px */
    height: 22px;      /* was 10px */
    border-radius: 50%;
    pointer-events: none;
    z-index: 10002;      /* above everything */
      background: var(--timer-particle-gradient);
    animation: timerParticle 1.2s ease-out forwards; /* longer, dramatic */
    --tx: 0px;
    --ty: 0px;
    }

    @keyframes timerParticle {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1.3);
        filter: blur(0px);
    }
    40% {
        opacity: 1;
        transform: translate(var(--tx), var(--ty)) scale(1.0);
        filter: blur(1px);
    }
    100% {
        opacity: 0;
        transform: translate(calc(var(--tx) * 1.8), calc(var(--ty) * 1.8)) scale(0.3);
        filter: blur(4px);
    }
    }


    .timer-svg {
      width: 100%;
      height: 100%;
      transform: rotate(-90deg); /* start at top */
    }

    /* Ring base */
    .timer-ring-bg {
      fill: none;
      stroke: var(--timer-ring-bg);
      stroke-width: 10;
    }

    /* Foreground color is overridden by JS for green->yellow->red */
    .timer-ring-fg {
      fill: none;
      stroke: var(--timer-ring-fg);
      stroke-width: 10;
      stroke-linecap: round;
      stroke-dasharray: 339.292;
      stroke-dashoffset: 0;
      transition: stroke-dashoffset 0.2s linear;
    }

    .timer-text {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 2.2rem;
      color: var(--timer-text);
      font-weight: 800;
    }





        /* Emoji host (right side) */
    .emoji-face {
      font-size: clamp(5rem, 9vw, 8rem); /* MUCH larger */
      filter: drop-shadow(0 14px 28px rgba(15, 23, 42, 0.35));
      opacity: 1;
      transition: transform 0.25s ease, opacity 0.25s ease;
    }



    .emoji-face.emoji-pop {
    transform: scale(1.1);
    opacity: 1;
    }


    /* ---------- QUIZ LAYOUT (shared) ---------- */

    .quiz-main {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-top: 10px;
      min-height: 0;
    }

    .question-panel {
      display: flex;
      min-height: 0;
    }

    .answers-panel {
      display: flex;
      flex-direction: column;
      min-height: 0;
      position: relative;  /* NEW: so the suspense layer can anchor to this area */
    }


    .question-card {
    position: relative;            /* so we can attach an arrow to it */
    width: 100%;
    background: var(--question-bg);
    color: var(--question-text);
    border-radius: 1.35rem;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;        /* stack question + feedback + button */
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.55);
    }


    .question-text {
      font-weight: 800;
      line-height: 1.3;
      text-wrap: pretty;   /* fallback */
      text-wrap: balance;  /* preferred */
    }

    /* ----- Question Reveal Animation ----- */
    .question-text.question-reveal {
    animation: questionReveal 0.55s ease-out;
    }

    @keyframes questionReveal {
    0%   { opacity: 0; transform: translateY(12px) scale(0.98); }
    60%  { opacity: 1; transform: translateY(0) scale(1.02); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
    }


    .answers-grid {
      display: grid;
      gap: 12px;
      flex: 1;
      min-height: 0;
    }

    @media (min-width: 640px) {
      .answers-grid {
        grid-template-columns: 1fr 1fr;
      }
    }

    .answer-button {
    position: relative; 
    width: 100%;
    border-radius: var(--button-radius);
    border: 9px solid transparent; 
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(15,23,42,0.3);
    transition: transform 0.08s ease,
                box-shadow 0.08s ease,
                filter 0.08s ease,
                border-color 0.08s ease;
    padding: 14px 16px;
    }

    .answer-button.spotlight-chosen {
    position: relative;
    z-index: 60;
    }


    /* Hide keyboard hint numbers in phone mode */
    body.mode-phone .answer-key-hint {
    display: none !important;
    }


    .answer-key-hint {
      position: absolute;
      top: 6px;
      left: 8px;
      font-size: 1rem;
      font-weight: 700;
      background: var(--answer-key-pill-bg);
      color: var(--answer-key-pill-text);
      padding: 4px 8px;
      border-radius: 999px;
      pointer-events: none;
    }




    .answer-button:hover {
      transform: translateY(-1px);
      box-shadow: 0 16px 36px rgba(15,23,42,0.4);
      filter: brightness(1.05);
      border-color: var(--answer-border-strong);
    }

    .answer-button:active {
      transform: translateY(0);
      box-shadow: 0 8px 18px rgba(15,23,42,0.3);
      filter: brightness(0.97);
    }

    .answer-button.disabled {
      pointer-events: none;
      opacity: 0.85;
      filter: none;
    }

    /* Visual states for correct / wrong answers */
    .answer-button.answer-correct {
    box-shadow:
        0 0 0 3px var(--answer-border-strong);  /* clean strong outline */
    transform: translateY(-2px) scale(1.02);
    border-color: var(--answer-border-strong);
    }


    .answer-button.answer-wrong {
      animation: shake 0.24s ease-in-out;
      opacity: 0.9;
    }

    .answer-button.answer-faded {
      filter: grayscale(1) brightness(0.8);
      opacity: 0.5;
    }


    @keyframes shake {
      0%   { transform: translateX(0); }
      25%  { transform: translateX(-4px); }
      50%  { transform: translateX(4px); }
      75%  { transform: translateX(-4px); }
      100% { transform: translateX(0); }
    }


    .answer-text {
      line-height: 1.3;
      text-wrap: pretty;   /* fallback */
      text-wrap: balance;  /* preferred */
    }

    /* Slight glossy gradient on answer buttons */
    .color-red {
      background: linear-gradient(to bottom, rgba(255,255,255,0.18), rgba(0,0,0,0.18)), var(--red);
      color: var(--red-text);
      border-color: var(--red-border);
    }

    .color-yellow {
      background: linear-gradient(to bottom, rgba(255,255,255,0.18), rgba(0,0,0,0.18)), var(--yellow);
      color: var(--yellow-text);
      border-color: var(--yellow-border);
    }

    .color-blue {
      background: linear-gradient(to bottom, rgba(255,255,255,0.18), rgba(0,0,0,0.18)), var(--blue);
      color: var(--blue-text);
      border-color: var(--blue-border);
    }

    .color-green {
      background: linear-gradient(to bottom, rgba(255,255,255,0.18), rgba(0,0,0,0.18)), var(--green);
      color: var(--green-text);
      border-color: var(--green-border);
    }




    .score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: clamp(0.95rem, 1.6vw, 1.2rem);
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px solid var(--progress-track-bg);
    color: var(--text-muted);
    }


    .score-row strong {
      color: var(--text-main);
    }

    /* ---------- BIG-SCREEN MODE ---------- */

    body.mode-big .question-panel {
    /* Let the question area be only as tall as it needs */
    flex: 0 0 auto;
    }

    body.mode-big .answers-panel {
    /* Let the answers panel take the remaining height */
    flex: 1 1 auto;
    }

    body.mode-big .question-text,
    body.mode-big .answer-text {
    text-wrap: balance;
}


    body.mode-big .question-text {
      font-size: clamp(1.6rem, 3.2vw, 3.4rem);
    }

    body.mode-big .answer-button {
    font-size: clamp(1.2rem, 2.4vw, 2.6rem);

    /* Make the button 94% of its grid cell (≈47% of the whole area) */
    width: 94%;
    height: 94%;
    }


    /* Big-screen layout: timer | question | emoji */
    body.mode-big .question-panel {
      justify-content: center;
    }

    body.mode-big .question-layout {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      gap: 24px;
    }

    /* Side areas expand to fill leftover space, contents centered */
    body.mode-big .question-side {
      flex: 1 0 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    /* Center block takes ~60% width, leaving ~20% on each side */
    body.mode-big .question-card {
      flex: 0 0 60%;
    }


    body.mode-big .answers-grid {
    grid-auto-rows: 1fr;

    /* Center the smaller buttons in their cells */
    justify-items: center;
    align-items: center;
    }

    /* ---------- QUESTION SLIDE TRANSITION ---------- */

    .quiz-main {
      position: relative; /* so the transform animations look smooth */
    }

    .quiz-main.question-slide-out {
      animation: questionSlideOut 0.55s ease-in forwards;
    }

    .quiz-main.question-slide-in {
      animation: questionSlideIn 0.55s cubic-bezier(0.22, 0.75, 0.25, 1.05) forwards;
    }

    @keyframes questionSlideOut {
      0% {
        transform: translateX(0) scale(1);
        opacity: 1;
      }
      15% {
        /* little "rev" to the right */
        transform: translateX(14px) scale(1.03);
      }
      100% {
        /* zoom off to the left */
        transform: translateX(-115%) scale(0.95);
        opacity: 0;
      }
    }

    @keyframes questionSlideIn {
      0% {
        transform: translateX(115%) scale(0.95);
        opacity: 0;
      }
      60% {
        /* snap into place */
        transform: translateX(0) scale(1.03);
        opacity: 1;
      }
      80% {
        /* tiny wiggle past center */
        transform: translateX(-8px) scale(0.99);
      }
      100% {
        transform: translateX(0) scale(1);
      }
    }


    /* ---------- PHONE MODE ---------- */

    body.mode-phone .quiz-main {
      gap: 6px;
    }

    body.mode-phone .question-panel {
    flex: 0 0 auto;
    display: block;       /* Stop using flex here on phone */
    }

    body.mode-phone .question-layout {
    width: 100%;          /* Make the layout span full width */
    }


    body.mode-phone .answers-panel {
      flex: 1 0 auto;
    }

    body.mode-phone .question-card {
      padding: 10px 12px;
    }

    body.mode-phone .question-text {
      font-size: clamp(1rem, 2.5vh, 1.5rem);
    }

    body.mode-phone .answers-grid {
      grid-template-columns: 1fr;
      grid-auto-rows: auto;
      gap: 8px;
    }

    body.mode-phone .answer-button {
      font-size: clamp(0.9rem, 2.2vh, 1.1rem);
      padding: 10px 12px;
    }

    /* Hide emoji entirely in phone mode */
    body.mode-phone .question-emoji,
    body.mode-phone #emoji-face {
    display: none !important;
    }

    /* ----- Streak Animations ----- */

    body.streak-tier-1 #emoji-face {
    animation: streakGlow 0.6s ease-out;
    }

    body.streak-tier-2 #emoji-face {
    animation: streakAura 0.9s ease-out;
    }

    body.streak-tier-3 #emoji-face {
    animation: streakFinal 1.2s ease-out;
    }

    @keyframes streakGlow {
    0%   { filter: drop-shadow(0 0 0 rgba(255,255,0,0)); }
    100% { filter: drop-shadow(0 0 18px rgba(255, 255, 135, 0.9)); }
    }

    @keyframes streakAura {
    0%   { filter: drop-shadow(0 0 0 rgba(255,215,0,0)); transform: scale(1); }
    50%  { filter: drop-shadow(0 0 25px rgba(255,215,0,0.9)); transform: scale(1.06); }
    100% { filter: drop-shadow(0 0 12px rgba(255,215,0,0.6)); transform: scale(1.02); }
    }

    @keyframes streakFinal {
    0%   { transform: scale(1) rotate(0);   filter: drop-shadow(0 0 0 rgba(255,180,0,0)); }
    40%  { transform: scale(1.15) rotate(3deg); filter: drop-shadow(0 0 45px rgba(255,200,0,1)); }
    70%  { transform: scale(1.1) rotate(-3deg); filter: drop-shadow(0 0 30px rgba(255,185,0,1)); }
    100% { transform: scale(1.05) rotate(0); filter: drop-shadow(0 0 18px rgba(255,180,0,0.7)); }
    }


    /* ---------- FULLSCREEN TWEAKS ---------- */

    :fullscreen .question-text,
    :-webkit-full-screen .question-text {
      font-size: clamp(2.2rem, 4vw, 5rem);
    }

    :fullscreen body.mode-big .answer-button,
    :-webkit-full-screen body.mode-big .answer-button {
       font-size: clamp(1.2rem, 2.4vw, 2.6rem);
    }



    /* ---------- FEEDBACK + STARS ---------- */

    /* Hidden by default, only shown when the card is in feedback mode */
    .feedback-bubble {
    display: none;
    width: 100%;
    }

    /* Question card becomes a “speech bubble” after answering */
    .question-card.feedback-mode {
    padding: 18px 22px 20px;
    }

    /* In feedback mode, hide the normal question text */
    .question-card.feedback-mode .question-text {
    display: none;
    }

    /* In feedback mode, show the feedback text area */
    .question-card.feedback-mode .feedback-bubble {
    display: block;
    }

    /* Arrow pointing from the right edge toward the emoji */
    .question-card.feedback-mode::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -18px;
    transform: translateY(-50%);
    border-width: 12px 0 12px 18px;
    border-style: solid;
    border-color: transparent transparent transparent var(--question-bg);
    }

    /* Hide the arrow on phone since the emoji isn’t shown there */
    body.mode-phone .question-card.feedback-mode::after {
    display: none;
    }

    /* Title inside the “bubble” */
    .feedback-title {
    font-size: clamp(3rem, 5vw, 4.2rem);
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 6px;
    text-align: center;
    }

    .feedback-title.correct-text {
      color: var(--feedback-correct-text);
    }

    .feedback-title.incorrect-text {
      color: var(--feedback-incorrect-text);
    }


    /* Subtitle + Next row (in the white strip above the answers) */
    .feedback-subrow {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        margin: 18px 0 28px;  /* top, left/right, bottom */
        text-align: center;
    }



 .feedback-detail {
    color: var(--feedback-subtitle-text);
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    line-height: 1.35;
    min-height: 1.8em;
}




    .feedback-next-btn {
        align-self: center;
        font-size: clamp(1.1rem, 2.1vw, 1.5rem);
        padding: 14px 30px;
    }


    /* Falling stars for correct answers (unchanged) */
    .star {
    position: fixed;
    top: -40px;
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
    animation: fall 1.2s linear forwards;
    z-index: 60;
    pointer-events: none;
    }

    @keyframes fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
    }


    /* ---------- SPOTLIGHT + SUSPENSE ---------- */

    .spotlight-overlay {
    position: absolute;
    inset: 0;
    background: var(--spotlight-overlay-bg);
    z-index: 40;
    pointer-events: none;
    }

    /* ---------- END REWARD SPOTLIGHT ---------- */

    .reward-overlay {
      position: fixed;
      inset: 0;
        background: var(--reward-overlay-bg);
      z-index: 10000; /* above everything else */
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .reward-center {
      text-align: center;
        color: var(--reward-text);
    }

  .reward-present-big {
    font-size: clamp(5rem, 10vw, 8rem);
    display: inline-block;       /* makes transform-origin behave nicely */
    transform-origin: center;    /* rotate from the center, not a corner */
  }



    .reward-final-emoji {
        font-size: clamp(20rem, 44vw, 36rem); /* 4× bigger */
        margin-top: 8px;
        cursor: pointer;
        user-select: none;
        pointer-events: auto;
        position: relative;
        z-index: 10001;
    }



    /* Big present wiggle while we're in the spotlight */
    .reward-present-animate {
      animation: rewardPresentBigWiggle 1.2s ease-in-out infinite;
    }

    @keyframes rewardPresentBigWiggle {
      0%, 40%, 100% { transform: rotate(0deg); }
      10% { transform: rotate(-6deg); }
      20% { transform: rotate(6deg); }
      30% { transform: rotate(-3deg); }
    }


    /* Giant emoji entrance (simple pop, for scores < 5) */
    .reward-emoji-pop {
      animation: rewardEmojiPop 0.7s ease-out forwards;
    }

    @keyframes rewardEmojiPop {
      0%   { transform: scale(0.6); opacity: 0; }
      60%  { transform: scale(1.1); opacity: 1; }
      100% { transform: scale(1); opacity: 1; }
    }

    /* Giant emoji dance (for scores >= 5) */
    .reward-emoji-dance {
      animation: rewardEmojiDance 2s ease-in-out forwards;
    }

    @keyframes rewardEmojiDance {
      0%   { transform: translateY(0) scale(1); }
      15%  { transform: translateY(-12px) scale(1.05); }
      30%  { transform: translateY(0) scale(1); }
      45%  { transform: rotate(-4deg) scale(1.05); }
      60%  { transform: rotate(4deg) scale(1.05); }
      75%  { transform: rotate(0deg) translateY(-8px) scale(1.05); }
      100% { transform: translateY(0) scale(1); }
    }


    .suspense-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 80;
    pointer-events: none;
    }

    .suspense-thumb {
    /* EVEN bigger thumbs */
    font-size: clamp(7rem, 14vw, 11rem);

    /* Strong, soft shadow so it stands out on the dark overlay */
    filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.9));
    }



    /* Particle explosion from the chosen button */
    .burst-star {
    position: fixed;
    font-size: 1.5rem;
    pointer-events: none;
    z-index: 70;
    animation: buttonBurst 0.7s ease-out forwards;
    }

    @keyframes buttonBurst {
    0% {
        transform: translate(0,0) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(1);
        opacity: 0;
    }
    }



    /* ---------- END SCREEN ---------- */

    /* Make the end screen center vertically */
    .card-header {
    flex: 1;
    display: flex;
    }


    .end-main {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 14px;
      text-align: center;
    }

    .end-trophy {
      font-size: clamp(3rem, 6vw, 4rem);
      cursor: pointer; /* make it look clickable */
    }

    /* Small present wiggle on the end screen */
    .end-present-wiggle {
      animation: endPresentWiggle 2s ease-in-out infinite;
    }

    @keyframes endPresentWiggle {
      0%, 20%, 100% { transform: rotate(0deg); }
      5%  { transform: rotate(-6deg); }
      10% { transform: rotate(6deg); }
      15% { transform: rotate(-3deg); }
    }


    .end-score {
      font-size: clamp(2.2rem, 3.3vw, 3rem);
      font-weight: 800;
      color: var(--end-score-text);
    }

    .end-detail {
      font-size: clamp(1.05rem, 1.8vw, 1.3rem);
      color: var(--end-detail-text);
    }

    /* End screen title & subtitle text colors */
    #end-screen .card-title {
      color: var(--end-title-text);
    }

    #end-screen .card-subtitle {
      color: var(--end-subtitle-text);
    }


    #end-screen.end-great {
      background: radial-gradient(circle at top, var(--end-great-bg-top), var(--end-great-bg-bottom));
    }

    #end-screen.end-good {
      background: radial-gradient(circle at top, var(--end-good-bg-top), var(--end-good-bg-bottom));
    }

    #end-screen.end-try {
      background: radial-gradient(circle at top, var(--end-try-bg-top), var(--end-try-bg-bottom));
    }


  /* ----- Dynamic Background Reactions (on quiz card) ----- */

    #quiz-screen.bg-correct {
    animation: bgCorrectPulse 0.6s ease-out;
    }

    #quiz-screen.bg-incorrect {
    animation: bgIncorrectPulse 0.6s ease-out;
    }

  @keyframes bgCorrectPulse {
    0%   { background: var(--flash-correct-bg); }
    100% { background: var(--flash-return-bg); }
  }


  @keyframes bgIncorrectPulse {
    0%   { background: var(--flash-incorrect-bg); }
    100% { background: var(--flash-return-bg); }
  }


    /* HIDE CURSOR IN BIG MODE (for all elements) */
    body.mode-big,
    body.mode-big * {
    cursor: none !important;
    }



    

    /* CUSTOM BIG POINTER */
    #big-pointer {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10001;
    font-size: 3.5rem;
    pointer-events: none;
    transform: translate(-38%, -15%);
    transition: transform 0.04s linear;
    }

    /* Little emoji "ghosts" that follow the big pointer */
    .pointer-trail-emoji {
    position: fixed;
    z-index: 9998; /* just under the main pointer */
    font-size: 2.5rem;
    pointer-events: none;
    transform: translate(-38%, -15%);
    opacity: 1;
    animation: pointerTrailFade 0.6s ease-out forwards;
    }

    @keyframes pointerTrailFade {
    0% {
        opacity: 1;
        transform: translate(-38%, -15%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-38%, -5%) scale(0.7);
    }
    }


    /* CLICK RIPPLE EFFECT (big-screen pointer) */
    .click-ripple {
    position: fixed;
    width: 80px;
    height: 80px;
    border-radius: 999px;
    border: 3px solid rgba(255, 255, 255, 0.85);
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0.9;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
    animation: clickRipple 0.45s ease-out forwards;
    }

    @keyframes clickRipple {
    0% {
        transform: translate(-50%, -50%) scale(0.1);
        opacity: 0.9;
    }
    70% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0;
        box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    }
    }


.question-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.question-progress .nav-icon {
  width: 20px;
  height: 20px;
}

    
/* DEBUG: temporarily show the real mouse cursor */
body.show-real-cursor,
body.show-real-cursor * {
  cursor: auto !important;
}

/* ==========================================
   HARDCODED TITLE SCREEN OVERRIDES
   ========================================== */

body.mode-title {
  background: #f2f2f2 !important;
  animation: none !important;
  color: #333333 !important;
}

#title-screen.screen-card {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

#title-screen,
#title-screen-content {
  color: #333333 !important;
}

#title-screen .card-title,
#title-screen .card-subtitle,
#title-screen .mode-note {
  color: #333333 !important;
}

#title-screen .primary-button {
  background: #7f66c6 !important;
  color: #ffffff !important;
  box-shadow: 0 10px 25px rgba(127, 102, 198, 0.28) !important;
  filter: none !important;
}

#title-screen .primary-button:hover {
  background: #7f66c6 !important;
  color: #ffffff !important;
  filter: brightness(1.05) !important;
  box-shadow: 0 14px 30px rgba(127, 102, 198, 0.34) !important;
}

#title-screen .primary-button:active {
  background: #7f66c6 !important;
  color: #ffffff !important;
  filter: brightness(0.95) !important;
  box-shadow: 0 6px 12px rgba(127, 102, 198, 0.22) !important;
}

#title-screen .mode-buttons {
  width: 100%;
  max-width: 320px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

#title-screen .mode-buttons .primary-button {
  margin: 0 auto;
}

#title-screen .lesson-image {
  animation: none;
}
