:root {
  --ink: #302d62;
  --ink-soft: #646087;
  --paper: #fffdf7;
  --cream: #f8f3e9;
  --purple: #6c63e9;
  --purple-dark: #5148c9;
  --purple-light: #ece9ff;
  --coral: #ff8f70;
  --pink: #ff79a8;
  --yellow: #ffd45a;
  --mint: #8be9e4;
  --teal: #2fa9b5;
  --sky: #dff6ff;
  --green: #70c792;
  --danger: #df5d68;
  --shadow: 0 20px 55px rgba(52, 47, 105, 0.11);
  --border: 1px solid rgba(48, 45, 98, 0.1);
  --radius-xl: 30px;
  --radius-lg: 23px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", system-ui, sans-serif;
  background:
    radial-gradient(circle at 6% 8%, rgba(255, 212, 90, 0.3), transparent 24rem),
    radial-gradient(circle at 96% 19%, rgba(139, 233, 228, 0.28), transparent 26rem),
    linear-gradient(150deg, #fffaf0 0%, #f7f9ff 45%, #f0f7ff 100%);
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(108, 99, 233, 0.3);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.ambient-star {
  position: absolute;
  color: var(--purple);
  font-size: 22px;
  opacity: 0.22;
  animation: twinkle 3s ease-in-out infinite;
}

.star-a {
  top: 16%;
  left: 2%;
}

.star-b {
  right: 4%;
  top: 42%;
  color: var(--coral);
  animation-delay: -1.4s;
}

.ambient-cloud {
  position: absolute;
  width: 200px;
  height: 55px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  filter: blur(3px);
}

.ambient-cloud::before,
.ambient-cloud::after {
  content: "";
  position: absolute;
  bottom: 0;
  border-radius: 50%;
  background: inherit;
}

.ambient-cloud::before {
  width: 85px;
  height: 85px;
  left: 35px;
}

.ambient-cloud::after {
  width: 105px;
  height: 105px;
  right: 22px;
}

.cloud-a {
  left: -60px;
  top: 38%;
  transform: scale(0.8);
}

.cloud-b {
  right: -80px;
  top: 68%;
  transform: scale(1.1);
  opacity: 0.45;
}

.app-shell {
  width: min(1440px, calc(100% - 54px));
  margin: 0 auto;
  padding: 22px 0 34px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 66px;
  margin-bottom: 24px;
}

.brand {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 49px;
  height: 49px;
  place-items: center;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 9px 24px rgba(53, 48, 113, 0.15);
  transform: rotate(-3deg);
}

.brand-mark svg {
  width: 42px;
  height: 42px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-copy strong {
  font-size: 20px;
  letter-spacing: 0.04em;
}

.brand-copy small {
  margin-top: 1px;
  color: var(--ink-soft);
  font-family: ui-rounded, "Arial Rounded MT Bold", sans-serif;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(48, 45, 98, 0.07);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 6px 22px rgba(52, 47, 105, 0.06);
  backdrop-filter: blur(12px);
}

.nav-item {
  padding: 10px 17px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.nav-item:hover {
  color: var(--ink);
  background: #f7f5ff;
}

.nav-item.active {
  color: #fff;
  background: var(--ink);
  box-shadow: 0 6px 14px rgba(48, 45, 98, 0.2);
}

.top-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 9px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 39px;
  padding: 7px 12px;
  border: var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 5px 15px rgba(52, 47, 105, 0.05);
  cursor: default;
}

.stat-pill span {
  font-size: 17px;
}

.stat-pill strong {
  font-size: 15px;
}

.stat-pill small {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.star-pill span {
  filter: drop-shadow(0 2px 3px rgba(255, 188, 40, 0.3));
}

.avatar-button {
  position: relative;
  display: grid;
  width: 45px;
  height: 45px;
  margin-left: 2px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--yellow), #ffae71);
  box-shadow: 0 8px 18px rgba(232, 150, 58, 0.23);
  font-size: 25px;
  cursor: pointer;
}

.avatar-button i {
  position: absolute;
  right: -9px;
  bottom: -7px;
  padding: 3px 6px;
  border: 2px solid #fff;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-family: ui-rounded, sans-serif;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
}

.view {
  display: none;
  animation: view-in 0.35s ease both;
}

.view.active {
  display: block;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.86fr) minmax(320px, 0.92fr);
  gap: 18px;
}

.hero-card,
.energy-card,
.review-card,
.streak-card,
.wordbook-card,
.family-card {
  border: var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  min-height: 432px;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 26%, rgba(139, 233, 228, 0.19), transparent 18rem),
    radial-gradient(circle at 81% 110%, rgba(255, 117, 164, 0.23), transparent 20rem),
    linear-gradient(135deg, #6157dc 0%, #6e64e9 45%, #574dcd 100%);
  color: #fff;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(100deg, rgba(40, 35, 110, 0.22), transparent 58%);
  pointer-events: none;
}

.hero-stars i {
  position: absolute;
  z-index: 1;
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff7bd;
  box-shadow: 0 0 10px #fff7bd;
  animation: twinkle 2.6s ease-in-out infinite;
}

.hero-stars i:nth-child(1) { left: 22%; top: 11%; }
.hero-stars i:nth-child(2) { left: 59%; top: 9%; width: 7px; height: 7px; animation-delay: -1s; }
.hero-stars i:nth-child(3) { left: 73%; top: 19%; animation-delay: -0.4s; }
.hero-stars i:nth-child(4) { left: 92%; top: 10%; width: 3px; height: 3px; animation-delay: -2s; }
.hero-stars i:nth-child(5) { left: 57%; top: 49%; width: 3px; height: 3px; animation-delay: -0.7s; }
.hero-stars i:nth-child(6) { left: 89%; top: 68%; width: 5px; height: 5px; animation-delay: -1.8s; }

.hero-copy {
  position: relative;
  z-index: 5;
  width: 59%;
  padding: 46px 0 36px 47px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  backdrop-filter: blur(7px);
}

.eyebrow b {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(255, 212, 90, 0.15);
}

.eyebrow.dark {
  border-color: rgba(108, 99, 233, 0.2);
  background: var(--purple-light);
  color: var(--purple);
}

.hero-copy h1 {
  margin: 18px 0 13px;
  font-size: clamp(31px, 3vw, 47px);
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.hero-copy h1 em {
  color: var(--yellow);
  font-style: normal;
  text-shadow: 0 4px 0 rgba(40, 34, 112, 0.2);
}

.hero-copy > p {
  max-width: 490px;
  margin: 0;
  color: rgba(255, 255, 255, 0.79);
  font-size: 14px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 25px;
}

.primary-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 19px;
  border: 0;
  border-radius: 15px;
  background: var(--yellow);
  color: #3a3158;
  box-shadow: 0 7px 0 #d9a930, 0 12px 25px rgba(54, 43, 128, 0.22);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.primary-button:hover {
  background: #ffdc72;
  transform: translateY(-2px);
  box-shadow: 0 9px 0 #d9a930, 0 14px 28px rgba(54, 43, 128, 0.23);
}

.primary-button:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 #d9a930, 0 5px 12px rgba(54, 43, 128, 0.16);
}

.primary-button span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.primary-button.compact {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 13px;
  box-shadow: 0 4px 0 #d9a930;
}

.ghost-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 7px;
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.27);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(7px);
  transition: 0.2s ease;
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.17);
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 21px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 10px;
  font-weight: 700;
}

.hero-world {
  position: absolute;
  z-index: 3;
  right: -9px;
  bottom: 2px;
  width: 49%;
  height: 100%;
}

.cloud-island {
  position: absolute;
  right: 7%;
  bottom: 39px;
  width: 280px;
  height: 95px;
  border-radius: 50%;
  background: linear-gradient(160deg, #b9f4ef, #6bd7da);
  box-shadow: inset 0 -17px 0 rgba(52, 164, 178, 0.32), 0 15px 30px rgba(34, 28, 116, 0.25);
}

.cloud-island::before,
.cloud-island::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

.cloud-island::before {
  width: 90px;
  height: 90px;
  left: 26px;
  top: -34px;
}

.cloud-island::after {
  width: 115px;
  height: 115px;
  right: 27px;
  top: -52px;
}

.hero-mascot {
  position: absolute;
  z-index: 5;
  right: 81px;
  bottom: 73px;
  width: 235px;
  filter: drop-shadow(0 19px 20px rgba(41, 34, 118, 0.31));
  animation: mascot-float 4s ease-in-out infinite;
}

.orbit {
  position: absolute;
  z-index: 2;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 50%;
}

.orbit-one {
  right: 23px;
  top: 90px;
  width: 280px;
  height: 150px;
  transform: rotate(-18deg);
}

.orbit-two {
  right: 58px;
  top: 38px;
  width: 220px;
  height: 260px;
  transform: rotate(22deg);
}

.orbit span {
  position: absolute;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.orbit-one span {
  left: 15px;
  top: 9px;
}

.orbit-two span {
  right: 0;
  top: 108px;
  background: #ff8f9d;
  color: #fff;
  font-size: 7px;
}

.floating-word {
  position: absolute;
  z-index: 6;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
  font-family: ui-rounded, "Arial Rounded MT Bold", sans-serif;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
  backdrop-filter: blur(5px);
  animation: float-label 3.6s ease-in-out infinite;
}

.word-one {
  right: 35px;
  top: 148px;
  transform: rotate(5deg);
}

.word-two {
  right: 270px;
  top: 94px;
  animation-delay: -1.8s;
  transform: rotate(-5deg);
}

.island-flag {
  position: absolute;
  z-index: 7;
  right: 52px;
  bottom: 127px;
  width: 4px;
  height: 72px;
  border-radius: 3px;
  background: rgba(48, 45, 98, 0.65);
}

.island-flag::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 43px;
  height: 28px;
  border-radius: 2px 7px 7px 2px;
  background: var(--coral);
  clip-path: polygon(0 0, 100% 9%, 82% 50%, 100% 91%, 0 100%);
}

.island-flag span {
  position: absolute;
  z-index: 2;
  left: 15px;
  top: 7px;
  color: #fff;
  font-size: 11px;
}

.tiny-planet {
  position: absolute;
  right: 300px;
  bottom: 285px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe889, #f6b64e);
  box-shadow: 0 0 18px rgba(255, 212, 90, 0.45);
}

.energy-card {
  display: flex;
  flex-direction: column;
  min-height: 432px;
  padding: 25px 25px 19px;
  background: rgba(255, 253, 247, 0.92);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.mini-label {
  display: block;
  color: var(--ink-soft);
  font-family: ui-rounded, "Arial Rounded MT Bold", sans-serif;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.section-heading h2,
.streak-card h2,
.wordbook-card h2,
.family-card h2,
.review-card h2 {
  margin: 4px 0 0;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.date-chip {
  padding: 6px 9px;
  border-radius: 9px;
  background: var(--cream);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.energy-meter-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 18px 0 17px;
}

.energy-meter {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 114px;
  height: 114px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--purple) var(--progress), #eeeaf0 0);
  box-shadow: inset 0 0 0 1px rgba(48, 45, 98, 0.03);
  transition: background 0.6s ease;
}

.energy-meter::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #fffdf7;
}

.energy-meter-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.energy-meter-inner span {
  font-family: ui-rounded, "Arial Rounded MT Bold", sans-serif;
  font-size: 31px;
  font-weight: 900;
  line-height: 1;
}

.energy-meter-inner small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.meter-spark {
  position: absolute;
  z-index: 3;
  color: var(--yellow);
  font-size: 10px;
  text-shadow: 0 1px 0 rgba(144, 103, 0, 0.25);
}

.spark-one { top: 5px; right: 12px; }
.spark-two { bottom: 12px; left: 3px; font-size: 7px; }

.energy-copy strong {
  font-size: 16px;
}

.energy-copy p {
  max-width: 160px;
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.65;
}

.quest-list {
  display: grid;
  gap: 7px;
}

.quest-item {
  display: grid;
  grid-template-columns: 34px 1fr auto 19px;
  align-items: center;
  gap: 9px;
  min-height: 49px;
  padding: 7px 8px;
  border-radius: 13px;
  background: #fff;
  border: 1px solid rgba(48, 45, 98, 0.055);
  transition: background 0.25s ease;
}

.quest-item.complete {
  background: #f1fbf4;
}

.quest-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 900;
}

.quest-icon.purple { color: var(--purple); background: var(--purple-light); }
.quest-icon.coral { color: #cf684d; background: #fff0e9; }
.quest-icon.yellow { color: #9a741a; background: #fff7d9; }

.quest-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quest-info strong {
  font-size: 11px;
}

.quest-info span {
  color: #8d89a3;
  font-size: 8px;
}

.quest-progress {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 900;
}

.quest-check {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid #ded9ee;
  border-radius: 50%;
  color: transparent;
  font-size: 11px;
  font-weight: 900;
}

.quest-item.complete .quest-check {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.pet-strip {
  display: grid;
  grid-template-columns: 35px 1fr auto;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px dashed #e6e1ed;
}

.pet-face {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 12px;
  background: #dff7f3;
  font-size: 19px;
}

.pet-strip strong {
  display: block;
  font-size: 10px;
}

.pet-strip p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 8px;
}

.mini-level {
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-family: ui-rounded, sans-serif;
  font-size: 8px;
  font-weight: 900;
}

.review-card {
  position: relative;
  display: grid;
  grid-template-columns: 126px 1fr auto;
  align-items: center;
  min-height: 174px;
  padding: 23px 25px;
  overflow: hidden;
  background: linear-gradient(110deg, #eafaf8, #f9fdfb 65%, #effbff);
}

.review-card::after {
  content: "";
  position: absolute;
  right: 6%;
  top: -80px;
  width: 240px;
  height: 240px;
  border: 1px dashed rgba(47, 169, 181, 0.16);
  border-radius: 50%;
}

.review-planet {
  position: relative;
  width: 100px;
  height: 100px;
}

.planet-core {
  position: absolute;
  display: grid;
  inset: 20px;
  z-index: 2;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #8be9e4, #56cbd2);
  color: #fff;
  box-shadow: inset -8px -8px 0 rgba(34, 143, 154, 0.18), 0 12px 24px rgba(47, 169, 181, 0.18);
  font-size: 28px;
  font-weight: 900;
}

.ring {
  position: absolute;
  inset: 36px -5px;
  border: 9px solid rgba(108, 99, 233, 0.65);
  border-radius: 50%;
  transform: rotate(-15deg);
}

.ring::after {
  content: "";
  position: absolute;
  inset: -9px;
  border: 1px solid rgba(108, 99, 233, 0.22);
  border-radius: 50%;
}

.review-planet i {
  position: absolute;
  right: 1px;
  top: 3px;
  color: var(--yellow);
  font-style: normal;
  animation: twinkle 2.4s infinite;
}

.review-copy {
  position: relative;
  z-index: 2;
}

.review-copy p {
  max-width: 470px;
  margin: 7px 0 9px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.text-button span {
  display: inline-block;
  transition: transform 0.2s ease;
}

.text-button:hover span {
  transform: translateX(4px);
}

.due-badge {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 78px;
  border: 1px solid rgba(47, 169, 181, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.73);
}

.due-badge strong {
  color: var(--teal);
  font-family: ui-rounded, sans-serif;
  font-size: 25px;
  line-height: 1;
}

.due-badge span {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 8px;
}

.streak-card {
  min-height: 190px;
  padding: 23px 25px 20px;
  background: rgba(255, 253, 247, 0.9);
}

.streak-heading h2 {
  display: flex;
  align-items: center;
  gap: 7px;
}

.streak-heading h2 span {
  font-size: 21px;
}

.streak-heading h2 em {
  color: var(--coral);
  font-style: normal;
}

.best-streak {
  padding: 6px 9px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 9px;
}

.best-streak b {
  color: var(--ink);
}

.streak-card > p {
  margin: 8px 0 15px;
  color: var(--ink-soft);
  font-size: 10px;
}

.week-track {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.day-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.day-node::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 14px;
  right: 50%;
  width: calc(100% + 8px);
  height: 2px;
  background: #e8e2ec;
}

.day-node:first-child::before {
  display: none;
}

.day-node.done::before,
.day-node.previous-done::before {
  background: #f3bf65;
}

.day-dot {
  position: relative;
  z-index: 1;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 2px solid #e3ddec;
  border-radius: 50%;
  background: #fff;
  color: #a7a1b7;
  font-size: 10px;
  font-weight: 900;
}

.day-node.done .day-dot {
  border-color: #ffc45d;
  background: #ffcc70;
  color: #7e4f00;
  box-shadow: 0 3px 0 #e4a842;
}

.day-node.today .day-dot {
  border-color: var(--purple);
  color: var(--purple);
  box-shadow: 0 0 0 5px var(--purple-light);
}

.day-node.today.done .day-dot {
  border-color: #ffb843;
  color: #7e4f00;
  box-shadow: 0 0 0 5px #fff2cf;
}

.day-node small {
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 700;
}

.day-node.today small {
  color: var(--purple);
  font-weight: 900;
}

.wordbook-card {
  display: grid;
  grid-template-columns: 135px 1fr;
  align-items: center;
  min-height: 190px;
  padding: 20px 24px;
  overflow: hidden;
  background: linear-gradient(125deg, #fff0f3, #fffbfa 68%);
}

.wordbook-decor {
  position: relative;
  width: 103px;
  height: 110px;
  margin-left: 6px;
}

.book-back,
.book-front {
  position: absolute;
  display: grid;
  width: 68px;
  height: 86px;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 9px 15px 15px 9px;
  font-family: ui-rounded, sans-serif;
  font-weight: 900;
}

.book-back {
  top: 3px;
  left: 29px;
  background: var(--mint);
  transform: rotate(10deg);
}

.book-front {
  left: 12px;
  top: 16px;
  background: var(--purple);
  color: #fff;
  font-size: 24px;
  box-shadow: inset 6px 0 0 rgba(255, 255, 255, 0.12), 0 9px 16px rgba(48, 45, 98, 0.17);
  transform: rotate(-4deg);
}

.book-front::after {
  content: "";
  position: absolute;
  left: -2px;
  top: 6px;
  width: 7px;
  height: 68px;
  border-right: 2px solid var(--ink);
  border-left: 2px solid var(--ink);
  background: #fff4cf;
}

.book-star {
  position: absolute;
  right: 0;
  top: 0;
  color: #f8b935;
  font-size: 20px;
  animation: twinkle 3s infinite;
}

.wordbook-copy {
  position: relative;
  z-index: 2;
}

.wordbook-copy p {
  margin: 6px 0 8px;
  color: var(--ink-soft);
  font-size: 10px;
}

.wordbook-copy p strong {
  color: var(--ink);
}

.word-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 24px;
  margin-bottom: 9px;
  overflow: hidden;
}

.word-chip {
  padding: 4px 7px;
  border: 1px solid rgba(48, 45, 98, 0.08);
  border-radius: 7px;
  background: #fff;
  color: var(--ink-soft);
  font-family: ui-rounded, sans-serif;
  font-size: 8px;
  font-weight: 800;
}

.outline-button {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--purple);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.outline-button span {
  display: inline-block;
  margin-left: 5px;
  font-size: 13px;
  transition: transform 0.2s ease;
}

.outline-button:hover span {
  transform: rotate(90deg);
}

.family-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 19px;
  min-height: 190px;
  padding: 20px 24px;
  background:
    radial-gradient(circle at 92% 20%, rgba(255, 212, 90, 0.18), transparent 13rem),
    rgba(255, 253, 247, 0.9);
}

.family-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 17px;
  background: #fff0d4;
  font-size: 28px;
}

.family-card h2 {
  font-size: 16px;
}

.family-card p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
}

.family-check {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px dashed #cfc7db;
  border-radius: 50%;
  background: #fff;
  color: transparent;
  font-weight: 900;
  cursor: pointer;
}

.family-check.done {
  border-style: solid;
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 21px 5px 0;
  color: #9993ac;
  font-size: 9px;
}

.app-footer p {
  margin: 0;
}

.app-footer button {
  border: 0;
  background: transparent;
  color: #77718f;
  font-size: 9px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Full-page views */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 12px 0 22px;
  padding: 10px 4px;
}

.page-head h1 {
  margin: 5px 0 6px;
  font-size: 35px;
  letter-spacing: -0.04em;
}

.page-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.wordbook-view-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.library-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: -7px 2px 17px;
}

.library-filter-row button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 11px;
  border: 1px solid #e4deec;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.library-filter-row button:hover,
.library-filter-row button.active {
  border-color: var(--purple);
  background: var(--purple-light);
  color: var(--purple);
}

.library-filter-row button b {
  color: #ad5b4d;
}

.library-filter-row button span {
  padding: 2px 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 7px;
}

.library-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  grid-column: 1 / -1;
  padding: 18px;
  color: var(--ink-soft);
  font-size: 9px;
}

.wordbook-card-full {
  display: flex;
  min-height: 210px;
  flex-direction: column;
  padding: 19px;
  border: var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 247, 0.9);
  box-shadow: 0 12px 35px rgba(52, 47, 105, 0.075);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wordbook-card-full:hover {
  transform: translateY(-4px);
  box-shadow: 0 17px 38px rgba(52, 47, 105, 0.11);
}

.wordbook-card-full .wordbook-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 17px;
  background: var(--cream);
  font-size: 29px;
}

.wordbook-card-full h3 {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-family: ui-rounded, "Arial Rounded MT Bold", sans-serif;
  font-size: 22px;
}

.priority-square {
  display: inline-block;
  margin-right: 4px;
  color: #ad5b4d;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  vertical-align: 1px;
}

.wordbook-card-full .phonetic {
  margin-top: 3px;
  color: var(--purple);
  font-size: 11px;
}

.wordbook-card-full .meaning {
  margin: 11px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.wordbook-card-full .example {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.wordbook-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 13px;
}

.mastery-dots {
  display: flex;
  gap: 3px;
}

.mastery-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e6e0ec;
}

.mastery-dots i.on {
  background: var(--purple);
}

.speak-round {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #e3ddf5;
  border-radius: 50%;
  background: #fff;
  color: var(--purple);
  cursor: pointer;
}

.speak-round.speaking {
  animation: pulse-ring 0.7s infinite;
}

.badge-grid-full {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.badge-showcase {
  position: relative;
  display: flex;
  min-height: 220px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  border: var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 247, 0.9);
  box-shadow: var(--shadow);
  text-align: center;
}

.badge-showcase::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px dashed rgba(48, 45, 98, 0.09);
  border-radius: 16px;
}

.badge-showcase.locked {
  filter: saturate(0.25);
  opacity: 0.67;
}

.badge-emblem {
  position: relative;
  display: grid;
  width: 75px;
  height: 75px;
  z-index: 1;
  place-items: center;
  border: 6px solid #fff6d4;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--yellow), #ff9e69);
  box-shadow: 0 8px 0 #eab349, 0 15px 25px rgba(156, 110, 38, 0.19);
  font-size: 33px;
}

.badge-showcase h3 {
  position: relative;
  z-index: 1;
  margin: 18px 0 5px;
  font-size: 16px;
}

.badge-showcase p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.badge-lock {
  position: absolute;
  right: 17px;
  top: 17px;
  z-index: 2;
  padding: 4px 6px;
  border-radius: 6px;
  background: #ece8ef;
  color: #79728e;
  font-size: 8px;
  font-weight: 800;
}

/* Overlays */
.overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(43, 39, 88, 0.52);
  backdrop-filter: blur(11px);
  animation: fade-in 0.2s ease;
}

.sheet-panel {
  width: min(820px, 100%);
  max-height: min(880px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 29px;
  background: var(--paper);
  box-shadow: 0 30px 90px rgba(30, 26, 78, 0.28);
  animation: panel-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.wide-sheet {
  padding: 29px;
}

.narrow-sheet {
  width: min(680px, 100%);
  padding: 28px;
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.sheet-header h2 {
  margin: 5px 0 5px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.sheet-header p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid #e7e1ef;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: 0.2s ease;
}

.icon-button:hover {
  background: var(--cream);
  transform: rotate(4deg);
}

.bank-toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 9px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 43px;
  padding: 0 13px;
  border: 1px solid #e3deeb;
  border-radius: 13px;
  background: #fff;
}

.search-box span {
  color: #8d87a1;
  font-size: 22px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.secondary-button {
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 13px;
  border: 1px solid #dfd9e9;
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.secondary-button:hover {
  background: #faf8ff;
  border-color: #c9c1de;
}

.secondary-button.compact {
  min-height: 35px;
  padding: 7px 10px;
  font-size: 9px;
}

.bank-toolbar .primary-button {
  min-height: 43px;
  font-size: 11px;
}

.bank-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 17px 1px 10px;
  color: var(--ink-soft);
  font-size: 10px;
}

.bank-summary b {
  color: var(--ink);
}

.bank-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.bank-filter-bar button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border: 1px solid #e5dfec;
  border-radius: 10px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.bank-filter-bar button:hover,
.bank-filter-bar button.active {
  border-color: var(--purple);
  background: var(--purple-light);
  color: var(--purple);
}

.bank-filter-bar button b {
  color: #ad5b4d;
  font-size: 11px;
}

.bank-filter-bar button span {
  padding: 1px 5px;
  border-radius: 99px;
  background: #f6f2fa;
  color: var(--ink-soft);
  font-size: 7px;
}

.bank-legend {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 8px;
}

.bank-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-light);
}

.bank-list {
  display: grid;
  gap: 7px;
}

.bank-row {
  display: grid;
  grid-template-columns: 43px minmax(100px, 1.1fr) 1.8fr minmax(130px, 1.5fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 8px 10px;
  border: 1px solid #ece7f1;
  border-radius: 14px;
  background: #fff;
}

.bank-emoji {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 12px;
  background: var(--cream);
  font-size: 23px;
}

.bank-word {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.bank-word strong {
  display: flex;
  align-items: center;
  overflow: hidden;
  font-family: ui-rounded, "Arial Rounded MT Bold", sans-serif;
  font-size: 15px;
  text-overflow: ellipsis;
}

.bank-word strong .priority-square {
  flex: 0 0 auto;
  margin-right: 5px;
}

.bank-load-more {
  grid-column: 1 / -1;
  padding: 11px;
  border: 1px dashed #d9d2e4;
  border-radius: 11px;
  background: #fbf9fd;
  color: var(--purple);
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.bank-word small {
  margin-top: 2px;
  color: var(--purple);
  font-size: 8px;
}

.bank-meaning {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-example {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-actions {
  display: flex;
  gap: 4px;
}

.bank-actions button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: #f7f5f9;
  color: var(--ink-soft);
  cursor: pointer;
}

.bank-actions button:hover {
  background: var(--purple-light);
  color: var(--purple);
}

.bank-actions .delete-word:hover {
  background: #fff0f1;
  color: var(--danger);
}

.bank-empty {
  padding: 36px 10px;
  text-align: center;
}

.bank-empty > span {
  font-size: 38px;
}

.bank-empty h3 {
  margin: 8px 0 4px;
  font-size: 16px;
}

.bank-empty p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.sheet-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid #eee9f2;
}

.plain-button {
  padding: 8px 3px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.plain-button:hover {
  color: var(--ink);
}

.danger-text {
  color: var(--danger);
}

.word-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-row.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row label,
.form-row > span {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.form-row span b {
  color: var(--danger);
}

.form-row span small {
  color: #9e98ac;
  font-size: 8px;
  font-weight: 500;
}

.word-form input,
.word-form textarea,
.bulk-label + textarea,
.profile-name-field input,
.bulk-label + textarea:focus {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid #e3deeb;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.word-form input:focus,
.profile-name-field input:focus,
textarea:focus {
  border-color: rgba(108, 99, 233, 0.6);
  box-shadow: 0 0 0 4px rgba(108, 99, 233, 0.08);
}

.emoji-suggestions {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 9px;
}

.emoji-suggestions button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #ece7f2;
  border-radius: 9px;
  background: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.emoji-suggestions button:hover {
  transform: translateY(-2px) scale(1.05);
}

.priority-check {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px dashed #ded6e9;
  border-radius: 11px;
  background: #faf8fc;
  cursor: pointer;
}

.priority-check input {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  accent-color: var(--purple);
}

.priority-check span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.priority-check span b {
  color: #ad5b4d;
  font-size: 13px;
}

.priority-check small {
  margin-left: auto;
  color: var(--ink-soft);
  font-size: 8px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  margin-top: 4px;
}

.bulk-label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
}

#bulkForm textarea {
  resize: vertical;
  line-height: 1.7;
}

.format-help {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 11px 0 17px;
  padding: 11px 13px;
  border-radius: 11px;
  background: var(--purple-light);
  color: var(--ink-soft);
  font-size: 9px;
}

.format-help strong {
  color: var(--purple);
}

.profile-sheet {
  width: min(620px, 100%);
}

.profile-name-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11px;
  font-weight: 800;
}

.avatar-picker {
  display: flex;
  gap: 8px;
  margin: 15px 0 18px;
  padding: 0;
  border: 0;
}

.avatar-picker legend {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
}

.avatar-picker input {
  position: absolute;
  opacity: 0;
}

.avatar-picker span {
  display: grid;
  width: 47px;
  height: 47px;
  place-items: center;
  border: 2px solid #ece7f1;
  border-radius: 14px;
  background: #fff;
  font-size: 25px;
  cursor: pointer;
  transition: 0.18s ease;
}

.avatar-picker input:checked + span {
  border-color: var(--purple);
  background: var(--purple-light);
  box-shadow: 0 0 0 3px rgba(108, 99, 233, 0.12);
  transform: translateY(-2px);
}

.audio-settings {
  padding: 15px;
  border-radius: 16px;
  background: #f7f5fb;
}

.setting-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.setting-heading > div > span {
  font-size: 12px;
  font-weight: 900;
}

.setting-heading p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 8px;
}

.range-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 16px;
  font-size: 10px;
  font-weight: 800;
}

.range-field span b {
  margin-left: 6px;
  color: var(--purple);
}

.range-field input {
  width: 100%;
  accent-color: var(--purple);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 500;
}

.voice-choice {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.voice-choice input {
  position: absolute;
  opacity: 0;
}

.voice-choice span {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid #e2dcea;
  border-radius: 10px;
  background: #fff;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.voice-choice input:checked + span {
  border-color: var(--purple);
  background: var(--purple);
  color: #fff;
}

/* Badges modal */
.badge-sheet {
  width: min(900px, 100%);
}

.modal-badge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.modal-badge {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px;
  border: 1px solid #ece7f1;
  border-radius: 16px;
  background: #fff;
}

.modal-badge.locked {
  background: #faf9fb;
  filter: saturate(0.1);
  opacity: 0.66;
}

.modal-badge-icon {
  display: grid;
  flex: 0 0 auto;
  width: 51px;
  height: 51px;
  place-items: center;
  border: 4px solid #fff3c9;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--yellow), #ffa56f);
  font-size: 23px;
}

.modal-badge h3 {
  margin: 0 0 3px;
  font-size: 12px;
}

.modal-badge p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 8px;
  line-height: 1.45;
}

.sticker-shelf {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 25px;
  margin-top: 22px;
  padding: 18px;
  border-radius: 18px;
  background: var(--cream);
}

.sticker-shelf h3 {
  margin: 4px 0 0;
  font-size: 14px;
}

.sticker-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sticker-item {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid #e6e0ec;
  border-radius: 12px;
  background: #fff;
  font-size: 20px;
}

/* Game */
.game-overlay {
  padding: 18px;
  background:
    radial-gradient(circle at 13% 14%, rgba(255, 212, 90, 0.19), transparent 20rem),
    radial-gradient(circle at 88% 85%, rgba(139, 233, 228, 0.18), transparent 22rem),
    #5a51d3;
}

.game-shell {
  position: relative;
  width: min(1050px, 100%);
  height: min(780px, calc(100vh - 36px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 30px;
  background: var(--paper);
  box-shadow: 0 30px 90px rgba(29, 23, 91, 0.36);
  animation: panel-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.game-shell::before {
  content: "✦";
  position: absolute;
  z-index: 0;
  right: 34px;
  top: 80px;
  color: var(--yellow);
  font-size: 20px;
  opacity: 0.6;
}

.game-header {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  height: 76px;
  padding: 13px 21px;
  border-bottom: 1px solid #eee9f1;
}

.close-button {
  width: 34px;
  height: 34px;
  font-size: 21px;
}

.game-title-wrap h2 {
  margin: 3px 0 0;
  font-size: 17px;
}

.game-stats {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--ink-soft);
  font-size: 11px;
}

.game-stats b {
  color: var(--ink);
}

.session-progress-copy b {
  color: var(--purple);
  font-size: 14px;
}

.game-progress {
  position: relative;
  z-index: 4;
  height: 5px;
  background: #eeeaf1;
}

.game-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(90deg, var(--yellow), var(--coral));
  transition: width 0.45s ease;
}

.game-stage {
  position: relative;
  height: calc(100% - 81px);
  overflow: auto;
}

.learn-stage,
.quiz-stage {
  display: grid;
  min-height: 100%;
  grid-template-columns: 0.8fr 1.2fr;
}

.learn-visual {
  position: relative;
  display: flex;
  min-height: 440px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 43%, rgba(255, 255, 255, 0.8), transparent 14rem),
    linear-gradient(145deg, #e8f9f6, #eff3ff);
}

.learn-visual::before,
.learn-visual::after {
  content: "";
  position: absolute;
  border: 1px dashed rgba(108, 99, 233, 0.18);
  border-radius: 50%;
}

.learn-visual::before {
  width: 390px;
  height: 210px;
  transform: rotate(-20deg);
}

.learn-visual::after {
  width: 250px;
  height: 330px;
  transform: rotate(23deg);
}

.word-orb {
  position: relative;
  z-index: 2;
  display: grid;
  width: 164px;
  height: 164px;
  place-items: center;
  border: 8px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: linear-gradient(145deg, #ffe9a5, #ffd267);
  box-shadow: 0 18px 0 rgba(225, 166, 49, 0.24), 0 30px 45px rgba(71, 62, 140, 0.16);
  font-size: 75px;
  animation: orb-float 4s ease-in-out infinite;
}

.word-orb::before {
  content: "";
  position: absolute;
  inset: -21px;
  border: 2px dashed rgba(108, 99, 233, 0.25);
  border-radius: 50%;
}

.orbit-tag {
  position: absolute;
  z-index: 3;
  padding: 6px 10px;
  border: 1px solid rgba(48, 45, 98, 0.1);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 900;
  box-shadow: 0 5px 13px rgba(48, 45, 98, 0.08);
}

.tag-one { left: 8%; top: 20%; transform: rotate(-8deg); }
.tag-two { right: 7%; top: 25%; transform: rotate(6deg); }
.tag-three { right: 16%; bottom: 18%; transform: rotate(-4deg); }

.visual-caption {
  position: relative;
  z-index: 3;
  margin-top: 29px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.learn-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 42px clamp(28px, 5vw, 68px);
}

.stage-kicker {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--purple-light);
  color: var(--purple);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.stage-kicker::before {
  content: "✦";
}

.learn-word-row {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 17px;
}

.learn-content h1 {
  margin: 0;
  font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  font-size: clamp(43px, 5.8vw, 67px);
  letter-spacing: -0.055em;
  line-height: 1;
}

.speak-button {
  display: grid;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 0;
  border-radius: 16px;
  background: var(--purple);
  color: #fff;
  box-shadow: 0 6px 0 var(--purple-dark);
  cursor: pointer;
  transition: 0.15s ease;
}

.speak-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--purple-dark);
}

.speak-button.speaking {
  animation: pulse-ring 0.7s infinite;
}

.speak-button svg {
  width: 23px;
  height: 23px;
}

.phonetic-line {
  margin-top: 8px;
  color: var(--purple);
  font-family: "Trebuchet MS", sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.meaning-block {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px dashed #ddd7e6;
}

.meaning-block > span,
.example-block > span {
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.meaning-block h2 {
  margin: 5px 0 0;
  font-size: 22px;
}

.example-block {
  margin: 18px 0 25px;
}

.example-block p {
  margin: 6px 0 0;
  color: var(--ink);
  font-family: "Trebuchet MS", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 1.65;
}

.example-block small {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
}

.learn-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.listen-again {
  display: inline-flex;
  min-height: 47px;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  border: 1px solid #e2dcec;
  border-radius: 14px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.quiz-stage {
  position: relative;
  grid-template-columns: 0.88fr 1.12fr;
  padding: 28px;
  gap: 28px;
  background:
    radial-gradient(circle at 6% 6%, rgba(255, 212, 90, 0.13), transparent 17rem),
    #fffdf7;
}

.quiz-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 23px;
  background:
    radial-gradient(circle at 50% 50%, #fff, transparent 12rem),
    linear-gradient(145deg, #eeeaff, #e2f8f5);
}

.quiz-visual::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border: 2px dashed rgba(108, 99, 233, 0.18);
  border-radius: 50%;
}

.quiz-emoji {
  position: relative;
  z-index: 1;
  display: grid;
  width: 132px;
  height: 132px;
  place-items: center;
  border: 7px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: #fff6d6;
  box-shadow: 0 15px 30px rgba(69, 61, 132, 0.14);
  font-size: 62px;
}

.quiz-visual .speaker-orb {
  position: relative;
  z-index: 2;
  display: grid;
  width: 52px;
  height: 52px;
  margin-top: 22px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  box-shadow: 0 6px 0 var(--purple-dark);
  font-size: 21px;
  cursor: pointer;
}

.quiz-visual .speaker-orb.speaking {
  animation: pulse-ring 0.7s infinite;
}

.quiz-visual p {
  position: relative;
  z-index: 2;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  text-align: center;
}

.quiz-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.quiz-type {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--purple);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.09em;
}

.quiz-type::before {
  content: "✦";
  font-size: 13px;
}

.quiz-content h2 {
  margin: 8px 0 5px;
  font-size: clamp(23px, 2.7vw, 31px);
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.quiz-hint {
  margin: 0 0 21px;
  color: var(--ink-soft);
  font-size: 10px;
}

.answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.answer-option {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1.5px solid #e4deec;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: 0.17s ease;
}

.answer-option span {
  display: grid;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  background: var(--cream);
  color: var(--ink-soft);
  font-size: 9px;
}

.answer-option:hover {
  border-color: #beb5e9;
  background: #fbfaff;
  transform: translateY(-1px);
}

.answer-option.correct {
  border-color: var(--green);
  background: #edf9f1;
  color: #287243;
}

.answer-option.correct span {
  background: var(--green);
  color: #fff;
}

.answer-option.wrong {
  animation: shake 0.34s;
  border-color: #ff9da2;
  background: #fff1f2;
  color: #ad424a;
}

.quiz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.hint-button {
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.feedback {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 17px;
  padding: 11px 12px;
  border-radius: 13px;
  background: #edf9f1;
  color: #2c7047;
  animation: feedback-in 0.3s ease;
}

.feedback.error {
  background: #fff3f3;
  color: #a84149;
}

.feedback > span {
  font-size: 23px;
}

.feedback div {
  flex: 1;
}

.feedback strong {
  display: block;
  font-size: 11px;
}

.feedback p {
  margin: 2px 0 0;
  font-size: 9px;
  line-height: 1.4;
}

.feedback button {
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  background: #fff;
  color: inherit;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
}

.spell-panel {
  margin-top: 2px;
}

.spell-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 54px;
  margin-bottom: 17px;
}

.spell-slot {
  display: grid;
  width: 42px;
  height: 50px;
  place-items: center;
  border-bottom: 3px solid #d3ccdf;
  border-radius: 7px 7px 2px 2px;
  background: #faf8fc;
  color: var(--ink);
  font-family: ui-rounded, "Trebuchet MS", sans-serif;
  font-size: 22px;
  font-weight: 900;
  text-transform: lowercase;
}

.spell-slot.filled {
  border-bottom-color: var(--purple);
  background: var(--purple-light);
}

.letter-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.letter-tile {
  display: grid;
  width: 47px;
  height: 47px;
  place-items: center;
  border: 1px solid #dcd5e7;
  border-bottom-width: 3px;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-family: ui-rounded, "Trebuchet MS", sans-serif;
  font-size: 19px;
  font-weight: 900;
  text-transform: lowercase;
  cursor: pointer;
  transition: 0.15s ease;
}

.letter-tile:hover {
  background: #fbfaff;
  transform: translateY(-2px);
}

.letter-tile.used {
  opacity: 0.2;
  pointer-events: none;
}

.spell-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.spell-hint {
  color: var(--ink-soft);
  font-size: 9px;
}

/* Results */
.result-panel {
  position: relative;
  width: min(580px, 100%);
  overflow: hidden;
  padding: 36px 40px 32px;
  border-radius: 31px;
  background: #fffdf7;
  box-shadow: 0 30px 90px rgba(30, 26, 78, 0.3);
  text-align: center;
  animation: panel-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.result-rays {
  position: absolute;
  left: 50%;
  top: -170px;
  width: 460px;
  height: 460px;
  transform: translateX(-50%);
  background: repeating-conic-gradient(from 0deg, rgba(255, 212, 90, 0.17) 0deg 10deg, transparent 10deg 23deg);
  border-radius: 50%;
  animation: rotate-rays 30s linear infinite;
}

.result-mascot {
  position: relative;
  z-index: 2;
  display: grid;
  width: 99px;
  height: 99px;
  margin: 0 auto 18px;
  place-items: center;
  border: 7px solid #fff5d4;
  border-radius: 50%;
  background: linear-gradient(145deg, #9af2eb, #65c7e9);
  box-shadow: 0 9px 0 #54aec5, 0 16px 30px rgba(48, 170, 190, 0.17);
  font-size: 53px;
  animation: mascot-float 3.5s ease-in-out infinite;
}

.result-panel > .eyebrow {
  position: relative;
  z-index: 2;
}

.result-panel h2 {
  position: relative;
  z-index: 2;
  margin: 13px 0 7px;
  font-size: 38px;
  letter-spacing: -0.045em;
}

.result-panel > p {
  position: relative;
  z-index: 2;
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.result-stats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 23px 0 15px;
}

.result-stats > div {
  display: flex;
  min-height: 96px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #ede7f0;
  border-radius: 16px;
  background: #fff;
}

.result-stats span {
  font-size: 19px;
}

.result-stats strong {
  margin-top: 3px;
  font-family: ui-rounded, sans-serif;
  font-size: 23px;
  line-height: 1;
}

.result-stats small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 8px;
}

.result-reward {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 13px;
  border: 1px dashed #e4c56d;
  border-radius: 12px;
  background: #fffaea;
  color: #866520;
  font-size: 9px;
  font-weight: 800;
}

.result-reward strong {
  font-size: 24px;
}

.result-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 22px;
}

.result-actions .primary-button {
  min-width: 141px;
}

/* Confirm + toast + confetti */
.confirm-panel {
  width: min(430px, 100%);
  padding: 30px;
  border-radius: 25px;
  background: var(--paper);
  box-shadow: 0 25px 80px rgba(30, 26, 78, 0.3);
  text-align: center;
  animation: panel-in 0.25s ease;
}

.confirm-icon {
  display: grid;
  width: 66px;
  height: 66px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 19px;
  background: #fff1da;
  font-size: 33px;
}

.confirm-panel h2 {
  margin: 0;
  font-size: 20px;
}

.confirm-panel p {
  margin: 9px 0 20px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.65;
}

.center-actions {
  justify-content: center;
}

.toast {
  position: fixed;
  z-index: 300;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100% - 30px);
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(48, 45, 98, 0.95);
  color: #fff;
  box-shadow: 0 13px 35px rgba(30, 26, 78, 0.25);
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.toast button {
  padding: 3px 5px;
  border: 0;
  background: transparent;
  color: var(--yellow);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.confetti-layer {
  position: fixed;
  z-index: 250;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 13px;
  border-radius: 2px;
  animation: confetti-fall var(--duration) cubic-bezier(0.18, 0.7, 0.3, 1) forwards;
}

/* Animations */
@keyframes twinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15) rotate(12deg); }
}

@keyframes mascot-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}

@keyframes orb-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

@keyframes float-label {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -6px; }
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(15px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 6px 0 var(--purple-dark), 0 0 0 0 rgba(108, 99, 233, 0.28); }
  50% { box-shadow: 0 6px 0 var(--purple-dark), 0 0 0 9px rgba(108, 99, 233, 0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

@keyframes feedback-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rotate-rays {
  to { transform: translateX(-50%) rotate(360deg); }
}

@keyframes confetti-fall {
  0% { opacity: 1; transform: translate3d(0, -20px, 0) rotate(0); }
  100% { opacity: 0; transform: translate3d(var(--drift), 105vh, 0) rotate(var(--spin)); }
}

@media (max-width: 1120px) {
  .app-shell {
    width: min(960px, calc(100% - 34px));
  }

  .topbar {
    grid-template-columns: auto 1fr auto;
  }

  .main-nav {
    justify-self: center;
  }

  .brand-copy small {
    display: none;
  }

  .hero-copy {
    width: 63%;
    padding-left: 34px;
  }

  .hero-world {
    width: 46%;
    right: -40px;
  }

  .hero-mascot {
    width: 210px;
    right: 54px;
  }

  .cloud-island {
    width: 240px;
    right: 0;
  }

  .floating-word,
  .orbit-two {
    display: none;
  }
}

@media (max-width: 900px) {
  .app-shell {
    width: min(760px, calc(100% - 28px));
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    position: fixed;
    z-index: 50;
    left: 50%;
    bottom: max(9px, env(safe-area-inset-bottom));
    width: min(440px, calc(100% - 24px));
    justify-content: space-around;
    transform: translateX(-50%);
    box-shadow: 0 9px 30px rgba(48, 45, 98, 0.18);
  }

  .nav-item {
    flex: 1;
    padding: 10px 7px;
  }

  .app-footer {
    padding-bottom: 80px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .hero-card {
    min-height: 425px;
  }

  .hero-copy {
    width: 64%;
  }

  .energy-card {
    min-height: auto;
  }

  .pet-strip {
    margin-top: 14px;
  }

  .review-card {
    grid-column: 1;
  }

  .streak-card,
  .wordbook-card {
    grid-column: 1;
  }

  .wordbook-view-grid,
  .badge-grid-full {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: calc(100% - 20px);
    padding-top: 12px;
  }

  .topbar {
    margin-bottom: 13px;
    min-height: 54px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .brand-mark svg {
    width: 37px;
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .top-actions {
    gap: 5px;
  }

  .stat-pill {
    min-height: 35px;
    padding: 5px 8px;
    border-radius: 11px;
  }

  .stat-pill span {
    font-size: 14px;
  }

  .stat-pill strong {
    font-size: 12px;
  }

  .stat-pill small {
    display: none;
  }

  .avatar-button {
    width: 39px;
    height: 39px;
    border-radius: 12px;
    font-size: 21px;
  }

  .hero-card {
    min-height: 528px;
  }

  .hero-copy {
    width: 100%;
    padding: 28px 24px 0;
  }

  .hero-copy h1 {
    margin-top: 13px;
    font-size: 31px;
  }

  .hero-copy > p {
    max-width: 320px;
    font-size: 12px;
  }

  .hero-actions {
    margin-top: 18px;
  }

  .primary-button {
    min-height: 46px;
  }

  .ghost-button {
    min-height: 46px;
  }

  .hero-note {
    margin-top: 14px;
  }

  .hero-world {
    right: -20px;
    bottom: -24px;
    width: 100%;
    height: 240px;
  }

  .hero-mascot {
    right: 74px;
    bottom: 22px;
    width: 191px;
  }

  .cloud-island {
    right: 51px;
    bottom: 3px;
    width: 248px;
    height: 77px;
  }

  .island-flag {
    right: 61px;
    bottom: 70px;
    height: 61px;
  }

  .orbit-one {
    right: 43px;
    top: 32px;
    width: 260px;
  }

  .tiny-planet {
    right: 312px;
    bottom: 154px;
  }

  .word-one {
    right: 22px;
    top: 66px;
  }

  .energy-card,
  .review-card,
  .streak-card,
  .wordbook-card {
    border-radius: 23px;
  }

  .energy-card {
    padding: 20px 18px 16px;
  }

  .energy-meter-wrap {
    margin: 15px 0;
  }

  .energy-meter {
    width: 100px;
    height: 100px;
  }

  .energy-meter-inner span {
    font-size: 27px;
  }

  .review-card {
    grid-template-columns: 82px 1fr auto;
    gap: 9px;
    padding: 18px;
  }

  .review-planet {
    width: 73px;
    height: 73px;
  }

  .review-planet .ring {
    inset: 28px -4px;
    border-width: 7px;
  }

  .planet-core {
    inset: 15px;
    font-size: 21px;
  }

  .review-copy h2 {
    font-size: 16px;
  }

  .review-copy p {
    font-size: 9px;
  }

  .due-badge {
    width: 62px;
    height: 64px;
  }

  .due-badge strong {
    font-size: 21px;
  }

  .streak-card {
    padding: 20px 18px;
  }

  .week-track {
    gap: 2px;
  }

  .wordbook-card {
    grid-template-columns: 104px 1fr;
    padding: 16px 18px;
  }

  .wordbook-decor {
    transform: scale(0.82);
    transform-origin: left center;
  }

  .family-card {
    grid-template-columns: auto 1fr auto;
    min-height: 104px;
    padding: 18px;
  }

  .family-icon {
    width: 44px;
    height: 44px;
    font-size: 23px;
  }

  .family-card p {
    display: none;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .page-head h1 {
    font-size: 29px;
  }

  .wordbook-view-grid,
  .badge-grid-full {
    grid-template-columns: 1fr;
  }

  .overlay {
    padding: 9px;
  }

  .wide-sheet,
  .narrow-sheet {
    max-height: calc(100vh - 18px);
    padding: 20px 16px;
    border-radius: 23px;
  }

  .sheet-header {
    margin-bottom: 17px;
  }

  .sheet-header h2 {
    font-size: 23px;
  }

  .bank-toolbar {
    grid-template-columns: 1fr auto;
  }

  .search-box {
    grid-column: 1 / -1;
  }

  .bank-toolbar .primary-button,
  .bank-toolbar .secondary-button {
    font-size: 10px;
  }

  .bank-summary {
    margin-top: 13px;
  }

  .bank-legend {
    display: none;
  }

  .bank-row {
    grid-template-columns: 39px minmax(70px, 1fr) minmax(80px, 1fr) auto;
    gap: 8px;
    min-height: 59px;
  }

  .bank-emoji {
    width: 39px;
    height: 39px;
    font-size: 20px;
  }

  .bank-example {
    display: none;
  }

  .bank-word strong {
    font-size: 13px;
  }

  .bank-meaning {
    font-size: 10px;
  }

  .bank-actions {
    gap: 2px;
  }

  .bank-actions button {
    width: 27px;
    height: 27px;
  }

  .form-row.two-cols {
    grid-template-columns: 1fr;
  }

  .emoji-suggestions {
    flex-wrap: wrap;
  }

  .avatar-picker {
    gap: 5px;
    flex-wrap: wrap;
  }

  .avatar-picker span {
    width: 43px;
    height: 43px;
  }

  .setting-heading {
    flex-direction: column;
  }

  .modal-badge-grid {
    grid-template-columns: 1fr;
  }

  .sticker-shelf {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .game-overlay {
    padding: 0;
  }

  .game-shell {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .game-header {
    height: 66px;
    padding: 9px 13px;
  }

  .game-stage {
    height: calc(100% - 71px);
  }

  .learn-stage,
  .quiz-stage {
    display: block;
    min-height: 100%;
  }

  .learn-visual {
    min-height: 220px;
  }

  .word-orb {
    width: 110px;
    height: 110px;
    font-size: 52px;
    border-width: 6px;
  }

  .visual-caption {
    margin-top: 18px;
  }

  .tag-one { left: 10%; top: 18%; }
  .tag-two { right: 9%; top: 20%; }
  .tag-three { right: 12%; bottom: 11%; }

  .learn-content {
    padding: 24px 21px 30px;
  }

  .learn-word-row {
    margin-top: 13px;
  }

  .learn-content h1 {
    font-size: 43px;
  }

  .speak-button {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .meaning-block {
    margin-top: 18px;
    padding-top: 15px;
  }

  .example-block {
    margin: 13px 0 19px;
  }

  .quiz-stage {
    padding: 14px 19px 25px;
  }

  .quiz-visual {
    min-height: 173px;
  }

  .quiz-emoji {
    width: 81px;
    height: 81px;
    font-size: 41px;
    border-width: 5px;
  }

  .quiz-visual::before {
    width: 190px;
    height: 190px;
  }

  .quiz-visual .speaker-orb {
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
    margin: 0;
  }

  .quiz-visual p {
    margin-top: 10px;
  }

  .quiz-content {
    padding-top: 20px;
  }

  .quiz-content h2 {
    font-size: 23px;
  }

  .quiz-hint {
    margin-bottom: 15px;
  }

  .answer-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .answer-option {
    min-height: 48px;
  }

  .spell-slots {
    gap: 4px;
  }

  .spell-slot {
    width: 35px;
    height: 44px;
    font-size: 19px;
  }

  .letter-tile {
    width: 42px;
    height: 42px;
  }

  .result-panel {
    padding: 27px 19px 24px;
    border-radius: 24px;
  }

  .result-mascot {
    width: 78px;
    height: 78px;
    border-width: 5px;
    font-size: 41px;
  }

  .result-panel h2 {
    font-size: 31px;
  }

  .result-stats > div {
    min-height: 82px;
  }

  .result-stats strong {
    font-size: 19px;
  }

  .app-footer {
    justify-content: center;
  }

  .app-footer button {
    display: none;
  }
}

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