/* Adenola's Learning Adventure — styles */

:root {
  --ink: #2d3a5a;
  --ink-soft: #5b6787;
  --paper: #ffffff;
  --sky-top: #bfe8ff;
  --sky-bottom: #fff4dc;
  --coral: #ff7a8a;
  --coral-dark: #e65a6c;
  --blue: #38b6e8;
  --blue-dark: #1f93c4;
  --sun: #ffc93c;
  --sun-dark: #e8a910;
  --green: #4cc979;
  --green-dark: #33a85d;
  --purple: #8e7cf0;
  --purple-dark: #6d5ad6;
  --orange: #ff9f43;
  --grey: #c9cfdc;
  --grey-dark: #a3abbe;
  --radius: 26px;
  --shadow: 0 6px 0 rgba(45, 58, 90, .12), 0 12px 28px rgba(45, 58, 90, .12);
  --font-ui: "Fredoka", "Baloo 2", "Comic Sans MS", "Chalkboard SE", system-ui, sans-serif;
  --font-glyph: "Andika", "Fredoka", "Century Gothic", system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --accent: var(--purple);
  --accent-dark: var(--purple-dark);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-top) 0%, #e3f5ff 45%, var(--sky-bottom) 100%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
  touch-action: manipulation;
  overflow-x: hidden;
}
button { font-family: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 4px solid var(--sun); outline-offset: 3px; }
[hidden] { display: none !important; }
.noscript { text-align: center; font-size: 1.3rem; padding: 40px 16px; }

/* ---------- Background scenery ---------- */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.cloud {
  position: absolute; background: #fff; border-radius: 100px; opacity: .85;
  box-shadow: 40px -18px 0 6px #fff, 85px 2px 0 -4px #fff;
  animation: drift 60s linear infinite;
}
.cloud.c1 { width: 110px; height: 38px; top: 9%; left: -160px; }
.cloud.c2 { width: 80px; height: 28px; top: 22%; left: -160px; animation-duration: 85s; animation-delay: -30s; opacity: .7; }
.cloud.c3 { width: 130px; height: 44px; top: 4%; left: -160px; animation-duration: 110s; animation-delay: -70s; opacity: .6; }
@keyframes drift { to { transform: translateX(calc(100vw + 320px)); } }
.hill { position: absolute; border-radius: 50%; bottom: -60vh; }
.hill.h1 { width: 120vw; height: 80vh; left: -40vw; background: #c8efb5; bottom: -66vh; }
.hill.h2 { width: 110vw; height: 80vh; right: -50vw; background: #b3e69c; bottom: -70vh; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.spacer { flex: 1; }
.icon-btn {
  width: 52px; height: 52px; border-radius: 18px; border: 0;
  background: var(--paper); font-size: 26px; line-height: 1;
  box-shadow: 0 4px 0 rgba(45, 58, 90, .15);
  display: grid; place-items: center;
  transition: transform .12s;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(45, 58, 90, .15); }
.icon-btn.small { width: 44px; height: 44px; font-size: 20px; opacity: .75; }
.icon-btn.off { opacity: .45; filter: grayscale(1); }
.stars-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--paper); border-radius: 999px; padding: 6px 16px 6px 10px;
  font-weight: 700; font-size: 1.45rem; box-shadow: 0 4px 0 rgba(45, 58, 90, .15);
}
.stars-pill .star-icon { font-size: 1.6rem; }
.stars-pill.bump { animation: bump .45s; }
@keyframes bump { 40% { transform: scale(1.25); } }

/* ---------- Layout ---------- */
.app { max-width: 1040px; margin: 0 auto; padding: 16px 16px calc(150px + var(--safe-bottom)); outline: none; }
.view { animation: view-in .35s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(14px); } }
.page-title { font-size: clamp(1.7rem, 5vw, 2.5rem); font-weight: 700; margin: 6px 0 4px; text-align: center; }
.page-sub { text-align: center; color: var(--ink-soft); font-size: 1.15rem; margin: 0 0 18px; }
.row { display: flex; gap: 12px; align-items: center; }
.center { text-align: center; }

.loading { display: flex; gap: 12px; justify-content: center; padding: 30vh 0; }
.loading-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--purple); animation: hop .9s infinite ease-in-out; }
.loading-dot:nth-child(2) { animation-delay: .15s; background: var(--coral); }
.loading-dot:nth-child(3) { animation-delay: .3s; background: var(--blue); }
@keyframes hop { 50% { transform: translateY(-18px); } }

/* ---------- Buttons ---------- */
.btn {
  --b: var(--accent); --bd: var(--accent-dark);
  border: 0; border-radius: 999px; padding: 16px 30px; min-height: 64px;
  font-size: 1.35rem; font-weight: 700; color: #fff; background: var(--b);
  box-shadow: 0 6px 0 var(--bd); display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .1s, box-shadow .1s;
}
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--bd); }
.btn.green { --b: var(--green); --bd: var(--green-dark); }
.btn.coral { --b: var(--coral); --bd: var(--coral-dark); }
.btn.blue { --b: var(--blue); --bd: var(--blue-dark); }
.btn.sun { --b: var(--sun); --bd: var(--sun-dark); color: var(--ink); }
.btn.white { --b: #fff; --bd: #d5dbe8; color: var(--ink); }
.btn.big { font-size: 1.7rem; padding: 20px 44px; min-height: 80px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 22px; }

.back-btn { margin-bottom: 4px; }

/* ---------- Splash ---------- */
.splash { min-height: 78vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; }
.splash .mascot-big { width: min(240px, 55vw); }
.logo-title { font-size: clamp(2rem, 7vw, 3.4rem); font-weight: 700; line-height: 1.05; margin: 8px 0 0; }
.logo-title .name { color: var(--coral); }
.logo-title .rest { display: block; color: var(--purple); }
.logo-title span.l { display: inline-block; animation: wave 2.4s ease-in-out infinite; }
@keyframes wave { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-8px); } }
.motto { letter-spacing: .12em; font-weight: 600; color: var(--ink-soft); font-size: .95rem; margin: 4px 0 18px; }

/* ---------- Home ---------- */
.hero { display: flex; align-items: center; gap: 14px; justify-content: center; margin: 4px 0 18px; text-align: left; }
.hero .mascot-big { width: 120px; flex: 0 0 auto; }
.hero h1 { margin: 0; font-size: clamp(1.5rem, 4.6vw, 2.3rem); line-height: 1.15; }
.hero h1 .name { color: var(--coral); }
.hero p { margin: 4px 0 0; color: var(--ink-soft); font-size: 1.1rem; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.cat-card {
  --c: var(--coral); border: 0; text-align: left; position: relative; overflow: hidden;
  border-radius: 32px; padding: 24px; min-height: 230px; color: #fff;
  background: var(--c); box-shadow: 0 8px 0 rgba(0, 0, 0, .12), 0 16px 30px rgba(45, 58, 90, .15);
  display: flex; flex-direction: column; gap: 8px; transition: transform .15s;
}
.cat-card:active { transform: translateY(5px) scale(.99); }
.cat-card .cat-icon {
  position: absolute; right: -10px; top: -14px; font-size: 7.5rem; opacity: .95; transform: rotate(10deg);
  font-family: var(--font-glyph); font-weight: 700; letter-spacing: -0.05em; color: rgba(255, 255, 255, .28);
}
.cat-card h2 { margin: 0; font-size: 2rem; text-shadow: 0 2px 0 rgba(0, 0, 0, .12); position: relative; }
.cat-card .tagline { font-size: 1.2rem; opacity: .95; position: relative; }
.cat-card .cat-meta { margin-top: auto; position: relative; display: flex; flex-direction: column; gap: 10px; }
.cat-card .go { align-self: flex-start; background: #fff; color: var(--ink); border-radius: 999px; padding: 10px 22px; font-weight: 700; font-size: 1.2rem; }

.progress { height: 18px; border-radius: 999px; background: rgba(255, 255, 255, .45); overflow: hidden; position: relative; }
.progress.dark { background: #e6eaf3; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--sun); width: 0; transition: width .8s cubic-bezier(.2, .9, .3, 1.2); }
.progress.dark > span { background: var(--green); }
.progress-label { font-weight: 600; font-size: 1.05rem; display: flex; justify-content: space-between; }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 20px; }
.quick {
  border: 0; border-radius: 24px; background: var(--paper); padding: 16px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px; font-size: 1.25rem; font-weight: 600; min-height: 76px;
}
.quick .q-icon { font-size: 2.2rem; }
.quick:active { transform: translateY(4px); }

/* ---------- Category dashboard ---------- */
.cat-header { border-radius: 30px; padding: 18px 22px; color: #fff; background: var(--accent); box-shadow: var(--shadow); margin-bottom: 20px; }
.cat-header h1 { margin: 0 0 8px; font-size: clamp(1.6rem, 5vw, 2.3rem); }
.level-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.level-card {
  border: 0; border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow);
  padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  position: relative; transition: transform .15s; min-height: 210px;
}
.level-card:active { transform: translateY(4px); }
.level-card .lvl-num {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 2rem; font-weight: 700; box-shadow: 0 4px 0 var(--accent-dark);
}
.level-card .lvl-range { font-family: var(--font-glyph); font-weight: 700; font-size: 1.9rem; }
.level-card .progress { width: 100%; }
.level-card.locked { background: #eef1f6; color: var(--grey-dark); box-shadow: 0 6px 0 rgba(45, 58, 90, .08); }
.level-card.locked .lvl-num { background: var(--grey); box-shadow: 0 4px 0 var(--grey-dark); }
.level-card .lock { position: absolute; top: 10px; right: 12px; font-size: 1.6rem; }
.level-card .done-badge { position: absolute; top: 10px; right: 12px; font-size: 1.6rem; }
.level-card.current { outline: 5px solid var(--sun); animation: glow 2s infinite; }
@keyframes glow { 50% { outline-color: rgba(255, 201, 60, .35); } }

.rating { display: inline-flex; gap: 2px; font-size: 1.6rem; line-height: 1; }
.rating .s { filter: grayscale(1); opacity: .3; }
.rating .s.on { filter: none; opacity: 1; }
.rating.big { font-size: 3.6rem; gap: 6px; }
.rating.big .s.on { animation: star-pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.rating.big .s:nth-child(2) { animation-delay: .25s; }
.rating.big .s:nth-child(3) { animation-delay: .5s; }
@keyframes star-pop { from { transform: scale(0) rotate(-90deg); } }

/* ---------- Level page / activity tiles ---------- */
.act-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.act-tile {
  border: 0; border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow);
  padding: 16px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  position: relative; min-height: 150px; justify-content: center; transition: transform .15s;
}
.act-tile:active { transform: translateY(4px); }
.act-tile .a-icon { font-size: 3rem; line-height: 1; }
.act-tile .a-name { font-size: 1.2rem; font-weight: 600; }
.act-tile .tick { position: absolute; top: 8px; right: 10px; background: var(--green); color: #fff; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; font-weight: 700; }
.act-tile.quiz-tile {
  grid-column: 1 / -1; flex-direction: row; gap: 16px; min-height: 110px;
  background: linear-gradient(135deg, #ffd65a, var(--orange)); color: var(--ink);
}
.act-tile.quiz-tile .a-icon { font-size: 3.6rem; }
.act-tile.quiz-tile .a-name { font-size: 1.6rem; }
.act-tile.quiz-tile .a-desc { font-size: 1.05rem; opacity: .85; }
.act-tile.quiz-tile .q-text { text-align: left; }
.level-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.level-head .lvl-badge { background: var(--accent); color: #fff; border-radius: 22px; padding: 10px 18px; font-weight: 700; font-size: 1.3rem; box-shadow: 0 4px 0 var(--accent-dark); }
.level-head .lvl-range { font-family: var(--font-glyph); font-weight: 700; font-size: 2.2rem; }

/* ---------- Game screen ---------- */
.game { max-width: 760px; margin: 0 auto; }
.game-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.game-top .game-name { font-weight: 700; font-size: 1.25rem; flex: 1; text-align: center; }
.dots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.dot { width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 3px #dfe4ef; transition: background .3s; }
.dot.now { box-shadow: inset 0 0 0 3px var(--accent); transform: scale(1.25); }
.dot.ok { background: var(--green); box-shadow: none; }
.dot.retry { background: var(--sun); box-shadow: none; }
.dot.miss { background: var(--coral); box-shadow: none; }

.q-card { background: var(--paper); border-radius: 32px; box-shadow: var(--shadow); padding: 20px 18px 22px; text-align: center; }
.q-prompt { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: clamp(1.35rem, 4.2vw, 1.9rem); font-weight: 600; margin-bottom: 12px; }
.speak-btn {
  border: 0; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 1.6rem;
  box-shadow: 0 4px 0 var(--accent-dark); flex: 0 0 auto; display: grid; place-items: center;
}
.speak-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-dark); }
.speak-btn.huge { width: 130px; height: 130px; font-size: 4rem; margin: 6px auto 10px; animation: pulse 2s infinite; }
.speak-btn.playing { animation: pulse .6s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }

.q-visual { min-height: 120px; display: grid; place-items: center; margin: 4px 0 16px; }
.big-glyph { font-family: var(--font-glyph); font-weight: 700; font-size: clamp(6rem, 26vw, 10rem); line-height: 1; color: var(--accent); text-shadow: 0 6px 0 rgba(45, 58, 90, .1); }
.picture { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.picture .emoji { font-size: clamp(5rem, 22vw, 8rem); line-height: 1.1; animation: bob 3s ease-in-out infinite; }
.picture .word { font-family: var(--font-glyph); font-size: 2.2rem; font-weight: 700; letter-spacing: .03em; }
.picture .word .blank { display: inline-block; min-width: .8em; border-bottom: 5px solid var(--accent); color: transparent; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-3deg); } }

.count-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 520px; }
.count-item { border: 0; background: none; font-size: clamp(2.2rem, 8vw, 3.2rem); line-height: 1; padding: 4px; border-radius: 16px; position: relative; transition: transform .15s; }
.count-item.counted { background: #e9fbe9; transform: scale(.92); }
.count-item.counted::after {
  content: attr(data-n); position: absolute; top: -4px; right: -4px; background: var(--green); color: #fff;
  font-size: .9rem; font-family: var(--font-ui); font-weight: 700; border-radius: 999px; min-width: 24px; height: 24px; display: grid; place-items: center; padding: 0 4px;
}
.count-grid.many .count-item { font-size: clamp(1.7rem, 6vw, 2.4rem); }
.tens { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: flex-end; max-width: 620px; }
.ten-bar { display: flex; flex-direction: column-reverse; gap: 2px; padding: 4px; border-radius: 10px; background: #e7f6fd; border: 0; }
.ten-bar .cube, .ones .cube { width: 20px; height: 15px; border-radius: 4px; background: var(--blue); box-shadow: inset 0 -3px 0 var(--blue-dark); }
.ones { display: flex; flex-wrap: wrap; gap: 3px; width: 46px; padding: 4px; }
.ones .cube { background: var(--orange); box-shadow: inset 0 -3px 0 #e07f22; }
.tens-hint { width: 100%; text-align: center; color: var(--ink-soft); font-size: 1rem; margin-top: 4px; }

.sequence { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.seq-tile {
  min-width: 74px; height: 88px; padding: 0 10px; border-radius: 20px; background: #f1f4fb; display: grid; place-items: center;
  font-family: var(--font-glyph); font-weight: 700; font-size: 2.8rem; color: var(--ink);
}
.seq-tile.gap { background: #fff; border: 4px dashed var(--accent); color: var(--accent); animation: pulse 1.6s infinite; }

.options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 6px; }
.option {
  border: 0; border-radius: 26px; background: #f4f6fc; min-height: 116px; padding: 10px;
  font-family: var(--font-glyph); font-weight: 700; font-size: clamp(3rem, 12vw, 4.4rem); line-height: 1;
  box-shadow: 0 6px 0 #dce2ee; transition: transform .12s, background .2s, box-shadow .12s;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.option:nth-child(4n+1) { color: var(--coral-dark); }
.option:nth-child(4n+2) { color: var(--blue-dark); }
.option:nth-child(4n+3) { color: var(--purple-dark); }
.option:nth-child(4n+4) { color: #e07f22; }
.option:active { transform: translateY(4px); box-shadow: 0 2px 0 #dce2ee; }
.option .opt-emoji { font-size: clamp(2.8rem, 10vw, 3.8rem); }
.option .opt-word { font-family: var(--font-ui); font-size: 1.1rem; font-weight: 600; color: var(--ink); }
.option.correct { background: var(--green); color: #fff !important; box-shadow: 0 6px 0 var(--green-dark); animation: yay .5s; }
.option.correct .opt-word { color: #fff; }
.option.wrong { background: #ffe3e6; opacity: .5; animation: shake .45s; }
.option.reveal { box-shadow: 0 0 0 6px var(--green), 0 6px 0 #dce2ee; animation: pulse .8s infinite; }
@keyframes yay { 40% { transform: scale(1.1) rotate(-3deg); } 70% { transform: scale(.97); } }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.shake { animation: shake .45s; }

/* Meet & learn cards */
.meet-card { background: var(--paper); border-radius: 36px; box-shadow: var(--shadow); padding: 22px; text-align: center; border: 0; width: 100%; display: block; }
.meet-card .glyphs { font-family: var(--font-glyph); font-weight: 700; font-size: clamp(6rem, 28vw, 11rem); line-height: 1; color: var(--accent); }
.meet-card .glyphs .lower { color: var(--orange); margin-left: .15em; }
.meet-card .m-emoji { font-size: clamp(4rem, 16vw, 6rem); margin: 6px 0; animation: bob 3s ease-in-out infinite; }
.meet-card .m-word { font-size: 2rem; font-weight: 700; }
.meet-card .m-word b { color: var(--coral); }
.meet-card .count-grid { margin: 10px auto; }
.meet-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 12px; }
.meet-nav .counter { font-weight: 700; font-size: 1.2rem; color: var(--ink-soft); }
.meet-card.flip { animation: flip-in .4s ease; }
@keyframes flip-in { from { transform: rotateY(70deg) scale(.9); opacity: 0; } }

/* Sequencing */
.seq-slots { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 6px 0 22px; }
.seq-slot { width: 84px; height: 96px; border-radius: 22px; border: 4px dashed var(--grey); display: grid; place-items: center; font-family: var(--font-glyph); font-weight: 700; font-size: 2.8rem; background: #fafbff; }
.seq-slot.filled { border: 0; background: var(--green); color: #fff; animation: yay .45s; }
.seq-slot.next { border-color: var(--accent); }
.seq-pool { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.seq-pool .option { min-width: 96px; min-height: 96px; font-size: 2.8rem; }
.seq-pool .option.used { visibility: hidden; }
.seq-pool .option.hint { box-shadow: 0 0 0 6px var(--sun), 0 6px 0 #dce2ee; animation: pulse .8s infinite; }

/* ---------- Tracing ---------- */
.trace-wrap { position: relative; width: 100%; max-width: 520px; margin: 0 auto; aspect-ratio: 1 / 1; border-radius: 30px; background: #fffdf6; box-shadow: var(--shadow); overflow: hidden; touch-action: none; }
.trace-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.trace-wrap .draw-layer { cursor: crosshair; touch-action: none; }
.trace-tools { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.trace-tools .btn { font-size: 1.15rem; padding: 12px 20px; min-height: 58px; }
.color-swatches { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.swatch.on { transform: scale(1.2); border-color: var(--ink); }
.picker-tabs { display: flex; gap: 10px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.picker-tabs .btn { min-height: 54px; padding: 10px 22px; font-size: 1.2rem; }
.picker-tabs .btn:not(.on) { --b: #fff; --bd: #d5dbe8; color: var(--ink); }
.picker-strip { display: flex; gap: 8px; overflow-x: auto; padding: 6px 4px 14px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.picker-strip button { flex: 0 0 auto; scroll-snap-align: center; min-width: 58px; height: 58px; border-radius: 18px; border: 0; background: #fff; font-family: var(--font-glyph); font-weight: 700; font-size: 1.7rem; box-shadow: 0 4px 0 #dce2ee; padding: 0 8px; }
.picker-strip button.on { background: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent-dark); }

/* ---------- Results ---------- */
.result { background: var(--paper); border-radius: 36px; box-shadow: var(--shadow); padding: 26px 20px; text-align: center; max-width: 620px; margin: 10px auto; position: relative; overflow: hidden; }
.result h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); margin: 6px 0; }
.result .r-emoji { font-size: 4.5rem; animation: bob 2.5s ease-in-out infinite; }
.result .r-msg { font-size: 1.3rem; color: var(--ink-soft); margin: 4px 0 14px; }
.stat-row { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 16px 0 6px; }
.stat { background: #f4f6fc; border-radius: 22px; padding: 12px 18px; min-width: 120px; }
.stat b { display: block; font-size: 2rem; }
.stat span { color: var(--ink-soft); font-size: 1rem; }
.stat.gold { background: #fff4d1; }
.result .new-badges { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

/* ---------- Badges ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.badge { background: var(--paper); border-radius: 26px; box-shadow: var(--shadow); padding: 18px 12px; text-align: center; }
.badge .b-icon { font-size: 3.4rem; width: 86px; height: 86px; border-radius: 50%; margin: 0 auto 8px; display: grid; place-items: center; background: radial-gradient(circle, #fff6cf, #ffd65a); box-shadow: 0 4px 0 var(--sun-dark); }
.badge .b-name { font-weight: 700; font-size: 1.15rem; }
.badge .b-desc { color: var(--ink-soft); font-size: .95rem; margin-top: 4px; }
.badge.locked .b-icon { background: #e9edf4; box-shadow: 0 4px 0 var(--grey); filter: grayscale(1); opacity: .5; }
.badge.locked .b-name { color: var(--grey-dark); }

/* ---------- Grown-ups ---------- */
.panel { background: var(--paper); border-radius: 26px; box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.panel h2 { margin: 0 0 12px; font-size: 1.4rem; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf0f6; font-size: 1.15rem; }
.setting:last-child { border-bottom: 0; }
.toggle { width: 72px; height: 40px; border-radius: 999px; border: 0; background: var(--grey); position: relative; transition: background .2s; flex: 0 0 auto; }
.toggle::after { content: ""; position: absolute; top: 4px; left: 4px; width: 32px; height: 32px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); }
.toggle[aria-checked="true"] { background: var(--green); }
.toggle[aria-checked="true"]::after { transform: translateX(32px); }
.report-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.report-table th, .report-table td { padding: 8px 6px; border-bottom: 1px solid #edf0f6; text-align: left; }
.report-table th { color: var(--ink-soft); font-weight: 600; }
.small-note { color: var(--ink-soft); font-size: .95rem; }
.hold-btn { position: relative; overflow: hidden; }
.hold-btn .fill { position: absolute; inset: 0; background: rgba(0, 0, 0, .18); transform-origin: left; transform: scaleX(0); }

/* ---------- Mascot ---------- */
.mascot-dock {
  position: fixed; left: max(10px, env(safe-area-inset-left)); bottom: calc(8px + var(--safe-bottom)); z-index: 30;
  display: flex; align-items: flex-end; gap: 6px; pointer-events: none; max-width: calc(100vw - 20px);
}
.mascot-dock .mascot-svg { width: 104px; height: auto; pointer-events: auto; cursor: pointer; flex: 0 0 auto; }
.bubble {
  background: #fff; border-radius: 24px; padding: 12px 18px; font-size: 1.2rem; font-weight: 600; box-shadow: var(--shadow);
  margin-bottom: 64px; position: relative; max-width: min(420px, calc(100vw - 140px)); opacity: 0; transform: scale(.7) translateY(10px);
  transform-origin: bottom left; transition: opacity .2s, transform .25s cubic-bezier(.2, 1.5, .4, 1);
}
.bubble::before { content: ""; position: absolute; left: -10px; bottom: 16px; border: 12px solid transparent; border-right-color: #fff; border-left: 0; }
.bubble.show { opacity: 1; transform: none; }

.mascot-svg .owl { transform-origin: 50% 90%; animation: idle 3.2s ease-in-out infinite; }
.mascot-svg .lid { transform-box: fill-box; transform-origin: center top; transform: scaleY(0); animation: blink 4.5s infinite; }
.mascot-svg .wing-l { transform-box: fill-box; transform-origin: 80% 20%; }
.mascot-svg .wing-r { transform-box: fill-box; transform-origin: 20% 20%; }
.mascot-svg .beak-low { transform-box: fill-box; transform-origin: top center; }
.mascot-svg.talk .beak-low { animation: chatter .25s infinite; }
.mascot-svg.happy .owl { animation: jump .6s ease 2; }
.mascot-svg.happy .wing-l { animation: flap-l .3s ease 4; }
.mascot-svg.happy .wing-r { animation: flap-r .3s ease 4; }
.mascot-svg.cheer .owl { animation: jump .5s ease 4; }
.mascot-svg.cheer .wing-l { animation: flap-l .25s ease 8; }
.mascot-svg.cheer .wing-r { animation: flap-r .25s ease 8; }
.mascot-svg.think .owl { animation: tilt 1.4s ease-in-out 2; }
@keyframes idle { 50% { transform: translateY(-4px); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(0); } 95% { transform: scaleY(1); } }
@keyframes chatter { 50% { transform: scaleY(.4); } }
@keyframes jump { 40% { transform: translateY(-22px) scale(1.04); } 70% { transform: translateY(0) scale(1, .95); } }
@keyframes flap-l { 50% { transform: rotate(35deg); } }
@keyframes flap-r { 50% { transform: rotate(-35deg); } }
@keyframes tilt { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }

/* ---------- Overlays: popups, confetti, flying stars ---------- */
.overlay-layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.modal-back { position: fixed; inset: 0; background: rgba(45, 58, 90, .45); display: grid; place-items: center; pointer-events: auto; animation: fade .25s; padding: 16px; z-index: 60; }
.modal { background: #fff; border-radius: 36px; padding: 26px 22px; text-align: center; max-width: 420px; width: 100%; box-shadow: var(--shadow); animation: pop-in .45s cubic-bezier(.2, 1.5, .4, 1); }
.modal .b-icon { font-size: 5rem; width: 140px; height: 140px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, #fff6cf, #ffd65a); box-shadow: 0 6px 0 var(--sun-dark); animation: spin-in .8s ease; }
.modal h2 { margin: 6px 0; font-size: 1.9rem; }
.modal p { font-size: 1.2rem; color: var(--ink-soft); margin: 4px 0 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop-in { from { transform: scale(.6); opacity: 0; } }
@keyframes spin-in { from { transform: rotate(-200deg) scale(.3); } }

.confetti { position: fixed; top: -20px; width: 12px; height: 18px; border-radius: 3px; pointer-events: none; z-index: 70; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--rot)); } }
.fly-star { position: fixed; font-size: 2.4rem; z-index: 80; pointer-events: none; transition: transform .8s cubic-bezier(.5, -0.3, .7, 1), opacity .8s; }
.burst { position: fixed; pointer-events: none; z-index: 75; font-size: 1.6rem; animation: burst .7s ease-out forwards; }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) scale(.4); opacity: 0; } }

.error-box { text-align: center; padding: 40px 16px; }
.error-box .e-emoji { font-size: 4rem; }
.error-box p { font-size: 1.3rem; }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .app { padding-left: 12px; padding-right: 12px; }
  .topbar { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .icon-btn { width: 46px; height: 46px; font-size: 22px; border-radius: 15px; }
  .icon-btn.small { width: 40px; height: 40px; }
  .stars-pill { font-size: 1.25rem; }
  .mascot-dock .mascot-svg { width: 82px; }
  .bubble { font-size: 1.05rem; margin-bottom: 50px; }
  .cat-card { min-height: 200px; }
  .options { gap: 10px; }
  .option { min-height: 100px; }
  .hero .mascot-big { width: 90px; }
  .seq-slot { width: 64px; height: 76px; font-size: 2.2rem; }
  .seq-pool .option { min-width: 78px; min-height: 80px; font-size: 2.3rem; }
  .level-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .level-card { min-height: 190px; padding: 14px 8px; }
  .level-card .lvl-range { font-size: 1.5rem; }
  .act-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (min-width: 900px) {
  .options.four { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
