/* ===== Shared look for every game ===== */
:root {
  --pink: #ff6fb5;
  --pink-dark: #e0478f;
  --pink-light: #ffd6ea;
  --lav: #c9a7ff;
  --mint: #8fe3c8;
  --gold: #ffc94d;
  --ink: #5a2a4a;
  --white: #ffffff;
  --radius: 28px;
  --font: "Baloo 2", "Chalkboard SE", "Comic Sans MS", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(160deg, #ffe3f1 0%, #f3e6ff 55%, #e3f6ff 100%);
  background-attachment: fixed;
  min-height: 100vh;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overflow-x: hidden;
}

/* Top bar: home button, title, repeat-voice button */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px;
}
.icon-btn {
  width: 64px; height: 64px; flex: none;
  border-radius: 50%; border: none; background: var(--white);
  box-shadow: 0 6px 0 var(--pink-light), 0 8px 18px rgba(224,71,143,.2);
  font-size: 32px; cursor: pointer;
  display: grid; place-items: center; text-decoration: none;
}
.icon-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--pink-light); }
.title {
  font-size: clamp(22px, 4vw, 38px); font-weight: 800; margin: 0;
  text-align: center; color: var(--pink-dark);
}

.progress { display: flex; gap: 6px; justify-content: center; padding: 4px; font-size: 28px; }
.stage { max-width: 900px; margin: 0 auto; padding: 8px 16px 40px; text-align: center; }

/* Big chunky buttons */
.big-btn {
  font-family: inherit; font-size: clamp(30px, 6vw, 52px); font-weight: 800;
  min-width: 110px; min-height: 110px; padding: 10px 24px;
  border: none; border-radius: var(--radius);
  background: var(--white); color: var(--ink);
  box-shadow: 0 8px 0 var(--lav), 0 10px 24px rgba(120,60,160,.18);
  cursor: pointer; transition: transform .08s;
  display: inline-grid; place-items: center; text-decoration: none;
}
.big-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--lav); }
.big-btn.primary { background: var(--pink); color: #fff; box-shadow: 0 8px 0 var(--pink-dark), 0 10px 24px rgba(224,71,143,.3); }
.big-btn.correct { background: var(--mint); }
.choices { display: flex; flex-wrap: wrap; gap: 22px; justify-content: center; margin-top: 28px; }

/* Start / finish pop-ups */
.overlay {
  position: fixed; inset: 0; z-index: 50; padding: 16px;
  display: grid; place-items: center; background: rgba(255,227,241,.94);
}
.card {
  background: #fff; border-radius: 36px; padding: 32px 28px; text-align: center;
  box-shadow: 0 12px 40px rgba(224,71,143,.25); max-width: 520px; width: 100%;
}
.card .emoji { font-size: 100px; line-height: 1.1; }
.card h2 { font-size: clamp(30px, 6vw, 46px); margin: 12px 0; color: var(--pink-dark); }
.card .row { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }

/* ===== French games ===== */
.frpic { display: grid; place-items: center; line-height: 1; }
.frpic.big { font-size: clamp(64px, 13vw, 92px); width: 1.4em; height: 1.4em; }
.frpic.small { font-size: clamp(44px, 9vw, 60px); width: 1.4em; height: 1.4em; }
.frpic.num { font-weight: 800; font-family: var(--font); color: #fff; background: var(--pink); border-radius: 22%; font-size: clamp(44px, 9vw, 64px); }
.frpic.swatch { background: var(--sw); border-radius: 50%; border: 5px solid #e9d9e4; font-size: 0; width: clamp(84px, 17vw, 120px); height: clamp(84px, 17vw, 120px); }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; max-width: 760px; margin: 10px auto; }
.theme-grid .big-btn { flex-direction: column; font-size: 20px; min-height: 120px; gap: 2px; }
.theme-grid .big-btn .e { font-size: 48px; }
.rep-row { display: flex; gap: 18px; justify-content: center; margin-top: 16px; }
.rep-mic { font-size: 54px !important; }
.rep-mic.recording { animation: bob .8s ease-in-out infinite; background: #ff4d6d !important; }
.rep-meter { width: min(70vw, 320px); height: 16px; margin: 14px auto 0; background: #fff; border-radius: 999px; overflow: hidden; }
.rep-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), var(--pink)); transition: width .08s; }
.fr-word { font-size: clamp(32px, 6.5vw, 52px); font-weight: 800; color: var(--pink-dark); margin: 8px 0 0; }
.fr-flag { font-size: 20px; font-weight: 800; color: #3d5bd9; letter-spacing: 1px; }

.sticker-win { margin-top: 12px; font-size: 22px; font-weight: 800; color: var(--pink-dark); }
.sticker-win .big { font-size: 64px; animation: bounceIn .7s; }
.adv-note { margin-top: 8px; font-size: 20px; font-weight: 800; color: #b8860b; background: #fff6d6; border-radius: 14px; padding: 6px 12px; }

.level-tag { font-size: 24px; font-weight: 800; color: #b8860b; margin-top: 4px; }

/* Animations */
@keyframes wiggle {
  0%,100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-10px) rotate(-6deg); }
  40% { transform: translateX(10px) rotate(6deg); }
  60% { transform: translateX(-6px) rotate(-3deg); }
  80% { transform: translateX(6px) rotate(3deg); }
}
.wiggle { animation: wiggle .45s; }

@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(0); opacity: 0; } }
.popped { animation: pop .35s forwards !important; }

@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }

@keyframes bounceIn { 0% { transform: scale(.3); opacity: 0; } 60% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); } }
.bounce-in { animation: bounceIn .5s; }

@keyframes fall { to { transform: translateY(115vh) rotate(540deg); } }
.confetti {
  position: fixed; top: -50px; font-size: 30px; pointer-events: none; z-index: 60;
  animation-name: fall; animation-timing-function: linear; animation-fill-mode: forwards;
}
