﻿:root {
  --ink: #31405a;
  --muted: #6f7e99;
  --cream: #fffaf1;
  --blue: #66b8ff;
  --blue-dark: #277ee9;
  --mint: #75dfad;
  --pink: #ff91c6;
  --yellow: #ffd85c;
  --orange: #ffae53;
  --purple: #a58cff;
  --shadow: 0 22px 48px rgba(55, 82, 132, 0.2);
}

/* Restored sky companion skin: state before the responsive-lock experiment. */
body.sentence-rpg-page {
  min-height: 100vh;
  overflow-x: hidden;
  color: #17345f;
  background:
    linear-gradient(180deg, rgba(236, 249, 255, 0.78), rgba(220, 241, 255, 0.88)),
    url("assets/ui/cloud-kingdom-game-bg.png") center bottom / cover fixed no-repeat,
    #dcefff;
}

body.sentence-rpg-page,
body.sentence-rpg-page * {
  text-shadow: none;
  box-sizing: border-box;
}

.sentence-rpg-page .pet-app {
  width: min(1380px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 12px 0 92px;
}

.sentence-rpg-page .topbar,
.sentence-rpg-page .quiz-card,
.sentence-rpg-page .buddy-card,
.sentence-rpg-page .picker-card {
  border: 2px solid #83aef3;
  border-radius: 16px;
  color: #17345f;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(233, 247, 255, 0.9)),
    rgba(247, 252, 255, 0.9);
  box-shadow:
    0 8px 0 rgba(76, 126, 202, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.86);
}

.sentence-rpg-page .topbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(260px, 0.52fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px 14px;
}

.sentence-rpg-page .lesson-select-top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sentence-rpg-page .lesson-select-top span,
.sentence-rpg-page .sentence-progress-bar > span,
.sentence-rpg-page .sentence-progress-bar > strong {
  min-width: 0;
  border: 2px solid #9fc4f1;
  border-radius: 10px;
  padding: 9px 12px;
  color: #17345f;
  font-size: 14px;
  font-weight: 950;
  text-align: center;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 -2px 0 rgba(68, 126, 190, 0.08);
}

.sentence-rpg-page .sentence-progress-bar {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) 58px minmax(120px, auto) minmax(112px, auto);
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
  border: 2px solid #83aef3;
  border-radius: 14px;
  padding: 7px 10px;
  background: rgba(247, 252, 255, 0.86);
  box-shadow: 0 6px 0 rgba(76, 126, 202, 0.11);
}

.sentence-rpg-page .sentence-progress-track {
  height: 16px;
  border: 2px solid #9bb5d6;
  border-radius: 999px;
  overflow: hidden;
  background: #dce9f7;
}

.sentence-rpg-page .sentence-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #ffd35a, #89ccff);
}

.sentence-rpg-page .brand {
  min-width: 0;
}

.sentence-rpg-page .brand-ball {
  border: 2px solid #fff;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(180deg, #6aa5f0, #3b78d2);
  box-shadow: none;
}

.sentence-rpg-page .brand h1 {
  color: #17345f;
  font-size: clamp(26px, 3vw, 40px);
}

.sentence-rpg-page .eyebrow {
  color: #3378d8;
  letter-spacing: 0;
}

.sentence-rpg-page .top-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.sentence-rpg-page .top-stat-chip,
.sentence-rpg-page .top-stats span {
  border: 2px solid #9fc4f1;
  border-radius: 999px;
  padding: 8px 11px;
  color: #17345f;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 -2px 0 rgba(68, 126, 190, 0.08);
}

.sentence-rpg-page .sentence-sound-button,
.sentence-rpg-page .sentence-settings summary,
.sentence-rpg-page .soft-button,
.sentence-rpg-page .primary-button {
  min-height: 40px;
  border: 2px solid #83aef3;
  border-radius: 10px;
  padding: 7px 12px;
  color: #17345f;
  font-weight: 900;
  background: linear-gradient(180deg, #fff, #e5f3ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.sentence-rpg-page .primary-button {
  color: #744608;
  border-color: #edb34e;
  background: linear-gradient(180deg, #fff5bd, #ffd35a);
}

.sentence-rpg-page .sentence-settings {
  position: relative;
}

.sentence-rpg-page .sentence-settings summary {
  display: grid;
  place-items: center;
  width: 42px;
  padding: 6px;
  list-style: none;
  cursor: pointer;
}

.sentence-rpg-page .sentence-settings summary::-webkit-details-marker {
  display: none;
}

.sentence-rpg-page .sentence-settings summary img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.sentence-rpg-page .sentence-settings-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 7px;
  min-width: 170px;
  border: 2px solid #83aef3;
  border-radius: 14px;
  padding: 10px;
  background: rgba(247, 252, 255, 0.96);
  box-shadow: 0 8px 0 rgba(76, 126, 202, 0.14);
}

.sentence-rpg-page .settings-action {
  border: 1.5px solid #9fc4f1;
  border-radius: 9px;
  padding: 7px 10px;
  color: #17345f;
  text-align: center;
  text-decoration: none;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.86);
}

.sentence-rpg-page .playground {
  display: grid;
  grid-template-columns: minmax(0, 1.78fr) minmax(320px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.sentence-rpg-page .quiz-card,
.sentence-rpg-page .buddy-card {
  padding: 14px;
}

.sentence-rpg-page .quiz-card {
  position: relative;
  overflow: hidden;
  min-height: 720px;
  background:
    linear-gradient(180deg, rgba(225, 235, 255, 0.62), rgba(226, 247, 236, 0.66)),
    url("assets/ui/sentence-sky-kingdom-stage.png") center bottom / cover no-repeat,
    #e4f5ff;
}

.sentence-rpg-page .quiz-card > * {
  position: relative;
  z-index: 1;
}

.sentence-rpg-page .sentence-deck-bar {
  border: 2px solid rgba(131, 174, 243, 0.9);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(248, 252, 255, 0.88);
}

.sentence-rpg-page .sentence-deck-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 10px;
}

.sentence-rpg-page .sentence-series-list,
.sentence-rpg-page .sentence-grade-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  vertical-align: middle;
}

.sentence-rpg-page .sentence-series-item,
.sentence-rpg-page .sentence-deck-item {
  min-height: 28px;
  border: 1.5px solid #9fc4f1;
  border-radius: 999px;
  padding: 4px 9px;
  color: #17345f;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.8);
}

.sentence-rpg-page .sentence-deck-bar {
  border: 2px solid #9fc4f1;
  border-radius: 14px;
  padding: 10px;
  background: rgba(238, 248, 255, 0.86);
}

.sentence-rpg-page .sentence-deck-head label,
.sentence-rpg-page .lesson-meta span,
.sentence-rpg-page .growth-top,
.sentence-rpg-page .food-shortcut-head {
  color: #3378d8;
  font-weight: 900;
}

.sentence-rpg-page .cn-sentence {
  width: min(840px, 98%);
  margin: 70px auto 52px;
  border: 1px solid rgba(237, 179, 78, 0.45);
  border-radius: 16px;
  padding: 16px;
  color: #17345f;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.25;
  text-align: center;
  background: rgba(255, 252, 241, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 151, 0.32),
    0 8px 22px rgba(237, 179, 78, 0.12);
}

.sentence-rpg-page .answer-slots {
  margin-bottom: 68px;
}

.sentence-rpg-page .answer-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  min-height: 58px;
  margin: 10px auto;
}

.sentence-rpg-page .answer-slot,
.sentence-rpg-page .word-chip {
  border: 2px solid #91bdf0;
  border-radius: 12px;
  color: #17345f;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 0 rgba(76, 126, 202, 0.1);
}

.sentence-rpg-page .word-bank {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 10px auto;
  padding: 8px;
  border: 0;
  background: transparent;
}

.sentence-rpg-page .word-chip {
  min-width: 88px;
  min-height: 46px;
  padding: 8px 14px;
  font-size: clamp(15px, 1.4vw, 19px);
  font-weight: 900;
  white-space: nowrap;
}

.sentence-rpg-page .action-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(82px, 1fr)) minmax(120px, 1.35fr);
  gap: 8px;
  width: min(720px, 96%);
  margin: 110px auto 0;
  border: 2px solid rgba(131, 174, 243, 0.78);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.82);
}

.sentence-rpg-page .pet-compact-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.sentence-rpg-page .pet-compact-summary h2 {
  margin: 0;
  color: #17345f;
}

.sentence-rpg-page .buddy-stage {
  position: relative;
  height: 720px;
  overflow: hidden;
  border: 2px solid #83aef3;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(20, 78, 130, 0.05)),
    url("assets/ui/sentence-sky-kingdom-stage.png") center bottom / cover no-repeat,
    #e3f6ff;
}

.sentence-rpg-page .pet-anchor {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
}

.sentence-rpg-page .buddy {
  transform: scale(0.9);
  transform-origin: bottom center;
}

.sentence-rpg-page .speech-bubble {
  position: absolute;
  right: -98px;
  bottom: 78%;
  width: 168px;
  border: 2px solid rgba(237, 179, 78, 0.7);
  border-radius: 16px;
  padding: 8px 10px;
  color: #7b4318;
  font-weight: 900;
  background: rgba(255, 253, 244, 0.94);
}

.sentence-rpg-page .growth-card {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  border: 2px solid #9fc4f1;
  border-radius: 16px;
  padding: 10px;
  background: rgba(247, 252, 255, 0.84);
}

.sentence-rpg-page .growth-track {
  height: 14px;
  border: 2px solid #9bb5d6;
  border-radius: 999px;
  overflow: hidden;
  background: #dce9f7;
}

.sentence-rpg-page .growth-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ffd35a, #89ccff);
}

.sentence-rpg-page .food-shortcut-head,
.sentence-rpg-page .pet-companion-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sentence-rpg-page .food-shortcut-head small {
  color: #496b9a;
  font-weight: 800;
}

.sentence-rpg-page .food-shortcut-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 58px;
  border: 2px dashed #9fc4f1;
  border-radius: 14px;
  padding: 8px;
  background: rgba(235, 248, 255, 0.72);
}

.sentence-rpg-page .collection-item {
  border: 2px solid #9fc4f1;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
}

@media (max-width: 820px) {
  .sentence-rpg-page .topbar,
  .sentence-rpg-page .playground {
    grid-template-columns: 1fr;
  }

  .sentence-rpg-page .sentence-progress-bar {
    grid-template-columns: auto minmax(120px, 1fr) 54px;
  }

  .sentence-rpg-page .sentence-progress-bar > span:nth-of-type(n + 2) {
    grid-column: auto;
  }

  .sentence-rpg-page .top-stats {
    justify-content: flex-start;
  }

  .sentence-rpg-page .buddy-stage {
    height: 260px;
  }
}

@media (max-width: 560px) {
  .sentence-rpg-page .pet-app {
    width: calc(100vw - 14px);
  }

  .sentence-rpg-page .topbar,
  .sentence-rpg-page .quiz-card,
  .sentence-rpg-page .buddy-card {
    padding: 10px;
  }

  .sentence-rpg-page .action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sentence-rpg-page #checkBtn {
    grid-column: 1 / -1;
  }
}

/* Final pet-stage lock: this must stay after all restored legacy blocks. */
.sentence-rpg-page .buddy-stage {
  position: relative !important;
  overflow: hidden !important;
}

.sentence-rpg-page .buddy-stage .pet-anchor {
  position: absolute !important;
  left: 50% !important;
  bottom: 24% !important;
  z-index: 8 !important;
  width: min(54%, 220px) !important;
  height: 34% !important;
  transform: translateX(-50%) !important;
  pointer-events: none !important;
}

.sentence-rpg-page .buddy-stage .pet-anchor .buddy {
  position: absolute !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  transform: translateX(-50%) scale(var(--pet-stage-scale, 0.82)) !important;
  transform-origin: 50% 100% !important;
  pointer-events: auto !important;
}

.sentence-rpg-page .buddy-stage .pet-anchor .buddy-art {
  position: absolute !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  transform: translateX(-50%) !important;
  background-position: center bottom !important;
  background-size: contain !important;
}

.sentence-rpg-page .buddy-stage .pet-anchor .pet-stage-egg {
  --pet-stage-scale: 0.54;
}

.sentence-rpg-page .buddy-stage .pet-anchor .pet-stage-1 {
  --pet-stage-scale: 0.72;
}

.sentence-rpg-page .buddy-stage .pet-anchor .pet-stage-2 {
  --pet-stage-scale: 0.86;
}

.sentence-rpg-page .buddy-stage .pet-anchor .pet-stage-3 {
  --pet-stage-scale: 1;
}

.sentence-rpg-page .buddy-stage .pet-anchor .speech-bubble {
  position: absolute !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: calc(100% - 4px) !important;
  z-index: 9 !important;
  width: clamp(132px, 82%, 190px) !important;
  max-width: calc(100% + 20px) !important;
  min-height: 28px !important;
  padding: 8px 10px !important;
  box-sizing: border-box !important;
  border: 2px solid rgba(91, 137, 211, 0.72) !important;
  border-radius: 12px !important;
  color: #17345f !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  text-align: center !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  background: rgba(255, 252, 236, 0.94) !important;
  box-shadow: 0 5px 0 rgba(73, 118, 188, 0.12) !important;
  transform: translateX(-50%) !important;
}

.sentence-rpg-page .buddy-stage .pet-anchor .speech-bubble::after {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  bottom: -8px !important;
  width: 14px !important;
  height: 14px !important;
  border-right: 2px solid rgba(91, 137, 211, 0.72) !important;
  border-bottom: 2px solid rgba(91, 137, 211, 0.72) !important;
  background: rgba(255, 252, 236, 0.94) !important;
  transform: translateX(-50%) rotate(45deg) !important;
}

.sentence-rpg-page .buddy-stage .pet-anchor .image-buddy.happy .buddy-art {
  animation-name: petHappyHopContained !important;
}

.sentence-rpg-page .buddy-stage .pet-anchor .image-buddy.catch .buddy-art {
  transform: translateX(-50%) translateY(-8px) scale(1.025) !important;
}

.sentence-rpg-page .buddy-stage .pet-anchor .image-buddy.mouth-open .buddy-art,
.sentence-rpg-page .buddy-stage .pet-anchor .image-buddy.eat .buddy-art {
  transform: translateX(-50%) scale(1.025) !important;
}

@media (max-width: 900px) {
  .sentence-rpg-page .buddy-stage .pet-anchor {
    bottom: 23% !important;
    width: min(58%, 190px) !important;
    height: 33% !important;
  }

  .sentence-rpg-page .buddy-stage .pet-anchor .speech-bubble {
    width: clamp(124px, 86%, 170px) !important;
    max-width: calc(100% + 12px) !important;
    font-size: 11px !important;
  }
}

/* Final visual lock: new sentence game background and Fig.2 top border layout. */
.sentence-rpg-page .topbar {
  display: grid !important;
  grid-template-columns: minmax(270px, auto) minmax(360px, 1fr) auto !important;
  align-items: center !important;
  gap: 14px !important;
  min-height: 76px !important;
  margin: 10px 10px 8px !important;
  padding: 10px 12px !important;
  border: 2px solid #8ebaff !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(237, 248, 255, 0.9)) !important;
  box-shadow: 0 6px 0 rgba(91, 145, 218, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.78) !important;
}

.sentence-rpg-page .brand {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
}

.sentence-rpg-page .brand-ball {
  width: 54px !important;
  height: 54px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.sentence-rpg-page .brand h1 {
  margin: 0 !important;
  font-size: clamp(30px, 3.2vw, 42px) !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.sentence-rpg-page .lesson-select-top {
  display: grid !important;
  grid-template-columns: minmax(210px, 1fr) minmax(150px, auto) !important;
  align-items: center !important;
  justify-self: stretch !important;
  gap: 10px !important;
  width: auto !important;
  max-width: 520px !important;
  margin-left: auto !important;
}

.sentence-rpg-page .lesson-select-top span,
.sentence-rpg-page .top-stat-chip,
.sentence-rpg-page .sentence-guide-button,
.sentence-rpg-page .sentence-sound-button,
.sentence-rpg-page .sentence-settings summary {
  min-height: 38px !important;
  border: 2px solid #9ac1ff !important;
  border-radius: 10px !important;
  padding: 8px 12px !important;
  color: #17345f !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
  background: rgba(255, 255, 255, 0.82) !important;
  box-shadow: 0 3px 0 rgba(91, 145, 218, 0.12) !important;
}

.sentence-rpg-page .top-stats {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  min-width: 0 !important;
}

.sentence-rpg-page .sentence-settings summary {
  width: 44px !important;
  padding: 6px !important;
}

.sentence-rpg-page .sentence-progress-bar {
  display: grid !important;
  grid-template-columns: auto minmax(180px, 1fr) auto auto auto !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 10px 10px !important;
  padding: 8px 10px !important;
  border: 2px solid #8ebaff !important;
  border-radius: 12px !important;
  background: rgba(242, 250, 255, 0.9) !important;
  box-shadow: 0 4px 0 rgba(91, 145, 218, 0.1) !important;
}

.sentence-rpg-page .quiz-card {
  position: relative !important;
  overflow: hidden !important;
  background: rgba(236, 247, 255, 0.28) !important;
}

.sentence-rpg-page .quiz-card::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;
  display: block !important;
  background:
    linear-gradient(180deg, rgba(226, 238, 255, 0.16), rgba(255, 255, 255, 0.36)),
    url("assets/ui/cloud-kingdom-game-bg.png") center center / cover no-repeat !important;
  opacity: 0.72 !important;
  pointer-events: none !important;
}

.sentence-rpg-page .quiz-card > * {
  position: relative !important;
  z-index: 1 !important;
}

@media (max-width: 980px) {
  .sentence-rpg-page .topbar {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .sentence-rpg-page .lesson-select-top {
    max-width: none !important;
    margin-left: 0 !important;
  }

  .sentence-rpg-page .top-stats {
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }
}

/* Absolute final settings popover layer fix. */
.sentence-rpg-page .pet-app,
.sentence-rpg-page .topbar,
.sentence-rpg-page .top-stats,
.sentence-rpg-page .sentence-settings {
  overflow: visible !important;
}

.sentence-rpg-page .topbar {
  position: relative !important;
  z-index: 8200 !important;
}

.sentence-rpg-page .sentence-progress-bar,
.sentence-rpg-page .playground,
.sentence-rpg-page .quiz-card,
.sentence-rpg-page .buddy-card {
  position: relative !important;
  z-index: 1 !important;
}

.sentence-rpg-page .sentence-settings,
.sentence-rpg-page .sentence-settings[open] {
  position: relative !important;
  z-index: 9000 !important;
}

.sentence-rpg-page .sentence-settings-menu,
.sentence-rpg-page .sentence-settings[open] .sentence-settings-menu {
  position: absolute !important;
  top: calc(100% + 9px) !important;
  right: 0 !important;
  z-index: 9200 !important;
  display: grid !important;
  gap: 8px !important;
  width: min(320px, calc(100vw - 28px)) !important;
  min-width: 220px !important;
  max-height: min(68vh, 540px) !important;
  overflow: auto !important;
  padding: 12px !important;
  border: 2px solid rgba(88, 151, 210, 0.78) !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, rgba(248, 253, 255, 0.99), rgba(229, 247, 255, 0.97)) !important;
  box-shadow: 0 18px 34px rgba(38, 88, 145, 0.22) !important;
}

.sentence-rpg-page .sentence-settings-menu .settings-action {
  min-height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
}

/* Sentence Practice Design System migration v1. Keep JS hooks intact; override only layout and visuals. */
html,
body.sentence-rpg-page {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  overflow-x: hidden !important;
  box-sizing: border-box;
}

body.sentence-rpg-page,
body.sentence-rpg-page:has(.pet-app) {
  margin: 0 !important;
  color: var(--lq-ink, #17345f) !important;
  font-family: var(--lq-font-sans, "Inter", "Noto Sans SC", system-ui, sans-serif) !important;
  background:
    linear-gradient(180deg, rgba(188, 235, 255, 0.18), rgba(255, 255, 255, 0.05)),
    url("assets/ui/cloud-kingdom-game-bg.png") center bottom / cover fixed no-repeat,
    var(--lq-bg-sky, #bdeeff) !important;
}

.sentence-rpg-page *,
.sentence-rpg-page *::before,
.sentence-rpg-page *::after {
  box-sizing: border-box;
}

.sentence-rpg-page img {
  max-width: 100%;
}

.sentence-rpg-page .pet-app {
  width: min(1120px, calc(100vw - 32px)) !important;
  max-width: 100% !important;
  min-height: 100vh !important;
  margin: 0 auto !important;
  padding: 14px 0 calc(96px + env(safe-area-inset-bottom, 0px)) !important;
  display: grid !important;
  grid-template-rows: auto auto 1fr !important;
  gap: 12px !important;
  overflow: visible !important;
  background: transparent !important;
}

.sentence-rpg-page .topbar {
  width: 100% !important;
  min-height: 88px !important;
  display: grid !important;
  grid-template-columns: minmax(230px, 0.8fr) minmax(300px, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 12px 14px !important;
  border: 2px solid var(--lq-blue-300, #8fc1f4) !important;
  border-radius: var(--lq-radius-xl, 24px) !important;
  color: var(--lq-ink, #17345f) !important;
  background: var(--lq-white-glass, rgba(255, 255, 255, 0.84)) !important;
  box-shadow: var(--lq-shadow-soft, 0 8px 18px rgba(65, 129, 196, 0.14)) !important;
  position: relative !important;
  z-index: 8200 !important;
}

.sentence-rpg-page .brand {
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.sentence-rpg-page .brand-ball {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  display: grid !important;
  place-items: center !important;
  border: 2px solid rgba(143, 193, 244, 0.88) !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, #ffffff, #eaf7ff) !important;
  box-shadow: 0 6px 14px rgba(65, 129, 196, 0.14) !important;
}

.sentence-rpg-page .brand-ball img {
  width: 34px !important;
  height: 34px !important;
  object-fit: contain !important;
}

.sentence-rpg-page .brand .eyebrow {
  margin: 0 0 2px !important;
  color: var(--lq-blue-600, #2f76d2) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: 0 !important;
  text-transform: uppercase;
  text-shadow: none !important;
}

.sentence-rpg-page .brand h1 {
  margin: 0 !important;
  color: var(--lq-ink, #17345f) !important;
  font-size: 22px !important;
  font-weight: 950 !important;
  line-height: 1.05 !important;
  letter-spacing: 0 !important;
  text-shadow: none !important;
}

.sentence-rpg-page .brand .lq-topbar-subtitle {
  display: block !important;
  margin: 2px 0 0 !important;
  color: var(--lq-muted, #5f789d) !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
}

.sentence-rpg-page .lesson-select-top {
  display: flex !important;
  min-width: 0 !important;
  max-width: none !important;
  width: 100% !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 8px 12px !important;
  border: 1.5px solid rgba(143, 193, 244, 0.9) !important;
  border-radius: 999px !important;
  color: var(--lq-blue-600, #2f76d2) !important;
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  overflow: hidden !important;
}

.sentence-rpg-page .lesson-select-top span {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 13px !important;
  font-weight: 900 !important;
}

.sentence-rpg-page .top-stats {
  display: flex !important;
  width: auto !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
}

.sentence-rpg-page .top-stat-chip {
  display: inline-flex !important;
  min-height: 34px !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 5px 10px !important;
  border: 1.5px solid rgba(143, 193, 244, 0.86) !important;
  border-radius: 999px !important;
  color: var(--lq-blue-600, #2f76d2) !important;
  background: rgba(255, 255, 255, 0.76) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
}

.sentence-rpg-page .sentence-guide-button,
.sentence-rpg-page .sentence-sound-button,
.sentence-rpg-page .sentence-settings,
.sentence-rpg-page .sentence-settings summary {
  display: inline-grid !important;
}

.sentence-rpg-page .sentence-guide-button,
.sentence-rpg-page .sentence-sound-button,
.sentence-rpg-page .sentence-settings summary {
  width: 48px !important;
  min-width: 48px !important;
  height: 44px !important;
  min-height: 44px !important;
  place-items: center !important;
  padding: 0 !important;
  border: 2px solid #9ecbf7 !important;
  border-radius: 18px !important;
  color: var(--lq-ink, #17345f) !important;
  background: linear-gradient(180deg, #ffffff, #eef9ff) !important;
  box-shadow: 0 6px 14px rgba(65, 129, 196, 0.13) !important;
  font-size: 14px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

.sentence-rpg-page .sentence-guide-button {
  width: 58px !important;
  min-width: 58px !important;
}

.sentence-rpg-page .sentence-sound-button {
  gap: 0 !important;
}

.sentence-rpg-page .sentence-sound-label {
  display: none !important;
}

.sentence-rpg-page .sentence-sound-icon {
  width: 25px !important;
  height: 25px !important;
  display: block !important;
  background: url("assets/ui/sentence-pixel/sentence-icon-sound.png") center / contain no-repeat !important;
}

.sentence-rpg-page .sentence-settings {
  position: relative !important;
  z-index: 9000 !important;
}

.sentence-rpg-page .sentence-settings summary {
  list-style: none !important;
}

.sentence-rpg-page .sentence-settings summary::-webkit-details-marker {
  display: none !important;
}

.sentence-rpg-page .sentence-settings summary img {
  width: 25px !important;
  height: 25px !important;
}

.sentence-rpg-page .sentence-settings-menu,
.sentence-rpg-page .adventure-settings-menu {
  right: 0 !important;
  top: calc(100% + 10px) !important;
  z-index: 9500 !important;
  min-width: 176px !important;
  border: 2px solid rgba(126, 177, 235, 0.95) !important;
  border-radius: 20px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(230, 247, 255, 0.94)) !important;
  box-shadow: 0 18px 34px rgba(37, 92, 150, 0.24) !important;
}

.sentence-rpg-page .sentence-progress-bar {
  width: 100% !important;
  min-height: 54px !important;
  display: grid !important;
  grid-template-columns: auto minmax(160px, 1fr) auto auto auto !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px 14px !important;
  border: 2px solid var(--lq-blue-300, #8fc1f4) !important;
  border-radius: var(--lq-radius-large, 20px) !important;
  color: var(--lq-ink, #17345f) !important;
  background: var(--lq-white-glass, rgba(255, 255, 255, 0.84)) !important;
  box-shadow: var(--lq-shadow-soft, 0 8px 18px rgba(65, 129, 196, 0.14)) !important;
}

.sentence-rpg-page .sentence-progress-bar > span,
.sentence-rpg-page .sentence-progress-bar strong {
  color: var(--lq-ink, #17345f) !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
}

.sentence-rpg-page .sentence-progress-track {
  height: 12px !important;
  border: 2px solid rgba(143, 193, 244, 0.72) !important;
  border-radius: 999px !important;
  background: rgba(224, 240, 255, 0.88) !important;
  overflow: hidden !important;
}

.sentence-rpg-page .sentence-progress-track span {
  height: 100% !important;
  border-radius: inherit !important;
  background: linear-gradient(90deg, #74d99b, #72b6ff) !important;
}

.sentence-rpg-page .playground {
  width: 100% !important;
  max-width: 100% !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1.58fr) minmax(300px, 0.82fr) !important;
  align-items: stretch !important;
  gap: 14px !important;
  overflow: visible !important;
}

.sentence-rpg-page .quiz-card,
.sentence-rpg-page .buddy-card {
  min-width: 0 !important;
  border: 2px solid var(--lq-blue-300, #8fc1f4) !important;
  border-radius: var(--lq-radius-xl, 24px) !important;
  color: var(--lq-ink, #17345f) !important;
  background: var(--lq-white-glass, rgba(255, 255, 255, 0.84)) !important;
  box-shadow: var(--lq-shadow-panel, 0 18px 34px rgba(38, 88, 145, 0.2)) !important;
  overflow: hidden !important;
}

.sentence-rpg-page .quiz-card {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  padding: 14px !important;
}

.sentence-rpg-page .quiz-card::before {
  background:
    linear-gradient(180deg, rgba(239, 248, 255, 0.14), rgba(255, 255, 255, 0.34)),
    url("assets/ui/cloud-kingdom-game-bg.png") center bottom / cover no-repeat !important;
  opacity: 0.52 !important;
}

.sentence-rpg-page .sentence-deck-bar,
.sentence-rpg-page .lesson-meta,
.sentence-rpg-page .cn-sentence,
.sentence-rpg-page .answer-slots {
  position: relative !important;
  z-index: 1 !important;
}

.sentence-rpg-page .sentence-deck-bar {
  margin: 0 !important;
  padding: 10px !important;
  border: 2px solid rgba(143, 193, 244, 0.86) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.82) !important;
  box-shadow: 0 8px 18px rgba(65, 129, 196, 0.12) !important;
}

.sentence-rpg-page .sentence-deck-summary {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
}

.sentence-rpg-page .sentence-deck-summary label,
.sentence-rpg-page .lesson-meta span {
  color: var(--lq-blue-600, #2f76d2) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: 0 !important;
}

.sentence-rpg-page .sentence-deck-summary strong,
.sentence-rpg-page .lesson-meta strong {
  min-width: 0 !important;
  color: var(--lq-ink, #17345f) !important;
  font-weight: 950 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.sentence-rpg-page .lesson-meta {
  min-height: 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 8px 12px !important;
  border: 1.5px solid rgba(143, 193, 244, 0.76) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.72) !important;
}

.sentence-rpg-page .cn-sentence {
  min-height: 86px !important;
  margin: 0 !important;
  padding: 16px 18px !important;
  display: grid !important;
  place-items: center !important;
  border: 2px solid rgba(143, 193, 244, 0.9) !important;
  border-radius: 20px !important;
  color: #17345f !important;
  background: #ffffff !important;
  box-shadow: 0 8px 18px rgba(65, 129, 196, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
  font-size: clamp(24px, 2.4vw, 34px) !important;
  font-weight: 950 !important;
  line-height: 1.18 !important;
  text-align: center !important;
  text-shadow: none !important;
}

.sentence-rpg-page .answer-slots {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 58px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 8px !important;
  border: 2px dashed rgba(143, 193, 244, 0.85) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.64) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

.sentence-rpg-page .answer-slot,
.sentence-rpg-page .word-chip {
  min-width: 78px !important;
  min-height: 42px !important;
  max-width: 100% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 7px 12px !important;
  border: 2px solid rgba(143, 193, 244, 0.9) !important;
  border-radius: 14px !important;
  color: var(--lq-ink, #17345f) !important;
  background: linear-gradient(180deg, #ffffff, #eef9ff) !important;
  box-shadow: 0 5px 12px rgba(65, 129, 196, 0.12) !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
}

.sentence-rpg-page .answer-slot.filled {
  background: linear-gradient(180deg, #ffffff 0 50%, #fff1a8 50% 100%) !important;
  border-color: #72aef0 !important;
}

.sentence-rpg-page .answer-slot.hint-target {
  border-color: #ffc24b !important;
  box-shadow: 0 0 0 3px rgba(255, 194, 75, 0.22), 0 5px 12px rgba(65, 129, 196, 0.12) !important;
}

.sentence-rpg-page .answer-slot.wrong {
  border-color: var(--lq-danger, #ff7a90) !important;
  color: #8c2a3a !important;
}

.sentence-rpg-page .word-bank {
  width: 100% !important;
  max-width: 100% !important;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative !important;
  z-index: 1 !important;
}

.sentence-rpg-page .word-chip {
  cursor: pointer !important;
}

.sentence-rpg-page .word-chip:hover:not(:disabled) {
  transform: translateY(-1px) !important;
  box-shadow: 0 8px 16px rgba(65, 129, 196, 0.18) !important;
}

.sentence-rpg-page .word-chip:disabled {
  opacity: 1 !important;
  color: #17345f !important;
  border-color: #5ca8ee !important;
  background:
    linear-gradient(135deg, rgba(108, 183, 255, 0.96) 0 48%, rgba(255, 210, 91, 0.98) 48% 100%) !important;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.88),
    0 8px 16px rgba(46, 120, 202, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
  cursor: default !important;
  transform: translateY(1px) !important;
}

.sentence-rpg-page .hint-line {
  min-height: 22px !important;
  margin: -2px 0 0 !important;
  color: #2f6faf !important;
  font-size: 13px !important;
  font-weight: 850 !important;
  line-height: 1.25 !important;
  text-align: center !important;
  position: relative !important;
  z-index: 1 !important;
}

.sentence-rpg-page .action-row {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(124px, 1.28fr) !important;
  align-items: stretch !important;
  gap: 8px !important;
  margin: 0 !important;
  position: relative !important;
  z-index: 1 !important;
}

.sentence-rpg-page .action-row button {
  min-width: 0 !important;
  min-height: 48px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  padding: 8px 10px !important;
  border: 2px solid rgba(143, 193, 244, 0.9) !important;
  border-radius: 16px !important;
  color: var(--lq-ink, #17345f) !important;
  background: linear-gradient(180deg, #ffffff, #eef9ff) !important;
  box-shadow: 0 6px 14px rgba(65, 129, 196, 0.13) !important;
  font-size: 14px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.sentence-rpg-page .action-row button img {
  width: 24px !important;
  height: 24px !important;
  flex: 0 0 auto !important;
  object-fit: contain !important;
  image-rendering: pixelated;
}

.sentence-rpg-page .action-row #checkBtn {
  color: #4b3107 !important;
  border-color: #d59a28 !important;
  background: linear-gradient(180deg, #ffe28a, var(--lq-gold, #ffc24b)) !important;
  box-shadow: 0 8px 18px rgba(177, 126, 26, 0.2) !important;
}

.sentence-rpg-page .buddy-card {
  display: grid !important;
  grid-template-rows: auto minmax(250px, 1fr) auto !important;
  gap: 10px !important;
  padding: 14px !important;
}

.sentence-rpg-page .pet-compact-summary,
.sentence-rpg-page .growth-card {
  border: 2px solid rgba(143, 193, 244, 0.86) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.82) !important;
  box-shadow: 0 8px 18px rgba(65, 129, 196, 0.12) !important;
}

.sentence-rpg-page .pet-compact-summary {
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px !important;
}

.sentence-rpg-page .pet-compact-summary h2 {
  min-width: 0 !important;
  color: var(--lq-ink, #17345f) !important;
  font-size: 19px !important;
  font-weight: 950 !important;
  text-shadow: none !important;
}

.sentence-rpg-page .buddy-stage {
  height: auto !important;
  min-height: 270px !important;
  margin: 0 !important;
  border: 2px solid rgba(143, 193, 244, 0.78) !important;
  border-radius: 20px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(24, 94, 80, 0.06)),
    url("assets/ui/sentence-sky-kingdom-stage.png") center 60% / cover no-repeat,
    #dff6ff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78) !important;
}

.sentence-rpg-page .growth-card {
  padding: 10px !important;
}

.sentence-rpg-page .growth-top,
.sentence-rpg-page .food-shortcut-head,
.sentence-rpg-page .pet-companion-actions {
  margin: 0 !important;
}

.sentence-rpg-page .food-shortcut-grid {
  min-height: 54px !important;
  max-height: 72px !important;
  overflow: auto !important;
}

.sentence-rpg-page .deck-selector-modal,
.sentence-rpg-page .pet-picker {
  z-index: 10000 !important;
}

@media (min-width: 1180px) {
  .sentence-rpg-page .pet-app {
    width: min(1180px, calc(100vw - 48px)) !important;
    padding-top: 18px !important;
    gap: 14px !important;
  }

  .sentence-rpg-page .playground {
    grid-template-columns: minmax(0, 1.62fr) minmax(320px, 0.78fr) !important;
  }

  .sentence-rpg-page .quiz-card {
    min-height: 620px !important;
    justify-content: start !important;
  }

  .sentence-rpg-page .buddy-card {
    min-height: 620px !important;
  }
}

@media (min-width: 721px) and (max-width: 1179px) {
  .sentence-rpg-page .pet-app {
    width: min(720px, calc(100vw - 32px)) !important;
    grid-template-rows: auto auto auto !important;
    padding-top: 14px !important;
  }

  .sentence-rpg-page .topbar {
    grid-template-columns: minmax(0, 1fr) auto !important;
    min-height: auto !important;
  }

  .sentence-rpg-page .lesson-select-top {
    grid-column: 1 / -1 !important;
    order: 3 !important;
  }

  .sentence-rpg-page .top-stats {
    grid-column: 2 !important;
  }

  .sentence-rpg-page .sentence-progress-bar {
    grid-template-columns: auto minmax(160px, 1fr) auto !important;
  }

  .sentence-rpg-page .sentence-progress-bar #sentenceRemainText,
  .sentence-rpg-page .sentence-progress-bar #sentenceTimerText {
    display: none !important;
  }

  .sentence-rpg-page .playground {
    grid-template-columns: 1fr !important;
  }

  .sentence-rpg-page .quiz-card {
    min-height: 0 !important;
  }

  .sentence-rpg-page .buddy-card {
    grid-template-rows: auto 300px auto !important;
  }

  .sentence-rpg-page .buddy-stage {
    min-height: 300px !important;
  }
}

/* Shared learning-game background: Sentence Practice. */
body.sentence-rpg-page,
body.sentence-rpg-page:has(.pet-app) {
  background:
    linear-gradient(180deg, rgba(160, 222, 255, 0.16), rgba(255, 255, 255, 0.05)),
    url("assets/ui/cloud-kingdom-game-bg.png") center bottom / cover fixed no-repeat,
    #bdeeff !important;
}

body.sentence-rpg-page .pet-app {
  background:
    linear-gradient(180deg, rgba(160, 222, 255, 0.12), rgba(255, 255, 255, 0.03)),
    url("assets/ui/cloud-kingdom-game-bg.png") center bottom / cover fixed no-repeat !important;
}

body.sentence-rpg-page .playground,
body.sentence-rpg-page .buddy-card,
body.sentence-rpg-page .pet-stage,
body.sentence-rpg-page .stage-scene {
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08)),
    url("assets/ui/cloud-kingdom-game-bg.png") !important;
  background-position: center bottom !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
}

@media (max-width: 720px) {
  body.sentence-rpg-page,
  body.sentence-rpg-page:has(.pet-app),
  body.sentence-rpg-page .pet-app {
    background:
      linear-gradient(180deg, rgba(160, 222, 255, 0.14), rgba(255, 255, 255, 0.04)),
      url("assets/ui/cloud-kingdom-game-bg.png") center bottom / cover scroll no-repeat,
      #bdeeff !important;
  }
}
*** End of File

/* Absolute final mobile compact sentence practice layout. */
@media (max-width: 620px) {
  .sentence-rpg-page .pet-app {
    gap: 7px !important;
    width: 100% !important;
    padding: 8px 8px calc(74px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .sentence-rpg-page .topbar {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 8px 9px !important;
    border-radius: 12px !important;
  }

  .sentence-rpg-page .brand {
    gap: 7px !important;
  }

  .sentence-rpg-page .brand-ball {
    width: 42px !important;
    height: 42px !important;
  }

  .sentence-rpg-page .eyebrow {
    font-size: 10px !important;
    line-height: 1 !important;
  }

  .sentence-rpg-page .brand h1 {
    font-size: 28px !important;
  }

  .sentence-rpg-page .lesson-select-top {
    grid-template-columns: minmax(0, 1fr) minmax(94px, auto) !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  .sentence-rpg-page .lesson-select-top span,
  .sentence-rpg-page .top-stat-chip,
  .sentence-rpg-page .sentence-guide-button,
  .sentence-rpg-page .sentence-sound-button,
  .sentence-rpg-page .sentence-settings summary {
    min-height: 33px !important;
    padding: 6px 8px !important;
    border-width: 1.5px !important;
    border-radius: 9px !important;
    font-size: 12px !important;
  }

  .sentence-rpg-page .lesson-select-top span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .sentence-rpg-page .top-stats {
    display: grid !important;
    grid-template-columns: minmax(52px, 0.72fr) minmax(68px, 0.9fr) repeat(3, minmax(44px, 1fr)) !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .sentence-rpg-page .sentence-guide-button,
  .sentence-rpg-page .sentence-sound-button {
    width: 100% !important;
  }

  .sentence-rpg-page .sentence-settings summary {
    width: 100% !important;
    min-width: 42px !important;
  }

  .sentence-rpg-page .sentence-progress-bar {
    grid-template-columns: auto minmax(0, 1fr) 42px !important;
    gap: 7px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 7px 8px !important;
    border-width: 1.5px !important;
    border-radius: 10px !important;
  }

  .sentence-rpg-page .sentence-progress-bar > span:first-child {
    writing-mode: horizontal-tb !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }

  .sentence-rpg-page #sentenceRemainText,
  .sentence-rpg-page #sentenceTimerText {
    display: none !important;
  }

  .sentence-rpg-page .sentence-progress-track {
    height: 10px !important;
  }

  .sentence-rpg-page .playground {
    display: block !important;
    margin: 0 !important;
  }

  .sentence-rpg-page .quiz-card {
    min-height: 0 !important;
    margin: 0 !important;
    padding: 10px 8px 12px !important;
    border-width: 1.5px !important;
    border-radius: 14px !important;
  }

  .sentence-rpg-page .sentence-deck-bar {
    margin: 0 0 8px !important;
    padding: 8px 9px !important;
    border-radius: 12px !important;
  }

  .sentence-rpg-page .sentence-deck-summary {
    gap: 8px !important;
  }

  .sentence-rpg-page .sentence-deck-summary strong {
    font-size: 13px !important;
    line-height: 1.15 !important;
  }

  .sentence-rpg-page .sentence-deck-count,
  .sentence-rpg-page .lesson-meta {
    display: none !important;
  }

  .sentence-rpg-page .cn-sentence {
    min-height: 118px !important;
    margin: 0 0 8px !important;
    padding: 16px 12px !important;
    border-radius: 13px !important;
    font-size: clamp(24px, 7vw, 34px) !important;
    line-height: 1.15 !important;
  }

  .sentence-rpg-page .answer-slots {
    gap: 8px !important;
    margin: 0 auto 10px !important;
    padding: 7px !important;
    width: fit-content !important;
    max-width: 100% !important;
  }

  .sentence-rpg-page .answer-slot {
    min-width: 96px !important;
    min-height: 48px !important;
    padding: 8px 10px !important;
    font-size: 18px !important;
  }

  .sentence-rpg-page .word-bank {
    gap: 8px 9px !important;
    margin: 8px 0 8px !important;
    padding: 0 !important;
  }

  .sentence-rpg-page .word-chip {
    min-width: 88px !important;
    min-height: 44px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    font-size: 15px !important;
  }

  .sentence-rpg-page .hint-line {
    margin: 8px 0 9px !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
  }

  .sentence-rpg-page .action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 0 !important;
  }

  .sentence-rpg-page .action-row button {
    min-height: 42px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
  }

  .sentence-rpg-page .action-row #checkBtn {
    grid-column: 1 / -1 !important;
  }

  .sentence-rpg-page .buddy-card {
    margin-top: 8px !important;
    padding: 9px !important;
    border-width: 1.5px !important;
    border-radius: 14px !important;
  }
}

/* Absolute final mobile compact sentence practice layout. */
@media (max-width: 620px) {
  .sentence-rpg-page .pet-app {
    gap: 7px !important;
    width: 100% !important;
    padding: 8px 8px calc(74px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .sentence-rpg-page .topbar {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 8px 9px !important;
    border-radius: 12px !important;
  }

  .sentence-rpg-page .brand {
    gap: 7px !important;
  }

  .sentence-rpg-page .brand-ball {
    width: 42px !important;
    height: 42px !important;
  }

  .sentence-rpg-page .eyebrow {
    font-size: 10px !important;
    line-height: 1 !important;
  }

  .sentence-rpg-page .brand h1 {
    font-size: 28px !important;
  }

  .sentence-rpg-page .lesson-select-top {
    grid-template-columns: minmax(0, 1fr) minmax(94px, auto) !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  .sentence-rpg-page .lesson-select-top span,
  .sentence-rpg-page .top-stat-chip,
  .sentence-rpg-page .sentence-guide-button,
  .sentence-rpg-page .sentence-sound-button,
  .sentence-rpg-page .sentence-settings summary {
    min-height: 33px !important;
    padding: 6px 8px !important;
    border-width: 1.5px !important;
    border-radius: 9px !important;
    font-size: 12px !important;
  }

  .sentence-rpg-page .lesson-select-top span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .sentence-rpg-page .top-stats {
    display: grid !important;
    grid-template-columns: minmax(52px, 0.72fr) minmax(68px, 0.9fr) repeat(3, minmax(44px, 1fr)) !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .sentence-rpg-page .sentence-guide-button,
  .sentence-rpg-page .sentence-sound-button {
    width: 100% !important;
  }

  .sentence-rpg-page .sentence-settings summary {
    width: 100% !important;
    min-width: 42px !important;
  }

  .sentence-rpg-page .sentence-progress-bar {
    grid-template-columns: auto minmax(0, 1fr) 42px !important;
    gap: 7px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 7px 8px !important;
    border-width: 1.5px !important;
    border-radius: 10px !important;
  }

  .sentence-rpg-page .sentence-progress-bar > span:first-child {
    writing-mode: horizontal-tb !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }

  .sentence-rpg-page #sentenceRemainText,
  .sentence-rpg-page #sentenceTimerText {
    display: none !important;
  }

  .sentence-rpg-page .sentence-progress-track {
    height: 10px !important;
  }

  .sentence-rpg-page .playground {
    display: block !important;
    margin: 0 !important;
  }

  .sentence-rpg-page .quiz-card {
    min-height: 0 !important;
    margin: 0 !important;
    padding: 10px 8px 12px !important;
    border-width: 1.5px !important;
    border-radius: 14px !important;
  }

  .sentence-rpg-page .sentence-deck-bar {
    margin: 0 0 8px !important;
    padding: 8px 9px !important;
    border-radius: 12px !important;
  }

  .sentence-rpg-page .sentence-deck-summary {
    gap: 8px !important;
  }

  .sentence-rpg-page .sentence-deck-summary strong {
    font-size: 13px !important;
    line-height: 1.15 !important;
  }

  .sentence-rpg-page .sentence-deck-count,
  .sentence-rpg-page .lesson-meta {
    display: none !important;
  }

  .sentence-rpg-page .cn-sentence {
    min-height: 118px !important;
    margin: 0 0 8px !important;
    padding: 16px 12px !important;
    border-radius: 13px !important;
    font-size: clamp(24px, 7vw, 34px) !important;
    line-height: 1.15 !important;
  }

  .sentence-rpg-page .answer-slots {
    gap: 8px !important;
    margin: 0 auto 10px !important;
    padding: 7px !important;
    width: fit-content !important;
    max-width: 100% !important;
  }

  .sentence-rpg-page .answer-slot {
    min-width: 96px !important;
    min-height: 48px !important;
    padding: 8px 10px !important;
    font-size: 18px !important;
  }

  .sentence-rpg-page .word-bank {
    gap: 8px 9px !important;
    margin: 8px 0 8px !important;
    padding: 0 !important;
  }

  .sentence-rpg-page .word-chip {
    min-width: 88px !important;
    min-height: 44px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    font-size: 15px !important;
  }

  .sentence-rpg-page .hint-line {
    margin: 8px 0 9px !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
  }

  .sentence-rpg-page .action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 0 !important;
  }

  .sentence-rpg-page .action-row button {
    min-height: 42px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
  }

  .sentence-rpg-page .action-row #checkBtn {
    grid-column: 1 / -1 !important;
  }

  .sentence-rpg-page .buddy-card {
    margin-top: 8px !important;
    padding: 9px !important;
    border-width: 1.5px !important;
    border-radius: 14px !important;
  }
}

/* Mobile compact sentence practice layout: reduce vertical gaps and prevent squeezed labels. */
@media (max-width: 620px) {
  body.sentence-rpg-page,
  body.sentence-rpg-page:has(.pet-app) {
    background-attachment: scroll !important;
  }

  .sentence-rpg-page .pet-app {
    gap: 7px !important;
    width: 100% !important;
    padding: 8px 8px calc(74px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .sentence-rpg-page .topbar {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 8px 9px !important;
    border-radius: 12px !important;
  }

  .sentence-rpg-page .brand {
    gap: 7px !important;
  }

  .sentence-rpg-page .brand-ball {
    width: 42px !important;
    height: 42px !important;
  }

  .sentence-rpg-page .eyebrow {
    font-size: 10px !important;
    line-height: 1 !important;
  }

  .sentence-rpg-page .brand h1 {
    font-size: 28px !important;
  }

  .sentence-rpg-page .lesson-select-top {
    grid-template-columns: minmax(0, 1fr) minmax(94px, auto) !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  .sentence-rpg-page .lesson-select-top span,
  .sentence-rpg-page .top-stat-chip,
  .sentence-rpg-page .sentence-guide-button,
  .sentence-rpg-page .sentence-sound-button,
  .sentence-rpg-page .sentence-settings summary {
    min-height: 33px !important;
    padding: 6px 8px !important;
    border-width: 1.5px !important;
    border-radius: 9px !important;
    font-size: 12px !important;
  }

  .sentence-rpg-page .lesson-select-top span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .sentence-rpg-page .top-stats {
    display: grid !important;
    grid-template-columns: minmax(52px, 0.72fr) minmax(68px, 0.9fr) repeat(3, minmax(44px, 1fr)) !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .sentence-rpg-page .sentence-guide-button,
  .sentence-rpg-page .sentence-sound-button {
    width: 100% !important;
  }

  .sentence-rpg-page .sentence-settings summary {
    width: 100% !important;
    min-width: 42px !important;
  }

  .sentence-rpg-page .sentence-progress-bar {
    grid-template-columns: auto minmax(0, 1fr) 42px !important;
    gap: 7px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 7px 8px !important;
    border-width: 1.5px !important;
    border-radius: 10px !important;
  }

  .sentence-rpg-page .sentence-progress-bar > span:first-child {
    writing-mode: horizontal-tb !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }

  .sentence-rpg-page #sentenceRemainText,
  .sentence-rpg-page #sentenceTimerText {
    display: none !important;
  }

  .sentence-rpg-page .sentence-progress-track {
    height: 10px !important;
  }

  .sentence-rpg-page .playground {
    display: block !important;
    margin: 0 !important;
  }

  .sentence-rpg-page .quiz-card {
    min-height: 0 !important;
    margin: 0 !important;
    padding: 10px 8px 12px !important;
    border-width: 1.5px !important;
    border-radius: 14px !important;
  }

  .sentence-rpg-page .sentence-deck-bar {
    margin: 0 0 8px !important;
    padding: 8px 9px !important;
    border-radius: 12px !important;
  }

  .sentence-rpg-page .sentence-deck-summary {
    gap: 8px !important;
  }

  .sentence-rpg-page .sentence-deck-summary label,
  .sentence-rpg-page .sentence-deck-summary strong,
  .sentence-rpg-page .sentence-deck-summary span {
    line-height: 1.15 !important;
  }

  .sentence-rpg-page .sentence-deck-summary strong {
    font-size: 13px !important;
  }

  .sentence-rpg-page .sentence-deck-count,
  .sentence-rpg-page .lesson-meta {
    display: none !important;
  }

  .sentence-rpg-page .cn-sentence {
    min-height: 118px !important;
    margin: 0 0 8px !important;
    padding: 16px 12px !important;
    border-radius: 13px !important;
    font-size: clamp(24px, 7vw, 34px) !important;
    line-height: 1.15 !important;
  }

  .sentence-rpg-page .answer-slots {
    gap: 8px !important;
    margin: 0 auto 10px !important;
    padding: 7px !important;
    width: fit-content !important;
    max-width: 100% !important;
  }

  .sentence-rpg-page .answer-slot {
    min-width: 96px !important;
    min-height: 48px !important;
    padding: 8px 10px !important;
    font-size: 18px !important;
  }

  .sentence-rpg-page .word-bank {
    gap: 8px 9px !important;
    margin: 8px 0 8px !important;
    padding: 0 !important;
  }

  .sentence-rpg-page .word-chip {
    min-width: 88px !important;
    min-height: 44px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    font-size: 15px !important;
  }

  .sentence-rpg-page .hint-line {
    margin: 8px 0 9px !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
  }

  .sentence-rpg-page .action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 0 !important;
  }

  .sentence-rpg-page .action-row button {
    min-height: 42px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
  }

  .sentence-rpg-page .action-row #checkBtn {
    grid-column: 1 / -1 !important;
  }

  .sentence-rpg-page .buddy-card {
    margin-top: 8px !important;
    padding: 9px !important;
    border-width: 1.5px !important;
    border-radius: 14px !important;
  }
}

/* Final settings popover layer fix: keep the sentence settings menu above status panels. */
.sentence-rpg-page .pet-app,
.sentence-rpg-page .topbar,
.sentence-rpg-page .top-stats,
.sentence-rpg-page .sentence-settings {
  overflow: visible !important;
}

.sentence-rpg-page .topbar {
  position: relative !important;
  z-index: 4200 !important;
}

.sentence-rpg-page .sentence-progress-bar,
.sentence-rpg-page .playground {
  position: relative !important;
  z-index: 1 !important;
}

.sentence-rpg-page .sentence-settings {
  position: relative !important;
  z-index: 4300 !important;
}

.sentence-rpg-page .sentence-settings[open] {
  z-index: 5200 !important;
}

.sentence-rpg-page .sentence-settings-menu {
  position: absolute !important;
  top: calc(100% + 9px) !important;
  right: 0 !important;
  z-index: 5300 !important;
  display: grid !important;
  gap: 8px !important;
  width: min(320px, calc(100vw - 28px)) !important;
  min-width: 210px !important;
  max-height: min(68vh, 540px) !important;
  overflow: auto !important;
  padding: 12px !important;
  border: 2px solid rgba(88, 151, 210, 0.78) !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, rgba(248, 253, 255, 0.99), rgba(229, 247, 255, 0.97)) !important;
  box-shadow: 0 18px 34px rgba(38, 88, 145, 0.22) !important;
}

.sentence-rpg-page .sentence-settings-menu .settings-action {
  min-height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
}

/* Cloud kingdom background pass: transparent world layer, solid learning controls. */
body.sentence-rpg-page,
body.sentence-rpg-page:has(.pet-app) {
  background:
    linear-gradient(180deg, rgba(232, 249, 255, 0.08), rgba(230, 246, 255, 0.18)),
    url("assets/ui/cloud-kingdom-game-bg.png") center bottom / cover fixed no-repeat,
    #cfeeff !important;
}

.sentence-rpg-page .pet-app {
  position: relative !important;
  isolation: isolate !important;
}

.sentence-rpg-page .pet-app::before {
  content: "" !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: -1 !important;
  display: block !important;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.28), transparent 34%),
    linear-gradient(180deg, rgba(236, 250, 255, 0.08), rgba(255, 255, 255, 0.22)) !important;
  pointer-events: none !important;
}

.sentence-rpg-page .topbar,
.sentence-rpg-page .sentence-progress-bar,
.sentence-rpg-page .quiz-card,
.sentence-rpg-page .buddy-card,
.sentence-rpg-page .growth-card,
.sentence-rpg-page .sentence-deck-bar,
.sentence-rpg-page .deck-selector-card,
.sentence-rpg-page .picker-card {
  border: 1px solid rgba(104, 164, 218, 0.68) !important;
  border-radius: 20px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(232, 248, 255, 0.66)) !important;
  box-shadow:
    0 16px 34px rgba(42, 100, 154, 0.16),
    inset 0 0 0 4px rgba(255, 255, 255, 0.22) !important;
  backdrop-filter: blur(2px) saturate(1.04) !important;
}

.sentence-rpg-page .topbar,
.sentence-rpg-page .sentence-progress-bar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(232, 248, 255, 0.7)) !important;
}

.sentence-rpg-page .quiz-card {
  overflow: visible !important;
  min-height: 720px !important;
  background:
    linear-gradient(180deg, rgba(246, 253, 255, 0.66), rgba(226, 245, 255, 0.44)) !important;
}

.sentence-rpg-page .quiz-card::before {
  content: none !important;
  display: none !important;
}

.sentence-rpg-page .buddy-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(229, 247, 255, 0.58)) !important;
}

.sentence-rpg-page .buddy-stage {
  border: 1px solid rgba(104, 164, 218, 0.58) !important;
  border-radius: 22px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(220, 247, 255, 0.1)),
    url("assets/ui/sentence-sky-kingdom-stage.png") center bottom / cover no-repeat,
    rgba(215, 244, 255, 0.48) !important;
  box-shadow:
    0 14px 28px rgba(42, 100, 154, 0.14),
    inset 0 0 0 3px rgba(255, 255, 255, 0.18) !important;
}

.sentence-rpg-page .lesson-select-top span,
.sentence-rpg-page .top-stat-chip,
.sentence-rpg-page .sentence-progress-bar > span,
.sentence-rpg-page .sentence-progress-bar > strong,
.sentence-rpg-page .sentence-deck-item,
.sentence-rpg-page .sentence-series-item,
.sentence-rpg-page .settings-action,
.sentence-rpg-page .food-shortcut-grid,
.sentence-rpg-page .collection-item {
  background: rgba(255, 255, 255, 0.84) !important;
  border-color: rgba(116, 177, 226, 0.7) !important;
  box-shadow: 0 4px 12px rgba(50, 111, 168, 0.08) !important;
}

.sentence-rpg-page .cn-sentence,
.sentence-rpg-page .answer-slots,
.sentence-rpg-page .answer-slot,
.sentence-rpg-page .word-chip,
.sentence-rpg-page .action-row,
.sentence-rpg-page .soft-button,
.sentence-rpg-page .primary-button {
  border-color: rgba(91, 154, 211, 0.86) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow:
    0 6px 14px rgba(50, 111, 168, 0.13),
    inset 0 -2px 0 rgba(104, 164, 218, 0.1) !important;
}

.sentence-rpg-page .cn-sentence {
  border: 1px solid rgba(246, 184, 86, 0.5) !important;
  background: rgba(255, 252, 244, 0.96) !important;
  box-shadow:
    0 8px 22px rgba(67, 128, 184, 0.1),
    inset 0 0 0 1px rgba(255, 215, 144, 0.26) !important;
}

.sentence-rpg-page .answer-slots {
  min-height: 64px !important;
  padding: 10px !important;
  border: 1px solid rgba(104, 164, 218, 0.72) !important;
  border-radius: 16px !important;
}

.sentence-rpg-page .word-bank {
  background: transparent !important;
}

.sentence-rpg-page .word-chip {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(238, 248, 255, 0.96)) !important;
}

.sentence-rpg-page .action-row {
  background: rgba(255, 255, 255, 0.92) !important;
}

.sentence-rpg-page .soft-button {
  background: linear-gradient(180deg, #ffffff, #e8f7ff) !important;
}

.sentence-rpg-page .primary-button {
  color: #6e4a10 !important;
  border-color: rgba(238, 178, 75, 0.9) !important;
  background: linear-gradient(180deg, #fff4bd, #ffd06c) !important;
}

.sentence-rpg-page .hint-line,
.sentence-rpg-page .lesson-meta {
  color: #244d7a !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) !important;
}

@media (max-width: 1100px) {
  body.sentence-rpg-page,
  body.sentence-rpg-page:has(.pet-app) {
    background:
      linear-gradient(180deg, rgba(232, 249, 255, 0.08), rgba(230, 246, 255, 0.18)),
      url("assets/ui/cloud-kingdom-game-bg.png") center bottom / cover fixed no-repeat,
      #cfeeff !important;
  }
}

@media (max-width: 620px) {
  body.sentence-rpg-page,
  body.sentence-rpg-page:has(.pet-app) {
    background:
      linear-gradient(180deg, rgba(232, 249, 255, 0.08), rgba(230, 246, 255, 0.18)),
      url("assets/ui/cloud-kingdom-game-bg.png") center bottom / cover scroll no-repeat,
      #cfeeff !important;
  }

  .sentence-rpg-page .quiz-card,
  .sentence-rpg-page .buddy-card {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(232, 248, 255, 0.7)) !important;
  }

  .sentence-rpg-page .lesson-select-top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 8px !important;
  }

  .sentence-rpg-page .lesson-select-top span {
    min-width: 0 !important;
    width: 100% !important;
    padding: 8px 9px !important;
    font-size: 12px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .sentence-rpg-page #topDeckLabel,
  .sentence-rpg-page #topQuestionLabel {
    display: block !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .sentence-rpg-page #topQuestionLabel {
    width: auto !important;
    justify-self: stretch !important;
  }
}

@media (max-width: 620px) {
  body.sentence-rpg-page .topbar {
    width: calc(100vw - 34px) !important;
    max-width: calc(100vw - 34px) !important;
    overflow: hidden !important;
  }

  body.sentence-rpg-page .lesson-select-top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 112px) !important;
    overflow: hidden !important;
  }

  body.sentence-rpg-page #topQuestionLabel {
    max-width: 112px !important;
  }
}

/* Absolute final pet-card simplification lock: Lv/EXP, food storage, and equal action buttons. */
.sentence-rpg-page .sentence-deck-count {
  display: none !important;
}

.sentence-rpg-page .buddy-card {
  align-self: stretch !important;
}

.sentence-rpg-page .growth-card {
  display: grid !important;
  gap: 10px !important;
  padding: 12px !important;
  border: 2px solid rgba(142, 186, 255, 0.78) !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(234, 247, 255, 0.76)) !important;
  box-shadow: 0 6px 0 rgba(87, 145, 216, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.7) !important;
}

.sentence-rpg-page .growth-top,
.sentence-rpg-page #growthText,
.sentence-rpg-page .food-shortcut-head,
.sentence-rpg-page .pet-companion-actions {
  min-height: 42px !important;
  box-sizing: border-box !important;
}

.sentence-rpg-page .growth-top {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 0 2px !important;
  color: #24456f !important;
  font-weight: 900 !important;
}

.sentence-rpg-page .growth-top span:first-child {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
}

.sentence-rpg-page .growth-top span:first-child::before {
  content: "" !important;
  width: 20px !important;
  height: 20px !important;
  flex: 0 0 auto !important;
  background: url("assets/ui/sentence-pixel/sentence-icon-star.png") center / contain no-repeat !important;
}

.sentence-rpg-page #growthExpLabel {
  color: #3f73bd !important;
  font-size: 13px !important;
  white-space: nowrap !important;
}

.sentence-rpg-page .growth-track {
  height: 14px !important;
  border: 2px solid rgba(98, 145, 215, 0.55) !important;
  border-radius: 999px !important;
  background: rgba(227, 242, 255, 0.86) !important;
  box-shadow: inset 0 2px 0 rgba(91, 130, 193, 0.12) !important;
  overflow: hidden !important;
}

.sentence-rpg-page .growth-track span {
  display: block !important;
  height: 100% !important;
  border-radius: inherit !important;
  background: linear-gradient(90deg, #73c7ff, #ffe073) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62) !important;
}

.sentence-rpg-page #growthText {
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 8px 12px !important;
  border: 2px solid rgba(143, 194, 255, 0.5) !important;
  border-radius: 12px !important;
  color: #17345f !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
  background: rgba(255, 255, 255, 0.62) !important;
}

.sentence-rpg-page #growthText span:last-child {
  color: #3f73bd !important;
  font-size: 13px !important;
  white-space: nowrap !important;
}

.sentence-rpg-page .pet-food-shortcuts {
  display: grid !important;
  gap: 8px !important;
}

.sentence-rpg-page .food-shortcut-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 12px !important;
  border: 2px solid rgba(142, 186, 255, 0.52) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.58) !important;
  color: #24456f !important;
  font-weight: 900 !important;
}

.sentence-rpg-page .food-shortcut-head small {
  color: #5c7fb5 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
}

.sentence-rpg-page .food-shortcut-grid {
  position: relative !important;
  min-height: 88px !important;
  padding: 10px !important;
  border: 2px dashed rgba(107, 157, 229, 0.72) !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(234, 247, 255, 0.68)) !important;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.42) !important;
  align-items: center !important;
  justify-content: center !important;
}

.sentence-rpg-page .food-shortcut-grid::before,
.sentence-rpg-page .food-shortcut-grid::after {
  content: "" !important;
  position: absolute !important;
  width: 18px !important;
  height: 18px !important;
  background: url("assets/ui/sentence-pixel/sentence-icon-star.png") center / contain no-repeat !important;
  opacity: 0.78 !important;
  pointer-events: none !important;
}

.sentence-rpg-page .food-shortcut-grid::before {
  left: 10px !important;
  top: 8px !important;
}

.sentence-rpg-page .food-shortcut-grid::after {
  right: 10px !important;
  bottom: 8px !important;
}

.sentence-rpg-page .food-shortcut-grid .collection-item,
.sentence-rpg-page .food-shortcut-grid .empty-collection {
  min-height: 58px !important;
  box-sizing: border-box !important;
}

.sentence-rpg-page .pet-companion-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  align-items: stretch !important;
  gap: 10px !important;
}

.sentence-rpg-page .pet-companion-actions .soft-button,
.sentence-rpg-page .pet-companion-actions a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  min-height: 50px !important;
  height: 50px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  border-width: 2px !important;
  border-radius: 14px !important;
  padding: 0 18px !important;
  font-size: 16px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  overflow: visible !important;
  box-shadow: 0 5px 0 rgba(85, 119, 171, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.72) !important;
}

.sentence-rpg-page .companion-feed-tip {
  border-color: #79c99a !important;
  color: #1f6d44 !important;
  background: linear-gradient(180deg, #f2fff5, #c9f4d5) !important;
}

.sentence-rpg-page .companion-detail-link {
  border-color: #e0aa34 !important;
  color: #744608 !important;
  background: linear-gradient(180deg, #fff4be, #ffc957) !important;
}

.sentence-rpg-page .companion-feed-tip::before,
.sentence-rpg-page .companion-detail-link::before {
  content: "" !important;
  display: inline-block !important;
  width: 22px !important;
  height: 22px !important;
  flex: 0 0 auto !important;
  background-position: center !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
}

.sentence-rpg-page .companion-feed-tip::before {
  background-image: url("assets/ui/sentence-pixel/sentence-icon-star.png") !important;
}

.sentence-rpg-page .companion-detail-link::before {
  background-image: url("assets/ui/sentence-pixel/sentence-icon-paw.png") !important;
}

@media (max-width: 760px) {
  .sentence-rpg-page #growthText,
  .sentence-rpg-page .food-shortcut-head {
    grid-template-columns: 1fr !important;
    justify-items: center !important;
    text-align: center !important;
  }

  .sentence-rpg-page .pet-companion-actions .soft-button,
  .sentence-rpg-page .pet-companion-actions a {
    min-height: 46px !important;
    height: 46px !important;
    padding: 0 12px !important;
    font-size: 14px !important;
  }
}

/* Absolute final word-chip hover lock: soft two-tone reveal like the reference. */
.sentence-rpg-page .word-chip:not(:disabled):hover,
.sentence-rpg-page .word-chip:not(:disabled):focus-visible {
  color: #17345f !important;
  border-color: #8fb9f2 !important;
  background:
    linear-gradient(180deg, rgba(255, 253, 193, 0.94) 0 49%, rgba(214, 244, 248, 0.96) 50% 100%) !important;
  box-shadow:
    0 6px 0 rgba(95, 145, 211, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  transform: translateY(-2px) !important;
}

.sentence-rpg-page .word-chip:not(:disabled):active {
  transform: translateY(1px) !important;
  box-shadow: 0 3px 0 rgba(95, 145, 211, 0.14) !important;
}

/* Target restore layer: compact Fig.2 sentence practice layout. */
.sentence-rpg-page {
  overflow-x: hidden;
}

.sentence-rpg-page .pet-app {
  min-height: calc(100vh - 86px);
  padding-bottom: 96px;
}

.sentence-rpg-page .topbar {
  grid-template-columns: minmax(220px, 0.9fr) minmax(250px, 1.1fr) minmax(360px, 1.25fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 10px 12px;
}

.sentence-rpg-page .brand {
  min-width: 0;
}

.sentence-rpg-page .brand h1 {
  margin: 0;
  font-size: clamp(22px, 2vw, 30px);
  white-space: nowrap;
}

.sentence-rpg-page .eyebrow {
  margin: 0 0 2px;
}

.sentence-rpg-page .lesson-select-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sentence-rpg-page .lesson-select-top span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sentence-rpg-page .top-stats {
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.sentence-rpg-page .top-stat-chip,
.sentence-rpg-page .top-stats span,
.sentence-rpg-page .sentence-sound-button,
.sentence-rpg-page .sentence-settings summary,
.sentence-rpg-page .soft-button.small {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.sentence-rpg-page .sentence-settings summary {
  width: 38px;
}

.sentence-rpg-page .sentence-progress-bar {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto auto auto;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  padding: 8px 12px;
}

.sentence-rpg-page .playground {
  grid-template-columns: minmax(0, 2.15fr) minmax(300px, 0.95fr);
  gap: 12px;
}

.sentence-rpg-page .quiz-card,
.sentence-rpg-page .buddy-card {
  min-width: 0;
  border-radius: 18px;
}

.sentence-rpg-page .quiz-card {
  display: grid;
  grid-template-rows: auto auto minmax(110px, auto) auto auto auto;
  gap: 8px;
}

.sentence-rpg-page .sentence-deck-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 2px solid rgba(131, 174, 243, 0.74);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
}

.sentence-rpg-page .sentence-deck-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.sentence-rpg-page .sentence-deck-summary > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.sentence-rpg-page .sentence-deck-summary label,
.sentence-rpg-page .sentence-deck-count {
  color: #4c6f9c;
  font-size: 12px;
  font-weight: 900;
}

.sentence-rpg-page .sentence-deck-summary strong {
  min-width: 0;
  overflow: hidden;
  color: #17345f;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sentence-rpg-page .sentence-deck-summary span {
  color: #7a8cab;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.sentence-rpg-page .lesson-meta {
  padding: 6px 10px;
}

.sentence-rpg-page .cn-sentence {
  width: min(760px, 94%);
  margin: 8px auto 4px;
  padding: 14px 16px;
  font-size: clamp(26px, 3.25vw, 38px);
}

.sentence-rpg-page .answer-slots {
  justify-content: center;
  gap: 8px;
  margin: 4px auto;
}

.sentence-rpg-page .word-bank {
  max-width: 760px;
  margin: 4px auto;
}

.sentence-rpg-page .hint-line {
  margin: 0 auto;
}

.sentence-rpg-page .action-row {
  width: min(680px, 96%);
  margin-top: 8px;
}

.sentence-rpg-page .buddy-card {
  display: grid;
  grid-template-rows: auto minmax(250px, 300px) auto;
  gap: 10px;
}

.sentence-rpg-page .pet-compact-summary {
  min-width: 0;
  padding: 2px 2px 0;
}

.sentence-rpg-page .pet-compact-summary h2 {
  max-width: 180px;
  overflow: hidden;
  font-size: clamp(18px, 1.8vw, 24px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sentence-rpg-page .buddy-stage {
  height: 100%;
  min-height: 250px;
  max-height: 300px;
  background-position: center bottom;
  background-size: cover;
}

.sentence-rpg-page .pet-anchor {
  bottom: 19%;
}

.sentence-rpg-page .buddy-shadow {
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
}

.sentence-rpg-page .growth-card {
  min-height: 0;
  padding: 9px;
}

.sentence-rpg-page .food-shortcut-grid {
  min-height: 52px;
  max-height: 106px;
  overflow: auto;
}

.sentence-rpg-page .food-shortcut-empty {
  margin: 0;
  color: #4d6f9c;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.deck-selector-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(24, 56, 104, 0.34);
}

.deck-selector-modal.open {
  display: grid;
}

.deck-selector-card {
  width: min(760px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 42px));
  overflow: auto;
  border: 2px solid #83aef3;
  border-radius: 18px;
  padding: 14px;
  background: rgba(247, 252, 255, 0.97);
  box-shadow: 0 18px 40px rgba(48, 96, 160, 0.24);
}

.deck-selector-card .sentence-series-list,
.deck-selector-card .sentence-grade-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.deck-selector-card .sentence-grade-list {
  grid-template-columns: 1fr;
}

.deck-selector-card .sentence-series-item,
.deck-selector-card .sentence-deck-item {
  width: 100%;
}

@media (max-width: 1080px) {
  .sentence-rpg-page .topbar {
    grid-template-columns: 1fr;
  }

  .sentence-rpg-page .top-stats {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .sentence-rpg-page .playground {
    grid-template-columns: 1fr;
  }

  .sentence-rpg-page .buddy-card {
    grid-template-rows: auto 280px auto;
  }
}

@media (max-width: 620px) {
  .sentence-rpg-page .pet-app {
    width: calc(100vw - 12px);
    padding-inline: 6px;
    padding-bottom: 92px;
  }

  .sentence-rpg-page .lesson-select-top,
  .sentence-rpg-page .sentence-progress-bar,
  .sentence-rpg-page .sentence-deck-summary > div {
    grid-template-columns: 1fr;
  }

  .sentence-rpg-page .sentence-progress-bar {
    gap: 6px;
  }

  .sentence-rpg-page .sentence-deck-bar {
    grid-template-columns: 1fr;
  }

  .sentence-rpg-page .sentence-deck-summary {
    align-items: stretch;
  }

  .sentence-rpg-page .cn-sentence {
    font-size: clamp(22px, 7vw, 30px);
  }

  .sentence-rpg-page .word-chip {
    min-width: 76px;
    padding-inline: 10px;
    font-size: 14px;
  }

  .sentence-rpg-page .buddy-card {
    grid-template-rows: auto 240px auto;
  }

  .sentence-rpg-page .speech-bubble {
    right: -56px;
    width: 136px;
    font-size: 12px;
  }
}

/* Pixel icon and frame polish from the supplied sentence UI sheet. */
.sentence-rpg-page {
  --sheet-word-frame: url("assets/ui/sentence-pixel/sentence-frame-word-wide.png");
  --sheet-square-frame: url("assets/ui/sentence-pixel/sentence-frame-word-square.png");
  --sheet-gold-frame: url("assets/ui/sentence-pixel/sentence-frame-button-gold.png");
  --sheet-cn-bubble: url("assets/ui/sentence-pixel/sentence-frame-cn-bubble.png");
}

.sentence-rpg-page .brand-ball {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.sentence-rpg-page .brand-ball img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

.sentence-rpg-page .top-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sentence-rpg-page .top-stat-chip:first-child::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  background: url("assets/ui/sentence-pixel/sentence-icon-paw.png") center / contain no-repeat;
}

.sentence-rpg-page .icon-action,
.sentence-rpg-page .sentence-sound-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.sentence-rpg-page .icon-action::before,
.sentence-rpg-page .sentence-sound-button::before {
  content: "";
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  background: var(--action-icon) center / contain no-repeat;
}

.sentence-rpg-page .icon-guide {
  --action-icon: url("assets/ui/sentence-pixel/sentence-icon-open-book.png");
}

.sentence-rpg-page .icon-paw {
  --action-icon: url("assets/ui/sentence-pixel/sentence-icon-paw.png");
}

.sentence-rpg-page .icon-sound,
.sentence-rpg-page .sentence-sound-button {
  --action-icon: url("assets/ui/sentence-pixel/sentence-icon-sound.png");
}

.sentence-rpg-page .icon-hint {
  --action-icon: url("assets/ui/sentence-pixel/sentence-icon-hint.png");
}

.sentence-rpg-page .icon-clear {
  --action-icon: url("assets/ui/sentence-pixel/sentence-icon-clear.png");
}

.sentence-rpg-page .icon-refresh {
  --action-icon: url("assets/ui/sentence-pixel/sentence-icon-refresh.png");
}

.sentence-rpg-page .icon-star {
  --action-icon: url("assets/ui/sentence-pixel/sentence-icon-star.png");
}

.sentence-rpg-page .soft-button,
.sentence-rpg-page .sentence-sound-button,
.sentence-rpg-page .settings-action {
  border: 0;
  border-radius: 12px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.72), rgba(232, 244, 255, 0.62)),
    var(--sheet-word-frame) center / 100% 100% no-repeat;
  box-shadow: none;
}

.sentence-rpg-page .primary-button {
  border: 0;
  border-radius: 12px;
  color: #744608;
  background:
    linear-gradient(rgba(255, 241, 158, 0.22), rgba(255, 203, 72, 0.22)),
    var(--sheet-gold-frame) center / 100% 100% no-repeat;
  box-shadow: none;
}

.sentence-rpg-page .action-row .soft-button,
.sentence-rpg-page .action-row .primary-button {
  min-height: 58px;
  padding: 12px 14px;
  font-size: 16px;
}

.sentence-rpg-page .cn-sentence {
  position: relative;
  border: 0;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 24px rgba(94, 137, 196, 0.14);
}

.sentence-rpg-page .cn-sentence::before {
  content: "";
  position: absolute;
  inset: -10px -12px;
  z-index: -1;
  border-radius: 18px;
  background: var(--sheet-cn-bubble) center / 100% 100% no-repeat;
  opacity: 0.24;
  pointer-events: none;
}

.sentence-rpg-page .word-chip,
.sentence-rpg-page .answer-slot {
  border: 0;
  border-radius: 12px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.78), rgba(232, 244, 255, 0.7)),
    var(--sheet-word-frame) center / 100% 100% no-repeat;
  box-shadow: none;
}

.sentence-rpg-page .answer-slot {
  background:
    rgba(255, 255, 255, 0.66)
    var(--sheet-square-frame) center / 100% 100% no-repeat;
}

.sentence-rpg-page .sentence-deck-bar,
.sentence-rpg-page .growth-card,
.sentence-rpg-page .food-shortcut-grid {
  border-color: rgba(109, 160, 239, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78);
}

.sentence-rpg-page .pet-detail-mini,
.sentence-rpg-page .hidden-pet-detail-control,
.sentence-rpg-page .pet-tags,
.sentence-rpg-page .pet-stat-grid,
.sentence-rpg-page .pet-skill-line,
.sentence-rpg-page .pet-desc-line {
  display: none !important;
}

.sentence-rpg-page .app-bottom-tabbar img {
  object-fit: contain;
}

@media (max-width: 620px) {
  .sentence-rpg-page .action-row .soft-button,
  .sentence-rpg-page .action-row .primary-button {
    min-height: 52px;
    padding: 10px 12px;
    font-size: 15px;
  }

  .sentence-rpg-page .icon-action::before,
  .sentence-rpg-page .sentence-sound-button::before {
    width: 19px;
    height: 19px;
  }
}

/* Requested cleanup: keep icons tasteful, keep the answer actions plain, align the two main panels. */
.sentence-rpg-page .playground {
  align-items: stretch;
}

.sentence-rpg-page .quiz-card,
.sentence-rpg-page .buddy-card {
  height: 100%;
}

.sentence-rpg-page .quiz-card {
  min-height: 100%;
}

.sentence-rpg-page .buddy-card {
  min-height: 100%;
}

.sentence-rpg-page .sentence-deck-summary label,
.sentence-rpg-page .pet-compact-summary .eyebrow,
.sentence-rpg-page .food-shortcut-head span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sentence-rpg-page .sentence-deck-summary label::before {
  content: "";
  width: 22px;
  height: 22px;
  background: url("assets/ui/sentence-pixel/sentence-icon-open-book.png") center / contain no-repeat;
}

.sentence-rpg-page .pet-compact-summary .eyebrow::before,
.sentence-rpg-page .food-shortcut-head span::before {
  content: "";
  width: 20px;
  height: 20px;
  background: url("assets/ui/sentence-pixel/sentence-icon-paw.png") center / contain no-repeat;
}

.sentence-rpg-page .cn-sentence {
  border: 2px solid rgba(244, 178, 82, 0.5);
  border-radius: 16px;
  background: rgba(255, 251, 241, 0.56);
  box-shadow:
    inset 0 0 0 1px rgba(255, 227, 172, 0.36),
    0 10px 20px rgba(108, 148, 204, 0.1);
}

.sentence-rpg-page .cn-sentence::before {
  display: none;
}

.sentence-rpg-page .action-row .soft-button,
.sentence-rpg-page .action-row .primary-button {
  gap: 0;
  border: 2px solid #86b5f7;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #eaf6ff);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 4px 0 rgba(82, 134, 210, 0.12);
}

.sentence-rpg-page .action-row .primary-button {
  border-color: #e0aa34;
  background: linear-gradient(180deg, #fff0a3, #ffd45a);
}

.sentence-rpg-page .action-row .soft-button::before,
.sentence-rpg-page .action-row .primary-button::before {
  display: none;
}

@media (min-width: 1081px) {
  .sentence-rpg-page .playground {
    grid-auto-rows: 1fr;
  }
}

/* Topbar and pet-stage placement correction. */
@media (min-width: 901px) {
  .sentence-rpg-page .topbar {
    display: grid;
    grid-template-columns: minmax(300px, 1.25fr) minmax(340px, 0.9fr) minmax(430px, 1.15fr);
    align-items: center;
    gap: 12px;
    min-height: 82px;
    padding: 10px 14px;
  }

  .sentence-rpg-page .lesson-select-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    justify-self: center;
    width: min(100%, 470px);
  }

  .sentence-rpg-page .top-stats {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .sentence-rpg-page .top-stat-chip,
  .sentence-rpg-page .top-stats span,
  .sentence-rpg-page .sentence-guide-button,
  .sentence-rpg-page .sentence-sound-button,
  .sentence-rpg-page .sentence-settings summary {
    min-height: 40px;
  }
}

.sentence-rpg-page .brand-ball {
  width: 58px;
  height: 58px;
}

.sentence-rpg-page .buddy-card {
  overflow: hidden;
}

.sentence-rpg-page .buddy-stage {
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(30, 92, 150, 0.02)),
    url("assets/ui/sentence-sky-kingdom-stage.png") center bottom / cover no-repeat,
    #e3f6ff;
}

.sentence-rpg-page .pet-anchor {
  position: absolute;
  left: 50%;
  bottom: 24%;
  z-index: 7;
  width: min(54%, 220px);
  height: 34%;
  transform: translateX(-50%);
  pointer-events: none;
}

.sentence-rpg-page .pet-anchor .buddy {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100%;
  height: 100%;
  transform: translateX(-50%) scale(var(--pet-stage-scale, 0.82));
  transform-origin: 50% 100%;
  pointer-events: auto;
}

.sentence-rpg-page .pet-anchor .buddy-art {
  left: 50%;
  bottom: 0;
  width: 100%;
  height: 100%;
  transform: translateX(-50%);
  background-position: center bottom;
  background-size: contain;
}

.sentence-rpg-page .pet-anchor .pet-stage-egg {
  --pet-stage-scale: 0.54;
}

.sentence-rpg-page .pet-anchor .pet-stage-1 {
  --pet-stage-scale: 0.72;
}

.sentence-rpg-page .pet-anchor .pet-stage-2 {
  --pet-stage-scale: 0.86;
}

.sentence-rpg-page .pet-anchor .pet-stage-3 {
  --pet-stage-scale: 1;
}

.sentence-rpg-page .pet-anchor .speech-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 4px);
  z-index: 8;
  width: clamp(132px, 82%, 190px);
  max-width: calc(100% + 20px);
  min-height: 28px;
  padding: 8px 10px;
  border: 2px solid rgba(91, 137, 211, 0.72);
  border-radius: 12px;
  color: #17345f;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  background: rgba(255, 252, 236, 0.94);
  box-shadow: 0 5px 0 rgba(73, 118, 188, 0.12);
  transform: translateX(-50%);
  white-space: normal;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

.sentence-rpg-page .pet-anchor .speech-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 14px;
  height: 14px;
  border-right: 2px solid rgba(91, 137, 211, 0.72);
  border-bottom: 2px solid rgba(91, 137, 211, 0.72);
  background: rgba(255, 252, 236, 0.94);
  transform: translateX(-50%) rotate(45deg);
}

.sentence-rpg-page .pet-anchor .image-buddy.happy .buddy-art {
  animation-name: petHappyHopContained;
}

.sentence-rpg-page .pet-anchor .image-buddy.catch .buddy-art {
  transform: translateX(-50%) translateY(-8px) scale(1.025);
}

.sentence-rpg-page .pet-anchor .image-buddy.mouth-open .buddy-art,
.sentence-rpg-page .pet-anchor .image-buddy.eat .buddy-art {
  transform: translateX(-50%) scale(1.025);
}

@keyframes petHappyHopContained {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  45% {
    transform: translateX(-50%) translateY(-10px);
  }
}

@media (max-width: 900px) {
  .sentence-rpg-page .pet-anchor {
    width: min(58%, 190px);
    height: 33%;
    bottom: 23%;
  }

  .sentence-rpg-page .pet-anchor .speech-bubble {
    width: clamp(124px, 86%, 170px);
    max-width: calc(100% + 12px);
    font-size: 11px;
  }
}

/* Pre-chaos target restoration: sentence page framework from the UI logic drafts. */
body.sentence-rpg-page {
  --sentence-blue-line: #79aefd;
  --sentence-deep: #143576;
  --sentence-soft-blue: #e8f3ff;
  --sentence-gold: #ffd35a;
  --sentence-orange: #ff8a3d;
  margin: 0;
  overflow-x: hidden;
  color: var(--sentence-deep);
  background: linear-gradient(180deg, #eef8ff 0%, #dcefff 100%);
}

.sentence-rpg-page .pet-app {
  width: min(1420px, calc(100vw - 24px));
  min-height: calc(100vh - 92px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0 92px;
}

.sentence-rpg-page .topbar,
.sentence-rpg-page .sentence-progress-bar,
.sentence-rpg-page .quiz-card,
.sentence-rpg-page .buddy-card {
  border: 2px solid var(--sentence-blue-line);
  border-radius: 12px;
  box-shadow:
    0 5px 0 rgba(68, 126, 190, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.88);
}

.sentence-rpg-page .topbar {
  min-height: 84px;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 0.56fr) minmax(360px, auto);
  align-items: center;
  margin: 0;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(232, 247, 255, 0.9));
}

.sentence-rpg-page .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sentence-rpg-page .brand-ball {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  font-size: 25px;
  background:
    url("assets/ui/sentence-pixel/icon-sentence-notebook.png") center / contain no-repeat,
    linear-gradient(180deg, #ffffff, #dff0ff);
  color: transparent;
}

.sentence-rpg-page .brand h1 {
  margin: 0;
  color: var(--sentence-deep);
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1;
}

.sentence-rpg-page .lesson-select-top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sentence-rpg-page .lesson-select-top span,
.sentence-rpg-page .top-stat-chip,
.sentence-rpg-page .sentence-progress-bar > span,
.sentence-rpg-page .sentence-progress-bar > strong {
  min-height: 40px;
  display: grid;
  place-items: center;
  border: 2px solid #9cc6ff;
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--sentence-deep);
  font-size: 14px;
  font-weight: 950;
  line-height: 1.15;
  background: rgba(255, 255, 255, 0.88);
}

.sentence-rpg-page .top-stats {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.sentence-rpg-page .sentence-sound-button,
.sentence-rpg-page .sentence-settings summary,
.sentence-rpg-page .sentence-guide-button {
  width: auto;
  min-width: 44px;
  min-height: 42px;
  border: 2px solid #9cc6ff;
  border-radius: 8px;
  padding: 6px 10px;
}

.sentence-rpg-page .sentence-settings summary {
  width: 46px;
}

.sentence-rpg-page .sentence-progress-bar {
  min-height: 52px;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) 64px minmax(128px, auto) minmax(116px, auto);
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 10px;
  background: rgba(247, 252, 255, 0.92);
}

.sentence-rpg-page .sentence-progress-track {
  height: 16px;
  border: 2px solid #9cc6ff;
  border-radius: 999px;
  overflow: hidden;
  background: #d8e9fb;
}

.sentence-rpg-page .sentence-progress-track span {
  height: 100%;
  background: linear-gradient(90deg, var(--sentence-gold), #7fc7ff);
}

.sentence-rpg-page .playground {
  min-height: 760px;
  display: grid;
  grid-template-columns: minmax(0, 0.69fr) minmax(330px, 0.31fr);
  gap: 12px;
  align-items: stretch;
}

.sentence-rpg-page .quiz-card {
  min-height: 760px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(225, 235, 255, 0.62), rgba(226, 247, 236, 0.7)),
    url("assets/ui/sentence-sky-kingdom-stage.png") center bottom / cover no-repeat,
    #e4f5ff;
}

.sentence-rpg-page .sentence-deck-bar {
  min-height: 54px;
  border: 2px solid rgba(121, 174, 253, 0.92);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(248, 252, 255, 0.88);
}

.sentence-rpg-page .sentence-deck-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 10px;
}

.sentence-rpg-page .sentence-deck-head label {
  color: var(--sentence-deep);
  font-weight: 950;
}

.sentence-rpg-page .sentence-series-list,
.sentence-rpg-page .sentence-grade-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  vertical-align: middle;
}

.sentence-rpg-page .lesson-meta {
  display: none;
}

.sentence-rpg-page .cn-sentence {
  width: min(850px, 98%);
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 70px auto 44px;
  border: 1px solid rgba(255, 138, 61, 0.34);
  border-radius: 16px;
  padding: 18px;
  color: var(--sentence-deep);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 950;
  line-height: 1.22;
  text-align: center;
  background: rgba(255, 255, 255, 0.76);
  box-shadow:
    inset 0 0 0 1px rgba(255, 210, 137, 0.32),
    0 12px 30px rgba(82, 122, 174, 0.14);
}

.sentence-rpg-page .answer-slots {
  min-height: 64px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 66px;
}

.sentence-rpg-page .answer-slot {
  min-width: 96px;
  min-height: 54px;
  border: 2px dashed #8ebcff;
  border-radius: 12px;
  color: var(--sentence-deep);
  font-size: 22px;
  font-weight: 950;
  background: rgba(255, 255, 255, 0.88);
}

.sentence-rpg-page .word-bank {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  margin: 0 auto;
  padding: 0 12px;
  border: 0;
  background: transparent;
}

.sentence-rpg-page .word-chip {
  min-width: 92px;
  min-height: 52px;
  border: 2px solid #83b6f7;
  border-radius: 10px;
  padding: 8px 14px;
  color: var(--sentence-deep);
  font-size: 18px;
  font-weight: 950;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.92);
}

.sentence-rpg-page .hint-line {
  margin: auto auto 0;
  color: #496b9a;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.sentence-rpg-page .action-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(108px, 1fr)) minmax(150px, 1.35fr);
  gap: 10px;
  width: min(850px, 98%);
  margin: 150px auto 0;
  border: 2px solid rgba(121, 174, 253, 0.85);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.84);
}

.sentence-rpg-page .action-row button {
  min-height: 78px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 950;
}

.sentence-rpg-page .buddy-card {
  min-height: 760px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
  padding: 10px;
  background: linear-gradient(180deg, rgba(245, 252, 255, 0.96), rgba(230, 246, 255, 0.94));
}

.sentence-rpg-page .pet-compact-summary {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 2px solid #9cc6ff;
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.88);
}

.sentence-rpg-page .pet-compact-summary h2 {
  margin: 0;
  color: var(--sentence-deep);
  font-size: 20px;
}

.sentence-rpg-page .buddy-stage {
  height: auto;
  min-height: 520px;
  border: 2px solid #83b6f7;
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(18, 75, 126, 0.04)),
    url("assets/ui/sentence-sky-kingdom-stage.png") center bottom / cover no-repeat,
    #dff2ff;
}

.sentence-rpg-page .pet-anchor {
  left: 50%;
  bottom: 11%;
  transform: translateX(-50%);
}

.sentence-rpg-page .buddy {
  transform: scale(0.78);
  transform-origin: bottom center;
}

.sentence-rpg-page .speech-bubble {
  right: -92px;
  bottom: 82%;
  width: 170px;
  border: 2px solid rgba(255, 138, 61, 0.58);
  border-radius: 14px;
  color: #8a4214;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.92);
}

.sentence-rpg-page .growth-card {
  display: grid;
  gap: 8px;
  border: 2px solid #9cc6ff;
  border-radius: 12px;
  padding: 10px;
  background: rgba(247, 252, 255, 0.9);
}

.sentence-rpg-page .growth-track {
  height: 16px;
  border: 2px solid #17345f;
  border-radius: 999px;
  overflow: hidden;
  background: #e6eef8;
}

.sentence-rpg-page .growth-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7be383, var(--sentence-gold));
}

.sentence-rpg-page .food-shortcut-grid {
  min-height: 62px;
  border: 2px dashed #9cc6ff;
  border-radius: 12px;
  background: rgba(245, 252, 255, 0.84);
}

.sentence-rpg-page .pet-companion-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sentence-rpg-page .pet-companion-actions .soft-button,
.sentence-rpg-page .pet-companion-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
}

@media (max-width: 900px) {
  .sentence-rpg-page .topbar,
  .sentence-rpg-page .playground {
    grid-template-columns: 1fr;
  }

  .sentence-rpg-page .top-stats {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .sentence-rpg-page .sentence-progress-bar {
    grid-template-columns: auto minmax(120px, 1fr) 58px;
  }

  .sentence-rpg-page .quiz-card,
  .sentence-rpg-page .buddy-card {
    min-height: auto;
  }

  .sentence-rpg-page .action-row {
    margin-top: 40px;
  }
}

@media (max-width: 560px) {
  .sentence-rpg-page .pet-app {
    width: calc(100vw - 12px);
  }

  .sentence-rpg-page .lesson-select-top,
  .sentence-rpg-page .action-row {
    grid-template-columns: 1fr 1fr;
  }

  .sentence-rpg-page .action-row #checkBtn {
    grid-column: 1 / -1;
  }
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Arial", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 216, 92, 0.45), transparent 22%),
    radial-gradient(circle at 88% 18%, rgba(255, 145, 198, 0.36), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(117, 223, 173, 0.5), transparent 36%),
    linear-gradient(160deg, #dff5ff 0%, #f4edff 52%, #fff2dc 100%);
}

button {
  font: inherit;
}

.pet-app {
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.topbar,
.quiz-card,
.buddy-card,
.reward-panel,
.picker-card {
  border: 5px solid rgba(255, 255, 255, 0.88);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 250, 241, 0.86));
  box-shadow: var(--shadow), inset 0 -8px 0 rgba(72, 103, 151, 0.06);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-ball {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 5px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 32px;
  font-weight: 900;
  background:
    radial-gradient(circle at 34% 25%, rgba(255, 255, 255, 0.82) 0 10%, transparent 11%),
    linear-gradient(145deg, var(--pink), var(--blue));
  box-shadow: 0 10px 0 rgba(39, 126, 233, 0.16);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(25px, 5vw, 44px);
}

.top-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.top-stats span {
  border: 4px solid #fff;
  border-radius: 999px;
  padding: 9px 13px;
  color: #446240;
  font-weight: 900;
  background: linear-gradient(180deg, #f5ffd8, #dfffb6);
  box-shadow: 0 7px 0 rgba(110, 162, 77, 0.16);
}

.playground {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(330px, 0.38fr);
  gap: 16px;
  margin-top: 16px;
}

.quiz-card,
.buddy-card,
.reward-panel {
  padding: 18px;
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.sentence-deck-bar {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.sentence-deck-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sentence-deck-head span {
  color: #7c8ca5;
  font-size: 12px;
}

.sentence-series-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sentence-series-item,
.sentence-deck-item {
  border: 2px solid #b8ddff;
  border-radius: 10px;
  color: var(--blue-dark);
  cursor: pointer;
  text-align: left;
  background: #f3fbff;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
}

.sentence-series-item {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 9px;
}

.sentence-series-item.coral {
  background: linear-gradient(135deg, #ffe4df, #fff4e2);
}

.sentence-series-item.sky {
  background: linear-gradient(135deg, #dff5ff, #e8edff);
}

.sentence-series-item.violet {
  background: linear-gradient(135deg, #efe5ff, #ffe7f8);
}

.sentence-series-item.mint {
  background: linear-gradient(135deg, #e1fff2, #e7fbff);
}

.sentence-series-item.gold {
  background: linear-gradient(135deg, #fff4cc, #ffe8d8);
}

.sentence-series-item.active,
.sentence-deck-item.active {
  border-color: #58aefb;
  box-shadow: 0 0 0 3px rgba(88, 174, 251, 0.16);
}

.sentence-series-title,
.sentence-deck-title {
  display: block;
  font-weight: 950;
}

.sentence-series-title {
  font-size: 13px;
}

.sentence-series-sub,
.sentence-deck-sub {
  display: block;
  margin-top: 3px;
  color: #687892;
  font-size: 11px;
  font-weight: 850;
}

.sentence-grade-list {
  display: grid;
  gap: 8px;
  max-height: 190px;
  overflow: auto;
  padding-right: 2px;
}

.sentence-deck-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
}

.sentence-deck-item > span:last-child {
  color: #58aefb;
}

.lesson-meta span,
.lesson-meta strong {
  border-radius: 999px;
  padding: 7px 12px;
  background: #eef8ff;
}

.lesson-meta strong {
  color: var(--blue-dark);
}

.cn-sentence {
  margin: 24px 0 18px;
  text-align: center;
  font-size: clamp(26px, 5vw, 48px);
  font-weight: 900;
  line-height: 1.18;
}

.answer-slots,
.word-bank,
.action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.answer-slot,
.word-chip {
  min-width: 92px;
  min-height: 54px;
  border: 4px solid #fff;
  border-radius: 22px;
  padding: 9px 15px;
  font-size: clamp(18px, 3.5vw, 30px);
  font-weight: 900;
}

.answer-slot {
  color: #50617d;
  background: linear-gradient(180deg, #ffffff, #eaf7ff);
  box-shadow: inset 0 -5px 0 rgba(80, 156, 220, 0.1);
}

.answer-slot.filled {
  color: #184f91;
  background: linear-gradient(180deg, #f4fbff, #ccecff);
}

.answer-slot.hint-target {
  animation: targetPulse 760ms ease infinite alternate;
}

.answer-slot.wrong {
  animation: softShake 360ms ease;
}

.word-bank {
  margin-top: 20px;
}

.word-chip {
  cursor: pointer;
  color: #31405a;
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.9) 0 12%, transparent 13%),
    linear-gradient(180deg, #ffffff, #ffe6f0);
  box-shadow: 0 9px 0 rgba(255, 145, 198, 0.22);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.word-chip:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 0 rgba(255, 145, 198, 0.2);
}

.word-chip:disabled {
  opacity: 0.38;
  cursor: default;
  transform: translateY(5px);
  box-shadow: none;
}

.hint-line {
  min-height: 24px;
  margin: 18px 0 0;
  color: var(--muted);
  text-align: center;
  font-weight: 900;
}

.action-row {
  margin-top: 18px;
}

.soft-button,
.primary-button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 900;
}

.soft-button {
  color: #46617f;
  background:
    radial-gradient(circle at 35% 20%, rgba(255, 255, 255, 0.8) 0 12%, transparent 13%),
    linear-gradient(180deg, #ffffff, #e9f4ff);
  box-shadow: 0 7px 0 rgba(80, 126, 175, 0.13);
}

.soft-button.small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

.soft-button:disabled {
  cursor: not-allowed;
  color: rgba(70, 97, 127, 0.58);
  filter: saturate(0.75);
  opacity: 0.72;
  transform: none;
}

.primary-button {
  color: #fff;
  background:
    radial-gradient(circle at 32% 20%, rgba(255, 255, 255, 0.66) 0 13%, transparent 14%),
    linear-gradient(135deg, var(--blue), var(--mint));
  box-shadow: 0 9px 0 rgba(39, 126, 233, 0.18);
}

.buddy-card {
  display: grid;
  grid-template-rows: minmax(360px, 1fr) auto;
  gap: 14px;
}

.buddy-stage {
  position: relative;
  min-height: 360px;
  border-radius: 30px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 255, 255, 0.82) 0 26%, transparent 27%),
    radial-gradient(circle at 50% 46%, rgba(255, 224, 248, 0.55) 0 34%, transparent 35%),
    radial-gradient(circle at 24% 72%, #aee985 0 8%, transparent 9%),
    radial-gradient(circle at 76% 74%, #94d873 0 10%, transparent 11%),
    linear-gradient(180deg, #f2e8ff 0 46%, #d5f6ff 46% 100%);
}

.buddy-stage::before,
.buddy-stage::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.stage-decor,
.sparkle-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.decor-piece,
.sparkle-piece {
  position: absolute;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 4px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  font-size: 24px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 8px 20px rgba(110, 97, 155, 0.14);
  animation: decorFloat 2400ms ease-in-out infinite alternate;
}

.decor-piece:nth-child(2n) {
  animation-delay: -700ms;
}

.decor-piece:nth-child(3n) {
  animation-delay: -1200ms;
}

.sparkle-piece {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  animation: sparklePop 1100ms ease forwards;
}

.buddy-stage::before {
  left: 9%;
  right: 9%;
  bottom: 28px;
  height: 34px;
  border-radius: 50%;
  background: rgba(64, 104, 55, 0.14);
}

.buddy-stage::after {
  right: 14%;
  bottom: 70px;
  width: 86px;
  height: 112px;
  border-radius: 999px 999px 26px 26px;
  background:
    radial-gradient(circle at 50% 26%, rgba(255, 255, 255, 0.82) 0 18%, transparent 19%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(102, 184, 255, 0.3));
  box-shadow: inset 0 -12px 0 rgba(255, 255, 255, 0.32);
}

.speech-bubble {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 6;
  max-width: min(82%, 330px);
  border: 4px solid #fff;
  border-radius: 26px 26px 26px 10px;
  padding: 11px 15px;
  color: #405475;
  font-size: 18px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 0 rgba(77, 111, 162, 0.1);
}

.speech-bubble small {
  display: block;
  margin-top: 5px;
  color: #6f7e99;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.buddy {
  position: absolute;
  left: 50%;
  bottom: 44px;
  z-index: 5;
  width: 220px;
  height: 270px;
  transform: translateX(-50%) scale(var(--pet-grow, 1));
  transform-origin: 50% 100%;
  transition: transform 180ms ease, filter 180ms ease;
}

.buddy-art {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 6;
  display: block;
  width: 306px;
  height: 204px;
  max-width: none;
  background-image: var(--pet-image);
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center bottom;
  transform: translateX(-50%);
  filter: drop-shadow(0 18px 18px rgba(99, 78, 128, 0.18));
  pointer-events: none;
}

.image-buddy .head,
.image-buddy .body,
.image-buddy .ear,
.image-buddy .tail,
.image-buddy .arm,
.image-buddy .leg {
  display: none;
}

.image-buddy .gear {
  right: 30px;
  top: 124px;
}

.image-buddy.mouth-open .buddy-art,
.image-buddy.eat .buddy-art {
  transform: translateX(-50%) scale(1.035);
}

.image-buddy.catch .buddy-art {
  transform: translateX(-50%) translateY(-12px) scale(1.035);
}

.head,
.body,
.ear,
.tail,
.arm,
.leg,
.belly,
.eye,
.mouth,
.blush {
  position: absolute;
  display: block;
}

.head {
  left: 31px;
  top: 0;
  z-index: 4;
  width: 158px;
  height: 135px;
  border: 6px solid #fff;
  border-radius: 48% 52% 44% 44%;
  background:
    radial-gradient(circle at 33% 24%, rgba(255, 255, 255, 0.95) 0 11%, transparent 12%),
    radial-gradient(ellipse at 24% 42%, rgba(170, 160, 177, 0.5) 0 19%, transparent 20%),
    radial-gradient(ellipse at 76% 42%, rgba(170, 160, 177, 0.42) 0 19%, transparent 20%),
    linear-gradient(145deg, var(--pet-cream, #fff7ec), var(--pet-soft, #ffe5f1));
  box-shadow:
    inset 0 -10px 0 rgba(235, 133, 172, 0.1),
    0 0 34px rgba(255, 255, 255, 0.72);
}

.head::before,
.head::after {
  position: absolute;
  top: 9px;
  width: 17px;
  height: 38px;
  border-radius: 999px;
  content: "";
  background: rgba(154, 145, 169, 0.38);
}

.head::before {
  left: 50px;
  transform: rotate(-18deg);
}

.head::after {
  right: 50px;
  transform: rotate(18deg);
}

.body {
  left: 35px;
  bottom: 20px;
  z-index: 2;
  width: 150px;
  height: 165px;
  border: 6px solid #fff;
  border-radius: 48% 48% 42% 42%;
  background:
    radial-gradient(circle at 38% 22%, rgba(255, 255, 255, 0.94) 0 12%, transparent 13%),
    linear-gradient(145deg, var(--pet-cream, #fff4de), var(--pet-soft, #ffdceb));
  box-shadow: 0 0 28px rgba(255, 255, 255, 0.58);
}

.belly {
  left: 38px;
  top: 48px;
  width: 74px;
  height: 84px;
  border-radius: 48%;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.74) 0 18%, transparent 19%),
    rgba(255, 255, 255, 0.48);
}

.ear {
  top: -10px;
  z-index: 3;
  width: 58px;
  height: 72px;
  border: 6px solid #fff;
  background:
    radial-gradient(ellipse at 50% 58%, rgba(255, 154, 190, 0.42) 0 35%, transparent 36%),
    linear-gradient(145deg, var(--pet-cream, #fff2d3), var(--pet-soft, #ffbad9));
}

.ear-left {
  left: 20px;
  border-radius: 78% 32% 58% 38%;
  transform: rotate(-16deg);
}

.ear-right {
  right: 20px;
  border-radius: 32% 78% 38% 58%;
  transform: rotate(16deg);
}

.eye {
  top: 48px;
  width: 34px;
  height: 39px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 28%, #fff 0 14%, transparent 15%),
    radial-gradient(circle at 62% 72%, rgba(136, 218, 255, 0.9) 0 18%, transparent 19%),
    linear-gradient(180deg, #1d5b8f, #1c2949);
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.5);
}

.eye-left {
  left: 36px;
}

.eye-right {
  right: 36px;
}

.blush {
  top: 84px;
  width: 28px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 112, 157, 0.34);
}

.blush-left {
  left: 24px;
}

.blush-right {
  right: 24px;
}

.mouth {
  left: 50%;
  top: 88px;
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50% 50% 45% 45%;
  background: #ef8aa8;
  transform: translateX(-50%);
}

.arm {
  top: 60px;
  z-index: 3;
  width: 42px;
  height: 74px;
  border: 6px solid #fff;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe2ec, #ffc1dc);
}

.arm-left {
  left: -9px;
  transform: rotate(10deg);
}

.arm-right {
  right: -9px;
  transform: rotate(-10deg);
}

.leg {
  bottom: -9px;
  z-index: 1;
  width: 48px;
  height: 38px;
  border: 6px solid #fff;
  border-radius: 999px;
  background: #ffc7dc;
}

.leg-left {
  left: 24px;
}

.leg-right {
  right: 24px;
}

.tail {
  left: 0;
  bottom: 22px;
  z-index: 1;
  width: 95px;
  height: 58px;
  border: 6px solid #fff;
  border-radius: 999px 999px 999px 40px;
  background:
    radial-gradient(circle at 72% 45%, rgba(128, 118, 148, 0.42) 0 28%, transparent 29%),
    linear-gradient(90deg, var(--pet-soft, #ffc1dc), var(--pet-cream, #ffeecb));
  transform: rotate(-18deg);
}

.gear {
  position: absolute;
  right: 44px;
  top: 128px;
  z-index: 7;
  font-size: 34px;
  filter: drop-shadow(0 5px 0 rgba(255, 255, 255, 0.72));
}

.buddy[data-pet="cat"]::before {
  position: absolute;
  left: 50%;
  top: 100px;
  z-index: 7;
  width: 92px;
  height: 48px;
  content: "";
  background:
    radial-gradient(circle at 24% 50%, #ffd8ec 0 31%, transparent 32%),
    radial-gradient(circle at 76% 50%, #ffd8ec 0 31%, transparent 32%),
    radial-gradient(circle at 50% 50%, #f3a9c9 0 16%, transparent 17%),
    linear-gradient(90deg, transparent 0 42%, #f3a9c9 42% 58%, transparent 58%);
  filter: drop-shadow(0 5px 0 rgba(255, 255, 255, 0.8));
  transform: translateX(-50%);
}

.buddy[data-pet="cat"]::after {
  position: absolute;
  left: 50%;
  top: -12px;
  z-index: 0;
  width: 210px;
  height: 252px;
  border: 5px dashed rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  content: "";
  background:
    radial-gradient(circle at 16% 28%, rgba(255, 255, 255, 0.8) 0 4px, transparent 5px),
    radial-gradient(circle at 80% 72%, rgba(255, 255, 255, 0.8) 0 4px, transparent 5px);
  transform: translateX(-50%);
}

.image-buddy[data-pet="cat"]::before,
.image-buddy[data-pet="cat"]::after {
  display: none;
}

.buddy[data-pet="cat"] {
  --pet-cream: #fff8ee;
  --pet-soft: #ffe0ee;
}

.buddy[data-pet="dog"] {
  --pet-cream: #fff0d8;
  --pet-soft: #ffd3c0;
}

.buddy[data-pet="rabbit"] {
  --pet-cream: #fff7fb;
  --pet-soft: #ffd8f0;
}

.buddy[data-pet="bear"],
.buddy[data-pet="panda"] {
  --pet-cream: #fff5e0;
  --pet-soft: #dccfff;
}

.buddy[data-pet="fox"],
.buddy[data-pet="squirrel"] {
  --pet-cream: #ffe8c2;
  --pet-soft: #ffb98a;
}

.buddy[data-pet="penguin"],
.buddy[data-pet="whale"],
.buddy[data-pet="seal"],
.buddy[data-pet="dolphin"] {
  --pet-cream: #f7fbff;
  --pet-soft: #c9ecff;
}

.buddy[data-pet="turtle"],
.buddy[data-pet="lizard"],
.buddy[data-pet="crocodile"],
.buddy[data-pet="snake"],
.buddy[data-pet="frog"],
.buddy[data-pet="dino"],
.buddy[data-pet="ptero"] {
  --pet-cream: #f5ffe2;
  --pet-soft: #bff0bd;
}

.buddy[data-pet="bird"],
.buddy[data-pet="chick"],
.buddy[data-pet="swan"],
.buddy[data-pet="duck"],
.buddy[data-pet="owl"],
.buddy[data-pet="flamingo"],
.buddy[data-pet="peacock"],
.buddy[data-pet="parrot"],
.buddy[data-pet="ladybug"],
.buddy[data-pet="bee"] {
  --pet-cream: #fff9d7;
  --pet-soft: #ffd4f0;
}

.buddy[data-pet="rabbit"] .ear {
  height: 74px;
  border-radius: 999px;
}

.buddy[data-pet="bear"] .ear,
.buddy[data-pet="panda"] .ear,
.buddy[data-pet="penguin"] .ear,
.buddy[data-pet="seal"] .ear,
.buddy[data-pet="whale"] .ear,
.buddy[data-pet="dolphin"] .ear {
  top: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.buddy[data-pet="bird"] .ear,
.buddy[data-pet="chick"] .ear,
.buddy[data-pet="swan"] .ear,
.buddy[data-pet="duck"] .ear,
.buddy[data-pet="owl"] .ear,
.buddy[data-pet="flamingo"] .ear,
.buddy[data-pet="peacock"] .ear,
.buddy[data-pet="parrot"] .ear,
.buddy[data-pet="bee"] .ear,
.buddy[data-pet="ladybug"] .ear {
  top: 18px;
  width: 32px;
  height: 26px;
  border-radius: 60% 60% 40% 40%;
}

.buddy[data-pet="turtle"] .tail,
.buddy[data-pet="lizard"] .tail,
.buddy[data-pet="crocodile"] .tail,
.buddy[data-pet="snake"] .tail,
.buddy[data-pet="dino"] .tail,
.buddy[data-pet="ptero"] .tail {
  right: 6px;
  bottom: 42px;
  width: 86px;
  height: 26px;
}

.buddy-shadow {
  position: absolute;
  left: 50%;
  bottom: 52px;
  z-index: 2;
  width: 174px;
  height: 30px;
  border-radius: 50%;
  background: rgba(50, 87, 45, 0.18);
  transform: translateX(-50%);
}

.buddy.happy {
  animation: jellyJump 680ms cubic-bezier(0.18, 0.82, 0.24, 1);
}

.buddy.sad {
  filter: saturate(0.8);
  transform: translateX(-50%) rotate(-4deg);
}

.buddy.cry {
  animation: cryWobble 840ms ease;
  filter: saturate(0.72);
}

.buddy.cry .eye::after {
  position: absolute;
  left: 5px;
  top: 19px;
  width: 7px;
  height: 15px;
  border-radius: 999px;
  content: "";
  background: #70c9ff;
}

.buddy.is-sparkly::after {
  position: absolute;
  inset: 6px 10px 18px;
  z-index: 8;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 35%, rgba(255, 255, 255, 0.95) 0 3px, transparent 4px),
    radial-gradient(circle at 72% 28%, rgba(255, 232, 126, 0.95) 0 4px, transparent 5px),
    radial-gradient(circle at 66% 72%, rgba(255, 145, 198, 0.95) 0 4px, transparent 5px),
    radial-gradient(circle at 35% 78%, rgba(167, 218, 255, 0.95) 0 3px, transparent 4px);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.9));
  animation: sparkleTwinkle 900ms ease-in-out infinite alternate;
}

.buddy.mouth-open .mouth,
.buddy.eat .mouth {
  top: 68px;
  width: 34px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #465166;
}

.buddy.catch {
  animation: catchBubble 720ms ease;
}

.buddy.catch .arm-left {
  transform: rotate(-34deg) translateY(-22px);
}

.buddy.catch .arm-right {
  transform: rotate(34deg) translateY(-22px);
}

.buddy.eat {
  animation: jellyJump 560ms ease 2;
}

@keyframes jellyJump {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) scale(var(--pet-grow, 1));
  }
  38% {
    transform: translateX(-50%) translateY(-28px) scale(calc(var(--pet-grow, 1) * 1.05), calc(var(--pet-grow, 1) * 0.95));
  }
  64% {
    transform: translateX(-50%) translateY(4px) scale(calc(var(--pet-grow, 1) * 0.96), calc(var(--pet-grow, 1) * 1.04));
  }
}

@keyframes cryWobble {
  0%,
  100% {
    transform: translateX(-50%) rotate(0) scale(var(--pet-grow, 1));
  }
  25% {
    transform: translateX(-50%) rotate(-6deg) scale(var(--pet-grow, 1));
  }
  55% {
    transform: translateX(-50%) rotate(6deg) scale(var(--pet-grow, 1));
  }
}

@keyframes decorFloat {
  from {
    transform: translateY(0) rotate(-4deg);
  }
  to {
    transform: translateY(-10px) rotate(6deg);
  }
}

@keyframes sparklePop {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(0);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.6) rotate(30deg);
  }
}

@keyframes catchBubble {
  0%,
  100% {
    transform: translateX(-50%) scale(var(--pet-grow, 1));
  }
  45% {
    transform: translateX(-50%) translateY(-12px) scale(calc(var(--pet-grow, 1) * 1.04));
  }
}

@keyframes sparkleTwinkle {
  from {
    opacity: 0.54;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1.03);
  }
}

@keyframes targetPulse {
  from {
    box-shadow: 0 0 0 rgba(255, 216, 92, 0.2);
  }
  to {
    box-shadow: 0 0 0 7px rgba(255, 216, 92, 0.34);
  }
}

@keyframes softShake {
  0%,
  100% {
    transform: translateX(0);
  }
  35% {
    transform: translateX(-7px);
  }
  70% {
    transform: translateX(7px);
  }
}

.growth-card {
  border: 4px solid #fff;
  border-radius: 26px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff, #fff5d8);
}

.growth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 24px;
  font-weight: 900;
}

.growth-track {
  height: 26px;
  border: 4px solid #fff;
  border-radius: 999px;
  overflow: hidden;
  background: #e7f1dc;
}

.growth-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--yellow), var(--pink));
  transition: width 260ms ease;
}

#growthText,
.panel-sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.pet-detail-mini {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.hatch-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  border: 3px solid var(--pixel-border);
  border-radius: 4px;
  padding: 8px;
  background: rgba(7, 9, 18, 0.32);
  box-shadow: 3px 3px 0 var(--pixel-border);
}

.hatch-card strong {
  color: #fff6d0;
  font-size: 14px;
  text-shadow: 2px 2px 0 var(--pixel-border);
}

.hatch-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hatch-track {
  grid-column: 1 / -1;
  height: 12px;
  border: 3px solid var(--pixel-border);
  border-radius: 4px;
  overflow: hidden;
  background: #111827;
}

.hatch-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #9ea4ff, #6be7ff, #ffe58b);
  transition: width 260ms ease;
}

.egg-thumb {
  background-size: contain;
}

.egg-option:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.pet-tags,
.pet-stat-grid {
  display: grid;
  gap: 8px;
}

.pet-tags {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pet-tags span,
.pet-stat-grid span {
  min-width: 0;
  border: 3px solid var(--pixel-border);
  border-radius: 4px;
  padding: 6px 8px;
  color: #fff6d0;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  background: rgba(7, 9, 18, 0.38);
  box-shadow: 3px 3px 0 var(--pixel-border);
}

.pet-stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pet-stat-grid b {
  color: var(--yellow);
}

.pet-skill-line,
.pet-desc-line {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.pet-skill-line {
  color: #cdeaff;
}

.evolve-button {
  width: 100%;
  margin: 8px 0 10px;
}

.evolve-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.35);
  opacity: 0.62;
}

.evolve-button.guide-pulse {
  animation: guidePulse 1s ease-in-out 5;
  box-shadow: 0 0 0 5px rgba(255, 236, 119, 0.42), 0 12px 0 rgba(79, 106, 178, 0.22);
}

.reward-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

.collection-box {
  min-height: 132px;
  border: 4px dashed rgba(255, 255, 255, 0.92);
  border-radius: 26px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.44);
}

.panel-title {
  margin: 0;
  font-size: 21px;
  font-weight: 900;
}

.collection-item {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  min-width: 58px;
  min-height: 58px;
  margin-top: 12px;
  border: 3px solid #fff;
  border-radius: 12px;
  padding: 5px;
  color: #405475;
  font-size: 28px;
  font-weight: 900;
  cursor: grab;
  background:
    radial-gradient(circle at 35% 20%, rgba(255, 255, 255, 0.8) 0 12%, transparent 13%),
    linear-gradient(180deg, #fff8d9, #ffdba5);
  box-shadow: 0 9px 0 rgba(218, 159, 73, 0.18);
  user-select: none;
}

.collection-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.collection-item.stone-item {
  min-width: 58px;
  font-size: 12px;
  cursor: pointer;
}

.stone-thumb {
  width: 48px;
  height: 48px;
  background-image: var(--stone-image);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 5px 3px rgba(70, 82, 116, 0.22));
}

.food-thumb {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background-image: var(--food-image, none);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 5px 3px rgba(70, 82, 116, 0.22));
  font-size: 28px;
  line-height: 1;
}

.item-count {
  position: absolute;
  right: -5px;
  bottom: -5px;
  min-width: 24px;
  padding: 2px 4px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: #273650;
  font-size: 11px;
  line-height: 1;
  box-shadow: 0 3px 0 rgba(38, 51, 74, 0.28);
}

.item-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 30;
  display: grid;
  gap: 4px;
  width: max-content;
  max-width: 230px;
  padding: 9px 10px;
  border: 3px solid var(--pixel-border, #1c2534);
  border-radius: 8px;
  color: #223047;
  text-align: left;
  background: #fff7d0;
  box-shadow: 4px 4px 0 rgba(16, 24, 38, 0.32);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.item-tooltip::after {
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 12px;
  height: 12px;
  border-right: 3px solid var(--pixel-border, #1c2534);
  border-bottom: 3px solid var(--pixel-border, #1c2534);
  background: #fff7d0;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.item-tooltip strong {
  font-size: 13px;
  line-height: 1.25;
}

.item-tooltip small {
  color: #56657d;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.collection-item:hover .item-tooltip,
.collection-item:focus-visible .item-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.collection-item.super-stone-item {
  background:
    radial-gradient(circle at 35% 20%, rgba(255, 255, 255, 0.86) 0 12%, transparent 13%),
    linear-gradient(180deg, #fff4c2, #d8c3ff 55%, #a9e6ff);
  box-shadow: 0 9px 0 rgba(89, 80, 155, 0.2);
}

.collection-item.egg-item {
  background:
    radial-gradient(circle at 35% 20%, rgba(255, 255, 255, 0.88) 0 12%, transparent 13%),
    linear-gradient(180deg, #eaf8ff, #d8ecff 52%, #ffe9b8);
}

.egg-confirm-card {
  width: min(720px, 100%);
}

.egg-confirm-body {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.egg-confirm-thumb {
  width: 108px;
  height: 108px;
  background-image: var(--pet-image);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 8px 5px rgba(32, 48, 76, 0.28));
}

.starter-egg-lead {
  max-width: 620px;
}

.starter-egg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(640px, 100%);
}

.starter-egg-option {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 174px;
  border: 3px solid var(--pixel-border);
  border-radius: 6px;
  padding: 10px 8px;
  color: #fff6d0;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
    #26334a;
  box-shadow: 4px 4px 0 var(--pixel-border);
  font: inherit;
}

.starter-egg-option:hover {
  transform: translate(-2px, -2px);
  background:
    linear-gradient(180deg, rgba(255, 245, 187, 0.16), rgba(255, 255, 255, 0.04)),
    #304666;
  box-shadow: 6px 6px 0 var(--pixel-border);
}

.starter-egg-option .egg-confirm-thumb {
  width: 78px;
  height: 78px;
}

.starter-egg-option strong {
  font-size: 15px;
}

.starter-egg-option small {
  color: #c7d8ef;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
}

.hatched-pet-art {
  width: min(230px, 62vw);
  height: min(230px, 62vw);
  background-image: var(--pet-image);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 12px 8px rgba(14, 24, 42, 0.36));
}

.food-reward-preview {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  background-image:
    var(--food-image, none),
    radial-gradient(circle at 35% 20%, rgba(255, 255, 255, 0.82) 0 12%, transparent 13%),
    linear-gradient(180deg, #fff8d9, #ffdba5);
  background-repeat: no-repeat;
  background-position: center, center, center;
  background-size: 82px 82px, auto, auto;
  border: 4px solid var(--pixel-border);
  border-radius: 8px;
  color: #1f2734;
  box-shadow: 5px 5px 0 var(--pixel-border);
  font-size: 58px;
  line-height: 1;
}

.egg-confirm-body strong {
  color: #174277;
  font-size: 22px;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.85);
}

.egg-confirm-body p {
  margin: 0;
  max-width: min(360px, 86vw);
  color: #28537d;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.egg-confirm-body .evolution-condition-note {
  max-width: min(390px, 86vw);
  color: #426c96;
  font-size: 13px;
}

.egg-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.collection-box.drag-over {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 5px rgba(117, 223, 173, 0.34);
}

@keyframes guidePulse {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.pet-picker {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  padding: 18px;
  background: rgba(49, 64, 90, 0.38);
}

.pet-picker.open {
  display: grid;
  place-items: center;
}

.picker-card {
  width: min(900px, 100%);
  max-height: min(760px, 92vh);
  overflow: auto;
  padding: 18px;
}

.picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.pet-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pet-option {
  border: 4px solid #fff;
  border-radius: 24px;
  padding: 12px 10px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
  background: linear-gradient(180deg, #fff, #eef8ff);
  box-shadow: 0 8px 0 rgba(87, 122, 174, 0.12);
}

.pet-option span {
  display: block;
  margin-bottom: 6px;
}

.pet-option-name {
  color: #203451;
  font-size: 15px;
  line-height: 1.2;
}

.pet-option-desc {
  min-height: 54px;
  margin-bottom: 0;
  color: #526681;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.pet-thumb {
  width: 92px;
  height: 62px;
  margin: 0 auto 8px;
  background-image: var(--pet-image);
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center bottom;
  filter: drop-shadow(0 6px 6px rgba(72, 77, 120, 0.14));
}

.pet-option.active {
  background: linear-gradient(180deg, #fffbe1, #ddffd8);
}

@media (max-width: 900px) {
  .pet-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .playground,
  .reward-panel {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-stats {
    justify-content: flex-start;
  }

  .pet-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .starter-egg-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .starter-egg-option {
    min-height: 150px;
  }

  .pet-app {
    width: calc(100vw - 14px);
    padding-top: 8px;
  }

  .topbar,
  .quiz-card,
  .buddy-card,
  .reward-panel {
    border-width: 4px;
    border-radius: 26px;
    padding: 12px;
  }

  .brand-ball {
    width: 52px;
    height: 52px;
  }

  .top-stats span {
    padding: 7px 10px;
    font-size: 13px;
  }

  .answer-slot,
  .word-chip {
    min-width: 72px;
    min-height: 44px;
    border-radius: 17px;
    padding: 7px 9px;
  }

  .buddy-card {
    grid-template-rows: minmax(310px, 1fr) auto;
  }

  .buddy-stage {
    min-height: 310px;
  }

  .buddy {
    width: 172px;
    height: 212px;
  }

  .buddy-art {
    width: 228px;
    height: 152px;
  }

  .head {
    left: 24px;
    width: 124px;
    height: 108px;
  }

  .body {
    left: 27px;
    width: 118px;
    height: 130px;
  }

  .ear {
    width: 46px;
    height: 58px;
  }

  .eye {
    width: 26px;
    height: 31px;
  }

  .buddy[data-pet="cat"]::before {
    top: 86px;
    width: 76px;
  }

  .buddy[data-pet="cat"]::after {
    width: 168px;
    height: 210px;
  }

  .pet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Lingo Kingdom pixel RPG skin, aligned with the main matching game. */
:root {
  --ink: #eef9ff;
  --muted: #a9c1d6;
  --cream: #fff2bf;
  --blue: #39c6ff;
  --blue-dark: #1d5e89;
  --mint: #72efb5;
  --pink: #ff9ebc;
  --yellow: #ffe58b;
  --orange: #f0a63d;
  --purple: #9ea4ff;
  --pixel-border: #070912;
  --panel-bg: #26334a;
  --panel-strong: #344a68;
  --shadow: 0 0 0 4px var(--pixel-border), 8px 8px 0 var(--pixel-border);
}

body {
  color: var(--ink);
  font-family: "Noto Sans SC", "Microsoft YaHei", "Courier New", monospace;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(135deg, rgba(57, 198, 255, 0.15), transparent 32%),
    linear-gradient(180deg, #151923 0%, #26334a 58%, #182032 100%);
  image-rendering: pixelated;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.35;
}

.pet-app {
  width: min(1220px, calc(100vw - 28px));
}

.topbar,
.quiz-card,
.buddy-card,
.reward-panel,
.picker-card,
.growth-card,
.collection-box {
  border: 4px solid var(--pixel-border);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    var(--panel-bg);
  box-shadow: var(--shadow);
}

.topbar {
  align-items: stretch;
  background:
    linear-gradient(180deg, #3d5779 0%, #26334a 100%);
}

.brand-ball {
  border: 4px solid var(--pixel-border);
  border-radius: 6px;
  color: #1a1208;
  background:
    linear-gradient(180deg, #ffe58b 0 50%, #f0a63d 50% 100%);
  box-shadow: 4px 4px 0 var(--pixel-border);
}

.eyebrow,
.lesson-meta span,
.lesson-meta strong,
.hint-line,
#growthText,
.panel-sub {
  color: var(--muted);
}

h1,
h2,
.cn-sentence,
.panel-title,
.growth-top,
.top-stats span {
  color: #fff6d0;
  text-shadow: 2px 2px 0 var(--pixel-border);
}

.top-stats span,
.lesson-meta span,
.lesson-meta strong {
  border: 3px solid var(--pixel-border);
  border-radius: 4px;
  background: #1b2536;
  box-shadow: 4px 4px 0 var(--pixel-border);
}

.top-stats b {
  color: var(--yellow);
}

.playground {
  grid-template-columns: minmax(0, 0.64fr) minmax(310px, 0.36fr);
}

.quiz-card {
  position: relative;
  overflow: hidden;
}

.quiz-card::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  background:
    linear-gradient(180deg, rgba(7, 9, 18, 0.1), rgba(7, 9, 18, 0.48)),
    url("assets/battle/battle-background.png") center / cover no-repeat;
  opacity: 0.3;
  image-rendering: pixelated;
}

.quiz-card > * {
  position: relative;
  z-index: 1;
}

.cn-sentence {
  padding: 16px;
  border: 4px solid var(--pixel-border);
  border-radius: 4px;
  background: rgba(7, 9, 18, 0.58);
}

.answer-slot,
.word-chip,
.collection-item,
.pet-option {
  border: 3px solid var(--pixel-border);
  border-radius: 4px;
  color: #1f2734;
  background:
    linear-gradient(180deg, #fff8d0 0 50%, #f0c66e 50% 100%);
  box-shadow: 4px 4px 0 var(--pixel-border);
}

.answer-slot {
  min-height: 50px;
  color: #dcecff;
  background: rgba(7, 9, 18, 0.58);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.1), 4px 4px 0 var(--pixel-border);
}

.answer-slot.filled {
  color: #fff2bf;
  background: #344a68;
}

.word-chip {
  color: #1a1208;
}

.word-chip:hover,
.pet-option:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--pixel-border);
}

.word-chip:disabled {
  opacity: 0.38;
  transform: translateY(3px);
  box-shadow: 2px 2px 0 var(--pixel-border);
}

.soft-button,
.primary-button {
  border: 3px solid var(--pixel-border);
  border-radius: 4px;
  color: #1a1208;
  box-shadow: 4px 4px 0 var(--pixel-border);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.soft-button {
  background:
    linear-gradient(180deg, #d9f4ff 0 50%, #8bd7ff 50% 100%);
}

.primary-button {
  background:
    linear-gradient(180deg, #ffe58b 0 50%, #f0a63d 50% 100%);
}

.soft-button:hover,
.primary-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--pixel-border);
}

.back-link {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.sentence-guide-button {
  cursor: pointer;
}

/* Sentence practice first-run guide: mobile-game style spotlight tutorial. */
.sentence-guide.hidden {
  display: none;
}

.sentence-guide {
  position: fixed;
  inset: 0;
  z-index: 5000;
  pointer-events: none;
  font-family: "Noto Sans SC", "Inter", system-ui, sans-serif;
}

.sentence-guide-dim,
.sentence-guide-spotlight,
.sentence-guide-card,
.sentence-guide-arrow {
  position: fixed;
}

.sentence-guide-dim {
  z-index: 5000;
  background: rgba(2, 5, 14, 0.78);
  pointer-events: auto;
}

.sentence-guide-spotlight {
  z-index: 5001;
  border: 4px solid #ffef8a;
  border-radius: 12px;
  box-shadow:
    0 0 0 3px #c92828,
    0 0 24px rgba(255, 236, 132, 0.95),
    inset 0 0 20px rgba(255, 236, 132, 0.2);
  pointer-events: none;
  animation: sentenceGuideSpotlightPulse 0.95s ease-in-out infinite alternate;
}

.sentence-guide-arrow {
  z-index: 5003;
  width: 34px;
  height: 34px;
  filter: drop-shadow(3px 3px 0 #070912);
  pointer-events: none;
}

.sentence-guide-arrow::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  border-left: 17px solid transparent;
  border-right: 17px solid transparent;
}

.sentence-guide-arrow.up::before {
  border-bottom: 30px solid #ff3737;
}

.sentence-guide-arrow.down::before {
  border-top: 30px solid #ff3737;
}

.sentence-guide-card {
  z-index: 5004;
  box-sizing: border-box;
  padding: 16px;
  color: #1c1407;
  background:
    linear-gradient(180deg, #fff7d6 0 50%, #ffd876 50% 100%);
  border: 4px solid #070912;
  border-radius: 8px;
  box-shadow: 8px 8px 0 #070912, 0 12px 34px rgba(0, 0, 0, 0.36);
  pointer-events: auto;
}

.sentence-guide .sentence-guide-step {
  margin: 0 0 5px;
  color: #8c3a0d !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  text-shadow: none !important;
}

.sentence-guide .sentence-guide-title {
  margin: 0 0 8px;
  color: #251707 !important;
  font-size: 20px !important;
  line-height: 1.15 !important;
  letter-spacing: 0 !important;
  text-shadow: none !important;
}

.sentence-guide .sentence-guide-text {
  margin: 0;
  color: #3d2910 !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.55 !important;
  text-shadow: none !important;
}

.sentence-guide-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.sentence-guide-skip,
.sentence-guide-next {
  min-height: 34px;
  padding: 7px 12px;
  color: #120d05;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  border: 3px solid #070912;
  border-radius: 4px;
  box-shadow: 4px 4px 0 #070912;
  cursor: pointer;
}

.sentence-guide-skip {
  background: linear-gradient(180deg, #ffffff 0 50%, #d8e0ef 50% 100%);
}

.sentence-guide-next {
  color: #fff9d7;
  background: linear-gradient(180deg, #ff8a8a 0 50%, #ff4545 50% 100%);
}

@keyframes sentenceGuideSpotlightPulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.015);
  }
}

@media (max-width: 760px) {
  .sentence-guide-card {
    padding: 13px;
    box-shadow: 5px 5px 0 #070912, 0 10px 28px rgba(0, 0, 0, 0.34);
  }

  .sentence-guide-title {
    font-size: 17px;
  }

  .sentence-guide-text {
    font-size: 13px;
    line-height: 1.45;
  }

  .sentence-guide-actions {
    gap: 8px;
  }

  .sentence-guide-skip,
  .sentence-guide-next {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
  }
}

.buddy-stage {
  border: 4px solid var(--pixel-border);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(63, 174, 255, 0.2), rgba(7, 9, 18, 0.22)),
    url("assets/battle/battle-background.png") center / cover no-repeat;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.08);
  image-rendering: pixelated;
}

.buddy-stage::before,
.buddy-stage::after {
  display: none;
}

.speech-bubble {
  border: 3px solid var(--pixel-border);
  border-radius: 4px;
  color: #1f2734;
  background: #fff2bf;
  box-shadow: 4px 4px 0 var(--pixel-border);
}

.speech-bubble small {
  color: #5d6a82;
  font-size: 11px;
}

.growth-card {
  border-width: 3px;
  box-shadow: 4px 4px 0 var(--pixel-border);
}

.growth-track {
  border: 3px solid var(--pixel-border);
  border-radius: 4px;
  background: #151923;
}

.growth-track span {
  border-radius: 0;
  background: linear-gradient(90deg, #5cf3a7, #ffe58b);
}

.reward-panel {
  background:
    linear-gradient(180deg, #344a68 0%, #26334a 100%);
}

.collection-box {
  min-height: 124px;
  border-style: solid;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.collection-item {
  width: 58px;
  height: 58px;
  min-width: 58px;
  min-height: 58px;
  margin-top: 10px;
  padding: 5px;
  overflow: visible;
  color: #1f2734;
  font-size: 28px;
}

.collection-item.stone-item {
  grid-template-columns: none;
  min-width: 58px;
}

.stone-thumb {
  width: 48px;
  height: 48px;
}

.collection-box.drag-over {
  background: #344a68;
  box-shadow:
    inset 0 0 0 4px rgba(92, 243, 167, 0.5),
    4px 4px 0 var(--pixel-border);
}

.pet-picker {
  background: rgba(7, 9, 18, 0.72);
}

.pet-option.active {
  color: #1a1208;
  background:
    linear-gradient(180deg, #b8f7a1 0 50%, #5cf3a7 50% 100%);
}

.pet-thumb,
.buddy-art {
  image-rendering: auto;
}

@media (max-width: 900px) {
  .playground,
  .reward-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .pet-app {
    width: calc(100vw - 12px);
  }

  .topbar,
  .quiz-card,
  .buddy-card,
  .reward-panel {
    border-width: 3px;
    box-shadow: 4px 4px 0 var(--pixel-border);
  }

  .top-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .top-stats span,
  .back-link {
    width: 100%;
  }

  .cn-sentence {
    margin: 16px 0 12px;
    font-size: clamp(24px, 7vw, 34px);
  }

  .sentence-deck-bar {
    gap: 6px;
    margin-bottom: 10px;
  }

  .sentence-series-list {
    grid-template-columns: 1fr;
  }

  .sentence-series-item,
  .sentence-deck-item {
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .sentence-series-item {
    min-height: 48px;
  }

  .answer-slots,
  .word-bank,
  .action-row {
    gap: 7px;
  }

  .answer-slot,
  .word-chip {
    min-width: 64px;
    min-height: 42px;
    font-size: clamp(16px, 4.6vw, 22px);
  }
}

.game-page-nav {
  position: fixed;
  left: 50%;
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 80;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  width: min(390px, calc(100vw - 14px));
  padding: 4px;
  border: 2px solid rgba(83, 115, 154, 0.72);
  border-radius: 12px;
  background: rgba(247, 252, 255, 0.9);
  box-shadow: 0 9px 22px rgba(27, 70, 111, 0.22);
  transform: translateX(-50%);
}

.game-page-nav a {
  display: grid;
  place-items: center;
  min-height: 42px;
  color: #2c4668;
  text-decoration: none;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 900;
}

.game-page-nav a.active {
  color: #11203a;
  background: linear-gradient(180deg, #fff3a5 0 50%, #ffc857 50% 100%);
}

.pet-app {
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

/* Restore final visual layer: pre-responsive-task sentence page. */
body.sentence-rpg-page {
  min-height: 100vh;
  overflow-x: hidden;
  color: #17345f;
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    linear-gradient(180deg, rgba(236, 249, 255, 0.78), rgba(220, 241, 255, 0.88)),
    url("assets/ui/cloud-kingdom-game-bg.png") center bottom / cover fixed no-repeat,
    #dcefff;
}

body.sentence-rpg-page,
body.sentence-rpg-page * {
  text-shadow: none !important;
  box-sizing: border-box;
}

.sentence-rpg-page .pet-app {
  width: min(1380px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 12px 0 92px;
}

.sentence-rpg-page .topbar,
.sentence-rpg-page .quiz-card,
.sentence-rpg-page .buddy-card,
.sentence-rpg-page .picker-card {
  border: 2px solid #83aef3;
  border-radius: 16px;
  color: #17345f;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(233, 247, 255, 0.9)),
    rgba(247, 252, 255, 0.9);
  box-shadow:
    0 8px 0 rgba(76, 126, 202, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.86);
}

.sentence-rpg-page .topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px 14px;
}

.sentence-rpg-page .brand-ball {
  border: 2px solid #fff;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(180deg, #6aa5f0, #3b78d2);
  box-shadow: none;
}

.sentence-rpg-page .brand h1,
.sentence-rpg-page .pet-compact-summary h2 {
  color: #17345f;
}

.sentence-rpg-page .top-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.sentence-rpg-page .top-stat-chip,
.sentence-rpg-page .top-stats span {
  border: 2px solid #9fc4f1;
  border-radius: 999px;
  padding: 8px 11px;
  color: #17345f;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 -2px 0 rgba(68, 126, 190, 0.08);
}

.sentence-rpg-page .sentence-sound-button,
.sentence-rpg-page .sentence-settings summary,
.sentence-rpg-page .soft-button,
.sentence-rpg-page .primary-button {
  min-height: 40px;
  border: 2px solid #83aef3;
  border-radius: 10px;
  padding: 7px 12px;
  color: #17345f;
  font-weight: 900;
  background: linear-gradient(180deg, #fff, #e5f3ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.sentence-rpg-page .primary-button {
  color: #744608;
  border-color: #edb34e;
  background: linear-gradient(180deg, #fff5bd, #ffd35a);
}

.sentence-rpg-page .sentence-settings {
  position: relative;
}

.sentence-rpg-page .sentence-settings summary {
  display: grid;
  place-items: center;
  width: 42px;
  padding: 6px;
  list-style: none;
  cursor: pointer;
}

.sentence-rpg-page .sentence-settings summary::-webkit-details-marker {
  display: none;
}

.sentence-rpg-page .sentence-settings summary img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.sentence-rpg-page .sentence-settings-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 7px;
  min-width: 170px;
  border: 2px solid #83aef3;
  border-radius: 14px;
  padding: 10px;
  background: rgba(247, 252, 255, 0.96);
  box-shadow: 0 8px 0 rgba(76, 126, 202, 0.14);
}

.sentence-rpg-page .settings-action {
  border: 1.5px solid #9fc4f1;
  border-radius: 9px;
  padding: 7px 10px;
  color: #17345f;
  text-align: center;
  text-decoration: none;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.86);
}

.sentence-rpg-page .playground {
  display: grid;
  grid-template-columns: minmax(0, 1.78fr) minmax(320px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.sentence-rpg-page .quiz-card,
.sentence-rpg-page .buddy-card {
  padding: 14px;
}

.sentence-rpg-page .cn-sentence {
  width: min(760px, 96%);
  margin: 14px auto;
  border: 1px solid rgba(237, 179, 78, 0.45);
  border-radius: 16px;
  padding: 16px;
  color: #17345f;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.25;
  text-align: center;
  background: rgba(255, 252, 241, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 151, 0.32),
    0 8px 22px rgba(237, 179, 78, 0.12);
}

.sentence-rpg-page .word-bank {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 10px auto;
  padding: 8px;
  border: 0;
  background: transparent;
}

.sentence-rpg-page .word-chip,
.sentence-rpg-page .answer-slot {
  border: 2px solid #91bdf0;
  border-radius: 12px;
  color: #17345f;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 0 rgba(76, 126, 202, 0.1);
}

.sentence-rpg-page .word-chip {
  min-width: 88px;
  min-height: 46px;
  padding: 8px 14px;
  font-size: clamp(15px, 1.4vw, 19px);
  font-weight: 900;
  white-space: nowrap;
}

.sentence-rpg-page .action-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(82px, 1fr)) minmax(120px, 1.35fr);
  gap: 8px;
  width: min(720px, 96%);
  margin: 12px auto 0;
}

.sentence-rpg-page .pet-compact-summary,
.sentence-rpg-page .growth-top,
.sentence-rpg-page .food-shortcut-head,
.sentence-rpg-page .pet-companion-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sentence-rpg-page .buddy-stage {
  position: relative;
  height: 300px;
  overflow: hidden;
  border: 2px solid #83aef3;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(20, 78, 130, 0.05)),
    url("assets/ui/sentence-sky-kingdom-stage.png") center bottom / cover no-repeat,
    #e3f6ff;
}

.sentence-rpg-page .pet-anchor {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
}

.sentence-rpg-page .buddy {
  transform: scale(0.9);
  transform-origin: bottom center;
}

.sentence-rpg-page .speech-bubble {
  position: absolute;
  right: -98px;
  bottom: 78%;
  width: 168px;
  border: 2px solid rgba(237, 179, 78, 0.7);
  border-radius: 16px;
  padding: 8px 10px;
  color: #7b4318;
  font-weight: 900;
  background: rgba(255, 253, 244, 0.94);
}

.sentence-rpg-page .growth-card {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  border: 2px solid #9fc4f1;
  border-radius: 16px;
  padding: 10px;
  background: rgba(247, 252, 255, 0.84);
}

.sentence-rpg-page .food-shortcut-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 58px;
  border: 2px dashed #9fc4f1;
  border-radius: 14px;
  padding: 8px;
  background: rgba(235, 248, 255, 0.72);
}

@media (max-width: 820px) {
  .sentence-rpg-page .topbar,
  .sentence-rpg-page .playground {
    grid-template-columns: 1fr;
  }

  .sentence-rpg-page .top-stats {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .sentence-rpg-page .pet-app {
    width: calc(100vw - 14px);
  }

  .sentence-rpg-page .action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sentence-rpg-page #checkBtn {
    grid-column: 1 / -1;
  }
}

/* Final override after legacy duplicate blocks: pet bubble stays inside and pet stays on the lawn. */
.sentence-rpg-page .buddy-stage .pet-anchor {
  position: absolute !important;
  left: 50% !important;
  bottom: 24% !important;
  z-index: 20 !important;
  width: min(54%, 220px) !important;
  height: 34% !important;
  transform: translateX(-50%) !important;
  pointer-events: none !important;
}

.sentence-rpg-page .buddy-stage .pet-anchor .buddy {
  position: absolute !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  transform: translateX(-50%) scale(var(--pet-stage-scale, 0.82)) !important;
  transform-origin: 50% 100% !important;
  pointer-events: auto !important;
}

.sentence-rpg-page .buddy-stage .pet-anchor .buddy-art {
  position: absolute !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  transform: translateX(-50%) !important;
  background-position: center bottom !important;
  background-size: contain !important;
}

.sentence-rpg-page .buddy-stage .pet-anchor .pet-stage-egg { --pet-stage-scale: 0.54; }
.sentence-rpg-page .buddy-stage .pet-anchor .pet-stage-1 { --pet-stage-scale: 0.72; }
.sentence-rpg-page .buddy-stage .pet-anchor .pet-stage-2 { --pet-stage-scale: 0.86; }
.sentence-rpg-page .buddy-stage .pet-anchor .pet-stage-3 { --pet-stage-scale: 1; }

.sentence-rpg-page .buddy-stage .pet-anchor .speech-bubble {
  position: absolute !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: calc(100% - 4px) !important;
  z-index: 21 !important;
  width: clamp(132px, 82%, 190px) !important;
  max-width: calc(100% + 20px) !important;
  min-height: 28px !important;
  padding: 8px 10px !important;
  box-sizing: border-box !important;
  border: 2px solid rgba(91, 137, 211, 0.72) !important;
  border-radius: 12px !important;
  color: #17345f !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  text-align: center !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  background: rgba(255, 252, 236, 0.94) !important;
  box-shadow: 0 5px 0 rgba(73, 118, 188, 0.12) !important;
  transform: translateX(-50%) !important;
}

.sentence-rpg-page .buddy-stage .pet-anchor .speech-bubble::after {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  bottom: -8px !important;
  width: 14px !important;
  height: 14px !important;
  border-right: 2px solid rgba(91, 137, 211, 0.72) !important;
  border-bottom: 2px solid rgba(91, 137, 211, 0.72) !important;
  background: rgba(255, 252, 236, 0.94) !important;
  transform: translateX(-50%) rotate(45deg) !important;
}

.sentence-rpg-page .buddy-stage .pet-anchor .image-buddy.happy .buddy-art {
  animation-name: petHappyHopContained !important;
}

.sentence-rpg-page .buddy-stage .pet-anchor .image-buddy.catch .buddy-art {
  transform: translateX(-50%) translateY(-8px) scale(1.025) !important;
}

.sentence-rpg-page .buddy-stage .pet-anchor .image-buddy.mouth-open .buddy-art,
.sentence-rpg-page .buddy-stage .pet-anchor .image-buddy.eat .buddy-art {
  transform: translateX(-50%) scale(1.025) !important;
}

@media (max-width: 900px) {
  .sentence-rpg-page .buddy-stage .pet-anchor {
    bottom: 23% !important;
    width: min(58%, 190px) !important;
    height: 33% !important;
  }

  .sentence-rpg-page .buddy-stage .pet-anchor .speech-bubble {
    width: clamp(124px, 86%, 170px) !important;
    max-width: calc(100% + 12px) !important;
    font-size: 11px !important;
  }
}

/* Absolute final visual lock: new sentence game background and Fig.2 top border layout. */
.sentence-rpg-page .topbar {
  display: grid !important;
  grid-template-columns: minmax(270px, auto) minmax(360px, 1fr) auto !important;
  align-items: center !important;
  gap: 14px !important;
  min-height: 76px !important;
  margin: 10px 10px 8px !important;
  padding: 10px 12px !important;
  border: 2px solid #8ebaff !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(237, 248, 255, 0.9)) !important;
  box-shadow: 0 6px 0 rgba(91, 145, 218, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.78) !important;
}

.sentence-rpg-page .brand {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
}

.sentence-rpg-page .brand-ball {
  width: 54px !important;
  height: 54px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.sentence-rpg-page .brand h1 {
  margin: 0 !important;
  font-size: clamp(30px, 3.2vw, 42px) !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.sentence-rpg-page .lesson-select-top {
  display: grid !important;
  grid-template-columns: minmax(210px, 1fr) minmax(150px, auto) !important;
  align-items: center !important;
  justify-self: stretch !important;
  gap: 10px !important;
  width: auto !important;
  max-width: 520px !important;
  margin-left: auto !important;
}

.sentence-rpg-page .lesson-select-top span,
.sentence-rpg-page .top-stat-chip,
.sentence-rpg-page .sentence-guide-button,
.sentence-rpg-page .sentence-sound-button,
.sentence-rpg-page .sentence-settings summary {
  min-height: 38px !important;
  border: 2px solid #9ac1ff !important;
  border-radius: 10px !important;
  padding: 8px 12px !important;
  color: #17345f !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
  background: rgba(255, 255, 255, 0.82) !important;
  box-shadow: 0 3px 0 rgba(91, 145, 218, 0.12) !important;
}

.sentence-rpg-page .top-stats {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  min-width: 0 !important;
}

.sentence-rpg-page .sentence-settings summary {
  width: 44px !important;
  padding: 6px !important;
}

.sentence-rpg-page .sentence-progress-bar {
  display: grid !important;
  grid-template-columns: auto minmax(180px, 1fr) auto auto auto !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 10px 10px !important;
  padding: 8px 10px !important;
  border: 2px solid #8ebaff !important;
  border-radius: 12px !important;
  background: rgba(242, 250, 255, 0.9) !important;
  box-shadow: 0 4px 0 rgba(91, 145, 218, 0.1) !important;
}

.sentence-rpg-page .quiz-card {
  position: relative !important;
  overflow: hidden !important;
  background: rgba(236, 247, 255, 0.28) !important;
}

.sentence-rpg-page .quiz-card::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;
  display: block !important;
  background: linear-gradient(180deg, rgba(226, 238, 255, 0.16), rgba(255, 255, 255, 0.36)), url("assets/ui/cloud-kingdom-game-bg.png") center center / cover no-repeat !important;
  opacity: 0.72 !important;
  pointer-events: none !important;
}

.sentence-rpg-page .quiz-card > * {
  position: relative !important;
  z-index: 1 !important;
}

@media (max-width: 980px) {
  .sentence-rpg-page .topbar {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .sentence-rpg-page .lesson-select-top {
    max-width: none !important;
    margin-left: 0 !important;
  }

  .sentence-rpg-page .top-stats {
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }
}

/* Absolute final settings popover layer fix. */
.sentence-rpg-page .pet-app,
.sentence-rpg-page .topbar,
.sentence-rpg-page .top-stats,
.sentence-rpg-page .sentence-settings {
  overflow: visible !important;
}

.sentence-rpg-page .topbar {
  position: relative !important;
  z-index: 8200 !important;
}

.sentence-rpg-page .sentence-progress-bar,
.sentence-rpg-page .playground,
.sentence-rpg-page .quiz-card,
.sentence-rpg-page .buddy-card {
  position: relative !important;
  z-index: 1 !important;
}

.sentence-rpg-page .sentence-settings,
.sentence-rpg-page .sentence-settings[open] {
  position: relative !important;
  z-index: 9000 !important;
}

.sentence-rpg-page .sentence-settings-menu,
.sentence-rpg-page .sentence-settings[open] .sentence-settings-menu {
  position: absolute !important;
  top: calc(100% + 9px) !important;
  right: 0 !important;
  z-index: 9200 !important;
  display: grid !important;
  gap: 8px !important;
  width: min(320px, calc(100vw - 28px)) !important;
  min-width: 220px !important;
  max-height: min(68vh, 540px) !important;
  overflow: auto !important;
  padding: 12px !important;
  border: 2px solid rgba(88, 151, 210, 0.78) !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, rgba(248, 253, 255, 0.99), rgba(229, 247, 255, 0.97)) !important;
  box-shadow: 0 18px 34px rgba(38, 88, 145, 0.22) !important;
}

.sentence-rpg-page .sentence-settings-menu .settings-action {
  min-height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
}

/* Sentence DS v1 true EOF final layer. */
.sentence-rpg-page .lesson-meta span,
.sentence-rpg-page .lesson-meta strong {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: inherit !important;
  background: transparent !important;
  box-shadow: none !important;
}

.sentence-rpg-page .lesson-meta span {
  color: var(--lq-blue-600, #2f76d2) !important;
}

.sentence-rpg-page .lesson-meta strong {
  color: var(--lq-ink, #17345f) !important;
}

.sentence-rpg-page .top-stats .sentence-guide-button::before,
.sentence-rpg-page .top-stats .sentence-sound-button::before {
  display: none !important;
  content: none !important;
}

.sentence-rpg-page .top-stats .sentence-guide-button {
  font-size: 14px !important;
}

.sentence-rpg-page .top-stats .sentence-sound-label {
  display: none !important;
}

.sentence-rpg-page .top-stats .sentence-sound-button {
  color: transparent !important;
  font-size: 0 !important;
}

.sentence-rpg-page .top-stats .sentence-sound-button::after {
  content: "" !important;
  display: block !important;
  width: 25px !important;
  height: 25px !important;
  background: url("assets/ui/sentence-pixel/sentence-icon-sound.png") center / contain no-repeat !important;
}

/* Sentence topbar compact v1: merge repeated status into the top row and pull pet feedback upward. */
.sentence-rpg-page .pet-app {
  width: min(1120px, calc(100vw - 32px)) !important;
  gap: 10px !important;
  padding-top: 12px !important;
  padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)) !important;
}

.sentence-rpg-page .topbar {
  min-height: 86px !important;
  display: grid !important;
  grid-template-columns: auto minmax(154px, 0.9fr) minmax(220px, 1.12fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 12px 14px !important;
}

.sentence-rpg-page .sentence-back-button {
  width: 58px !important;
  min-width: 58px !important;
  height: 48px !important;
  display: inline-grid !important;
  place-items: center !important;
  border: 2px solid #9ecbf7 !important;
  border-radius: 18px !important;
  color: var(--lq-ink, #17345f) !important;
  background: linear-gradient(180deg, #ffffff, #eef9ff) !important;
  box-shadow: 0 6px 14px rgba(65, 129, 196, 0.13) !important;
  font-size: 15px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  text-decoration: none !important;
}

.sentence-rpg-page .brand {
  min-width: 0 !important;
  gap: 8px !important;
}

.sentence-rpg-page .brand-ball {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.sentence-rpg-page .brand-ball img {
  width: 34px !important;
  height: 34px !important;
}

.sentence-rpg-page .brand .eyebrow {
  display: none !important;
}

.sentence-rpg-page .brand h1 {
  font-size: clamp(24px, 2.4vw, 32px) !important;
  line-height: 1.02 !important;
  white-space: nowrap !important;
}

.sentence-rpg-page .brand .lq-topbar-subtitle {
  margin-top: 4px !important;
  font-size: 12px !important;
}

.sentence-rpg-page .lesson-select-top {
  min-width: 0 !important;
  max-width: none !important;
  width: 100% !important;
  height: 50px !important;
  min-height: 50px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 14px !important;
  border: 2px solid #9ecbf7 !important;
  border-radius: 20px !important;
  background: linear-gradient(180deg, #ffffff, #eef9ff) !important;
  box-shadow: 0 6px 14px rgba(65, 129, 196, 0.13) !important;
  cursor: pointer !important;
}

.sentence-rpg-page .lesson-select-top img {
  width: 24px !important;
  height: 24px !important;
  flex: 0 0 auto !important;
  object-fit: contain !important;
}

.sentence-rpg-page .lesson-select-top .top-deck-static {
  min-width: 0 !important;
  display: block !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  color: var(--lq-ink, #17345f) !important;
  font-size: 18px !important;
  font-weight: 950 !important;
}

.sentence-rpg-page .lesson-select-top span,
.sentence-rpg-page .lesson-select-top .top-deck-static {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.sentence-rpg-page .lesson-select-top .top-deck-live,
.sentence-rpg-page .lesson-select-top #topDeckLabel,
.sentence-rpg-page .lesson-select-top #topQuestionLabel {
  display: none !important;
}

.sentence-rpg-page .top-stats {
  min-width: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
}

.sentence-rpg-page .top-stats .top-stat-chip {
  width: auto !important;
  min-width: 78px !important;
  height: 48px !important;
  min-height: 48px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  padding: 0 12px !important;
  border-radius: 18px !important;
  font-size: 15px !important;
}

.sentence-rpg-page .top-stats .top-stat-chip:first-child::before {
  content: "" !important;
  width: 22px !important;
  height: 22px !important;
  display: inline-block !important;
  background: url("assets/ui/sentence-pixel/sentence-icon-paw.png") center / contain no-repeat !important;
}

.sentence-rpg-page .top-stats .top-stat-chip:nth-child(2) {
  display: none !important;
}

.sentence-rpg-page .top-stats .sentence-guide-button,
.sentence-rpg-page .top-stats .sentence-sound-button,
.sentence-rpg-page .top-stats .sentence-settings summary {
  width: 54px !important;
  min-width: 54px !important;
  height: 48px !important;
  min-height: 48px !important;
  border-radius: 18px !important;
}

.sentence-rpg-page .top-stats .sentence-guide-button {
  width: 64px !important;
  min-width: 64px !important;
}

.sentence-rpg-page .sentence-progress-bar {
  min-height: 54px !important;
  margin: 0 !important;
  padding: 10px 14px !important;
  grid-template-columns: auto minmax(120px, 1fr) auto !important;
  border-radius: 22px !important;
}

.sentence-rpg-page .sentence-progress-bar #sentenceRemainText,
.sentence-rpg-page .sentence-progress-bar #sentenceTimerText {
  display: none !important;
}

.sentence-rpg-page .playground {
  gap: 10px !important;
  align-items: start !important;
}

.sentence-rpg-page .sentence-deck-bar,
.sentence-rpg-page .lesson-meta,
.sentence-rpg-page .sentence-deck-count {
  display: none !important;
}

.sentence-rpg-page .quiz-card {
  min-height: 0 !important;
  height: auto !important;
  justify-content: start !important;
  gap: 8px !important;
  padding: 12px !important;
}

.sentence-rpg-page .cn-sentence {
  min-height: 76px !important;
  padding: 12px 16px !important;
}

.sentence-rpg-page .answer-slots {
  min-height: 52px !important;
  padding: 7px !important;
}

.sentence-rpg-page .word-bank {
  margin: 0 !important;
}

.sentence-rpg-page .hint-line {
  margin: -2px 0 0 !important;
}

.sentence-rpg-page .action-row {
  margin: 0 !important;
}

.sentence-rpg-page .buddy-card {
  min-height: 0 !important;
  height: auto !important;
  align-self: start !important;
  grid-template-rows: auto minmax(220px, auto) auto !important;
  gap: 8px !important;
  padding: 12px !important;
}

.sentence-rpg-page .buddy-stage {
  min-height: 235px !important;
  height: 235px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(24, 94, 80, 0.06)),
    url("assets/ui/sentence-sky-kingdom-stage.png") center 54% / cover no-repeat,
    #dff6ff !important;
}

.sentence-rpg-page .growth-card {
  max-height: 214px !important;
  overflow: auto !important;
}

@media (min-width: 1180px) {
  .sentence-rpg-page .pet-app {
    width: min(1180px, calc(100vw - 48px)) !important;
  }

  .sentence-rpg-page .playground {
    grid-template-columns: minmax(0, 1.54fr) minmax(340px, 0.76fr) !important;
    align-items: start !important;
  }

  .sentence-rpg-page .quiz-card,
  .sentence-rpg-page .buddy-card {
    min-height: 0 !important;
    height: auto !important;
    align-self: start !important;
  }
}

@media (min-width: 721px) and (max-width: 1179px) {
  .sentence-rpg-page .pet-app {
    width: min(720px, calc(100vw - 32px)) !important;
  }

  .sentence-rpg-page .topbar {
    grid-template-columns: auto minmax(148px, 1fr) minmax(210px, 1.2fr) auto !important;
    gap: 8px !important;
  }

  .sentence-rpg-page .brand-ball {
    display: none !important;
  }

  .sentence-rpg-page .brand h1 {
    font-size: 28px !important;
  }

  .sentence-rpg-page .lesson-select-top .top-deck-static {
    font-size: 16px !important;
  }

  .sentence-rpg-page .playground {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .sentence-rpg-page .quiz-card {
    padding: 12px !important;
  }

  .sentence-rpg-page .buddy-card {
    margin-top: 0 !important;
    grid-template-rows: auto 230px auto !important;
  }

  .sentence-rpg-page .buddy-stage {
    height: 230px !important;
    min-height: 230px !important;
  }
}

@media (min-width: 721px) and (max-width: 900px) {
  .sentence-rpg-page .topbar {
    grid-template-columns: 54px minmax(120px, 0.8fr) minmax(154px, 1fr) auto !important;
    gap: 7px !important;
    padding: 10px 12px !important;
  }

  .sentence-rpg-page .sentence-back-button {
    width: 54px !important;
    min-width: 54px !important;
  }

  .sentence-rpg-page .brand h1 {
    font-size: 26px !important;
  }

  .sentence-rpg-page .brand .lq-topbar-subtitle {
    font-size: 11px !important;
  }

  .sentence-rpg-page .lesson-select-top {
    height: 46px !important;
    min-height: 46px !important;
    padding: 0 9px !important;
    gap: 5px !important;
    border-radius: 18px !important;
  }

  .sentence-rpg-page .lesson-select-top img {
    width: 20px !important;
    height: 20px !important;
  }

  .sentence-rpg-page .lesson-select-top .top-deck-static {
    font-size: 15px !important;
  }

  .sentence-rpg-page .top-stats {
    gap: 5px !important;
  }

  .sentence-rpg-page .top-stats .top-stat-chip {
    min-width: 58px !important;
    height: 46px !important;
    min-height: 46px !important;
    padding: 0 8px !important;
    font-size: 13px !important;
  }

  .sentence-rpg-page .top-stats .top-stat-chip:first-child::before {
    width: 18px !important;
    height: 18px !important;
  }

  .sentence-rpg-page .top-stats .sentence-guide-button {
    width: 54px !important;
    min-width: 54px !important;
    height: 46px !important;
    min-height: 46px !important;
    font-size: 13px !important;
  }

  .sentence-rpg-page .top-stats .sentence-sound-button,
  .sentence-rpg-page .top-stats .sentence-settings summary {
    width: 46px !important;
    min-width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
  }
}

@media (min-width: 721px) {
  .sentence-rpg-page .answer-slots {
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
}

/* Sentence topbar row lock v1 for tablet and desktop. */
@media (min-width: 721px) {
  .sentence-rpg-page .topbar {
    display: grid !important;
    grid-template-rows: auto !important;
    align-items: center !important;
  }

  .sentence-rpg-page .sentence-back-button {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .sentence-rpg-page .brand {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }

  .sentence-rpg-page .lesson-select-top {
    grid-column: 3 !important;
    grid-row: 1 !important;
    align-self: center !important;
    justify-self: stretch !important;
  }

  .sentence-rpg-page .top-stats {
    grid-column: 4 !important;
    grid-row: 1 !important;
    align-self: center !important;
    justify-self: end !important;
  }
}

/* Food shortcut tooltip visibility: keep hover text readable inside the pet panel. */
.sentence-rpg-page .pet-food-shortcuts,
.sentence-rpg-page .food-shortcut-grid,
.sentence-rpg-page .food-shortcut-grid .collection-item {
  overflow: visible !important;
}

.sentence-rpg-page .food-shortcut-grid {
  z-index: 12 !important;
}

.sentence-rpg-page .food-shortcut-grid .collection-item {
  z-index: 1 !important;
}

.sentence-rpg-page .food-shortcut-grid .collection-item:hover,
.sentence-rpg-page .food-shortcut-grid .collection-item:focus-visible {
  z-index: 60 !important;
}

.sentence-rpg-page .food-shortcut-grid .item-tooltip {
  top: calc(100% + 8px) !important;
  bottom: auto !important;
  left: 50% !important;
  z-index: 1000 !important;
  max-width: min(240px, calc(100vw - 48px)) !important;
  border: 2px solid #8fc1f4 !important;
  border-radius: 12px !important;
  color: #17345f !important;
  background: rgba(255, 252, 236, 0.98) !important;
  box-shadow: 0 10px 22px rgba(65, 129, 196, 0.22) !important;
  transform: translate(-50%, -4px) !important;
}

.sentence-rpg-page .food-shortcut-grid .item-tooltip::after {
  top: -7px !important;
  bottom: auto !important;
  border: 0 !important;
  border-left: 2px solid #8fc1f4 !important;
  border-top: 2px solid #8fc1f4 !important;
  background: rgba(255, 252, 236, 0.98) !important;
}

.sentence-rpg-page .food-shortcut-grid .collection-item:hover .item-tooltip,
.sentence-rpg-page .food-shortcut-grid .collection-item:focus-visible .item-tooltip {
  opacity: 1 !important;
  transform: translate(-50%, 0) !important;
}

/* Unified sound toggle state: blue when on, gray when muted. */
.sentence-rpg-page .sentence-sound-button .sentence-sound-icon,
.sentence-rpg-page .sentence-sound-button::after {
  filter: none !important;
}

.sentence-rpg-page .sentence-sound-button.is-muted .sentence-sound-icon,
.sentence-rpg-page .sentence-sound-button.is-muted::after {
  filter: grayscale(1) saturate(0) opacity(0.58) !important;
}

/* Sentence pet panel: show Lv above the EXP bar and keep food storage as one plain box. */
.sentence-rpg-page .growth-top.growth-top-level {
  grid-template-columns: minmax(0, 1fr) auto !important;
  min-height: 34px !important;
  padding: 0 4px !important;
}

.sentence-rpg-page .growth-top.growth-top-level::before,
.sentence-rpg-page .growth-top.growth-top-level > span:first-child::before {
  display: none !important;
  content: none !important;
}

.sentence-rpg-page .growth-top.growth-top-level #growthText {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #17345f !important;
  font-size: 20px !important;
  line-height: 1 !important;
  font-weight: 950 !important;
}

.sentence-rpg-page .growth-top.growth-top-level #growthText span:last-child {
  display: none !important;
}

.sentence-rpg-page .food-shortcut-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  min-height: 82px !important;
  max-height: none !important;
  overflow: visible !important;
  border-style: solid !important;
  scrollbar-width: none !important;
}

.sentence-rpg-page .food-shortcut-grid::-webkit-scrollbar {
  display: none !important;
}

.sentence-rpg-page .food-shortcut-grid .food-item {
  touch-action: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.sentence-rpg-page .food-shortcut-grid .food-item.is-touch-feeding {
  opacity: 0.58 !important;
}

.touch-feed-ghost {
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  z-index: 10000 !important;
  width: 70px !important;
  height: 70px !important;
  display: grid !important;
  place-items: center !important;
  pointer-events: none !important;
  border: 2px solid rgba(117, 171, 235, 0.9) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 14px 26px rgba(47, 111, 184, 0.24) !important;
}

.touch-feed-ghost .item-tooltip,
.touch-feed-ghost .item-count {
  display: none !important;
}

.sentence-rpg-page .buddy-stage.touch-feed-target {
  outline: 3px solid rgba(255, 203, 66, 0.78) !important;
  outline-offset: -6px !important;
}

.sentence-rpg-page .hatch-preview-card {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 10px;
  border: 2px solid rgba(112, 168, 237, 0.72);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78);
}

.sentence-rpg-page .hatch-preview-card[hidden] {
  display: none !important;
}

.sentence-rpg-page .hatch-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #163a73;
}

.sentence-rpg-page .hatch-preview-head strong {
  font-size: 14px;
}

.sentence-rpg-page .hatch-preview-head small {
  color: #4773b5;
  font-size: 11px;
  font-weight: 700;
}

.sentence-rpg-page .hatch-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  gap: 7px;
}

.sentence-rpg-page .hatch-preview-item {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 4px;
  min-height: 102px;
  padding: 7px 5px;
  border: 2px solid rgba(128, 180, 244, 0.74);
  border-radius: 12px;
  background: rgba(242, 249, 255, 0.88);
  color: #17345f;
  text-align: center;
}

.sentence-rpg-page .hatch-preview-art {
  width: 54px;
  height: 48px;
  background-image: var(--pet-image);
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: contain;
}

.sentence-rpg-page .hatch-preview-item.is-hidden-hatch .hatch-preview-art {
  filter: brightness(0);
  opacity: 0.82;
}

.sentence-rpg-page .hatch-preview-item.is-hidden-hatch {
  background: rgba(232, 241, 252, 0.9);
}

.sentence-rpg-page .hatch-preview-item strong {
  max-width: 100%;
  font-size: 12px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.sentence-rpg-page .hatch-preview-item small {
  max-width: 100%;
  color: #4f76b1;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
}

/* Sentence mid-width web layout: do not let the quiz panel leave a large blank area before the pet panel. */
@media (min-width: 721px) and (max-width: 1179px) {
  .sentence-rpg-page .playground {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-auto-rows: min-content !important;
    align-items: start !important;
    align-content: start !important;
    gap: 10px !important;
    margin-top: 0 !important;
    min-height: 0 !important;
    height: auto !important;
  }

  .sentence-rpg-page .quiz-card {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    align-self: start !important;
    padding-bottom: 12px !important;
  }

  .sentence-rpg-page .quiz-card::before {
    background-position: center top !important;
  }

  .sentence-rpg-page .buddy-card {
    margin-top: 0 !important;
    align-self: start !important;
  }
}

/* Final mid-width companion sizing: enlarge the pet itself without changing the stage frame. */
@media (min-width: 721px) and (max-width: 1179px) {
  .sentence-rpg-page .buddy-stage .pet-anchor,
  .sentence-rpg-page .pet-anchor {
    bottom: 12% !important;
    height: 55% !important;
    width: min(58%, 300px) !important;
  }

  .sentence-rpg-page .buddy-stage .pet-anchor .speech-bubble,
  .sentence-rpg-page .pet-anchor .speech-bubble {
    top: auto !important;
    bottom: calc(100% + 24px) !important;
    width: min(360px, calc(100vw - 96px)) !important;
    max-width: min(360px, calc(100vw - 96px)) !important;
  }

  .sentence-rpg-page .buddy-stage .pet-anchor .pet-stage-egg,
  .sentence-rpg-page .pet-anchor .pet-stage-egg {
    --pet-stage-scale: 0.78 !important;
  }

  .sentence-rpg-page .buddy-stage .pet-anchor .pet-stage-1,
  .sentence-rpg-page .pet-anchor .pet-stage-1 {
    --pet-stage-scale: 1.04 !important;
  }

  .sentence-rpg-page .buddy-stage .pet-anchor .pet-stage-2,
  .sentence-rpg-page .pet-anchor .pet-stage-2 {
    --pet-stage-scale: 1.18 !important;
  }

  .sentence-rpg-page .buddy-stage .pet-anchor .pet-stage-3,
  .sentence-rpg-page .pet-anchor .pet-stage-3 {
    --pet-stage-scale: 1.28 !important;
  }
}

/* Final tablet speech bubble: feeding lines need more width and must not be clipped by the stage. */
@media (min-width: 721px) and (max-width: 1179px) {
  .sentence-rpg-page .buddy-stage {
    overflow: visible !important;
  }

  .sentence-rpg-page .buddy-stage .pet-anchor .speech-bubble,
  .sentence-rpg-page .pet-anchor .speech-bubble {
    width: min(380px, calc(100vw - 96px)) !important;
    max-width: min(380px, calc(100vw - 96px)) !important;
  }
}

/* Wide tablets: place pet dialogue beside the companion but keep it inside the stage frame. */
@media (min-width: 901px) and (max-width: 1179px) {
  .sentence-rpg-page .buddy-stage .pet-anchor .speech-bubble,
  .sentence-rpg-page .pet-anchor .speech-bubble {
    left: auto !important;
    right: 14px !important;
    top: 46% !important;
    bottom: auto !important;
    width: min(300px, calc(42% - 24px)) !important;
    max-width: min(300px, calc(42% - 24px)) !important;
    transform: translateY(-50%) !important;
  }

  .sentence-rpg-page .buddy-stage .pet-anchor .speech-bubble::after,
  .sentence-rpg-page .pet-anchor .speech-bubble::after {
    left: -8px !important;
    top: 50% !important;
    bottom: auto !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    border-left: 2px solid rgba(91, 137, 211, 0.72) !important;
    border-top: 2px solid rgba(91, 137, 211, 0.72) !important;
    transform: translateY(-50%) rotate(-45deg) !important;
  }
}

/* Tablet pet panel: show food storage fully so students can drag items without inner scrolling. */
@media (min-width: 721px) and (max-width: 1179px) {
  .sentence-rpg-page .buddy-card {
    grid-template-rows: auto auto auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .sentence-rpg-page .growth-card {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
  }

  .sentence-rpg-page .pet-food-shortcuts {
    overflow: visible !important;
  }

  .sentence-rpg-page .food-shortcut-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)) !important;
    min-height: 82px !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .sentence-rpg-page .food-shortcut-grid .collection-item,
  .sentence-rpg-page .food-shortcut-grid .empty-collection {
    min-height: 64px !important;
  }
}

/* Final wide companion sizing: keep the desktop card frame fixed while making the pet readable. */
@media (min-width: 1180px) {
  .sentence-rpg-page .buddy-stage .pet-anchor,
  .sentence-rpg-page .pet-anchor {
    bottom: 12% !important;
    height: 55% !important;
    width: min(72%, 300px) !important;
  }

  .sentence-rpg-page .buddy-stage .pet-anchor .speech-bubble,
  .sentence-rpg-page .pet-anchor .speech-bubble {
    top: auto !important;
    bottom: calc(100% + 20px) !important;
  }

  .sentence-rpg-page .buddy-stage .pet-anchor .pet-stage-egg,
  .sentence-rpg-page .pet-anchor .pet-stage-egg {
    --pet-stage-scale: 0.78 !important;
  }

  .sentence-rpg-page .buddy-stage .pet-anchor .pet-stage-1,
  .sentence-rpg-page .pet-anchor .pet-stage-1 {
    --pet-stage-scale: 1.04 !important;
  }

  .sentence-rpg-page .buddy-stage .pet-anchor .pet-stage-2,
  .sentence-rpg-page .pet-anchor .pet-stage-2 {
    --pet-stage-scale: 1.18 !important;
  }

  .sentence-rpg-page .buddy-stage .pet-anchor .pet-stage-3,
  .sentence-rpg-page .pet-anchor .pet-stage-3 {
    --pet-stage-scale: 1.28 !important;
  }
}
