:root {
  --v26-ink: #173228;
  --v26-forest: #285746;
  --v26-moss: #74977d;
  --v26-paper: #f7f8f3;
  --v26-soft: #e8eee8;
  --v26-coral: #d56d5b;
  --v26-gold: #c9983f;
}

.support-link,
.hungry-notes-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 10px;
  color: var(--v26-ink);
  text-decoration: none;
  background: var(--v26-soft);
  border: 0;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 850;
  white-space: nowrap;
}

.support-link svg,
.hungry-notes-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.hungry-notes-link {
  color: #f8faf6;
  background: var(--v26-forest);
}

.difficulty-pill,
.refill-shortcut,
.level-up-offer {
  display: none !important;
}

.level-row {
  grid-template-columns: auto minmax(80px, 1fr) auto auto;
}

.question-heading-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 10px;
  align-items: stretch;
}

.question-heading-row h1 {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 58px;
  margin: 0;
}

.question-heading-row .round-timer {
  position: static;
  align-self: stretch;
  min-width: 0;
  width: auto;
  height: auto;
  aspect-ratio: 1;
  margin: 0;
}

.result-actions {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.result-actions > button {
  min-width: 0;
  min-height: 48px;
}

.wechat-manual-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 13px;
  color: var(--v26-ink);
  background: #dde9df;
  border-radius: 6px;
}

.pack.is-annual {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 82px;
  color: #f7faf7;
  background: #173d31;
}

.pack.is-annual strong,
.pack.is-annual span,
.pack.is-annual small {
  color: inherit;
}

.pack.is-annual em {
  color: #173d31;
  background: #dce8df;
}

.wallet.has-annual-pass #leafCount {
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}

.wechat-manual-panel > div {
  display: grid;
  gap: 3px;
}

.wechat-manual-panel strong {
  font-size: .78rem;
}

.wechat-manual-panel span {
  color: #53675c;
  font-size: .65rem;
  line-height: 1.4;
}

.wechat-manual-panel button {
  display: grid;
  gap: 2px;
  min-height: 44px;
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  color: #f8faf6;
  background: var(--v26-forest);
  cursor: pointer;
}

.wechat-manual-panel button span {
  color: #c8dbce;
  font-size: .56rem;
}

.wechat-manual-panel button b {
  font-size: .72rem;
}

.leaderboard li.is-podium,
.summary-league li.is-podium {
  position: relative;
  overflow: visible;
  background: #edf3ec;
  box-shadow: inset 3px 0 0 var(--podium-color, #8ea895), 0 7px 18px rgba(26, 63, 49, .09);
}

.leaderboard li.rank-1,
.summary-league li.rank-1 { --podium-color: #c79a45; }
.leaderboard li.rank-2,
.summary-league li.rank-2 { --podium-color: #8da39a; }
.leaderboard li.rank-3,
.summary-league li.rank-3 { --podium-color: #b97958; }

.podium-crown {
  display: inline-block;
  width: 13px;
  height: 10px;
  margin-left: 5px;
  background: var(--podium-color, #c79a45);
  clip-path: polygon(0 100%, 0 22%, 28% 55%, 50% 0, 72% 55%, 100% 22%, 100% 100%);
  filter: drop-shadow(0 0 5px rgba(202, 158, 78, .52));
  animation: podium-glint 2.6s ease-in-out infinite;
}

.league-time {
  display: block;
  margin-top: 3px;
  color: #708177;
  font-size: .55rem;
  font-weight: 750;
}

@keyframes podium-glint {
  50% { opacity: .58; transform: translateY(-1px); }
}

.mascot-bubble.is-correct,
.mascot-bubble.is-wrong {
  animation: v26-bubble-in 420ms cubic-bezier(.2,.9,.3,1.18);
}

.mascot-bubble.is-correct {
  background: #e8f1e8;
  box-shadow: inset 4px 0 0 #4c8a64;
}

.mascot-bubble.is-wrong {
  background: #f7e9e5;
  box-shadow: inset 4px 0 0 var(--v26-coral);
}

@keyframes v26-bubble-in {
  0% { opacity: .35; transform: translateY(8px) scale(.98); }
  60% { transform: translateY(-2px) scale(1.01); }
  100% { opacity: 1; transform: none; }
}

@media (max-width: 720px) {
  body:not(.needs-entry) .app-shell {
    min-height: 100dvh;
  }

  body:not(.needs-entry) .topbar {
    gap: 5px;
    padding: max(6px, env(safe-area-inset-top)) 8px 6px;
  }

  body:not(.needs-entry) .brand {
    min-width: 34px;
  }

  body:not(.needs-entry) .brand > span {
    display: none;
  }

  body:not(.needs-entry) .brand-mark {
    width: 32px;
    height: 32px;
  }

  body:not(.needs-entry) .track-switch {
    gap: 3px;
  }

  body:not(.needs-entry) .track-button {
    min-width: 44px;
    height: 36px;
    padding: 3px 6px;
  }

  body:not(.needs-entry) .track-button > span {
    font-size: .76rem;
    line-height: 1;
  }

  body:not(.needs-entry) .track-button small {
    font-size: .53rem;
  }

  body:not(.needs-entry) .topbar-tools {
    gap: 4px;
    min-width: 0;
  }

  body:not(.needs-entry) .support-link {
    width: 32px;
    min-height: 32px;
    padding: 0;
  }

  body:not(.needs-entry) .support-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  body:not(.needs-entry) .hungry-notes-link {
    min-height: 32px;
    padding: 5px 7px;
    font-size: .58rem;
  }

  body:not(.needs-entry) .hungry-notes-link svg {
    width: 15px;
    height: 15px;
  }

  body:not(.needs-entry) .wallet {
    min-height: 34px;
    padding: 4px 5px;
    gap: 3px;
  }

  body:not(.needs-entry) .wallet small,
  body:not(.needs-entry) .wallet-help {
    display: none;
  }

  body:not(.needs-entry) .wallet-redeem {
    font-size: .54rem;
    padding: 3px 4px;
  }

  body.refill-open .pack.is-annual {
    grid-column: 1 / -1;
    min-height: 62px;
  }

  body:not(.needs-entry) .game-layout {
    min-height: calc(100dvh - 50px);
  }

  body:not(.needs-entry) .stage {
    display: grid;
    grid-template-rows: auto 104px minmax(0, 1fr);
    min-height: calc(100dvh - 50px);
    padding: 6px 8px 8px;
    gap: 5px;
  }

  body:not(.needs-entry) .level-row {
    grid-template-columns: auto minmax(56px, 1fr) auto auto;
    gap: 6px;
    margin: 0;
  }

  body:not(.needs-entry) .level-pill {
    max-width: 86px;
    padding: 4px 7px;
    overflow: hidden;
    font-size: .6rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.needs-entry) .progress-shell {
    min-width: 0;
  }

  body:not(.needs-entry) .mascot-scene {
    grid-template-columns: 100px minmax(0, 1fr);
    min-height: 104px;
    height: 104px;
    gap: 7px;
    overflow: visible;
  }

  body:not(.needs-entry) .mascot-card {
    width: 100px;
    height: 104px;
    min-height: 0;
  }

  body:not(.needs-entry) .sloth {
    width: 105px;
    height: 105px;
    transform-origin: center bottom;
  }

  body:not(.needs-entry) .family-roost {
    transform: scale(.74);
    transform-origin: left bottom;
  }

  body:not(.needs-entry) .mascot-bubble {
    align-self: stretch;
    min-width: 0;
    min-height: 0;
    height: 104px;
    padding: 9px 58px 8px 10px;
    gap: 3px;
    overflow: hidden;
  }

  body:not(.needs-entry) .mascot-bubble strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: .76rem;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body:not(.needs-entry) .mascot-bubble > span:last-child {
    display: -webkit-box;
    overflow: hidden;
    font-size: .6rem;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  body:not(.needs-entry) .treehouse-card {
    top: 4px;
    right: 3px;
    left: auto;
    width: 52px;
    min-width: 52px;
    padding: 4px;
    transform: none;
  }

  body:not(.needs-entry) .treehouse-art {
    width: 34px;
    height: 27px;
  }

  body:not(.needs-entry) .treehouse-copy > span,
  body:not(.needs-entry) .treehouse-upgrade,
  body:not(.needs-entry) .treehouse-tip {
    display: none;
  }

  body:not(.needs-entry) .treehouse-copy small {
    display: block;
    font-size: .52rem;
    text-align: center;
  }

  body:not(.needs-entry) .challenge {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 9px;
    gap: 6px;
    overflow-y: auto;
    border: 0;
  }

  body:not(.needs-entry) .challenge-meta {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(82px, auto);
    gap: 6px;
    min-height: 28px;
    margin: 0;
  }

  body:not(.needs-entry) #costLabel {
    justify-self: start;
  }

  body:not(.needs-entry) .previous-button,
  body:not(.needs-entry) .pass-button {
    grid-column: auto;
    min-width: 82px;
    min-height: 28px;
    padding: 5px 8px;
    font-size: .62rem;
  }

  body:not(.needs-entry) .challenge-meta .previous-button:not([hidden]) + .pass-button:not([hidden]) {
    grid-column: 3;
  }

  body:not(.needs-entry) .question-heading-row {
    grid-template-columns: minmax(0, 1fr) 52px;
    gap: 7px;
    min-height: 52px;
  }

  body:not(.needs-entry) .question-heading-row h1 {
    min-height: 52px;
    padding: 0 2px;
    font-size: clamp(.94rem, 4vw, 1.08rem);
    line-height: 1.28;
  }

  body:not(.needs-entry) .question-heading-row .round-timer {
    width: 52px;
    height: 52px;
  }

  body:not(.needs-entry) .round-timer strong {
    font-size: 1.04rem;
  }

  body:not(.needs-entry) .choice-grid {
    grid-template-columns: 1fr;
    gap: 6px;
    min-height: 0;
  }

  body:not(.needs-entry) .choice {
    width: 100%;
    min-height: 54px;
    height: auto;
    padding: 8px 40px 8px 10px;
    border: 0;
  }

  body:not(.needs-entry) .choice-copy {
    min-width: 0;
  }

  body:not(.needs-entry) .choice strong {
    font-size: .88rem;
  }

  body:not(.needs-entry) .choice-example {
    margin-top: 4px;
    font-size: .66rem;
    line-height: 1.3;
  }

  body:not(.needs-entry) .feedback {
    min-height: 24px;
    margin: 0;
    font-size: .72rem;
    line-height: 1.35;
  }

  body:not(.needs-entry) .result-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
    margin: 0;
  }

  body:not(.needs-entry) .result-actions > button {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 7px 8px;
    font-size: .67rem;
  }

  body:not(.needs-entry) .hungry-save-button span:last-child,
  body:not(.needs-entry) .continue-button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.needs-entry) .hungry-save-icon {
    width: 20px;
    height: 20px;
  }

  body:not(.needs-entry) .explanation-panel {
    margin: 0;
    padding: 8px 9px;
    gap: 4px;
    border: 0;
  }

  body:not(.needs-entry) .explanation-preview,
  body:not(.needs-entry) .explanation-detail-wrap p {
    margin: 0;
    font-size: .68rem;
    line-height: 1.35;
  }

  body:not(.needs-entry) .explanation-lock button {
    min-height: 36px;
    font-size: .68rem;
  }

  body:not(.needs-entry) .wechat-manual-panel {
    grid-template-columns: 1fr;
  }

  body:not(.needs-entry) .wechat-manual-panel button {
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 8px;
  }
}

@media (max-width: 390px) {
  body:not(.needs-entry) .hungry-notes-link span {
    max-width: 54px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body:not(.needs-entry) .mascot-scene {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  body:not(.needs-entry) .mascot-card {
    width: 92px;
  }

  body:not(.needs-entry) .sloth {
    width: 97px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mascot-bubble.is-correct,
  .mascot-bubble.is-wrong {
    animation: none;
  }

  .podium-crown {
    animation: none;
  }
}
