:root {
  --orange: #FF8A3D;
  --orange-deep: #E86F22;
  --orange-soft: #FFE2CA;
  --ink: #2D2A21;
  --ink-2: #5F594A;
  --ink-3: #938B78;
  --cream: #FFF8ED;
  --cream-2: #FFF1DE;
  --card: #FFFDF8;
  --line: #EFE1C8;
  --green: #5E9B62;
  --green-deep: #35624A;
  --green-soft: #E8F3DD;
  --pink: #FF9CAF;
  --yellow: #FFC84A;
  --red: #E76450;
  --shadow-card: 0 12px 28px rgba(97, 67, 28, .09);
  --shadow-soft: 0 6px 14px rgba(97, 67, 28, .08);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #F2EADA;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(900px 520px at 12% -8%, #FFE3C4 0%, rgba(255, 227, 196, 0) 62%),
    radial-gradient(760px 500px at 96% 18%, #E4EFD5 0%, rgba(228, 239, 213, 0) 58%),
    #F5EEE1;
  overflow-x: hidden;
}

button {
  font-family: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible { outline: 3px solid rgba(255, 138, 61, .55); outline-offset: 2px; }

h1, h2, h3, p { margin: 0; }

.app {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 10px) 16px calc(var(--safe-bottom) + 20px);
  overflow: hidden;
}

/* ---------- ambient decoration ---------- */
.bg-deco { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.deco-leaf {
  position: absolute;
  width: 150px;
  height: 74px;
  background: linear-gradient(135deg, #DCEBC6, #C7DFAE);
  opacity: .55;
  border-radius: 100% 4% 100% 4%;
}
.deco-leaf-a { top: -32px; left: -58px; transform: rotate(28deg); }
.deco-leaf-b { top: 44%; right: -76px; width: 168px; transform: rotate(-145deg); opacity: .4; }
.deco-dots {
  position: absolute;
  width: 118px;
  height: 118px;
  background-image: radial-gradient(#E7C89F 1.7px, transparent 1.8px);
  background-size: 15px 15px;
  opacity: .5;
}
.deco-dots-a { top: 30%; left: -24px; }
.deco-dots-b { bottom: 8%; right: -18px; opacity: .35; }

.garden-hill {
  position: absolute;
  bottom: -92px;
  border-radius: 50%;
  background: #DDEBC6;
  opacity: .75;
}
.garden-hill-a { left: -90px; width: 330px; height: 178px; background: #E1EECC; }
.garden-hill-b { right: -110px; width: 360px; height: 200px; background: #CFE3B4; opacity: .65; bottom: -118px; }

.screen { position: relative; z-index: 1; }
.screen[hidden] { display: none !important; }

/* ---------- game hud ---------- */
.game-screen { animation: screenIn .32s ease both; }

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.lives {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  height: 44px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.lives .mp-icon {
  width: 21px;
  height: 21px;
  color: #FF6464;
  margin-right: 1px;
  transition: transform .25s ease, opacity .25s ease;
}
.lives .mp-icon.lost { opacity: .18; transform: scale(.86); }
.lives .mp-icon.beat { animation: heartBeat .42s ease; }

.hud-actions { display: flex; gap: 8px; }

.icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-soft);
  color: var(--green-deep);
  transition: transform .12s ease, background .2s ease;
}
.icon-btn .mp-icon { width: 22px; height: 22px; }
.icon-btn:active { transform: translateY(2px) scale(.97); background: var(--cream-2); }
.icon-dot[hidden] { display: none !important; }
.icon-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  border: 2px solid var(--card);
}

.progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.progress-track {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: #EADFCB;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(86, 60, 26, .08);
}
.progress-fill {
  height: 100%;
  width: 10%;
  border-radius: inherit;
  background: linear-gradient(90deg, #FFB066, var(--orange));
  transition: width .42s cubic-bezier(.22, 1, .36, 1);
}
.progress-text {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ---------- stage card ---------- */
.stage-card {
  position: relative;
  padding: 13px 13px 12px;
  border-radius: 26px;
  background: var(--card);
  border: 2px solid #F2E5CF;
  box-shadow: var(--shadow-card);
}

.stage-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.round-pill {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  height: 27px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
}
.score-box { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.score-label { font-size: 9px; font-weight: 800; letter-spacing: .14em; color: var(--ink-3); margin-bottom: 3px; }
.score-value {
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  transition: transform .18s ease;
}
.score-value.pop { transform: scale(1.16); }

.timer { position: relative; justify-self: end; width: 42px; height: 42px; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-bg { fill: none; stroke: #EFE5D3; stroke-width: 4; }
.timer-ring {
  fill: none;
  stroke: var(--green);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 100.53;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .12s linear, stroke .25s ease;
}
.timer.warn .timer-ring { stroke: var(--orange); }
.timer.danger .timer-ring { stroke: var(--red); }
.timer.danger .timer-num { color: var(--red); }
.timer-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.plant-stage {
  --plant-soft: #EAF1D8;
  position: relative;
  height: 294px;
  border-radius: 21px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 44%, var(--plant-soft) 0%, var(--plant-soft) 36%, rgba(255, 255, 255, 0) 71%),
    linear-gradient(180deg, #FFF9EE 0%, #FBF0DC 100%);
  border: 1.5px solid rgba(116, 86, 43, .07);
  isolation: isolate;
}
.plant-stage::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -44px;
  width: 270px;
  height: 120px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--plant-soft);
  opacity: .7;
  z-index: -1;
}
.plant-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .2) 0%, rgba(255, 255, 255, 0) 34%);
}

.plant-art {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 4px 4px 0;
}
.plant-art svg {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 296px;
  overflow: visible;
}
.plant-art svg .sway {
  transform-origin: 150px 236px;
  animation: sway 5.6s ease-in-out infinite;
}
.plant-art.enter svg { animation: artIn .45s cubic-bezier(.2, .9, .28, 1.2) both; }
.plant-art.correct svg { animation: artPop .5s cubic-bezier(.2, .9, .28, 1.3); }
.plant-art.wrong svg { animation: artShake .45s ease; }

.stage-dot {
  position: absolute;
  border-radius: 50%;
  background: #FFF;
  opacity: .7;
  z-index: 0;
}
.stage-dot-a { width: 9px; height: 9px; top: 20%; left: 12%; }
.stage-dot-b { width: 6px; height: 6px; top: 33%; right: 14%; opacity: .55; }
.stage-dot-c { width: 12px; height: 12px; bottom: 24%; left: 18%; opacity: .4; }

.streak-badge {
  position: absolute;
  z-index: 4;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 30px;
  padding: 0 10px 0 7px;
  border-radius: 999px;
  color: #873E10;
  background: linear-gradient(135deg, #FFE0B0, #FFD08A);
  border: 1.5px solid #F4B96C;
  box-shadow: 0 4px 10px rgba(219, 134, 45, .2);
  font-size: 11px;
  font-weight: 900;
  animation: badgeIn .3s cubic-bezier(.2, .9, .28, 1.4) both;
}
.streak-badge[hidden] { display: none !important; }
.streak-badge .mp-icon { width: 17px; height: 17px; color: #F0742A; }

.question-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 5px 2px;
}
.eyebrow {
  margin-bottom: 3px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
  color: var(--orange-deep);
}
.question { font-size: 20px; font-weight: 900; letter-spacing: -.01em; color: var(--ink); }
.qmark {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--cream-2);
  border: 1.5px solid #F0DDBE;
  color: var(--orange-deep);
  font-size: 19px;
  font-weight: 900;
  transform: rotate(6deg);
}

/* ---------- options ---------- */
.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 9px 11px;
  border-radius: 17px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 4px 0 #E9DAC0, 0 7px 14px rgba(97, 67, 28, .05);
  text-align: left;
  transition: transform .12s ease, box-shadow .12s ease, background .18s ease, border-color .18s ease, opacity .18s ease;
  animation: optionIn .32s ease both;
}
.option:nth-child(2) { animation-delay: .035s; }
.option:nth-child(3) { animation-delay: .07s; }
.option:nth-child(4) { animation-delay: .105s; }
.option:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #E9DAC0, 0 3px 7px rgba(97, 67, 28, .05);
}
.option:disabled { cursor: default; }

.opt-key {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--cream-2);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 900;
  transition: background .18s ease, color .18s ease;
}
.opt-name {
  flex: 1;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .01em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.opt-mark { flex: 0 0 auto; width: 19px; height: 19px; opacity: 0; transform: scale(.6); transition: .18s ease; }

.option.correct {
  background: linear-gradient(180deg, #EDF8E2, #E3F2D3);
  border-color: #83B65C;
  box-shadow: 0 4px 0 #B9D79B, 0 7px 14px rgba(80, 120, 54, .1);
}
.option.correct .opt-key { background: #6DA84D; color: #fff; }
.option.correct .opt-name { color: #2F5A2A; }
.option.correct .opt-mark { opacity: 1; transform: scale(1); color: #4E8A35; }

.option.wrong {
  background: linear-gradient(180deg, #FFF0EC, #FFE3DC);
  border-color: #E88A76;
  box-shadow: 0 4px 0 #F0BCAF;
}
.option.wrong .opt-key { background: #E76450; color: #fff; }
.option.wrong .opt-name { color: #8C3326; }
.option.wrong .opt-mark { opacity: 1; transform: scale(1); color: #C74B37; }

.option.dim { opacity: .48; box-shadow: 0 4px 0 #E9DAC0; }

.option.reveal { animation: revealPulse .45s ease; }

/* ---------- feedback ---------- */
.feedback {
  margin-top: 14px;
  padding: 15px 15px 15px;
  border-radius: 22px;
  background: var(--card);
  border: 2px solid #F2E5CF;
  box-shadow: var(--shadow-card);
  animation: sheetUp .34s cubic-bezier(.2, .9, .28, 1.1) both;
}
.feedback[hidden] { display: none !important; }
.feedback.good { border-color: #D8E9C2; }
.feedback.bad { border-color: #F3D6CE; }

.feedback-top { display: flex; align-items: center; gap: 10px; }
.feedback-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--green-soft);
  color: #4E8A35;
}
.feedback.bad .feedback-icon { background: #FFE7E1; color: var(--red); }
.feedback-icon .mp-icon { width: 22px; height: 22px; }
.feedback-copy { flex: 1; min-width: 0; }
.feedback-copy h2 { font-size: 17px; font-weight: 900; letter-spacing: -.01em; }
.feedback-copy p { margin-top: 2px; font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.earned {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 10px;
  background: var(--orange-soft);
  color: #A84E14;
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.feedback.bad .earned { background: #F1E8DA; color: var(--ink-3); }
.fact {
  margin-top: 11px;
  padding: 10px 12px;
  border-radius: 13px;
  background: #FBF4E7;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.65;
  font-weight: 500;
}
.fact::before {
  content: "小知识";
  display: inline-block;
  margin-right: 7px;
  padding: 1px 6px;
  border-radius: 5px;
  background: #FFE3C2;
  color: #A84E14;
  font-size: 10px;
  font-weight: 900;
  vertical-align: 1px;
}

.primary-btn {
  width: 100%;
  min-height: 54px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 17px;
  background: linear-gradient(180deg, #FF9B54, var(--orange));
  color: #FFF9F2;
  border: 1.5px solid #ED782A;
  box-shadow: 0 5px 0 #D9671E, 0 10px 20px rgba(232, 111, 34, .24);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: .02em;
  text-shadow: 0 1px 0 rgba(139, 64, 15, .22);
  transition: transform .12s ease, box-shadow .12s ease, filter .2s ease;
}
.primary-btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #D9671E, 0 5px 10px rgba(232, 111, 34, .2);
}
.primary-btn .mp-icon { width: 21px; height: 21px; }

.game-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 15px 0 4px;
  color: #9C8F78;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  text-align: center;
}
.game-tip .mp-icon { width: 14px; height: 14px; color: #8FB277; }

/* ---------- result ---------- */
.result-screen {
  position: fixed;
  z-index: 30;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 480px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-top) + 18px) 16px calc(var(--safe-bottom) + 26px);
  background:
    radial-gradient(560px 360px at 50% 0%, #FFE6C8 0%, rgba(255, 230, 200, 0) 68%),
    radial-gradient(500px 340px at 100% 60%, #E4EFD5 0%, rgba(228, 239, 213, 0) 62%),
    #FFF8ED;
  animation: screenIn .38s ease both;
}
.result-inner { position: relative; z-index: 2; }

.result-hero { text-align: center; }
.result-art {
  width: 196px;
  height: 178px;
  margin: 0 auto 2px;
  border-radius: 46% 54% 50% 50%;
  background: radial-gradient(circle at 50% 55%, #FFF 0%, #F6EBD4 48%, rgba(246, 235, 212, 0) 72%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  animation: floaty 4.8s ease-in-out infinite;
}
.result-art svg { width: 100%; height: 100%; display: block; }
.result-kicker {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #FFE4C8;
  color: #A84E14;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
}
.result-title { margin-top: 7px; font-size: 27px; font-weight: 900; letter-spacing: -.02em; }
.result-sub { margin-top: 4px; color: var(--ink-3); font-size: 12.5px; font-weight: 600; }

.score-card {
  margin-top: 17px;
  padding: 15px 15px 13px;
  border-radius: 24px;
  background: var(--card);
  border: 2px solid #F2E5CF;
  box-shadow: var(--shadow-card);
}
.score-main { display: flex; align-items: baseline; justify-content: center; gap: 8px; flex-wrap: wrap; }
.score-main-label { font-size: 11px; font-weight: 800; color: var(--ink-3); letter-spacing: .08em; }
.score-main strong {
  font-size: 48px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.best-flag[hidden] { display: none !important; }
.best-flag {
  padding: 3px 7px;
  border-radius: 7px;
  background: #FFE1BD;
  color: #A84E14;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  transform: translateY(-10px) rotate(-3deg);
  animation: badgeIn .4s .2s cubic-bezier(.2, .9, .28, 1.4) both;
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px dashed #EADCC3;
}
.stat { text-align: center; position: relative; }
.stat + .stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 1px;
  background: #F0E4CF;
}
.stat b { display: block; font-size: 21px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 3px; font-size: 10.5px; font-weight: 700; color: var(--ink-3); }

.discoveries { margin-top: 17px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; padding: 0 3px; }
.sec-head h3 { font-size: 14px; font-weight: 900; }
.sec-head span { font-size: 10.5px; font-weight: 800; color: var(--orange-deep); }
.discovery-list { display: flex; flex-wrap: wrap; gap: 8px; }
.discovery-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 5px;
  border-radius: 999px;
  background: var(--card);
  border: 1.5px solid var(--line);
  box-shadow: 0 3px 8px rgba(97, 67, 28, .06);
  font-size: 12px;
  font-weight: 800;
  animation: optionIn .36s ease both;
}
.discovery-chip .chip-art {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--plant-soft, #EAF1D8);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.discovery-chip .chip-art svg { width: 100%; height: 100%; }
.discovery-empty {
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  border: 1.5px dashed #E3D3B8;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.again-btn { margin-top: 18px; }
.result-links { display: flex; gap: 9px; margin-top: 10px; }
.ghost-btn {
  flex: 1;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 15px;
  background: #FFFCF5;
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 #EADCC3;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 800;
  transition: transform .12s ease, box-shadow .12s ease;
}
.ghost-btn:active { transform: translateY(3px); box-shadow: 0 0 0 #EADCC3; }
.ghost-btn .mp-icon { width: 19px; height: 19px; color: var(--green-deep); }
.collection-foot { margin-top: 14px; text-align: center; font-size: 11px; font-weight: 700; color: var(--ink-3); }

/* ---------- collection ---------- */
.collection-screen {
  position: fixed;
  z-index: 34;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 480px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bottom) + 26px);
  background:
    radial-gradient(520px 300px at 10% 0%, #FFE7CA 0%, rgba(255, 231, 202, 0) 65%),
    radial-gradient(460px 300px at 100% 30%, #E5F0D6 0%, rgba(229, 240, 214, 0) 60%),
    #FFF8ED;
  animation: screenIn .3s ease both;
}
.collection-head { display: flex; align-items: center; gap: 11px; }
.collection-title { flex: 1; min-width: 0; }
.collection-title h2 { font-size: 21px; font-weight: 900; letter-spacing: -.01em; }
.collection-title p { margin-top: 2px; font-size: 11px; font-weight: 600; color: var(--ink-3); }
.progress-chip {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: #FFE4C8;
  color: #A84E14;
  font-size: 11px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.collection-bar {
  height: 7px;
  margin-top: 14px;
  border-radius: 999px;
  background: #EADFCB;
  overflow: hidden;
}
.collection-bar #collectionBar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8CBF6E, var(--green));
  transition: width .5s cubic-bezier(.22, 1, .36, 1);
}
.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 15px;
}
.collect-card {
  position: relative;
  animation: optionIn .32s ease both;
  padding: 8px 8px 9px;
  border-radius: 18px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 4px 10px rgba(97, 67, 28, .06);
  text-align: center;
  transition: transform .14s ease;
}
.collect-card:active { transform: scale(.97); }
.collect-card.locked { background: #F7F1E5; border-color: #EADFCB; box-shadow: none; }
.collect-art {
  height: 74px;
  border-radius: 13px;
  background: radial-gradient(circle at 50% 58%, var(--plant-soft, #EAF1D8) 0%, var(--plant-soft, #EAF1D8) 48%, rgba(255, 255, 255, 0) 78%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}
.collect-card.locked .collect-art { background: #EFE8DA; }
.collect-art svg { width: 100%; height: 100%; display: block; }
.collect-card.locked .collect-art svg { filter: grayscale(1) brightness(.55) opacity(.3); }
.collect-card .lock-q {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 22px;
  font-weight: 900;
  color: #C6B79D;
}
.collect-name {
  display: block;
  margin-top: 7px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.collect-card.locked .collect-name { color: #B9AC95; font-weight: 700; }
.collection-all { margin-top: 18px; text-align: center; font-size: 11px; font-weight: 600; color: var(--ink-3); }

/* ---------- detail modal / toast ---------- */
.modal {
  position: fixed;
  z-index: 46;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(45, 42, 33, .42);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fadeIn .2s ease both;
}
.modal[hidden] { display: none !important; }
.modal-card {
  position: relative;
  width: 100%;
  max-width: 330px;
  padding: 16px 18px 20px;
  border-radius: 26px;
  background: var(--card);
  box-shadow: 0 28px 60px rgba(40, 28, 12, .3);
  border: 2px solid #F4E6CF;
  text-align: center;
  animation: modalIn .3s cubic-bezier(.2, .9, .28, 1.2) both;
}
.modal-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 12px; }
.modal-close .mp-icon { width: 19px; height: 19px; }
.detail-art {
  width: 180px;
  height: 160px;
  margin: 4px auto 2px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 55%, var(--plant-soft, #EAF1D8) 0%, rgba(255, 255, 255, 0) 72%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}
.detail-art svg { width: 100%; height: 100%; }
.detail-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .1em;
}
.detail-name { margin-top: 7px; font-size: 24px; font-weight: 900; letter-spacing: -.01em; }
.detail-meaning { margin-top: 3px; font-size: 12px; font-weight: 800; color: var(--orange-deep); }
.detail-fact {
  margin-top: 11px;
  padding: 11px 12px;
  border-radius: 13px;
  background: #FBF4E7;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.65;
  text-align: left;
}

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 28px);
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(45, 42, 33, .9);
  color: #FFF9F0;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  animation: toastIn .24s ease both;
}
.toast[hidden] { display: none !important; }

/* ---------- confetti ---------- */
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.confetti i {
  position: absolute;
  top: -16px;
  width: 8px;
  height: 13px;
  border-radius: 3px;
  opacity: .9;
  animation: confettiFall var(--dur, 2.8s) linear var(--delay, 0s) infinite;
}

/* ---------- keyframes ---------- */
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes optionIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes artIn { from { opacity: 0; transform: translateY(16px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes artPop { 0% { transform: scale(1); } 40% { transform: scale(1.06) rotate(-1.5deg); } 100% { transform: scale(1); } }
@keyframes artShake { 0%, 100% { transform: translateX(0); } 22% { transform: translateX(-7px) rotate(-1deg); } 48% { transform: translateX(6px); } 72% { transform: translateX(-3px); } }
@keyframes heartBeat { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.28); } }
@keyframes sway { 0%, 100% { transform: rotate(-1.3deg); } 50% { transform: rotate(1.3deg); } }
@keyframes badgeIn { from { opacity: 0; transform: translateY(-5px) scale(.86); } to { opacity: 1; transform: none; } }
@keyframes sheetUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes revealPulse { 0%, 100% { transform: none; } 45% { transform: scale(1.03); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes confettiFall {
  0% { transform: translate3d(0, -10px, 0) rotate(0deg); opacity: 0; }
  8% { opacity: .95; }
  100% { transform: translate3d(var(--drift, 20px), 740px, 0) rotate(var(--spin, 540deg)); opacity: .85; }
}

/* ---------- small screens ---------- */
@media (max-height: 720px) {
  .plant-stage { height: 248px; }
  .plant-art svg { max-height: 250px; }
  .question { font-size: 18px; }
  .option { min-height: 54px; }
  .opt-name { font-size: 15px; }
}
@media (max-height: 660px) {
  .hud { margin-bottom: 6px; }
  .lives { height: 40px; }
  .lives .mp-icon { width: 19px; height: 19px; }
  .icon-btn { width: 40px; height: 40px; border-radius: 13px; }
  .icon-btn .mp-icon { width: 21px; height: 21px; }
  .progress-row { margin-bottom: 8px; }
  .stage-card { padding: 10px 10px 9px; border-radius: 22px; }
  .stage-head { margin-bottom: 7px; }
  .round-pill { height: 25px; }
  .score-value { font-size: 21px; }
  .timer { width: 38px; height: 38px; }
  .plant-stage { height: 205px; }
  .plant-art svg { max-height: 207px; }
  .question-row { padding: 8px 4px 1px; }
  .question { font-size: 17px; }
  .eyebrow { font-size: 9px; margin-bottom: 2px; }
  .qmark { width: 30px; height: 30px; border-radius: 10px; font-size: 17px; }
  .options { gap: 8px; margin-top: 9px; }
  .option { min-height: 51px; border-radius: 15px; }
  .opt-name { font-size: 15px; }
  .feedback { margin-top: 9px; }
  .garden-hill { display: none; }
  .game-tip { display: none; }
}
@media (max-width: 350px) {
  .app { padding-left: 12px; padding-right: 12px; }
  .opt-name { font-size: 14.5px; }
  .question { font-size: 18px; }
  .score-main strong { font-size: 42px; }
  .collect-art { height: 66px; }
}

/* mini illustrations stay still so the grid feels calm */
.collect-art svg .sway,
.chip-art svg .sway,
.detail-art svg .sway,
.result-art svg .sway { animation: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
