/* =========================================================
   LingoSprout · vocabulary learning app
   Duolingo-inspired, light-blue theme
   ========================================================= */

:root {
  --green: #38bdf8;
  --green-dark: #0284c7;
  --green-strong: #0369a1;
  --green-soft: #e8f6ff;
  --green-line: #bae6fd;
  --blue: #1cb0f6;
  --blue-dark: #1494d0;
  --blue-soft: #e6f7ff;
  --purple: #ce82ff;
  --purple-dark: #a568cc;
  --purple-soft: #f7ecff;
  --yellow: #ffc800;
  --yellow-dark: #e0a800;
  --yellow-soft: #fff8d9;
  --orange: #ff9600;
  --orange-soft: #fff2df;
  --red: #ff4b4b;
  --red-dark: #d63a3a;
  --red-soft: #fff0f0;
  --ink: #344556;
  --ink-strong: #183247;
  --muted: #6b7b8a;
  --muted-light: #9aabb8;
  --line: #e1edf5;
  --line-strong: #cbdce8;
  --surface: #ffffff;
  --bg: #f7fbff;
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-card: 0 2px 0 var(--line);
  --shadow-btn: 0 4px 0 var(--green-dark);
  --font: "Nunito", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-en: "Nunito", "Arial Rounded MT Bold", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(56, 189, 248, 0.07), transparent 26rem),
    radial-gradient(circle at 88% 22%, rgba(28, 176, 246, 0.055), transparent 24rem),
    var(--bg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled) {
  cursor: pointer;
}

a {
  color: var(--green-strong);
}

svg {
  display: block;
  flex: none;
}

::selection {
  background: #bae6fd;
  color: var(--ink-strong);
}

:focus-visible {
  outline: 3px solid rgba(28, 176, 246, 0.7);
  outline-offset: 3px;
  border-radius: 8px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 500;
  padding: 10px 16px;
  border-radius: 10px;
  color: #fff;
  background: var(--ink-strong);
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

/* ---------- Layout & top bar ---------- */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  border-bottom: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar-inner {
  width: min(1240px, 100%);
  height: 76px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--green);
  box-shadow: 0 4px 0 var(--green-dark);
  transform: rotate(-3deg);
}

.brand-mark svg {
  width: 30px;
  height: 30px;
  transform: rotate(3deg);
}

.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.04;
}

.brand-name strong {
  color: var(--ink-strong);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.brand-name span {
  margin-top: 4px;
  color: var(--green-strong);
  font-family: var(--font-en);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.nav-tabs {
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #656565;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-tab svg {
  width: 22px;
  height: 22px;
}

.nav-tab:hover {
  background: #f5f5f5;
  color: var(--ink);
}

.nav-tab.active {
  color: var(--green-strong);
  background: var(--green-soft);
}

.nav-tab:active {
  transform: translateY(1px);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.top-stat {
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.top-stat svg {
  width: 20px;
  height: 20px;
}

.top-stat.streak {
  color: #f28b00;
}

.top-stat.xp {
  color: #d7a400;
}

.top-icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  transition: background 0.16s ease, transform 0.16s ease;
}

.top-icon-btn:hover {
  background: #f7f7f7;
  color: var(--ink);
}

.top-icon-btn:active {
  transform: translateY(1px);
}

.avatar-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid #a5ddf5;
  border-radius: 50%;
  background: linear-gradient(145deg, #e8f7ff, #c9edff);
  color: var(--green-strong);
  font-size: 16px;
  font-weight: 900;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.avatar-btn:hover {
  transform: translateY(-1px) rotate(-3deg);
  box-shadow: 0 3px 0 #93d8f5;
}

.page {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 28px 28px 70px;
  flex: 1;
}

.page:focus {
  outline: none;
}

.bottom-nav {
  display: none;
}

/* ---------- Shared primitives ---------- */

.btn {
  position: relative;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: 0;
  border-radius: 14px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.015em;
  text-align: center;
  text-decoration: none;
  transition: filter 0.16s ease, transform 0.08s ease, box-shadow 0.08s ease, background 0.16s ease;
  user-select: none;
}

.btn svg {
  width: 20px;
  height: 20px;
}

.btn-green {
  color: #fff;
  background: var(--green);
  box-shadow: 0 4px 0 var(--green-dark);
}

.btn-green:hover:not(:disabled) {
  filter: brightness(1.045);
}

.btn-green:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--green-dark);
}

.btn-blue {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 4px 0 var(--blue-dark);
}

.btn-blue:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--blue-dark);
}

.btn-red {
  color: #fff;
  background: var(--red);
  box-shadow: 0 4px 0 var(--red-dark);
}

.btn-red:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--red-dark);
}

.btn-ghost {
  color: var(--green-strong);
  background: #fff;
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--line);
}

.btn-ghost:hover:not(:disabled) {
  background: #f9f9f9;
}

.btn-ghost:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--line);
}

.btn-soft {
  color: var(--green-strong);
  background: var(--green-soft);
  border: 2px solid #bae6fd;
  box-shadow: 0 3px 0 #bae6fd;
}

.btn-soft:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #bae6fd;
}

.btn:disabled {
  cursor: not-allowed;
  color: #b5b5b5;
  background: #e9e9e9;
  box-shadow: 0 4px 0 #d7d7d7;
}

.btn-lg {
  min-height: 56px;
  padding: 14px 28px;
  border-radius: 16px;
  font-size: 17px;
  letter-spacing: 0.03em;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  border: 0;
  background: transparent;
  padding: 6px;
  color: var(--muted);
  border-radius: 10px;
}

.icon-btn:hover {
  background: #f2f2f2;
  color: var(--ink);
}

.card {
  border: 2px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green-strong);
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.eyebrow svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.speak-btn {
  position: relative;
  width: 38px;
  height: 38px;
  flex: none;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 2px solid #cfe8f5;
  border-radius: 50%;
  background: #f4fbff;
  color: var(--green-strong);
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.speak-btn svg {
  width: 19px;
  height: 19px;
}

.speak-btn:hover {
  transform: scale(1.06);
  background: var(--green-soft);
  border-color: #9ddcf7;
}

.speak-btn:active {
  transform: scale(0.96);
}

.speak-btn.is-speaking {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.speak-btn.is-speaking::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid rgba(56, 189, 248, 0.45);
  border-radius: 50%;
  animation: speakPulse 1.1s ease-out infinite;
}

.speak-btn.on-dark {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.45);
}

.speak-btn.on-dark:hover {
  background: rgba(255, 255, 255, 0.28);
}

.speak-btn.sm {
  width: 32px;
  height: 32px;
}

.speak-btn.sm svg {
  width: 16px;
  height: 16px;
}

.speak-btn.lg {
  width: 58px;
  height: 58px;
  border-width: 3px;
}

.speak-btn.lg svg {
  width: 27px;
  height: 27px;
}

.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
}

.section-title-row h2,
.section-title {
  margin: 0;
  color: var(--ink-strong);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.section-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Mascot ---------- */

.mascot {
  display: block;
  width: 100%;
  height: auto;
}

.mascot-float {
  animation: mascotFloat 4.2s ease-in-out infinite;
}

.mascot-shadow {
  transform-origin: center;
  animation: shadowBreathe 4.2s ease-in-out infinite;
}

.mascot-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 5.6s infinite;
}

.mascot-eye.delay {
  animation-delay: 0.12s;
}

/* ---------- Home grid ---------- */

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 326px;
  align-items: start;
  gap: 34px;
}

.home-main {
  min-width: 0;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}

.welcome-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
}

.welcome-copy h1 {
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(25px, 3vw, 32px);
  font-weight: 900;
  letter-spacing: -0.025em;
}

.welcome-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.welcome-date {
  flex: none;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mobile-goal-strip {
  display: none;
}

.unit-block {
  margin-bottom: 30px;
}

.unit-hero {
  position: relative;
  overflow: hidden;
  min-height: 172px;
  display: flex;
  align-items: center;
  padding: 26px 30px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(120deg, #3b9fe8 0%, #1686cb 62%, #0b6fa8 100%);
  box-shadow: 0 7px 0 #0b6fa8;
}

.unit-hero.unit-tone-1 {
  background: linear-gradient(120deg, #399fe6 0%, #1286ca 62%, #0b6fa8 100%);
  box-shadow: 0 7px 0 #0b6fa8;
}

.unit-hero.unit-tone-2 {
  background: linear-gradient(120deg, #22a9d6 0%, #0f8db8 62%, #0b769a 100%);
  box-shadow: 0 7px 0 #0b769a;
}

.unit-hero.unit-tone-3 {
  background: linear-gradient(120deg, #4c8ce8 0%, #2f6fc9 62%, #245ba8 100%);
  box-shadow: 0 7px 0 #245ba8;
}

.unit-hero.unit-tone-4 {
  background: linear-gradient(120deg, #5d84d9 0%, #4568bd 62%, #35539b 100%);
  box-shadow: 0 7px 0 #35539b;
}

.unit-hero.is-locked {
  color: #8e8e8e;
  background: linear-gradient(120deg, #efefef, #e7e7e7);
  box-shadow: 0 7px 0 #d4d4d4;
}

.unit-hero::before,
.unit-hero::after {
  content: "";
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  pointer-events: none;
}

.unit-hero::before {
  width: 220px;
  height: 220px;
  right: -46px;
  top: -92px;
}

.unit-hero::after {
  width: 140px;
  height: 140px;
  right: 72px;
  bottom: -86px;
  background: rgba(255, 255, 255, 0.08);
}

.unit-hero.is-locked::before,
.unit-hero.is-locked::after {
  border-color: rgba(0, 0, 0, 0.05);
}

.unit-copy {
  position: relative;
  z-index: 2;
  max-width: 72%;
}

.unit-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.unit-kicker .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.unit-hero.is-locked .unit-kicker {
  color: #888;
}

.unit-copy h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.025em;
}

.unit-copy h2 span {
  margin-left: 8px;
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  opacity: 0.78;
}

.unit-copy p {
  max-width: 440px;
  margin: 9px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
}

.unit-hero.is-locked .unit-copy p,
.unit-hero.is-locked .unit-copy h2 {
  color: #888;
}

.unit-guide {
  margin-top: 15px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 13px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  transition: background 0.16s ease, transform 0.16s ease;
}

.unit-guide:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.unit-guide svg {
  width: 16px;
  height: 16px;
}

.unit-hero.is-locked .unit-guide {
  border-color: #d0d0d0;
  color: #8a8a8a;
  background: rgba(255, 255, 255, 0.4);
}

.unit-mascot {
  position: absolute;
  z-index: 1;
  right: 22px;
  bottom: -8px;
  width: 142px;
  filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.06));
  transform: rotate(4deg);
}

.unit-mascot.mascot-small {
  width: 118px;
  right: 30px;
  bottom: -14px;
}

.unit-lock-badge {
  position: absolute;
  z-index: 3;
  right: 30px;
  bottom: 26px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #a2a2a2;
  box-shadow: 0 4px 0 #cfcfcf;
}

.unit-lock-badge svg {
  width: 25px;
  height: 25px;
}

.path-card {
  position: relative;
  margin-top: 18px;
  padding: 8px 0 22px;
}

.path-track {
  position: relative;
  width: min(100%, 520px);
  margin: 0 auto;
  padding-top: 10px;
}

.path-track::before {
  display: none;
}

.path-line-svg {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.node-row {
  position: relative;
  z-index: 2;
  min-height: 122px;
  display: flex;
  justify-content: center;
}

.node-unit {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 160px;
  transform: translateX(var(--offset, 0px));
}

.node-unit.has-bubble {
  padding-top: 31px;
}

.path-node {
  position: relative;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  box-shadow: 0 6px 0 var(--green-dark), inset 0 -4px 0 rgba(0, 0, 0, 0.06);
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
}

.path-node svg {
  width: 33px;
  height: 33px;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.08));
}

.path-node::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

.path-node:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.path-node:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 3px 0 var(--green-dark), inset 0 -2px 0 rgba(0, 0, 0, 0.06);
}

.node-completed .path-node {
  background: var(--yellow);
  box-shadow: 0 6px 0 var(--yellow-dark), inset 0 -4px 0 rgba(0, 0, 0, 0.07);
}

.node-completed .path-node:active:not(:disabled) {
  box-shadow: 0 3px 0 var(--yellow-dark), inset 0 -2px 0 rgba(0, 0, 0, 0.06);
}

.node-current .path-node {
  animation: nodeBob 2.8s ease-in-out infinite;
}

.node-current .path-node::after {
  content: "";
  position: absolute;
  inset: -10px;
  border: 3px solid rgba(56, 189, 248, 0.2);
  border-radius: 50%;
  animation: nodeHalo 2.8s ease-out infinite;
}

.node-locked .path-node {
  color: #a7a7a7;
  background: #ececec;
  box-shadow: 0 6px 0 #d5d5d5, inset 0 -4px 0 rgba(0, 0, 0, 0.03);
  cursor: not-allowed;
}

.node-challenge .path-node {
  background: var(--purple);
  box-shadow: 0 6px 0 var(--purple-dark), inset 0 -4px 0 rgba(0, 0, 0, 0.08);
}

.node-challenge .path-node:active:not(:disabled) {
  box-shadow: 0 3px 0 var(--purple-dark), inset 0 -2px 0 rgba(0, 0, 0, 0.06);
}

.node-challenge.node-completed .path-node {
  background: var(--yellow);
  box-shadow: 0 6px 0 var(--yellow-dark), inset 0 -4px 0 rgba(0, 0, 0, 0.07);
}

.node-challenge.node-locked .path-node {
  color: #a7a7a7;
  background: #ececec;
  box-shadow: 0 6px 0 #d5d5d5, inset 0 -4px 0 rgba(0, 0, 0, 0.03);
  cursor: not-allowed;
}

.node-caption {
  width: 168px;
  margin-top: 10px;
  text-align: center;
  line-height: 1.25;
}

.node-caption strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.node-caption span {
  display: block;
  margin-top: 3px;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.node-current .node-caption strong {
  color: var(--green-strong);
}

.node-locked .node-caption strong {
  color: #999;
}

.start-bubble {
  position: absolute;
  z-index: 3;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 14px;
  border: 2px solid #bae6fd;
  border-radius: 10px;
  background: #fff;
  color: var(--green-strong);
  box-shadow: 0 3px 0 #bae6fd;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  white-space: nowrap;
  animation: bubbleBob 2.8s ease-in-out infinite;
}

.start-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-right: 2px solid #bae6fd;
  border-bottom: 2px solid #bae6fd;
  transform: translateX(-50%) rotate(45deg);
}

.path-footnote {
  margin: 12px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted-light);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.path-footnote svg {
  width: 15px;
  height: 15px;
}

/* ---------- Side rail ---------- */

.side-rail {
  position: sticky;
  top: 102px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.side-card {
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.goal-card {
  display: flex;
  align-items: center;
  gap: 17px;
}

.goal-ring {
  --pct: 0;
  position: relative;
  width: 82px;
  height: 82px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--pct) * 1%), #e9e9e9 0);
  transition: background 0.4s ease;
}

.goal-ring::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px #f1f1f1;
}

.goal-ring-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
}

.goal-ring-text strong {
  color: var(--ink-strong);
  font-size: 22px;
  font-weight: 900;
}

.goal-ring-text span {
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.goal-copy {
  min-width: 0;
}

.goal-copy h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 16px;
  font-weight: 900;
}

.goal-copy p {
  margin: 4px 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.goal-mini-bar {
  height: 8px;
  border-radius: 6px;
  background: #eeeeee;
  overflow: hidden;
}

.goal-mini-bar span {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: var(--green);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
  transition: width 0.4s ease;
}

.streak-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.streak-card::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  right: -28px;
  top: -30px;
  border-radius: 50%;
  background: #fff4e5;
}

.streak-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
}

.streak-flame {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #ff8a00;
  background: var(--orange-soft);
}

.streak-flame svg {
  width: 27px;
  height: 27px;
}

.streak-head h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 15px;
  font-weight: 900;
}

.streak-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.week-dots {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.week-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.week-dot i {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f0f0f0;
  color: #b9b9b9;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.week-dot.active i {
  color: #fff;
  background: var(--green);
  box-shadow: 0 2px 0 var(--green-dark);
}

.week-dot.today i {
  outline: 2px solid #9edcf7;
  outline-offset: 2px;
}

.week-dot span {
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 800;
}

.phrase-card {
  background: linear-gradient(160deg, #f4fbff, #e8f5fd);
  border-color: #cfe8f6;
  box-shadow: 0 2px 0 #cfe8f6;
}

.phrase-card .eyebrow {
  margin-bottom: 10px;
  font-size: 10px;
}

.phrase-en {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.phrase-en p {
  margin: 0;
  color: var(--ink-strong);
  font-family: var(--font-en);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
}

.phrase-card .phrase-zh {
  margin: 8px 0 0;
  color: var(--green-strong);
  font-size: 12px;
  font-weight: 700;
}

.helper-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 20px;
  background: #fff;
  border: 2px dashed #dbeaf5;
}

.helper-mascot {
  width: 60px;
  flex: none;
  margin: -10px -2px -10px -6px;
}

.helper-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

.helper-card strong {
  color: var(--ink-strong);
  font-weight: 900;
}

/* ---------- Practice view ---------- */

.view-header {
  margin-bottom: 24px;
}

.view-header h1 {
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(26px, 3.2vw, 34px);
  font-weight: 900;
  letter-spacing: -0.025em;
}

.view-header p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.practice-layout {
  max-width: 940px;
  margin: 0 auto;
}

.practice-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 184px;
  padding: 28px 32px;
  border: 2px solid #cfe8f6;
  border-radius: 24px;
  background: linear-gradient(135deg, #f4fbff, #e6f5fe);
  box-shadow: 0 3px 0 #cfe8f6;
}

.practice-hero-copy {
  position: relative;
  z-index: 2;
  max-width: 60%;
}

.practice-hero h2 {
  margin: 4px 0 8px;
  color: var(--ink-strong);
  font-size: clamp(23px, 3.4vw, 30px);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.practice-hero p {
  margin: 0;
  color: #5b7180;
  font-size: 13px;
  font-weight: 600;
}

.practice-hero .practice-mascot {
  position: absolute;
  right: 35px;
  bottom: -16px;
  width: 152px;
  transform: rotate(5deg);
}

.practice-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 17px;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1.5px solid #b9e2f7;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--green-strong);
  font-size: 11px;
  font-weight: 900;
}

.stat-chip svg {
  width: 15px;
  height: 15px;
}

.practice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.practice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 248px;
  padding: 22px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 3px 0 var(--line);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.practice-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--line);
}

.practice-card.featured {
  grid-column: span 3;
  min-height: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-color: #ffd8d8;
  background: linear-gradient(120deg, #fffafa, #fff3f3);
  box-shadow: 0 3px 0 #ffd8d8;
}

.practice-icon {
  width: 52px;
  height: 52px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 3px 0 var(--green-dark);
}

.practice-icon.red {
  background: #ff6b6b;
  box-shadow: 0 3px 0 #dc4f4f;
}

.practice-icon.blue {
  background: var(--blue);
  box-shadow: 0 3px 0 var(--blue-dark);
}

.practice-icon.purple {
  background: var(--purple);
  box-shadow: 0 3px 0 var(--purple-dark);
}

.practice-icon svg {
  width: 26px;
  height: 26px;
}

.practice-card h3 {
  margin: 15px 0 6px;
  color: var(--ink-strong);
  font-size: 17px;
  font-weight: 900;
}

.practice-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
}

.practice-card .practice-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  color: var(--muted-light);
  font-size: 11px;
  font-weight: 800;
}

.practice-card .practice-count strong {
  color: var(--ink);
}

.practice-card-footer {
  margin-top: auto;
  padding-top: 18px;
}

.practice-card-footer .btn {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 12px;
}

.practice-featured-copy h3 {
  margin-top: 2px;
  font-size: 18px;
}

.practice-featured-copy .practice-count {
  margin-top: 6px;
}

.practice-featured .btn {
  width: auto;
  min-width: 150px;
}

.practice-tip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #f2f9fd;
  color: #5b7180;
  font-size: 12px;
  font-weight: 600;
}

.practice-tip svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--green-strong);
  margin-top: 1px;
}

/* ---------- Profile ---------- */

.profile-layout {
  max-width: 940px;
  margin: 0 auto;
}

.profile-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 26px 30px;
  border: 2px solid #c8e6f6;
  border-radius: 24px;
  background: linear-gradient(125deg, #f5fbff, #eaf7ff);
  box-shadow: 0 3px 0 #c8e6f6;
}

.profile-avatar {
  position: relative;
  z-index: 1;
  width: 104px;
  height: 104px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #c7e8f8;
  box-shadow: 0 4px 0 #c7e8f8;
}

.profile-avatar .mascot {
  width: 85px;
}

.profile-hero-copy {
  position: relative;
  z-index: 1;
}

.profile-hero-copy .eyebrow {
  margin-bottom: 4px;
}

.profile-hero-copy h1 {
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(24px, 3.4vw, 30px);
  font-weight: 900;
}

.profile-hero-copy p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.profile-hero .settings-trigger {
  position: absolute;
  right: 24px;
  top: 22px;
  z-index: 2;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.profile-stat {
  padding: 17px 18px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 0 var(--line);
}

.profile-stat-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.profile-stat-head svg {
  width: 17px;
  height: 17px;
}

.profile-stat strong {
  display: block;
  margin-top: 8px;
  color: var(--ink-strong);
  font-size: 27px;
  font-weight: 900;
  line-height: 1;
}

.profile-stat small {
  margin-left: 3px;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 800;
}

.profile-section {
  margin-top: 28px;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.achievement {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  opacity: 0.56;
  filter: grayscale(1);
}

.achievement.unlocked {
  opacity: 1;
  filter: none;
  border-color: #cfe8f6;
  background: #fbfeff;
  box-shadow: 0 2px 0 #cfe8f6;
}

.achievement-icon {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: var(--yellow);
  box-shadow: 0 2px 0 var(--yellow-dark);
}

.achievement-icon.green {
  background: var(--green);
  box-shadow: 0 2px 0 var(--green-dark);
}

.achievement-icon.blue {
  background: var(--blue);
  box-shadow: 0 2px 0 var(--blue-dark);
}

.achievement-icon.purple {
  background: var(--purple);
  box-shadow: 0 2px 0 var(--purple-dark);
}

.achievement-icon.red {
  background: #ff6b6b;
  box-shadow: 0 2px 0 #dc4f4f;
}

.achievement-icon svg {
  width: 23px;
  height: 23px;
}

.achievement-copy strong {
  display: block;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 900;
}

.achievement-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.45;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.history-icon {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--green-strong);
  background: var(--green-soft);
}

.history-icon svg {
  width: 20px;
  height: 20px;
}

.history-copy {
  min-width: 0;
  flex: 1;
}

.history-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 700;
}

.history-result {
  flex: none;
  text-align: right;
}

.history-result strong {
  display: block;
  color: var(--green-strong);
  font-size: 13px;
  font-weight: 900;
}

.history-result span {
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 700;
}

.profile-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.profile-settings-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.profile-settings-row strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: 900;
}

.danger-link {
  border: 0;
  background: transparent;
  color: #d34c4c;
  font-size: 12px;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.empty-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 34px 22px;
  border: 2px dashed #dceaf4;
  border-radius: 18px;
  background: #fbfdff;
  text-align: center;
}

.empty-panel svg {
  width: 34px;
  height: 34px;
  color: #abc5d6;
}

.empty-panel strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.empty-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

/* ---------- Lesson shell ---------- */

.lesson-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  animation: screenIn 0.22s ease both;
}

.lesson-topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 74px;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px 28px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lesson-close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted-light);
}

.lesson-close:hover {
  background: #f3f3f3;
  color: var(--ink);
}

.lesson-close svg {
  width: 24px;
  height: 24px;
}

.lesson-progress {
  width: 100%;
  height: 17px;
  overflow: hidden;
  border-radius: 12px;
  background: #e7e7e7;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.03);
}

.lesson-progress-fill {
  position: relative;
  height: 100%;
  min-width: 5px;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.35s cubic-bezier(0.22, 0.9, 0.3, 1);
}

.lesson-progress-fill::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 7px;
  right: 7px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.32);
}

.hearts {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  color: var(--red);
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.hearts svg {
  width: 23px;
  height: 23px;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.06));
}

.hearts.pop {
  animation: heartPop 0.4s ease;
}

.lesson-body {
  min-height: calc(100vh - 130px);
  display: flex;
  justify-content: center;
  padding: 16px 28px 180px;
}

.lesson-content {
  width: 100%;
  max-width: 720px;
  animation: questionIn 0.28s ease both;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 3px 0 18px;
}

.question-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green-strong);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.question-type.fill {
  color: #9a6800;
  background: var(--yellow-soft);
}

.question-type.listen {
  color: #077ca4;
  background: var(--blue-soft);
}

.question-type svg {
  width: 14px;
  height: 14px;
}

.question-meta-text {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.question-counter {
  margin-left: auto;
  color: var(--muted-light);
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.question-prompt {
  margin-bottom: 24px;
}

.prompt-card {
  padding: 22px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 2px 0 var(--line);
}

.prompt-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.prompt-english {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--ink-strong);
  font-family: var(--font-en);
  font-size: clamp(23px, 3vw, 29px);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.prompt-chinese {
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(25px, 3.2vw, 32px);
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.prompt-sub {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.listen-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  padding: 29px 22px;
  border: 2px solid #cdebf9;
  border-radius: 20px;
  background: linear-gradient(155deg, #f4fcff, #e9f8ff);
  box-shadow: 0 3px 0 #cdebf9;
  text-align: center;
}

.listen-panel .speak-btn {
  width: 66px;
  height: 66px;
  border-width: 3px;
  background: #fff;
  color: var(--blue-dark);
  border-color: #bde6fa;
}

.listen-panel .speak-btn svg {
  width: 30px;
  height: 30px;
}

.listen-panel .speak-btn.is-speaking {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.listen-panel .speak-btn.is-speaking::after {
  border-color: rgba(28, 176, 246, 0.45);
}

.listen-label {
  color: #087ba3;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.listen-sub {
  margin: -6px 0 0;
  color: #6f9cae;
  font-size: 11px;
  font-weight: 600;
}

.fill-card {
  padding: 22px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 2px 0 var(--line);
}

.fill-sentence-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.fill-sentence {
  flex: 1;
  margin: 0;
  color: var(--ink-strong);
  font-family: var(--font-en);
  font-size: clamp(23px, 3vw, 29px);
  font-weight: 800;
  line-height: 1.55;
  letter-spacing: -0.015em;
}

.blank-token {
  display: inline-block;
  min-width: 54px;
  margin: 0 4px;
  border-bottom: 3px solid #b9d99e;
  color: var(--green-strong);
  text-align: center;
  letter-spacing: 2px;
}

.blank-token.revealed {
  min-width: auto;
  border-bottom-color: var(--green);
  font-weight: 900;
  letter-spacing: 0;
}

.fill-translation {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.fill-input-area {
  margin-top: 20px;
  padding-top: 19px;
  border-top: 2px dashed #ededed;
}

.fill-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.fill-label svg {
  width: 15px;
  height: 15px;
  color: var(--green-strong);
}

.fill-input {
  width: 100%;
  min-height: 58px;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 13px;
  background: #fcfcfc;
  color: var(--ink-strong);
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.015em;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.fill-input::placeholder {
  color: #b5b5b5;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
}

.fill-input:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(28, 176, 246, 0.12);
}

.fill-input:disabled {
  color: var(--green-strong);
  background: var(--green-soft);
  border-color: var(--green-line);
  -webkit-text-fill-color: var(--green-strong);
  opacity: 1;
}

.fill-input.is-wrong {
  color: var(--red-dark);
  background: var(--red-soft);
  border-color: #ffb0b0;
  -webkit-text-fill-color: var(--red-dark);
}

.fill-hint-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 700;
}

.fill-hint-line kbd {
  display: inline-flex;
  min-width: 30px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 1.5px solid #d8d8d8;
  border-bottom-width: 2.5px;
  border-radius: 5px;
  background: #fff;
  color: #8b8b8b;
  font-family: var(--font);
  font-size: 9px;
  font-weight: 800;
}

.options {
  display: grid;
  gap: 12px;
}

.option-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
}

.option-wrap .option {
  flex: 1;
  min-width: 0;
  width: auto;
}

.option-wrap > .speak-btn {
  align-self: center;
  border-color: #e1edf5;
  background: #fafafa;
  color: #8c8c8c;
}

.option-wrap > .speak-btn:hover {
  color: var(--green-strong);
  border-color: #cde9b3;
  background: var(--green-soft);
}

.option {
  position: relative;
  width: 100%;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.08s ease, color 0.14s ease;
}

.option:hover:not(:disabled):not(.is-selected) {
  background: #f9f9f9;
  border-color: #d5d5d5;
}

.option:active:not(:disabled) {
  transform: translateY(1px);
}

.option-key {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border: 2px solid #dedede;
  border-radius: 8px;
  color: #9a9a9a;
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.option-text {
  flex: 1;
  min-width: 0;
  line-height: 1.45;
}

.option-text.en {
  font-family: var(--font-en);
  font-size: 17px;
  font-weight: 800;
}

.option .speak-btn {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-color: #e1edf5;
  background: #fafafa;
  color: #8c8c8c;
}

.option .speak-btn:hover {
  color: var(--green-strong);
  border-color: #cde9b3;
  background: var(--green-soft);
}

.option.is-selected {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-strong);
}

.option.is-selected .option-key {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.option.is-correct {
  border-color: var(--green);
  background: #e9f8ff;
  color: var(--green-strong);
}

.option.is-correct .option-key {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.option.is-wrong {
  border-color: #ff8b8b;
  background: var(--red-soft);
  color: var(--red-dark);
}

.option.is-wrong .option-key {
  border-color: #ff8b8b;
  background: #ff8b8b;
  color: #fff;
}

.option.is-correct::after,
.option.is-wrong::after {
  margin-left: 3px;
  width: 21px;
  height: 21px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.option.is-correct::after {
  content: "\2713";
  background: var(--green);
}

.option.is-wrong::after {
  content: "\00d7";
  background: #ff6b6b;
}

.option:disabled {
  cursor: default;
}

.option.is-correct .speak-btn,
.option.is-wrong .speak-btn {
  color: inherit;
}

.hint-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 2px solid #f1dfa2;
  border-radius: 15px;
  background: #fffbed;
  box-shadow: 0 2px 0 #f1dfa2;
  animation: hintIn 0.3s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}

.hint-avatar {
  width: 48px;
  flex: none;
  margin: -8px 0 -8px -5px;
}

.hint-copy {
  min-width: 0;
  padding-top: 1px;
}

.hint-label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
  color: #a87b00;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.hint-label svg {
  width: 14px;
  height: 14px;
}

.hint-copy p {
  margin: 0;
  color: #715a1d;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.65;
}

.feedback-card {
  margin-top: 18px;
  padding: 16px 18px;
  border: 2px solid var(--green-line);
  border-radius: 16px;
  background: #effaff;
  box-shadow: 0 2px 0 var(--green-line);
  animation: feedbackIn 0.26s ease both;
}

.feedback-card.is-wrong {
  border-color: #ffc2c2;
  background: #fff5f5;
  box-shadow: 0 2px 0 #ffc2c2;
}

.feedback-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.feedback-icon {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  box-shadow: 0 2px 0 var(--green-dark);
}

.feedback-card.is-wrong .feedback-icon {
  background: #ff6b6b;
  box-shadow: 0 2px 0 #dc4f4f;
}

.feedback-icon svg {
  width: 17px;
  height: 17px;
}

.feedback-head h3 {
  margin: 1px 0 0;
  color: var(--green-strong);
  font-size: 16px;
  font-weight: 900;
}

.feedback-card.is-wrong .feedback-head h3 {
  color: #b73c3c;
}

.feedback-head p {
  margin: 2px 0 0;
  color: #4c6b7e;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.feedback-card.is-wrong .feedback-head p {
  color: #8f6060;
}

.feedback-example {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
  border: 1.5px solid rgba(56, 189, 248, 0.16);
}

.feedback-card.is-wrong .feedback-example {
  border-color: rgba(255, 75, 75, 0.15);
}

.feedback-example p {
  flex: 1;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.feedback-example .speak-btn {
  width: 30px;
  height: 30px;
}

.lesson-footer {
  position: fixed;
  z-index: 22;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 15px 28px calc(15px + env(safe-area-inset-bottom));
  border-top: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lesson-footer-inner {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.hint-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  transition: background 0.16s ease, color 0.16s ease;
}

.hint-trigger:hover {
  color: #9a7200;
  background: var(--yellow-soft);
}

.hint-trigger svg {
  width: 17px;
  height: 17px;
}

.footer-keyhint {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.footer-keyhint kbd {
  display: inline-flex;
  min-width: 45px;
  height: 21px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 1.5px solid #dddddd;
  border-bottom-width: 3px;
  border-radius: 5px;
  background: #fff;
  color: #8d8d8d;
  font-family: var(--font);
  font-size: 9px;
  font-weight: 800;
}

.lesson-footer .btn {
  width: 185px;
  min-height: 49px;
  flex: none;
  border-radius: 13px;
  font-size: 14px;
  letter-spacing: 0.05em;
}

.lesson-footer .btn.is-ready {
  animation: buttonReady 0.24s ease;
}

/* ---------- Lesson intro ---------- */

.intro-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.intro-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
}

.intro-topbar .lesson-close {
  width: 42px;
  height: 42px;
}

.intro-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 24px 50px;
  background:
    radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.09), transparent 18rem),
    radial-gradient(circle at 82% 75%, rgba(255, 200, 0, 0.1), transparent 17rem),
    #fff;
}

.intro-card {
  width: 100%;
  max-width: 610px;
  text-align: center;
  animation: questionIn 0.3s ease both;
}

.intro-mascot-wrap {
  position: relative;
  width: 164px;
  margin: 0 auto 8px;
}

.intro-mascot-wrap .mascot {
  width: 164px;
}

.intro-bubble {
  position: absolute;
  z-index: 2;
  left: 122px;
  top: 12px;
  width: max-content;
  max-width: 170px;
  padding: 8px 11px;
  border: 2px solid #bae6fd;
  border-radius: 12px 12px 12px 3px;
  background: #fff;
  color: var(--green-strong);
  box-shadow: 0 2px 0 #bae6fd;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.4;
  text-align: left;
  transform: rotate(2deg);
}

.intro-card .eyebrow {
  margin-top: 10px;
}

.intro-card h1 {
  margin: 7px 0 5px;
  color: var(--ink-strong);
  font-size: clamp(32px, 5vw, 43px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.intro-en {
  margin: 0;
  color: var(--muted-light);
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.intro-desc {
  max-width: 460px;
  margin: 13px auto 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.65;
}

.intro-goals {
  max-width: 480px;
  margin: 24px auto 0;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  text-align: left;
}

.intro-goal {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.intro-goal-icon {
  width: 22px;
  height: 22px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--green-strong);
  background: var(--green-soft);
}

.intro-goal-icon svg {
  width: 13px;
  height: 13px;
}

.intro-tip {
  max-width: 480px;
  margin: 22px auto 0;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  border: 1.5px solid #f0e2b9;
  border-radius: 12px;
  background: #fffdf5;
  color: #7d6a37;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  text-align: left;
}

.intro-tip svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: #d7a400;
  margin-top: 1px;
}

.intro-actions {
  max-width: 480px;
  margin: 26px auto 0;
}

.intro-actions .btn {
  width: 100%;
}

.intro-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 12px 0 0;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 700;
}

.intro-meta svg {
  width: 14px;
  height: 14px;
}

.intro-phrases {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  max-width: 480px;
  margin: 18px auto 0;
}

.intro-phrase-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border: 1.5px solid #dceef9;
  border-radius: 8px;
  background: #fbfeff;
  color: #546b7b;
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 800;
}

.intro-phrase-chip .speak-btn {
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
}

.intro-phrase-chip .speak-btn svg {
  width: 13px;
  height: 13px;
}

/* ---------- Results ---------- */

.results-screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 8%, rgba(56, 189, 248, 0.12), transparent 22rem),
    radial-gradient(circle at 84% 30%, rgba(255, 200, 0, 0.12), transparent 20rem),
    #f8fcff;
}

.results-topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
}

.results-topbar .lesson-close {
  background: rgba(255, 255, 255, 0.7);
}

.results-body {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 6px 24px 70px;
  text-align: center;
}

.results-mascot {
  width: 180px;
  margin: 2px auto -5px;
}

.results-eyebrow {
  margin-top: 8px;
}

.results-title {
  margin: 7px 0 8px;
  color: var(--ink-strong);
  font-size: clamp(33px, 5.4vw, 46px);
  font-weight: 900;
  line-height: 1.13;
  letter-spacing: -0.035em;
}

.results-sub {
  margin: 0 auto;
  max-width: 430px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.65;
}

.xp-burst {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 19px 0 0;
  padding: 8px 15px;
  border: 2px solid #f3d879;
  border-radius: 999px;
  background: #fff9dd;
  color: #b78500;
  box-shadow: 0 3px 0 #f3d879;
  font-size: 14px;
  font-weight: 900;
  animation: xpPop 0.5s 0.12s both;
}

.xp-burst svg {
  width: 19px;
  height: 19px;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.result-stat {
  padding: 15px 10px;
  border: 2px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 2px 0 var(--line);
}

.result-stat span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.result-stat strong {
  display: block;
  margin-top: 5px;
  color: var(--ink-strong);
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
}

.result-stat strong em {
  color: var(--green);
  font-style: normal;
}

.result-review {
  margin-top: 26px;
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-card);
  text-align: left;
}

.result-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.result-review-head h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 16px;
  font-weight: 900;
}

.result-review-head span {
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 700;
}

.result-phrase {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-top: 1.5px solid #f1f1f1;
}

.result-review-head + .result-phrase {
  border-top: 0;
}

.result-phrase-copy {
  flex: 1;
  min-width: 0;
}

.result-phrase-copy p {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.result-phrase-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.result-actions {
  display: flex;
  gap: 11px;
  margin-top: 24px;
}

.result-actions .btn {
  flex: 1;
}

.result-actions .btn-ghost {
  flex: 0 0 40%;
}

.result-note {
  margin-top: 16px;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 700;
}

.confetti {
  position: absolute;
  top: -20px;
  z-index: 1;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.88;
  animation: confettiFall var(--duration, 3.6s) var(--delay, 0s) cubic-bezier(0.15, 0.7, 0.45, 1) infinite;
  pointer-events: none;
}

/* ---------- Modal & settings ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(30, 40, 30, 0.46);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fadeIn 0.18s ease both;
}

.modal-card {
  width: 100%;
  max-width: 460px;
  max-height: min(88vh, 760px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
  border-radius: 23px;
  background: #fff;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
  animation: modalPop 0.24s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-head h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 21px;
  font-weight: 900;
  line-height: 1.25;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.modal-close {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: #f4f4f4;
  color: var(--muted);
}

.modal-close:hover {
  background: #ececec;
  color: var(--ink);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-copy {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.7;
}

.modal-mascot {
  width: 142px;
  margin: 2px auto 14px;
}

.modal-copy strong {
  color: var(--ink);
  font-weight: 900;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 22px;
}

.modal-actions .btn {
  width: 100%;
}

.settings-group {
  margin-top: 18px;
}

.settings-group + .settings-group {
  padding-top: 18px;
  border-top: 1.5px solid #f0f0f0;
}

.settings-group-title {
  margin: 0 0 10px;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}

.settings-label {
  min-width: 0;
}

.settings-label strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.settings-label span {
  display: block;
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.45;
}

.toggle {
  position: relative;
  width: 47px;
  height: 28px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #d8d8d8;
  transition: background 0.2s ease;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s cubic-bezier(0.22, 0.9, 0.3, 1);
}

.toggle[aria-checked="true"] {
  background: var(--green);
}

.toggle[aria-checked="true"]::after {
  transform: translateX(19px);
}

.settings-select {
  width: 100%;
  min-height: 44px;
  margin-top: 3px;
  padding: 8px 36px 8px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.rate-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.rate-wrap input[type="range"] {
  flex: 1;
  height: 5px;
  accent-color: var(--green);
  cursor: pointer;
}

.rate-value {
  min-width: 36px;
  color: var(--green-strong);
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 900;
  text-align: right;
}

.voice-test {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.voice-test .btn {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 11px;
  border-radius: 9px;
}

.phrasebook-scroll {
  max-height: clamp(250px, 52vh, 530px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 5px;
  scrollbar-width: thin;
  scrollbar-color: #cfcfcf transparent;
}

.phrasebook-scroll::-webkit-scrollbar {
  width: 6px;
}

.phrasebook-scroll::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background: #d7d7d7;
}

.phrasebook-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.phrasebook-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1.5px solid #f1f1f1;
}

.phrasebook-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.phrasebook-item-copy {
  flex: 1;
  min-width: 0;
}

.phrasebook-item-copy p {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.phrasebook-item-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

/* ---------- Toast ---------- */

.toast-stack {
  position: fixed;
  z-index: 400;
  left: 50%;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(420px, calc(100% - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

#lesson-screen:not([hidden]) ~ .toast-stack {
  bottom: 96px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 7px 22px rgba(0, 0, 0, 0.12);
  font-size: 12px;
  font-weight: 800;
  animation: toastIn 0.2s ease both;
}

.toast svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--green-strong);
}

.toast.is-leaving {
  animation: toastOut 0.2s ease both;
}

/* ---------- Animations ---------- */

@keyframes screenIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes questionIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hintIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes feedbackIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalPop {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-5px) scale(0.98); }
}

@keyframes mascotFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-6px) rotate(1deg); }
}

@keyframes shadowBreathe {
  0%, 100% { transform: scaleX(1); opacity: 0.12; }
  50% { transform: scaleX(0.88); opacity: 0.09; }
}

@keyframes blink {
  0%, 44%, 48%, 100% { transform: scaleY(1); }
  46% { transform: scaleY(0.12); }
}

@keyframes nodeBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes bubbleBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
}

@keyframes nodeHalo {
  0% { transform: scale(0.9); opacity: 0.9; }
  70%, 100% { transform: scale(1.22); opacity: 0; }
}

@keyframes heartPop {
  0% { transform: scale(1); }
  35% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

@keyframes buttonReady {
  0% { transform: scale(1); }
  55% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

@keyframes speakPulse {
  0% { transform: scale(0.92); opacity: 0.8; }
  100% { transform: scale(1.22); opacity: 0; }
}

@keyframes xpPop {
  from { opacity: 0; transform: scale(0.7) rotate(-4deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes confettiFall {
  0% { transform: translate3d(0, -10px, 0) rotate(0deg); opacity: 0; }
  8% { opacity: 0.9; }
  100% { transform: translate3d(var(--drift, 40px), 105vh, 0) rotate(720deg); opacity: 0; }
}

/* ---------- Large course additions ---------- */

.nav-tab,
.bottom-tab {
  position: relative;
}

.nav-badge {
  min-width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-en);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.bottom-tab .nav-badge {
  position: absolute;
  top: 3px;
  right: calc(50% - 21px);
}

.nav-tab.active .nav-badge {
  box-shadow: 0 0 0 2px var(--green-soft);
}

.welcome-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.welcome-continue {
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: 0 3px 0 var(--green-dark);
}

.welcome-continue svg {
  width: 17px;
  height: 17px;
}

.unit-block {
  scroll-margin-top: 92px;
}

.unit-jump-card {
  margin: 0 0 22px;
  padding: 14px 16px 12px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.unit-jump-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.unit-jump-head div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.unit-jump-head strong {
  color: var(--ink-strong);
  font-size: 12px;
  font-weight: 900;
}

.unit-jump-head span {
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 700;
}

.unit-jump-head > span {
  padding-top: 1px;
  color: var(--green-strong);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.unit-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 1px 5px;
}

.unit-jump::-webkit-scrollbar {
  height: 5px;
}

.unit-jump::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background: #d4e5ef;
}

.unit-jump-btn {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--muted);
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 900;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.unit-jump-btn:hover {
  transform: translateY(-1px);
  border-color: var(--green-line);
}

.unit-jump-btn svg {
  width: 14px;
  height: 14px;
}

.unit-jump-btn.done {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 2px 0 var(--green-dark);
}

.unit-jump-btn.done::after {
  content: "\2713";
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  color: #fff;
}

.unit-jump-btn.current {
  color: var(--green-strong);
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: 0 2px 0 var(--green-line);
}

.unit-jump-btn.current i {
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
  transform: translateX(-50%);
}

.unit-jump-btn.open {
  color: var(--green-strong);
  border-color: var(--green-line);
  background: #fbffff;
}

.unit-jump-btn.locked {
  color: #b5c4ce;
  border-color: #e7eff5;
  background: #f7fafc;
}

.course-progress-card .eyebrow {
  margin-bottom: 9px;
}

.course-progress-card h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 16px;
  font-weight: 900;
}

.course-progress-card p {
  margin: 5px 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.course-progress-card p strong {
  color: var(--green-strong);
  font-size: 14px;
  font-weight: 900;
}

.course-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 800;
}

/* Intro word list */

.intro-word-section {
  max-width: 520px;
  margin: 20px auto 0;
  padding: 13px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-card);
  text-align: left;
}

.intro-word-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.intro-word-head span {
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 700;
}

.intro-word-head span:first-child {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.intro-word-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 270px;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: #d2e5f0 transparent;
}

.intro-word-grid::-webkit-scrollbar {
  width: 5px;
}

.intro-word-grid::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background: #d4e5ef;
}

.intro-word-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  min-width: 0;
  padding: 8px 9px;
  border: 1.5px solid #e2f0f8;
  border-radius: 10px;
  background: #fbfeff;
}

.intro-word-main {
  min-width: 0;
}

.intro-word-main strong {
  display: block;
  overflow: hidden;
  color: var(--ink-strong);
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intro-word-main span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intro-word-card .speak-btn {
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
}

.intro-word-card .speak-btn svg {
  width: 14px;
  height: 14px;
}

/* Spelling question */

.spell-card .spell-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.spell-pos {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--green-soft);
  color: var(--green-strong);
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 900;
}

.spell-count {
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.spell-meaning {
  margin: 14px 0 0;
  color: var(--ink-strong);
  font-size: clamp(25px, 3.4vw, 34px);
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.spell-card .fill-translation {
  margin-top: 8px;
}

.spell-card .fill-input-area {
  margin-top: 18px;
  padding-top: 16px;
}

/* Matching question */

.question-type.match {
  color: #0369a1;
  background: #e4f6ff;
}

.review-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border: 1.5px solid #f1dfa2;
  border-radius: 6px;
  background: #fffbed;
  color: #9a7200;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.match-card {
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 2px 0 var(--line);
}

.match-help {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.55;
}

.match-help svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--green-strong);
}

.match-board {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 68px;
  padding: 2px 0;
}

.match-lines {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.match-column {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.match-item-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.match-item {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.1s ease;
}

.match-item:hover:not(:disabled):not(.is-selected):not(.is-matched) {
  border-color: var(--green-line);
  background: #fbfeff;
}

.match-item:active:not(:disabled) {
  transform: translateY(1px);
}

.match-text {
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.match-text.en {
  font-family: var(--font-en);
  font-size: 16px;
  font-weight: 800;
}

.match-item.is-selected {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-strong);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.13);
}

.match-item.is-matched {
  color: var(--green-strong);
  border-color: #9edcf7;
  background: #eefaff;
  cursor: default;
}

.match-item.is-matched::after {
  content: "\2713";
  width: 19px;
  height: 19px;
  flex: none;
  display: inline-grid;
  place-items: center;
  margin-left: auto;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.match-item.is-wrong {
  color: #b73c3c;
  border-color: #ff8b8b;
  background: var(--red-soft);
  animation: matchShake 0.35s ease;
}

.match-item:disabled {
  opacity: 1;
}

.match-item-wrap > .speak-btn {
  width: 31px;
  height: 31px;
  flex: none;
  border: 0;
  background: #f5fbff;
}

.match-item-wrap > .speak-btn svg {
  width: 15px;
  height: 15px;
}

.match-status {
  min-height: 20px;
  margin-top: 14px;
  padding: 2px 2px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.match-status.is-wrong {
  color: #c64f4f;
}

.match-feedback-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.match-feedback-item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid rgba(88, 180, 225, 0.2);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.8);
}

.match-feedback-en {
  color: var(--ink);
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 800;
}

.match-feedback-zh {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-feedback-item .speak-btn {
  width: 25px;
  height: 25px;
  flex: none;
  border: 0;
  background: #f2fbff;
}

.match-feedback-item .speak-btn svg {
  width: 12px;
  height: 12px;
}

@keyframes matchShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

/* Unit exams */

.exam-intro-badge {
  max-width: 480px;
  margin: 16px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1.5px solid #f0de9f;
  border-radius: 10px;
  background: #fffbec;
  color: #8f6a00;
  font-size: 11px;
  font-weight: 800;
}

.exam-intro-badge svg {
  width: 16px;
  height: 16px;
  color: #e0a800;
}

.node-exam .path-node {
  color: #fff;
  background: linear-gradient(145deg, #fbbf24, #f59e0b);
  box-shadow: 0 6px 0 #c77c00, inset 0 -4px 0 rgba(0, 0, 0, 0.08);
}

.node-exam .path-node:active:not(:disabled) {
  box-shadow: 0 3px 0 #c77c00, inset 0 -2px 0 rgba(0, 0, 0, 0.06);
}

.node-exam.node-current .path-node::after {
  border-color: rgba(245, 158, 11, 0.25);
}

.node-exam.node-locked .path-node {
  color: #a7a7a7;
  background: #ececec;
  box-shadow: 0 6px 0 #d5d5d5, inset 0 -4px 0 rgba(0, 0, 0, 0.03);
  cursor: not-allowed;
}

.node-exam.node-completed .path-node {
  background: var(--yellow);
  box-shadow: 0 6px 0 var(--yellow-dark), inset 0 -4px 0 rgba(0, 0, 0, 0.07);
}

.exam-result-banner {
  width: min(420px, 100%);
  margin: 15px auto 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 2px solid #bfe8d8;
  border-radius: 12px;
  background: #effcf6;
  text-align: left;
}

.exam-result-banner.failed {
  border-color: #ffd4d4;
  background: #fff7f7;
}

.exam-result-icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: #18a77a;
}

.exam-result-banner.failed .exam-result-icon {
  background: #ff6b6b;
}

.exam-result-icon svg {
  width: 19px;
  height: 19px;
}

.exam-result-banner strong {
  display: block;
  color: #126648;
  font-size: 12px;
  font-weight: 900;
}

.exam-result-banner.failed strong {
  color: #b73c3c;
}

.exam-result-banner div > span {
  display: block;
  margin-top: 2px;
  color: #5f7e72;
  font-size: 10px;
  font-weight: 700;
}

.exam-result-banner.failed div > span {
  color: #916060;
}

/* Mistakes overview */

.mistakes-layout {
  max-width: 940px;
  margin: 0 auto;
}

.mistake-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 222px;
  padding: 28px 32px;
  border: 2px solid #cbe9f8;
  border-radius: 24px;
  background: linear-gradient(135deg, #f2fbff, #e1f4ff);
  box-shadow: 0 3px 0 #cbe9f8;
}

.mistake-hero::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -90px;
  top: -100px;
  border-radius: 50%;
  border: 2px solid rgba(52, 153, 208, 0.1);
  pointer-events: none;
}

.mistake-hero-copy {
  position: relative;
  z-index: 2;
  max-width: 66%;
}

.mistake-hero h2 {
  margin: 6px 0 8px;
  color: var(--ink-strong);
  font-size: clamp(23px, 3.3vw, 30px);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.mistake-hero p {
  max-width: 530px;
  margin: 0;
  color: #5b7180;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.65;
}

.mistake-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 17px;
}

.mistake-hero-actions .btn {
  min-height: 42px;
  padding: 8px 15px;
  border-radius: 11px;
  font-size: 12px;
}

.mistake-mascot {
  position: absolute;
  right: 36px;
  bottom: -16px;
  z-index: 1;
  width: 158px;
  transform: rotate(4deg);
}

.mistake-group {
  margin-top: 26px;
}

.mistake-group-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.mistake-group-head h2 {
  margin: 4px 0 0;
  color: var(--ink-strong);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.mistake-group-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.mistake-group-head .btn {
  min-height: 38px;
  padding: 7px 12px;
  font-size: 11px;
  border-radius: 10px;
  flex: none;
}

.mistake-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mistake-item {
  padding: 15px 16px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 0 var(--line);
}

.mistake-word-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.mistake-word-main {
  min-width: 0;
}

.mistake-word-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.mistake-word-line > strong {
  color: var(--ink-strong);
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
}

.mistake-word-line .speak-btn {
  width: 28px;
  height: 28px;
  border: 0;
  background: #f4fbff;
}

.mistake-word-line .speak-btn svg {
  width: 14px;
  height: 14px;
}

.mistake-type {
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green-strong);
  font-size: 9px;
  font-weight: 900;
}

.mistake-word-main p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.mistake-date {
  flex: none;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 700;
}

.mistake-answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 11px;
}

.mistake-answer {
  min-width: 0;
  padding: 9px 11px;
  border: 1.5px solid #e5f0f7;
  border-radius: 10px;
  background: #fafdff;
}

.mistake-answer > span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 800;
}

.mistake-answer strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.mistake-answer.wrong {
  border-color: #ffe1e1;
  background: #fff7f7;
}

.mistake-answer.wrong strong {
  color: #b86060;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.mistake-answer.correct {
  border-color: #c8eafa;
  background: #f2fbff;
}

.mistake-answer.correct strong {
  color: var(--green-strong);
}

.mistake-correct-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mistake-correct-line .speak-btn {
  width: 26px;
  height: 26px;
  flex: none;
  border: 0;
  background: #fff;
}

.mistake-correct-line .speak-btn svg {
  width: 14px;
  height: 14px;
}

.mistake-item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 700;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--green-strong);
  font-size: 10px;
  font-weight: 900;
}

.text-link:hover {
  color: var(--green-dark);
}

.text-link svg {
  width: 13px;
  height: 13px;
}

.mistake-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 20px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f0f9ff;
  color: #5c7382;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.6;
}

.mistake-note svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--green-strong);
  margin-top: 1px;
}

.mistake-empty {
  margin-top: 20px;
  padding: 30px 22px;
}

.mistake-empty-mascot {
  width: 116px;
}

.mistake-empty .btn {
  margin-top: 5px;
}

/* ---------- Stars, chests and tarot ---------- */

.star-pips {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #f4b400;
}

.star-pip {
  width: 11px;
  height: 11px;
  display: inline-grid;
  place-items: center;
  color: #d8e5ee;
}

.star-pip svg {
  width: 100%;
  height: 100%;
}

.star-pip.filled {
  color: #f5b400;
  filter: drop-shadow(0 1px 0 rgba(174, 113, 0, 0.2));
}

.star-pips.lg {
  gap: 8px;
}

.star-pips.lg .star-pip {
  width: 34px;
  height: 34px;
  color: #dce8f0;
}

.star-pips.lg .star-pip.filled {
  color: #f7b500;
  filter: drop-shadow(0 3px 0 rgba(200, 137, 0, 0.18));
}

.node-star-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 14px;
  margin-top: 2px;
}

.node-star-line em {
  color: var(--muted-light);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.result-star-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
}

.result-star-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.chest-earned-card {
  width: min(460px, 100%);
  margin: 14px auto 0;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid #f3df9c;
  border-radius: 13px;
  background: #fffbed;
  text-align: left;
}

.chest-earned-icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #b77900;
  background: #fff1c2;
}

.chest-earned-icon svg {
  width: 21px;
  height: 21px;
}

.chest-earned-card div {
  flex: 1;
  min-width: 0;
}

.chest-earned-card strong {
  display: block;
  color: #7b5b00;
  font-size: 12px;
  font-weight: 900;
}

.chest-earned-card div > span {
  display: block;
  margin-top: 2px;
  color: #9a7d31;
  font-size: 10px;
  font-weight: 700;
}

.chest-earned-card .text-link {
  flex: none;
  color: #9a7200;
  white-space: nowrap;
}

.nav-badge.gold {
  background: #f2a900;
  color: #3d2b00;
}

.wish-summary-card .eyebrow {
  margin-bottom: 10px;
}

.wish-summary-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 13px;
}

.wish-summary-row > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wish-summary-row span {
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 800;
}

.wish-summary-row strong {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-strong);
  font-family: var(--font-en);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.1;
}

.wish-summary-row strong svg {
  width: 17px;
  height: 17px;
  color: var(--yellow);
}

.wish-summary-row > div:last-child strong svg {
  color: #0ea5e9;
}

.wish-summary-card p {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.wish-summary-card p strong {
  color: var(--green-strong);
  font-weight: 900;
}

.wish-summary-card .btn {
  min-height: 36px;
  font-size: 11px;
  border-radius: 10px;
}

/* Collection page */

.collection-layout {
  max-width: 980px;
  margin: 0 auto;
}

.wish-hero {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  display: flex;
  align-items: center;
  padding: 28px 32px;
  border: 2px solid #c9e7f7;
  border-radius: 24px;
  background:
    radial-gradient(circle at 78% 30%, rgba(255, 255, 255, 0.9), transparent 16rem),
    linear-gradient(125deg, #f4fcff, #dff4ff 55%, #cceeff);
  box-shadow: 0 3px 0 #c9e7f7;
}

.wish-hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -115px;
  top: -130px;
  border: 2px solid rgba(55, 156, 205, 0.12);
  border-radius: 50%;
}

.wish-hero-copy {
  position: relative;
  z-index: 3;
  max-width: 58%;
}

.wish-hero h2 {
  margin: 7px 0 8px;
  color: var(--ink-strong);
  font-size: clamp(26px, 3.5vw, 34px);
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -0.025em;
}

.wish-hero p {
  max-width: 510px;
  margin: 0;
  color: #5b7180;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.65;
}

.wallet-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border: 1.5px solid rgba(167, 215, 236, 0.8);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.74);
  color: #4d6a7b;
  font-size: 10px;
  font-weight: 800;
}

.wallet-pill svg {
  width: 15px;
  height: 15px;
}

.wallet-pill.gems svg {
  color: #0ea5e9;
}

.wallet-pill.stars svg {
  color: #f2aa00;
}

.wallet-pill.chests svg {
  color: #8b5cf6;
}

.wallet-pill strong {
  color: var(--ink-strong);
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 900;
}

.wallet-pill.level {
  color: var(--green-strong);
  border-color: #b9e4fa;
  background: #f4fcff;
  font-weight: 900;
}

.hero-level-progress {
  width: min(330px, 100%);
  margin-top: 13px;
}

.hero-level-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  color: #6a8392;
  font-size: 9px;
  font-weight: 800;
}

.hero-level-head span:last-child {
  color: var(--green-strong);
}

.wish-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.wish-hero-actions .btn {
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 11px;
  font-size: 12px;
}

.wish-hero-cards {
  position: absolute;
  z-index: 2;
  right: 30px;
  bottom: -44px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  pointer-events: none;
}

.wish-hero-cards > .tarot-card {
  width: 122px;
  flex: none;
  transform-origin: bottom center;
}

.wish-hero-cards > .tarot-card:nth-child(1) {
  transform: rotate(-16deg) translateY(24px);
}

.wish-hero-cards > .tarot-card:nth-child(2) {
  transform: rotate(-3deg) translateY(4px);
}

.wish-hero-cards > .tarot-card:nth-child(3) {
  transform: rotate(12deg) translateY(20px);
}

.collection-section {
  margin-top: 28px;
}

.star-progress-card {
  padding: 18px 20px;
  border: 2px solid #f0e0ae;
  border-radius: 17px;
  background: linear-gradient(140deg, #fffdf6, #fff8e6);
  box-shadow: 0 2px 0 #f0e0ae;
}

.star-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.star-progress-top strong {
  color: var(--ink-strong);
  font-family: var(--font-en);
  font-size: 24px;
  font-weight: 900;
}

.star-progress-top > div span {
  color: #91753b;
  font-size: 11px;
  font-weight: 800;
}

.star-progress-top > span {
  color: #977a3d;
  font-size: 10px;
  font-weight: 800;
  text-align: right;
}

.star-meter {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.star-meter-cell {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #e7d8af;
  background: rgba(255, 255, 255, 0.8);
  border: 1.5px solid #f0e0ae;
}

.star-meter-cell svg {
  width: 14px;
  height: 14px;
}

.star-meter-cell.filled {
  color: #fff;
  background: #f5b400;
  border-color: #f5b400;
  box-shadow: 0 2px 0 #d39700;
}

.star-progress-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  color: #9f8959;
  font-size: 9px;
  font-weight: 700;
}

.star-rule-line {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed #f0e0ae;
  color: #a88e55;
  font-size: 8px;
  font-weight: 700;
}

.star-rule-line svg {
  width: 12px;
  height: 12px;
  color: #e0a800;
}

.chest-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 13px;
}

.chest-aggregate {
  display: flex;
  align-items: center;
  gap: 21px;
  margin-top: 13px;
  padding: 21px;
  overflow: hidden;
  border: 1px solid #dcecf5;
  border-radius: 18px;
  background:
    radial-gradient(circle at 8% 20%, rgba(109, 190, 225, 0.16), transparent 12rem),
    linear-gradient(135deg, #fbfdff, #f4faff);
}

.chest-aggregate-art {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 118px;
  height: 118px;
  border: 1px dashed #c6dfea;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.65);
}

.chest-aggregate-art .chest-art {
  width: 78px;
  height: 78px;
  border-radius: 19px;
}

.chest-aggregate-art .chest-art > svg {
  width: 43px;
  height: 43px;
}

.chest-aggregate-count {
  position: absolute;
  right: -4px;
  bottom: 7px;
  min-width: 28px;
  padding: 3px 7px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: #2f6fed;
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 3px 8px rgba(47, 111, 237, 0.22);
}

.chest-aggregate-copy {
  flex: 1;
  min-width: 0;
}

.chest-aggregate-copy h3 {
  margin: 3px 0 4px;
  color: var(--ink-strong);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.chest-aggregate-copy h3 strong {
  color: #2f6fed;
  font-family: var(--font-en);
  font-size: 25px;
}

.chest-aggregate-copy > p {
  max-width: 470px;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.chest-aggregate-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.chest-aggregate-stats span {
  padding: 4px 7px;
  border: 1px solid #e5eff5;
  border-radius: 6px;
  color: #8ca1ae;
  background: rgba(255, 255, 255, 0.6);
  font-size: 8px;
  font-weight: 700;
}

.chest-aggregate-stats b {
  color: #4c7084;
  font-family: var(--font-en);
  font-size: 10px;
}

.chest-aggregate-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 0;
  border-top: 1px dashed #dfeef5;
}

.chest-aggregate-next > div {
  min-width: 0;
}

.chest-aggregate-next > div > span {
  display: block;
  color: #a2b3bd;
  font-size: 7px;
  font-weight: 800;
}

.chest-aggregate-next strong {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: #577486;
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chest-aggregate-next .chest-mini-pips {
  flex: none;
  margin-top: 0;
}

.chest-aggregate-copy > .btn {
  width: auto;
  min-height: 35px;
  margin-top: 7px;
  padding: 6px 14px;
  border-radius: 9px;
  font-size: 10px;
}

.chest-aggregate-copy > .btn svg {
  width: 13px;
  height: 13px;
}

.chest-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 2px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 2px 0 var(--line);
}

.chest-card.tier-common {
  border-color: #e2e8f0;
  background: #fafcfe;
}

.chest-card.tier-rare {
  border-color: #bae6fd;
  background: #f7fdff;
}

.chest-card.tier-epic {
  border-color: #ddd0fa;
  background: #fbf8ff;
}

.chest-card.tier-mythic {
  border-color: #fbcfe8;
  background: #fff8fc;
}

.chest-card.tier-legendary {
  border-color: #fde3a7;
  background: #fffdf4;
}

.chest-card-copy {
  flex: 1;
  min-width: 0;
}

.chest-tier {
  display: block;
  color: var(--muted-light);
  font-family: var(--font-en);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.chest-card-copy strong {
  display: block;
  margin-top: 2px;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 900;
}

.chest-card-copy > span:last-child {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chest-card > .btn {
  min-height: 33px;
  padding: 5px 10px;
  border-radius: 9px;
  font-size: 10px;
  flex: none;
}

.chest-card.is-unknown {
  border-style: dashed;
  border-color: #c9dce8;
  background: linear-gradient(135deg, #fbfdff, #f2f9fd);
}

.chest-card.is-ready {
  border-color: #f1d795;
  background: #fffdf6;
}

.chest-mini-pips {
  display: flex !important;
  gap: 3px;
  margin-top: 5px;
  white-space: normal !important;
}

.chest-mini-pips i {
  width: 13px;
  height: 3px;
  border-radius: 99px;
  background: #e1ebf2;
}

.chest-mini-pips i.filled {
  background: #efb731;
}

.chest-art.tier-unknown {
  color: #6f91a7;
  background: #edf6fb;
  border: 1px dashed #c4d9e6;
}

.chest-art.tier-unknown .chest-halo {
  box-shadow: inset 0 0 24px rgba(126, 187, 218, 0.3), 0 0 24px rgba(93, 169, 210, 0.2);
}

.chest-upgrade-modal {
  display: flex;
  flex-direction: column;
}

.chest-upgrade-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 0 8px;
}

.chest-upgrade-flare {
  position: absolute;
  top: 18px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 185, 230, 0.2), transparent 66%);
  filter: blur(4px);
  animation: chestGlow 2.4s ease-in-out infinite;
}

.chest-upgrade-stage .chest-art {
  position: relative;
  z-index: 2;
  animation: chestFloat 3s ease-in-out infinite;
}

.chest-feedback {
  position: relative;
  z-index: 3;
  margin-top: 9px;
  padding: 5px 10px;
  border: 1px solid #d9ebf5;
  border-radius: 8px;
  color: #3d7898;
  background: #f5fcff;
  font-size: 9px;
  font-weight: 800;
  animation: chestFeedback 0.35s ease both;
}

.chest-feedback strong {
  font-weight: 900;
}

.chest-feedback > span {
  margin-left: 4px;
  color: #c48614;
  font-size: 8px;
}

.chest-feedback.is-big {
  color: #a36f00;
  border-color: #f0d694;
  background: #fff9e8;
}

.chest-feedback.is-miss {
  color: #8b9ca9;
  border-color: #e5edf3;
  background: #f8fafc;
}

.chest-upgrade-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
  text-align: left;
}

.chest-upgrade-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chest-upgrade-title .eyebrow {
  font-size: 7px !important;
}

.chest-upgrade-title strong {
  color: #294e68;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.chest-upgrade-title > span:last-child {
  color: #93a6b4;
  font-size: 8px;
  font-weight: 600;
}

.chest-click-count {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: #9aadb9;
  font-family: var(--font-en);
  font-size: 8px;
  font-weight: 800;
}

.chest-click-count strong {
  color: #315873;
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
}

.chest-click-pips {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin: 10px 0 7px;
}

.chest-click-pips i {
  width: 32px;
  height: 5px;
  border-radius: 99px;
  background: #e6eff5;
}

.chest-click-pips i.filled {
  background: #e9b437;
}

.chest-click-pips i.next {
  background: #c8e8f8;
  box-shadow: 0 0 0 1px #9fd6ef;
}

.chest-upgrade-note {
  margin: 4px 0 0;
  color: #8da2b0;
  font-size: 8px;
  line-height: 1.6;
}

.chest-chance-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-top: 9px;
}

.chest-chance-row span {
  padding: 4px 3px;
  border-radius: 5px;
  color: #7891a3;
  background: #f5fafd;
  font-size: 7px;
  font-weight: 700;
  text-align: center;
}

.chest-chance-row span:nth-child(2) {
  color: #3a7d9e;
  background: #eef9ff;
}

.chest-chance-row span:nth-child(3) {
  color: #8060a2;
  background: #f8f3ff;
}

.chest-final-reward {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 9px;
  padding: 8px;
  border: 1px solid #f1e2bd;
  border-radius: 8px;
  color: #9f7928;
  background: #fffbf1;
  font-size: 9px;
  font-weight: 700;
}

.chest-final-reward svg {
  width: 14px;
  height: 14px;
}

.chest-max-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 8px;
  color: #b08324;
  font-size: 8px;
  font-weight: 800;
}

.chest-max-note svg {
  width: 13px;
  height: 13px;
}

.chest-auto-note {
  margin: 7px 0 0;
  color: #9caeb9;
  font-size: 8px;
  text-align: center;
}

@keyframes chestFeedback {
  0% { opacity: 0; transform: translateY(4px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.chest-art {
  position: relative;
  width: 52px;
  height: 52px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #f1f5f9;
  color: #64748b;
}

.chest-art > svg {
  position: relative;
  z-index: 2;
  width: 30px;
  height: 30px;
}

.chest-art.tier-common { color: #64748b; background: #eef2f6; }
.chest-art.tier-rare { color: #0284c7; background: #e3f5ff; }
.chest-art.tier-epic { color: #7c3aed; background: #f0e9ff; }
.chest-art.tier-mythic { color: #db2777; background: #ffeaf5; }
.chest-art.tier-legendary { color: #d18a00; background: #fff3cf; }

.chest-art.lg {
  width: 126px;
  height: 126px;
  border-radius: 30px;
}

.chest-art.lg > svg {
  width: 72px;
  height: 72px;
}

.chest-halo {
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  box-shadow: inset 0 0 22px rgba(255, 255, 255, 0.8), 0 0 24px currentColor;
  opacity: 0.18;
}

.chest-spark {
  position: absolute;
  z-index: 3;
  font-size: 11px;
  color: currentColor;
  opacity: 0.7;
  animation: chestSpark 2.2s ease-in-out infinite;
}

.chest-spark.spark-a { top: 4px; right: 7px; }
.chest-spark.spark-b { bottom: 8px; left: 5px; animation-delay: 0.5s; font-size: 8px; }
.chest-spark.spark-c { top: 15px; left: 2px; animation-delay: 1s; font-size: 7px; }

.chest-empty {
  grid-column: span 2;
  margin-top: 13px;
  padding: 26px 20px;
}

.chest-empty > svg {
  width: 38px;
  height: 38px;
  color: #c3a257;
}

.chest-odds {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 700;
}

.chest-odds > span:first-child {
  margin-right: 2px;
  color: var(--muted);
  font-weight: 800;
}

.odds-pill {
  padding: 3px 7px;
  border-radius: 6px;
  background: #f6fafc;
  border: 1px solid #e1edf5;
}

.odds-pill.tier-rare { color: #0369a1; }
.odds-pill.tier-epic { color: #6d28d9; }
.odds-pill.tier-mythic { color: #be185d; }
.odds-pill.tier-legendary { color: #a16207; }

/* Gacha */

.gacha-card {
  display: grid;
  grid-template-columns: 0.9fr 1.35fr;
  align-items: center;
  gap: 24px;
  padding: 26px 30px;
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 35%, rgba(56, 189, 248, 0.25), transparent 18rem),
    linear-gradient(135deg, #102a43, #0b1d2d);
  box-shadow: 0 5px 0 #071521;
}

.gacha-art {
  position: relative;
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gacha-card-back {
  position: absolute;
  width: 102px;
  height: 158px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 2px solid rgba(125, 211, 252, 0.7);
  background:
    radial-gradient(circle at 50% 35%, rgba(125, 211, 252, 0.3), transparent 4rem),
    linear-gradient(155deg, #143959, #0a1a29);
  color: #7dd3fc;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25), inset 0 0 0 5px rgba(255, 255, 255, 0.06);
}

.gacha-card-back::before,
.gacha-card-back::after {
  content: "✦";
  position: absolute;
  color: #fcd34d;
  font-size: 10px;
}

.gacha-card-back::before { top: 13px; right: 14px; }
.gacha-card-back::after { bottom: 13px; left: 14px; font-size: 7px; }

.gacha-card-back svg {
  width: 34px;
  height: 34px;
}

.gacha-card-back.back-0 { transform: rotate(13deg) translateX(65px); opacity: 0.55; }
.gacha-card-back.back-1 { transform: rotate(-4deg) translateX(2px); z-index: 2; }
.gacha-card-back.back-2 { transform: rotate(-17deg) translateX(-62px); opacity: 0.55; }

.gacha-copy {
  position: relative;
  z-index: 3;
  color: #e5f6ff;
}

.gacha-copy .eyebrow {
  color: #7dd3fc;
}

.gacha-copy h3 {
  margin: 7px 0 7px;
  color: #f5fbff;
  font-size: clamp(21px, 2.7vw, 27px);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.gacha-copy p {
  margin: 0;
  color: #a9c5d6;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.7;
}

.gacha-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.gacha-actions .btn {
  min-height: 43px;
  padding: 8px 14px;
  border-radius: 11px;
  font-size: 12px;
}

.gacha-actions .btn-ghost {
  color: #d7efff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
}

.gacha-actions .btn-ghost:disabled {
  color: #6b8798;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.gacha-note {
  display: block;
  margin-top: 10px;
  color: #6f8b9c;
  font-size: 9px;
  font-weight: 700;
}

.duplicate-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  padding: 10px 13px;
  border: 1.5px solid #f0de9f;
  border-radius: 11px;
  background: #fffbec;
  color: #8b6d28;
  font-size: 10px;
  font-weight: 700;
}

.duplicate-toolbar span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.duplicate-toolbar svg {
  width: 15px;
  height: 15px;
  color: #d5a200;
}

.duplicate-toolbar strong {
  color: #7d5c10;
  font-weight: 900;
}

.duplicate-toolbar .btn {
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 10px;
  flex: none;
}

/* Tarot cards */

.tarot-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.tarot-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 0.62;
  padding: 0;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: #f8fbff;
  text-align: left;
  cursor: pointer;
  perspective: 600px;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.tarot-card:hover {
  transform: translateY(-4px) rotate(-1deg);
  filter: brightness(1.06);
}

.tarot-card:active {
  transform: translateY(-1px) scale(0.99);
}

.tarot-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 10px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background:
    radial-gradient(circle at 50% 25%, var(--card-accent) -80%, transparent 55%),
    linear-gradient(155deg, var(--card-accent-2), #09131e 92%);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.07),
    inset 0 0 0 4px rgba(0, 0, 0, 0.2),
    0 4px 0 rgba(8, 22, 35, 0.16);
}

.tarot-card-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 17% 21%, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.4px),
    radial-gradient(circle at 75% 11%, rgba(255, 255, 255, 0.55) 0 1px, transparent 1.4px),
    radial-gradient(circle at 84% 68%, rgba(255, 255, 255, 0.55) 0 1px, transparent 1.4px),
    radial-gradient(circle at 27% 82%, rgba(255, 255, 255, 0.45) 0 1px, transparent 1.4px);
  pointer-events: none;
}

.tarot-card-inner::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  pointer-events: none;
}

.tarot-card-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--card-accent);
  font-family: var(--font-en);
  font-size: 6px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.tarot-card-art {
  position: relative;
  z-index: 2;
  flex: 1;
  display: grid;
  place-items: center;
  margin: 5px 0 2px;
  color: var(--card-accent);
}

.tarot-card-art > svg {
  position: relative;
  z-index: 2;
  width: 46%;
  height: auto;
  aspect-ratio: 1;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.22));
}

.tarot-halo {
  position: absolute;
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--card-accent) 40%, transparent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--card-accent) 30%, transparent);
}

.tarot-halo::before,
.tarot-halo::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px solid color-mix(in srgb, var(--card-accent) 22%, transparent);
  border-radius: 50%;
}

.tarot-halo::after {
  inset: -10%;
  border-style: dashed;
  opacity: 0.6;
}

.tarot-card-copy {
  position: relative;
  z-index: 2;
}

.tarot-card-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--card-accent);
  font-family: var(--font-en);
  font-size: 5px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.tarot-card-copy strong {
  display: block;
  color: #f8fbff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.3;
}

.tarot-card-copy em {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: rgba(231, 246, 255, 0.58);
  font-family: var(--font-en);
  font-size: 6px;
  font-style: normal;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tarot-card-keywords {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.tarot-card-keywords > span {
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(234, 248, 255, 0.7);
  font-size: 6px;
  font-weight: 700;
}

.tarot-card-duplicate {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 4;
  padding: 3px 5px;
  border-radius: 5px;
  color: #4b3300;
  background: #f7c948;
  font-size: 6px;
  font-weight: 900;
}

.tarot-card.compact {
  border-radius: 11px;
}

.tarot-card.compact .tarot-card-inner {
  padding: 7px;
  border-radius: inherit;
}

.tarot-card.compact .tarot-card-inner::after {
  inset: 4px;
  border-radius: 7px;
}

.tarot-card.compact .tarot-card-copy strong {
  font-size: 9px;
}

.tarot-card.compact .tarot-card-copy em {
  font-size: 5px;
}

.tarot-card.compact .tarot-card-keywords {
  display: none;
}

.tarot-card.compact .tarot-card-art > svg {
  width: 45%;
}

.tarot-card.is-locked {
  cursor: pointer;
}

.tarot-card.is-locked .tarot-card-inner {
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-color: rgba(203, 224, 235, 0.24);
  background:
    radial-gradient(circle at 50% 35%, rgba(75, 121, 146, 0.18), transparent 50%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 8px, transparent 8px 16px),
    #112230;
}

.tarot-card.is-locked .tarot-card-head {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  color: #668398;
}

.tarot-locked-art {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(144, 182, 204, 0.35);
  color: #7295ab;
  background: rgba(255, 255, 255, 0.03);
}

.tarot-locked-art svg {
  width: 23px;
  height: 23px;
  opacity: 0.7;
}

.tarot-locked-copy {
  color: #7e9aad;
  font-size: 10px;
  font-weight: 900;
}

.tarot-card-locked-hint {
  color: #4e6a7c;
  font-size: 6px;
  font-weight: 700;
}

/* Reading */

.reading-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border: 2px solid #d9eaf4;
  border-radius: 18px;
  background: linear-gradient(125deg, #fbfeff, #eef9ff);
  box-shadow: 0 2px 0 #d9eaf4;
}

.reading-art {
  width: 54px;
  height: 54px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #4a7d9b;
  background: #e3f5ff;
}

.reading-art svg {
  width: 28px;
  height: 28px;
}

.reading-copy {
  flex: 1;
  min-width: 0;
}

.reading-copy h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 15px;
  font-weight: 900;
}

.reading-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.6;
}

.reading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  flex: none;
}

.reading-actions .btn {
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 10px;
}

/* Tarot detail and reading modals */

.tarot-detail {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.tarot-detail-card {
  width: 138px;
  flex: none;
}

.tarot-detail-copy {
  flex: 1;
  min-width: 0;
}

.tarot-keyword-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.tarot-keyword-line span {
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green-strong);
  font-size: 9px;
  font-weight: 900;
}

.tarot-detail-copy p {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.8;
}

.tarot-detail-note {
  display: block;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #edf3f7;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 600;
}

.reading-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.reading-modal-grid:has(.reading-card-block:only-child) {
  grid-template-columns: minmax(0, 280px);
  justify-content: center;
}

.reading-card-block {
  min-width: 0;
}

.reading-card-block .tarot-card {
  width: 100%;
  max-width: 190px;
  margin: 0 auto;
}

.reading-position {
  display: inline-flex;
  margin-bottom: 7px;
  padding: 4px 8px;
  border: 1px solid #cbe9f8;
  border-radius: 6px;
  color: var(--green-strong);
  background: #f4fcff;
  font-size: 9px;
  font-weight: 900;
}

.reading-meaning {
  margin-top: 9px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #f8fcff;
  border: 1px solid #e7f3fa;
}

.reading-meaning p {
  margin: 0;
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.6;
}

.reading-meaning span {
  display: block;
  margin-top: 4px;
  color: var(--muted-light);
  font-size: 8px;
  font-weight: 700;
}

.reading-footnote {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 15px 0 0;
  padding-top: 12px;
  border-top: 1px solid #edf3f7;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 600;
}

.reading-footnote svg {
  width: 14px;
  height: 14px;
  flex: none;
  color: #e0a800;
}

/* Draw results */

.draw-results-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.draw-result-item {
  position: relative;
}

.draw-result-tag {
  position: absolute;
  z-index: 5;
  top: 7px;
  left: 7px;
  padding: 3px 5px;
  border-radius: 5px;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.draw-result-tag.is-new {
  color: #0d5b3d;
  background: #a7f3d0;
}

.draw-result-tag.is-duplicate {
  color: #6b4a00;
  background: #fde68a;
}

.draw-results-note {
  margin: 13px 0 0;
  padding-top: 11px;
  border-top: 1px solid #edf3f7;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

/* Chest modals */

.chest-modal-stage,
.chest-reward-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0 6px;
  text-align: center;
}

.chest-modal-stage p,
.chest-reward-stage p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.chest-modal-glow,
.chest-reward-glow {
  position: absolute;
  width: 190px;
  height: 190px;
  top: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.22), transparent 68%);
  filter: blur(5px);
  animation: chestGlow 2.6s ease-in-out infinite;
}

.chest-reward-glow {
  background: radial-gradient(circle, rgba(251, 191, 36, 0.35), transparent 68%);
}

.chest-modal-stage .chest-art,
.chest-reward-stage .chest-art {
  margin-top: 4px;
  animation: chestFloat 3s ease-in-out infinite;
}

.chest-reward-gems {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  color: #0e7490;
  font-size: 14px;
  font-weight: 800;
}

.chest-reward-gems svg {
  width: 27px;
  height: 27px;
  color: #0ea5e9;
}

.chest-reward-gems strong {
  color: var(--ink-strong);
  font-family: var(--font-en);
  font-size: 34px;
  font-weight: 900;
}

.modal-card.wide {
  max-width: 850px;
}

@media (prefers-reduced-motion: no-preference) {
  .tarot-card {
    animation: cardBreathe 7s ease-in-out infinite;
  }

  .tarot-card:nth-child(2n) {
    animation-delay: 0.6s;
  }

  .tarot-card:nth-child(3n) {
    animation-delay: 1.2s;
  }
}

@keyframes chestSpark {
  0%, 100% { opacity: 0.35; transform: translateY(0) scale(0.9); }
  50% { opacity: 1; transform: translateY(-3px) scale(1.1); }
}

@keyframes chestGlow {
  0%, 100% { transform: scale(0.92); opacity: 0.6; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes chestFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}

@keyframes cardBreathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.05); }
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .home-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 26px;
  }

  .topbar-inner {
    gap: 15px;
  }

  .nav-tab {
    padding: 10px 12px;
  }

  .nav-tab span {
    display: none;
  }

  .nav-tab svg {
    width: 23px;
    height: 23px;
  }
}

@media (max-width: 900px) {
  .topbar-inner {
    height: 68px;
    padding: 0 20px;
  }

  .nav-tabs {
    display: none;
  }

  .topbar-right {
    margin-left: auto;
  }

  .page {
    padding: 20px 20px 110px;
  }

  .home-grid {
    display: block;
  }

  .home-main {
    max-width: 680px;
  }

  .side-rail {
    display: none;
  }

  .mobile-goal-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 2px solid var(--line);
    border-radius: 15px;
    background: #fff;
    box-shadow: var(--shadow-card);
  }

  .mobile-goal-strip .goal-ring {
    width: 54px;
    height: 54px;
  }

  .mobile-goal-strip .goal-ring::before {
    inset: 6px;
  }

  .mobile-goal-strip .goal-ring-text strong {
    font-size: 15px;
  }

  .mobile-goal-strip .goal-ring-text span {
    display: none;
  }

  .mobile-goal-copy {
    flex: 1;
    min-width: 0;
  }

  .mobile-goal-copy strong {
    display: block;
    color: var(--ink-strong);
    font-size: 12px;
    font-weight: 900;
  }

  .mobile-goal-copy span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
  }

  .mobile-goal-strip .goal-mini-bar {
    width: 92px;
    flex: none;
  }

  .bottom-nav {
    position: fixed;
    z-index: 45;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    padding: 5px 10px calc(5px + env(safe-area-inset-bottom));
    border-top: 2px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .bottom-tab {
    flex: 1;
    max-width: 130px;
    min-height: 55px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #8b8b8b;
    font-size: 10px;
    font-weight: 900;
  }

  .bottom-tab svg {
    width: 23px;
    height: 23px;
  }

  .bottom-tab.active {
    color: var(--green-strong);
    background: var(--green-soft);
  }

  .toast-stack {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }

  #lesson-screen:not([hidden]) ~ .toast-stack {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .practice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .practice-card.featured {
    grid-column: span 2;
  }

  .profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-stat:last-child {
    grid-column: span 2;
  }

  .achievement-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lesson-footer .btn {
    width: 200px;
  }
}

@media (max-width: 680px) {
  .topbar-inner {
    height: 60px;
    padding: 0 14px;
    gap: 8px;
  }

  .brand {
    gap: 7px;
  }

  .brand-mark {
    width: 35px;
    height: 35px;
    border-radius: 11px;
    box-shadow: 0 3px 0 var(--green-dark);
  }

  .brand-mark svg {
    width: 25px;
    height: 25px;
  }

  .brand-name strong {
    font-size: 17px;
  }

  .brand-name span {
    margin-top: 2px;
    font-size: 7px;
    letter-spacing: 0.14em;
  }

  .nav-tabs {
    display: none;
  }

  .topbar-right {
    margin-left: auto;
    gap: 6px;
  }

  .top-stat {
    height: 34px;
    padding: 0 9px;
    border-width: 1.5px;
    border-radius: 9px;
    font-size: 12px;
    gap: 4px;
  }

  .top-stat svg {
    width: 18px;
    height: 18px;
  }

  .top-icon-btn {
    display: none;
  }

  .avatar-btn {
    width: 34px;
    height: 34px;
    border-width: 1.5px;
    font-size: 13px;
  }

  .page {
    padding: 16px 14px 96px;
  }

  .welcome-row {
    margin-bottom: 14px;
  }

  .welcome-copy h1 {
    font-size: 23px;
  }

  .welcome-copy p {
    font-size: 12px;
  }

  .welcome-date {
    display: none;
  }

  .mobile-goal-strip {
    margin-bottom: 14px;
    padding: 10px 12px;
    gap: 10px;
  }

  .unit-hero {
    min-height: 148px;
    padding: 19px 19px;
    border-radius: 20px;
    box-shadow: 0 5px 0 var(--green-dark);
  }

  .unit-hero.unit-tone-1,
  .unit-hero.unit-tone-2,
  .unit-hero.unit-tone-3,
  .unit-hero.unit-tone-4 {
    box-shadow: 0 5px 0 #0b6fa8;
  }

  .unit-hero.is-locked {
    box-shadow: 0 5px 0 #d4d4d4;
  }

  .unit-copy {
    max-width: 73%;
  }

  .unit-kicker {
    margin-bottom: 5px;
    font-size: 10px;
  }

  .unit-copy h2 {
    font-size: 26px;
  }

  .unit-copy h2 span {
    display: block;
    margin: 3px 0 0;
    font-size: 11px;
  }

  .unit-copy p {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.5;
  }

  .unit-guide {
    margin-top: 10px;
    min-height: 32px;
    padding: 5px 10px;
    font-size: 10px;
  }

  .unit-mascot {
    right: -3px;
    bottom: -8px;
    width: 112px;
  }

  .unit-mascot.mascot-small {
    width: 95px;
    right: 2px;
    bottom: -12px;
  }

  .unit-lock-badge {
    right: 15px;
    bottom: 18px;
    width: 44px;
    height: 44px;
    box-shadow: 0 3px 0 #cfcfcf;
  }

  .unit-lock-badge svg {
    width: 21px;
    height: 21px;
  }

  .path-card {
    margin-top: 12px;
    padding-bottom: 12px;
  }

  .node-row {
    min-height: 107px;
  }

  .path-line-svg path {
    stroke-width: 3;
    stroke-dasharray: 6 10;
  }

  .node-unit {
    width: 142px;
    transform: translateX(calc(var(--offset, 0px) * 0.62));
  }

  .node-unit.has-bubble {
    padding-top: 29px;
  }

  .path-node {
    width: 64px;
    height: 64px;
    box-shadow: 0 5px 0 var(--green-dark), inset 0 -3px 0 rgba(0, 0, 0, 0.06);
  }

  .path-node svg {
    width: 28px;
    height: 28px;
  }

  .node-caption {
    width: 146px;
    margin-top: 8px;
  }

  .node-caption strong {
    font-size: 11px;
  }

  .node-caption span {
    font-size: 9px;
  }

  .start-bubble {
    padding: 5px 10px;
    font-size: 9px;
  }

  .path-footnote {
    font-size: 10px;
  }

  .practice-hero {
    min-height: 160px;
    padding: 20px;
    border-radius: 20px;
  }

  .practice-hero-copy {
    max-width: 70%;
  }

  .practice-hero h2 {
    font-size: 23px;
  }

  .practice-hero p {
    font-size: 11px;
  }

  .practice-hero .practice-mascot {
    right: 8px;
    width: 120px;
  }

  .practice-stat-row {
    margin-top: 12px;
  }

  .practice-grid {
    grid-template-columns: 1fr;
    gap: 13px;
    margin-top: 16px;
  }

  .practice-card.featured {
    grid-column: span 1;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 13px;
    padding: 17px;
  }

  .practice-featured .btn {
    grid-column: span 2;
    width: 100%;
    margin-top: 3px;
  }

  .practice-card {
    min-height: 0;
    padding: 18px;
  }

  .practice-card h3 {
    margin-top: 11px;
  }

  .practice-card-footer {
    padding-top: 12px;
  }

  .practice-featured-copy h3 {
    margin-top: 0;
  }

  .profile-hero {
    gap: 14px;
    padding: 20px;
  }

  .profile-avatar {
    width: 78px;
    height: 78px;
    border-width: 2px;
  }

  .profile-avatar .mascot {
    width: 65px;
  }

  .profile-hero-copy p {
    font-size: 11px;
  }

  .profile-hero .settings-trigger {
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
  }

  .profile-stats {
    gap: 9px;
    margin-top: 14px;
  }

  .profile-stat {
    padding: 13px;
  }

  .profile-stat strong {
    font-size: 23px;
  }

  .achievement-grid {
    grid-template-columns: 1fr;
  }

  .achievement {
    padding: 12px;
  }

  .profile-section {
    margin-top: 22px;
  }

  .profile-settings-row {
    padding: 14px;
  }

  .lesson-topbar {
    grid-template-columns: 42px minmax(0, 1fr) 58px;
    gap: 9px;
    padding: 12px 14px;
  }

  .lesson-close {
    width: 36px;
    height: 36px;
  }

  .lesson-progress {
    height: 14px;
  }

  .hearts {
    gap: 3px;
    font-size: 13px;
  }

  .hearts svg {
    width: 20px;
    height: 20px;
  }

  .lesson-body {
    min-height: calc(100vh - 100px);
    padding: 8px 14px 162px;
  }

  .question-meta {
    margin-bottom: 13px;
    gap: 7px;
  }

  .question-type {
    padding: 4px 7px;
    font-size: 9px;
  }

  .question-meta-text {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .question-counter {
    font-size: 10px;
  }

  .question-prompt {
    margin-bottom: 18px;
  }

  .prompt-card,
  .fill-card {
    padding: 16px;
    border-radius: 15px;
  }

  .prompt-row {
    gap: 11px;
  }

  .prompt-english {
    font-size: 21px;
    line-height: 1.4;
  }

  .prompt-chinese {
    font-size: 24px;
    line-height: 1.45;
  }

  .prompt-sub {
    margin-top: 8px;
    font-size: 10px;
  }

  .speak-btn {
    width: 36px;
    height: 36px;
  }

  .listen-panel {
    padding: 24px 16px;
    border-radius: 17px;
  }

  .listen-panel .speak-btn {
    width: 58px;
    height: 58px;
  }

  .fill-sentence-row {
    gap: 10px;
  }

  .fill-sentence {
    font-size: 21px;
    line-height: 1.55;
  }

  .blank-token {
    min-width: 46px;
  }

  .fill-translation {
    font-size: 11px;
  }

  .fill-input-area {
    margin-top: 15px;
    padding-top: 14px;
  }

  .fill-input {
    min-height: 54px;
    font-size: 18px;
  }

  .options {
    gap: 9px;
  }

  .option {
    min-height: 56px;
    gap: 10px;
    padding: 10px 11px;
    border-radius: 12px;
    font-size: 14px;
  }

  .option-wrap {
    gap: 6px;
  }

  .option-wrap > .speak-btn {
    width: 31px;
    height: 31px;
  }

  .option-key {
    width: 25px;
    height: 25px;
    font-size: 10px;
  }

  .option-text.en {
    font-size: 15px;
  }

  .option .speak-btn {
    width: 31px;
    height: 31px;
  }

  .hint-card {
    margin-top: 14px;
    padding: 12px;
    gap: 9px;
  }

  .hint-avatar {
    width: 42px;
  }

  .hint-copy p {
    font-size: 11px;
  }

  .feedback-card {
    margin-top: 14px;
    padding: 13px;
  }

  .feedback-head p {
    font-size: 11px;
  }

  .feedback-example {
    margin-top: 9px;
    padding: 8px 10px;
  }

  .feedback-example p {
    font-size: 12px;
  }

  .lesson-footer {
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  }

  .lesson-footer-inner {
    gap: 8px;
  }

  .hint-trigger {
    min-height: 36px;
    padding: 5px;
    font-size: 10px;
  }

  .footer-keyhint {
    display: none;
  }

  .lesson-footer .btn {
    width: auto;
    flex: 1;
    min-height: 46px;
    font-size: 13px;
  }

  .intro-topbar {
    padding: 12px 14px;
  }

  .intro-body {
    align-items: flex-start;
    padding: 2px 18px 40px;
  }

  .intro-card {
    max-width: 480px;
  }

  .intro-mascot-wrap,
  .intro-mascot-wrap .mascot {
    width: 132px;
  }

  .intro-mascot-wrap {
    margin-bottom: 4px;
  }

  .intro-bubble {
    left: 104px;
    top: 5px;
    max-width: 145px;
    padding: 6px 9px;
    font-size: 9px;
  }

  .intro-card h1 {
    font-size: 32px;
  }

  .intro-en {
    font-size: 12px;
  }

  .intro-desc {
    margin-top: 10px;
    font-size: 12px;
  }

  .intro-goals {
    margin-top: 18px;
    gap: 9px;
  }

  .intro-goal {
    font-size: 12px;
  }

  .intro-tip {
    margin-top: 16px;
    font-size: 10px;
    padding: 10px 12px;
  }

  .intro-actions {
    margin-top: 20px;
  }

  .intro-actions .btn {
    min-height: 52px;
    font-size: 15px;
  }

  .intro-phrases {
    margin-top: 13px;
  }

  .intro-phrase-chip {
    font-size: 9px;
  }

  .results-topbar {
    padding: 12px 14px;
  }

  .results-body {
    padding: 0 16px 50px;
  }

  .results-mascot {
    width: 145px;
  }

  .results-title {
    font-size: 34px;
  }

  .results-sub {
    font-size: 12px;
  }

  .result-stats {
    gap: 8px;
    margin-top: 22px;
  }

  .result-stat {
    padding: 12px 6px;
  }

  .result-stat strong {
    font-size: 21px;
  }

  .result-review {
    margin-top: 20px;
    padding: 15px;
  }

  .result-actions {
    flex-direction: column-reverse;
    gap: 9px;
  }

  .result-actions .btn,
  .result-actions .btn-ghost {
    flex: 1 1 auto;
    width: 100%;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card {
    max-width: none;
    max-height: 91vh;
    padding: 21px 18px calc(22px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    animation-name: sheetUp;
  }

  .toast-stack {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }

  #lesson-screen:not([hidden]) ~ .toast-stack {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 390px) {
  .brand-name span {
    display: none;
  }

  .top-stat {
    padding: 0 7px;
  }

  .unit-copy {
    max-width: 76%;
  }

  .unit-copy h2 {
    font-size: 24px;
  }

  .unit-mascot {
    width: 102px;
  }

  .prompt-english,
  .fill-sentence {
    font-size: 19px;
  }

  .intro-card h1 {
    font-size: 29px;
  }

  .intro-goal {
    font-size: 11px;
  }

  .result-title {
    font-size: 30px;
  }
}

@keyframes sheetUp {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .mistake-hero-copy {
    max-width: 72%;
  }

  .mistake-mascot {
    right: 18px;
    width: 138px;
  }
}

@media (max-width: 680px) {
  .welcome-row {
    align-items: flex-start;
  }

  .welcome-copy {
    flex: 1;
    min-width: 0;
  }

  .welcome-actions {
    flex: none;
  }

  .welcome-continue {
    min-height: 36px;
    padding: 6px 9px;
    border-radius: 10px;
    font-size: 10px;
  }

  .welcome-continue svg {
    width: 14px;
    height: 14px;
  }

  .unit-jump-card {
    margin-bottom: 16px;
    padding: 11px 12px 9px;
    border-radius: 14px;
  }

  .unit-jump {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #cfdfe9 transparent;
  }

  .unit-jump::-webkit-scrollbar {
    height: 5px;
  }

  .unit-jump::-webkit-scrollbar-thumb {
    border-radius: 5px;
    background: #d4e5ef;
  }

  .unit-jump-head {
    margin-bottom: 7px;
  }

  .unit-jump-head > span {
    display: none;
  }

  .unit-jump-btn {
    width: 35px;
    height: 35px;
    flex-basis: 35px;
    border-radius: 10px;
  }

  .unit-block {
    scroll-margin-top: 70px;
  }

  .intro-word-section {
    margin-top: 16px;
    padding: 11px;
    border-radius: 14px;
  }

  .intro-word-head {
    margin-bottom: 8px;
  }

  .intro-word-head span {
    font-size: 9px;
  }

  .intro-word-main strong {
    font-size: 13px;
  }

  .intro-word-main span {
    font-size: 8px;
  }

  .intro-word-grid {
    max-height: 238px;
    gap: 6px;
  }

  .intro-word-card {
    padding: 7px;
  }

  .spell-meaning {
    margin-top: 12px;
    font-size: 24px;
  }

  .spell-card .fill-input-area {
    margin-top: 14px;
    padding-top: 13px;
  }

  .review-chip {
    max-width: 78px;
    overflow: hidden;
    padding: 3px 5px;
    font-size: 8px;
    text-overflow: ellipsis;
  }

  .match-card {
    padding: 15px 13px;
    border-radius: 15px;
  }

  .match-help {
    margin-bottom: 12px;
    font-size: 10px;
  }

  .match-board {
    gap: 34px;
  }

  .match-column {
    gap: 8px;
  }

  .match-item {
    min-height: 48px;
    padding: 8px 9px;
    border-radius: 10px;
    font-size: 11px;
  }

  .match-text.en {
    font-size: 14px;
  }

  .match-item-wrap {
    gap: 4px;
  }

  .match-item-wrap > .speak-btn {
    width: 26px;
    height: 26px;
  }

  .match-item-wrap > .speak-btn svg {
    width: 13px;
    height: 13px;
  }

  .match-item.is-matched::after {
    width: 17px;
    height: 17px;
    font-size: 10px;
  }

  .match-status {
    margin-top: 11px;
    font-size: 10px;
  }

  .match-feedback-list {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .exam-intro-badge {
    margin-top: 12px;
    padding: 7px 10px;
    font-size: 9px;
  }

  .exam-result-banner {
    margin-top: 12px;
    padding: 9px 11px;
  }

  .mistake-hero {
    min-height: 0;
    padding: 20px;
    border-radius: 20px;
  }

  .mistake-hero-copy {
    max-width: 100%;
  }

  .mistake-hero h2 {
    font-size: 23px;
  }

  .mistake-hero p {
    font-size: 11px;
  }

  .mistake-hero-actions {
    flex-direction: column;
    gap: 7px;
    margin-top: 13px;
  }

  .mistake-hero-actions .btn {
    width: 100%;
  }

  .mistake-mascot {
    display: none;
  }

  .mistake-group {
    margin-top: 22px;
  }

  .mistake-group-head {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
  }

  .mistake-group-head .btn {
    width: 100%;
  }

  .mistake-item {
    padding: 12px;
  }

  .mistake-word-row {
    gap: 8px;
  }

  .mistake-word-line > strong {
    font-size: 18px;
  }

  .mistake-answer-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .mistake-item-foot {
    flex-wrap: wrap;
    gap: 6px;
  }

  .mistake-note {
    margin-top: 16px;
    font-size: 9px;
  }

  .mistake-empty {
    padding: 26px 18px;
  }

  .bottom-tab {
    font-size: 9px;
  }

  .bottom-tab .nav-badge {
    right: calc(50% - 20px);
    font-size: 8px;
  }
}

@media (max-width: 390px) {
  .welcome-copy h1 {
    font-size: 21px;
  }

  .welcome-continue {
    font-size: 9px;
    padding: 6px 7px;
  }

  .bottom-tab {
    font-size: 8.5px;
    gap: 2px;
  }

  .bottom-tab svg {
    width: 21px;
    height: 21px;
  }
}

@media (max-width: 1024px) {
  .wish-hero-copy {
    max-width: 100%;
  }

  .wish-hero-cards {
    display: none;
  }
}

@media (max-width: 900px) {
  .tarot-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .gacha-card {
    grid-template-columns: 0.75fr 1.35fr;
    gap: 16px;
    padding: 22px;
  }

  .reading-panel {
    flex-wrap: wrap;
  }

  .reading-actions {
    width: 100%;
  }

  .draw-results-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .wish-hero {
    min-height: 0;
    padding: 20px;
    border-radius: 20px;
  }

  .wish-hero-copy {
    max-width: 100%;
  }

  .wish-hero h2 {
    font-size: 26px;
  }

  .wish-hero p {
    font-size: 11px;
  }

  .wish-hero-cards {
    display: none;
  }

  .wallet-row {
    gap: 5px;
    margin-top: 12px;
  }

  .wallet-pill {
    padding: 6px 8px;
    font-size: 9px;
  }

  .wallet-pill strong {
    font-size: 12px;
  }

  .hero-level-progress {
    margin-top: 10px;
  }

  .wish-hero-actions {
    margin-top: 14px;
    gap: 6px;
  }

  .wish-hero-actions .btn {
    flex: 1;
    min-width: 0;
    padding: 7px 9px;
    font-size: 10px;
  }

  .collection-section {
    margin-top: 22px;
  }

  .star-progress-card {
    padding: 14px;
  }

  .star-progress-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .star-progress-top > span {
    text-align: left;
  }

  .star-meter {
    gap: 3px;
  }

  .star-meter-cell {
    width: 22px;
    height: 22px;
    border-radius: 6px;
  }

  .star-meter-cell svg {
    width: 12px;
    height: 12px;
  }

  .star-progress-footer {
    font-size: 8px;
  }

  .chest-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .chest-empty {
    grid-column: auto;
    padding: 22px 16px;
  }

  .chest-card {
    padding: 11px;
  }

  .chest-art {
    width: 45px;
    height: 45px;
  }

  .chest-art > svg {
    width: 26px;
    height: 26px;
  }

  .chest-odds {
    font-size: 8px;
  }

  .odds-pill {
    padding: 2px 5px;
  }

  .gacha-card {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 18px;
  }

  .gacha-art {
    height: 130px;
    transform: scale(0.82);
    margin: -16px 0 -10px;
  }

  .gacha-card-back {
    width: 82px;
    height: 128px;
  }

  .gacha-card-back.back-0 {
    transform: rotate(13deg) translateX(52px);
  }

  .gacha-card-back.back-2 {
    transform: rotate(-17deg) translateX(-50px);
  }

  .gacha-copy h3 {
    font-size: 22px;
  }

  .gacha-actions {
    margin-top: 12px;
  }

  .gacha-actions .btn {
    flex: 1;
    padding: 7px 9px;
    font-size: 10px;
  }

  .duplicate-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    padding: 9px 10px;
    font-size: 9px;
  }

  .duplicate-toolbar .btn {
    width: 100%;
  }

  .tarot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .tarot-card-copy strong {
    font-size: 13px;
  }

  .tarot-card-copy em {
    font-size: 6px;
  }

  .reading-panel {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .reading-actions {
    flex-direction: column;
    width: 100%;
  }

  .reading-actions .btn {
    width: 100%;
  }

  .tarot-detail {
    flex-direction: column;
    align-items: center;
  }

  .tarot-detail-card {
    width: 150px;
  }

  .tarot-detail-copy {
    width: 100%;
  }

  .reading-modal-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .reading-modal-grid:has(.reading-card-block:only-child) {
    grid-template-columns: minmax(0, 220px);
  }

  .reading-card-block .tarot-card {
    max-width: 170px;
  }

  .draw-results-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .draw-results-note {
    font-size: 9px;
  }

  .chest-art.lg {
    width: 106px;
    height: 106px;
  }

  .chest-art.lg > svg {
    width: 62px;
    height: 62px;
  }

  .chest-reward-gems strong {
    font-size: 30px;
  }

  .modal-card.wide {
    max-width: none;
  }

  .result-star-panel {
    margin-top: 12px;
  }

  .star-pips.lg .star-pip {
    width: 29px;
    height: 29px;
  }

  .chest-earned-card {
    flex-wrap: wrap;
  }

  .chest-earned-card .text-link {
    width: 100%;
    justify-content: flex-end;
  }

  .bottom-tab {
    max-width: none;
    font-size: 8px;
  }

  .bottom-tab .nav-badge {
    right: calc(50% - 23px);
    font-size: 7px;
  }
}

@media (max-width: 390px) {
  .wallet-pill {
    font-size: 8px;
    padding: 5px 6px;
  }

  .wallet-pill svg {
    width: 13px;
    height: 13px;
  }

  .tarot-grid {
    gap: 7px;
  }

  .tarot-card-inner {
    padding: 8px;
  }

  .tarot-card-copy strong {
    font-size: 12px;
  }

  .bottom-tab {
    padding: 0 2px;
  }

  .bottom-tab span {
    font-size: 7.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================================
   UI v2 · calmer surfaces, clearer hierarchy
   ========================================================= */

:root {
  --green: #2f6fed;
  --green-dark: #1f54c7;
  --green-strong: #1b46a5;
  --green-soft: #edf4ff;
  --green-line: #d8e6fb;
  --blue: #2f6fed;
  --blue-dark: #1f54c7;
  --blue-soft: #edf4ff;
  --yellow: #f4b63f;
  --yellow-dark: #c88b16;
  --yellow-soft: #fff8e8;
  --purple: #8b6ee8;
  --purple-dark: #6f50d0;
  --purple-soft: #f2efff;
  --red: #e85d62;
  --red-dark: #c9454b;
  --red-soft: #fff1f1;
  --ink: #2d4356;
  --ink-strong: #142b40;
  --muted: #6d8293;
  --muted-light: #98aab8;
  --line: #e4edf4;
  --line-strong: #d0e0eb;
  --surface: #ffffff;
  --bg: #f4f8fc;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-card: 0 8px 28px rgba(29, 69, 104, 0.055);
  --shadow-btn: 0 3px 0 var(--green-dark);
}

body {
  background:
    radial-gradient(circle at 8% 4%, rgba(78, 153, 232, 0.08), transparent 28rem),
    radial-gradient(circle at 92% 18%, rgba(112, 186, 226, 0.06), transparent 26rem),
    var(--bg);
}

.topbar {
  background: rgba(255, 255, 255, 0.9) !important;
  border-bottom: 1px solid rgba(215, 230, 240, 0.9) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(18px);
}

.topbar-inner {
  width: min(1180px, calc(100% - 48px)) !important;
  height: 74px !important;
  gap: 20px !important;
}

.brand {
  gap: 9px !important;
}

.brand-mark {
  width: 38px !important;
  height: 38px !important;
  border-radius: 12px !important;
  box-shadow: 0 3px 0 #1f54c7 !important;
}

.brand-name strong {
  font-size: 16px !important;
  letter-spacing: -0.02em;
}

.brand-name span {
  color: #8da3b4 !important;
  font-size: 8px !important;
  letter-spacing: 0.13em !important;
}

.nav-tabs {
  gap: 2px !important;
  padding: 4px !important;
  border: 1px solid #e8f0f6 !important;
  border-radius: 12px !important;
  background: #f6f9fc !important;
}

.nav-tab {
  min-width: 68px !important;
  height: 38px !important;
  padding: 0 12px !important;
  border-radius: 9px !important;
  color: #73899a !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}

.nav-tab svg {
  width: 16px !important;
  height: 16px !important;
}

.nav-tab.active {
  color: #1c4da8 !important;
  background: #fff !important;
  box-shadow: 0 2px 7px rgba(35, 85, 130, 0.1) !important;
}

.nav-tab.active::after {
  display: none !important;
}

.topbar-right {
  gap: 8px !important;
}

.top-sound {
  width: 34px !important;
  height: 34px !important;
  border: 1px solid #e5eef5 !important;
  background: #fff !important;
}

.top-resource {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid #dceaf5;
  border-radius: 10px;
  color: #1b5b8c;
  background: #f5fbff;
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 900;
}

.top-resource svg {
  width: 16px;
  height: 16px;
  color: #2596d8;
}

.top-stat {
  height: 34px;
  padding: 0 9px;
  gap: 5px !important;
  border: 1px solid #e5eef5;
  border-radius: 10px;
  color: #7d6a3d;
  background: #fffdf7;
  font-size: 11px !important;
}

.top-stat.streak svg {
  width: 15px;
  height: 15px;
  color: #efa51c;
}

.avatar-btn {
  width: 38px !important;
  height: 38px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 1px solid #cfe5f4 !important;
  color: #1c5a80 !important;
  background: #e8f6ff !important;
  box-shadow: none !important;
  font-size: 12px !important;
  line-height: 1;
}

.avatar-btn small {
  color: #6796b1;
  font-family: var(--font-en);
  font-size: 6px;
  font-weight: 900;
}

.page {
  width: min(1180px, calc(100% - 48px)) !important;
  max-width: none !important;
  margin: 0 auto !important;
  padding: 34px 0 70px !important;
}

.btn {
  min-height: 42px !important;
  padding: 9px 16px !important;
  border-radius: 11px !important;
  border-width: 1.5px !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

.btn-green {
  border-color: #2f6fed !important;
  color: #fff !important;
  background: #2f6fed !important;
  box-shadow: 0 3px 0 #1f54c7 !important;
}

.btn-green:hover {
  background: #3b7af2 !important;
}

.btn-ghost {
  border-color: #dfeaf2 !important;
  color: #3d5b70 !important;
  background: #fff !important;
  box-shadow: 0 2px 0 #e7eff5 !important;
}

.btn-soft {
  border-color: #dbeafa !important;
  color: #245b9a !important;
  background: #f2f8ff !important;
  box-shadow: 0 2px 0 #e3effa !important;
}

.btn-red {
  border-color: #e85d62 !important;
  box-shadow: 0 3px 0 #c9454b !important;
}

.btn:disabled {
  box-shadow: none !important;
  transform: none !important;
  opacity: 0.55;
}

.modal-backdrop {
  background: rgba(10, 26, 41, 0.58) !important;
  backdrop-filter: blur(9px) !important;
  -webkit-backdrop-filter: blur(9px) !important;
}

.modal-card {
  position: relative;
  border: 1px solid rgba(220, 234, 244, 0.8);
  border-radius: 21px !important;
  box-shadow: 0 24px 70px rgba(3, 18, 31, 0.28) !important;
}

.modal-head h2 {
  font-size: 22px !important;
  letter-spacing: -0.03em;
}

.modal-head p {
  color: #7f96a6 !important;
  font-size: 10px !important;
}

.draw-results-aura {
  position: absolute;
  inset: -40px;
  z-index: 0;
  opacity: 0.75;
}

.modal-card > .modal-head,
.modal-card > .modal-actions,
.modal-card > .draw-results-grid,
.modal-card > .draw-results-note {
  position: relative;
  z-index: 1;
}

.btn-lg {
  min-height: 50px !important;
  border-radius: 13px !important;
  font-size: 14px !important;
}

.view-header {
  margin-bottom: 26px !important;
}

.view-header h1 {
  color: var(--ink-strong);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.view-header p {
  max-width: 620px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.eyebrow {
  color: #4c7fa3 !important;
  font-size: 9px !important;
  letter-spacing: 0.16em !important;
}

.section-title {
  font-size: 20px !important;
  letter-spacing: -0.025em;
}

.section-sub {
  color: var(--muted);
  font-size: 11px;
}

/* Home */

.home-v2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 318px;
  gap: 26px;
  align-items: start;
}

.home-main {
  min-width: 0;
}

.home-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 0 28px;
}

.home-hero-copy {
  min-width: 0;
}

.home-hero-copy .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #56b4e9;
  box-shadow: 0 0 0 4px rgba(86, 180, 233, 0.15);
}

.home-hero h1 {
  margin: 13px 0 10px;
  color: var(--ink-strong);
  font-size: clamp(32px, 4.3vw, 46px);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.home-hero h1 span {
  color: #3677c8;
}

.home-hero p {
  max-width: 570px;
  margin: 0;
  color: #6f8494;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.75;
}

.home-hero p strong {
  color: #2d536f;
  font-weight: 900;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.ticket-mini {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 5px;
  color: #fff;
  background: #e8892f;
  font-size: 9px;
}

.home-hero-side {
  width: 200px;
  flex: none;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.home-level-badge {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.home-level-badge > span {
  color: #91a5b4;
  font-family: var(--font-en);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.home-level-badge > strong {
  color: var(--ink-strong);
  font-family: var(--font-en);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.home-level-badge > em {
  color: #7d98aa;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
}

.home-level-badge .goal-mini-bar {
  margin-top: 7px;
}

.home-resource-mini {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #eef4f8;
}

.home-resource-mini span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #657f92;
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 900;
}

.home-resource-mini svg {
  width: 13px;
  height: 13px;
  color: #5d9cc3;
}

.unit-switcher {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 17px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
}

.unit-switcher > div:first-child {
  min-width: 0;
  flex: 1;
}

.unit-switcher .eyebrow {
  display: block;
  margin-bottom: 3px;
  font-size: 7px !important;
}

.unit-switcher strong {
  display: block;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-switcher small {
  display: block;
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 600;
}

.unit-switcher-progress {
  width: 130px;
  flex: none;
}

.unit-select-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding-left: 15px;
  border-left: 1px solid #edf3f7;
  color: #8298a8;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.unit-select-wrap select {
  max-width: 190px;
  height: 34px;
  padding: 0 26px 0 9px;
  border: 1px solid #dce8f1;
  border-radius: 8px;
  color: #3a5c75;
  background: #fff;
  font-size: 10px;
  font-weight: 700;
}

.home-aside {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.mobile-home-strip {
  display: none;
}

.dash-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(31, 72, 105, 0.035);
}

.dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.dash-head .eyebrow {
  display: block;
  margin-bottom: 2px;
  font-size: 7px !important;
}

.dash-head h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: 900;
}

.dash-meta {
  color: #91a5b4;
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.focus-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.focus-copy {
  flex: 1;
  min-width: 0;
}

.focus-copy strong {
  display: block;
  color: #294f6b;
  font-size: 11px;
  font-weight: 900;
}

.focus-copy > span {
  display: block;
  margin-top: 3px;
  color: #8fa3b2;
  font-size: 8px;
  font-weight: 600;
}

.focus-copy .goal-mini-bar {
  margin-top: 8px;
}

.week-dots.compact {
  gap: 4px;
  margin-top: 14px;
}

.week-dots.compact .week-dot {
  width: 26px;
}

.week-dots.compact .week-dot i {
  width: 23px;
  height: 23px;
  border-radius: 7px;
}

.week-dots.compact .week-dot span {
  font-size: 7px;
}

.focus-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid #f0f5f8;
  color: #879dac;
  font-size: 8px;
  font-weight: 700;
}

.focus-foot span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.focus-foot svg {
  width: 12px;
  height: 12px;
  color: #eba51c;
}

.wish-resource-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.wish-resource-grid > div {
  padding: 8px;
  border: 1px solid #edf3f7;
  border-radius: 9px;
  background: #fafdff;
}

.wish-resource-grid span {
  display: flex;
  align-items: center;
  gap: 3px;
  color: #91a4b3;
  font-size: 7px;
  font-weight: 700;
}

.wish-resource-grid svg {
  width: 11px;
  height: 11px;
}

.wish-resource-grid strong {
  display: block;
  margin-top: 2px;
  color: #2e526e;
  font-family: var(--font-en);
  font-size: 16px;
  font-weight: 900;
}

.wish-progress-copy {
  display: flex;
  justify-content: space-between;
  margin: 12px 0 5px;
  color: #91a4b3;
  font-size: 8px;
  font-weight: 700;
}

.wish-progress-copy strong {
  color: #3b6d8f;
  font-family: var(--font-en);
  font-weight: 900;
}

.dash-actions {
  display: flex;
  gap: 6px;
  margin-top: 11px;
}

.dash-actions .btn {
  flex: 1;
  min-height: 34px !important;
  padding: 6px 8px !important;
  border-radius: 8px !important;
  font-size: 9px !important;
}

.dash-note {
  margin: 9px 0 0;
  color: #9babb7;
  font-size: 7px;
  font-weight: 600;
}

.challenge-dash {
  position: relative;
  overflow: hidden;
  border-color: #193c5b;
  color: #d8eaf8;
  background:
    radial-gradient(circle at 100% 0, rgba(95, 184, 231, 0.18), transparent 12rem),
    linear-gradient(140deg, #112b43, #0b2034);
}

.challenge-dash::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -35px;
  width: 140px;
  height: 140px;
  border: 1px solid rgba(135, 208, 245, 0.14);
  border-radius: 50%;
}

.challenge-dash-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 9px;
}

.challenge-dash-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #ffd085;
  background: rgba(255, 209, 133, 0.12);
}

.challenge-dash-icon svg {
  width: 17px;
  height: 17px;
}

.challenge-dash .eyebrow {
  color: #7bb9d9 !important;
  font-size: 7px !important;
}

.challenge-dash h3 {
  margin: 1px 0 0;
  color: #f3fbff;
  font-size: 14px;
  font-weight: 900;
}

.ticket-count {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ffd27f;
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 900;
}

.ticket-count svg {
  width: 15px;
  height: 15px;
}

.challenge-dash > p {
  position: relative;
  z-index: 2;
  margin: 10px 0 12px;
  color: #9bbbd0;
  font-size: 9px;
  line-height: 1.65;
}

.challenge-dash-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.challenge-dash-foot > span {
  color: #83a7bf;
  font-size: 8px;
  font-weight: 600;
}

.challenge-dash-foot > span strong {
  color: #d9f0ff;
  font-family: var(--font-en);
  font-weight: 900;
}

.challenge-dash-foot .btn {
  min-height: 31px !important;
  padding: 5px 9px !important;
  border-color: rgba(156, 208, 238, 0.2) !important;
  color: #cce9fa !important;
  background: rgba(255, 255, 255, 0.07) !important;
  box-shadow: none !important;
  font-size: 8px !important;
}

.challenge-ticket-hint {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 11px;
  padding-top: 8px;
  border-top: 1px solid rgba(164, 208, 235, 0.12);
  color: #6f96ae;
  font-size: 7px;
  font-weight: 600;
}

.challenge-ticket-hint svg {
  width: 11px;
  height: 11px;
}

.word-dash {
  background: linear-gradient(145deg, #fffdf7, #fffaf0);
  border-color: #f4e8c8;
}

.daily-word {
  display: block;
  margin-top: 7px;
  color: #283e50;
  font-family: var(--font-en);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.word-dash > p {
  margin: 3px 0 0;
  color: #967c42;
  font-size: 10px;
  font-weight: 600;
}

.goal-ring {
  width: 66px !important;
  height: 66px !important;
  flex: none;
}

.goal-ring-text strong {
  font-size: 17px !important;
}

.goal-ring-text span {
  font-size: 7px !important;
}

.goal-mini-bar {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #edf3f7;
}

.goal-mini-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4a9bdd, #65c2e8);
}

/* Unit path */

.unit-block {
  margin-bottom: 22px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.unit-hero,
.unit-hero.unit-tone-1,
.unit-hero.unit-tone-2,
.unit-hero.unit-tone-3,
.unit-hero.unit-tone-4 {
  position: relative;
  min-height: 0 !important;
  padding: 18px 68px 18px 20px !important;
  border: 1px solid #dcecf7 !important;
  border-radius: 18px !important;
  background: linear-gradient(120deg, #f5fbff, #eef7ff 72%, #e7f4fe) !important;
  box-shadow: none !important;
}

.unit-fold-btn {
  position: absolute;
  z-index: 4;
  top: 13px;
  right: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border: 1px solid #cfe4f2;
  border-radius: 7px;
  color: #5d849c;
  background: rgba(255, 255, 255, 0.7);
  font-size: 8px;
  font-weight: 800;
}

.unit-fold-btn:hover {
  color: #2e5d7b;
  background: #fff;
}

.unit-fold-btn svg {
  width: 12px;
  height: 12px;
}

.unit-block.is-collapsed .unit-fold-btn {
  color: #39779e;
  border-color: #b9dbee;
  background: #fff;
}

.unit-block.is-collapsed .path-card {
  display: none;
}

.unit-block.is-collapsed .unit-guide {
  display: none !important;
}

.unit-block.is-collapsed .unit-copy {
  max-width: calc(100% - 56px) !important;
}

.unit-block.is-collapsed .unit-lock-badge {
  display: none !important;
}

.unit-hero::before,
.unit-hero::after {
  display: none !important;
}

.unit-hero.locked,
.unit-hero.is-locked {
  background: #f4f7fa !important;
  border-color: #e7eef4 !important;
}

.unit-mascot {
  display: none !important;
}

.unit-copy {
  max-width: 78% !important;
}

.unit-kicker {
  color: #5c8eaf !important;
  font-size: 8px !important;
  font-weight: 800 !important;
}

.unit-kicker .dot {
  background: #52b5e8 !important;
}

.unit-copy h2 {
  margin: 5px 0 4px !important;
  color: #243f56 !important;
  font-size: 20px !important;
  font-weight: 900 !important;
  letter-spacing: -0.035em;
}

.unit-copy h2 span {
  margin-left: 7px !important;
  color: #91a8b8 !important;
  font-family: var(--font-en);
  font-size: 9px !important;
  font-weight: 700 !important;
}

.unit-copy > p {
  max-width: 500px;
  margin: 0 !important;
  color: #7590a2 !important;
  font-size: 10px !important;
  line-height: 1.65;
}

.unit-guide {
  margin-top: 11px !important;
  min-height: 31px !important;
  padding: 5px 10px !important;
  border: 1px solid #cfe4f2 !important;
  border-radius: 8px !important;
  color: #4b7895 !important;
  background: rgba(255, 255, 255, 0.62) !important;
  box-shadow: none !important;
  font-size: 9px !important;
}

.unit-mascot {
  width: 78px !important;
  height: 78px !important;
  opacity: 0.9;
}

.unit-lock-badge {
  display: none !important;
  background: #edf2f6 !important;
  color: #a9bac7 !important;
  box-shadow: none !important;
}

.path-card {
  margin-top: 9px !important;
  padding: 4px 0 16px !important;
  border: 1px solid #e7eff6 !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow: 0 4px 18px rgba(36, 79, 114, 0.025);
}

.path-track {
  padding-top: 7px !important;
}

.node-row {
  min-height: 116px !important;
}

.node-unit {
  width: 166px !important;
}

.path-node {
  width: 62px !important;
  height: 62px !important;
  border-width: 0 !important;
  box-shadow: 0 4px 0 #d9b12b !important;
}

.path-node svg {
  width: 25px !important;
  height: 25px !important;
}

.node-current .path-node {
  background: #3d89d6 !important;
  box-shadow: 0 4px 0 #2166ad !important;
}

.node-locked .path-node {
  background: #e8eff5 !important;
  color: #b2c3cf !important;
  box-shadow: 0 3px 0 #d7e3ec !important;
}

.node-exam .path-node {
  background: #f3b53f !important;
  box-shadow: 0 4px 0 #c88b16 !important;
}

.node-caption {
  width: 158px !important;
  margin-top: 8px !important;
}

.node-caption strong {
  color: #3f5c72 !important;
  font-size: 10px !important;
  font-weight: 900 !important;
}

.node-caption > span {
  color: #9aabb8 !important;
  font-size: 8px !important;
}

.node-star-line em {
  color: #9aabb8 !important;
  font-size: 8px !important;
}

.start-bubble {
  background: #2f6fed !important;
  box-shadow: 0 2px 0 #1f54c7 !important;
}

.path-footnote {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 4px 0;
  color: #9aabb8 !important;
  font-size: 8px !important;
}

.path-footnote svg {
  width: 13px;
  height: 13px;
}

/* Collection / wish */

.wish-v2 {
  max-width: 1080px;
  margin: 0 auto;
}

.wish-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 21px;
}

.wish-header h1 {
  margin: 6px 0 5px;
  color: var(--ink-strong);
  font-size: clamp(36px, 5vw, 50px);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
}

.wish-header p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.wish-balance {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 430px;
}

.wish-balance > span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 7px 9px;
  border: 1px solid #e0ebf3;
  border-radius: 9px;
  background: #fff;
  color: #6d889a;
  font-size: 8px;
  font-weight: 700;
}

.wish-balance svg {
  width: 14px;
  height: 14px;
  color: #4c9bc9;
  transform: translateY(2px);
}

.wish-balance strong {
  color: #24455f;
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 900;
}

.wish-balance em {
  color: #95a8b6;
  font-size: 8px;
  font-style: normal;
}

.wish-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid #e1ebf3;
  border-radius: 12px;
  background: #f0f5f9;
}

.wish-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 37px;
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  color: #7d95a6;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
}

.wish-tab svg {
  width: 14px;
  height: 14px;
}

.wish-tab.active {
  color: #2459a7;
  background: #fff;
  box-shadow: 0 2px 8px rgba(33, 78, 117, 0.08);
}

.wish-tab em {
  padding: 2px 4px;
  border-radius: 4px;
  color: #7e96a8;
  background: #edf3f7;
  font-family: var(--font-en);
  font-size: 7px;
  font-style: normal;
  font-weight: 900;
}

.wish-tab.active em {
  color: #2d6dad;
  background: #e8f3ff;
}

.wish-view {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.wish-panel {
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(35, 77, 110, 0.035);
}

.wish-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.wish-panel-head.compact {
  align-items: center;
  margin-bottom: 12px;
}

.wish-panel-head h2 {
  margin: 3px 0 0;
  color: var(--ink-strong);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.wish-panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.wish-big-number {
  color: #2d5d7f;
  font-family: var(--font-en);
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.wish-big-number small {
  margin-left: 3px;
  color: #9aadb9;
  font-size: 11px;
}

.wish-count {
  color: #8ca2b1;
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 900;
}

.wish-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.draw-stage {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 0.95fr 1.25fr;
  align-items: center;
  gap: 22px;
  min-height: 360px;
  padding: 30px 34px;
  border-radius: 24px;
  color: #eaf8ff;
  background:
    radial-gradient(circle at 22% 24%, rgba(53, 156, 214, 0.46), transparent 17rem),
    radial-gradient(circle at 88% 80%, rgba(77, 113, 209, 0.22), transparent 20rem),
    linear-gradient(135deg, #0d2137, #071625 70%);
  box-shadow: 0 14px 35px rgba(15, 42, 65, 0.2);
}

.draw-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 12% 20%, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.5px),
    radial-gradient(circle at 78% 16%, rgba(255, 255, 255, 0.6) 0 1px, transparent 1.5px),
    radial-gradient(circle at 69% 78%, rgba(255, 255, 255, 0.5) 0 1px, transparent 1.5px),
    radial-gradient(circle at 33% 83%, rgba(255, 255, 255, 0.4) 0 1px, transparent 1.5px);
  pointer-events: none;
}

.draw-stage-art {
  position: relative;
  z-index: 2;
  height: 280px;
}

.draw-orbit {
  position: absolute;
  left: 48%;
  top: 50%;
  border: 1px solid rgba(106, 204, 242, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.draw-orbit.orbit-a {
  width: 220px;
  height: 220px;
  animation: orbitSpin 18s linear infinite;
}

.draw-orbit.orbit-b {
  width: 300px;
  height: 300px;
  border-style: dashed;
  opacity: 0.55;
  animation: orbitSpin 26s linear infinite reverse;
}

.draw-card-back {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 116px;
  height: 182px;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(135, 214, 249, 0.65);
  border-radius: 16px;
  color: #78d4ff;
  background:
    radial-gradient(circle at 50% 30%, rgba(79, 185, 235, 0.28), transparent 4rem),
    linear-gradient(155deg, #183b59, #071827);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.28), inset 0 0 0 5px rgba(255, 255, 255, 0.04);
}

.draw-card-back::before,
.draw-card-back::after {
  content: "✦";
  position: absolute;
  color: #e1c77a;
  font-size: 10px;
}

.draw-card-back::before { top: 11px; right: 13px; }
.draw-card-back::after { bottom: 11px; left: 13px; font-size: 7px; }

.draw-card-back svg {
  width: 38px;
  height: 38px;
}

.draw-card-back.back-a {
  transform: translate(-50%, -50%) rotate(-17deg) translateX(-62px);
  opacity: 0.52;
}

.draw-card-back.back-b {
  z-index: 3;
  transform: translate(-50%, -50%) rotate(-2deg);
  animation: cardFloat 5s ease-in-out infinite;
}

.draw-card-back.back-c {
  transform: translate(-50%, -50%) rotate(15deg) translateX(62px);
  opacity: 0.52;
}

.draw-stage-copy {
  position: relative;
  z-index: 3;
}

.draw-stage-copy .eyebrow {
  color: #7dc8e8 !important;
}

.draw-stage-copy h2 {
  margin: 9px 0 8px;
  color: #f4fbff;
  font-size: clamp(30px, 4vw, 43px);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.draw-stage-copy > p {
  max-width: 430px;
  margin: 0;
  color: #9cbacd;
  font-size: 10px;
  line-height: 1.7;
}

.gacha-pool-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.gacha-pool-line span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid rgba(137, 205, 234, 0.18);
  border-radius: 6px;
  color: #a8d4e7;
  background: rgba(255, 255, 255, 0.055);
  font-size: 7px;
  font-weight: 700;
}

.gacha-pool-line svg {
  width: 11px;
  height: 11px;
  color: #e6c574;
}

.draw-price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 19px;
}

.draw-price-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 13px;
  border: 1px solid rgba(156, 211, 240, 0.22);
  border-radius: 12px;
  color: #e8f8ff;
  background: rgba(255, 255, 255, 0.065);
  text-align: left;
  transition: background 0.18s ease, transform 0.18s ease;
}

.draw-price-card:hover:not(:disabled) {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
}

.draw-price-card.featured {
  border-color: rgba(111, 198, 244, 0.54);
  background: linear-gradient(135deg, rgba(45, 143, 207, 0.6), rgba(31, 88, 146, 0.52));
}

.draw-price-card:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.draw-price-card > span {
  color: #9dcfe7;
  font-size: 9px;
  font-weight: 800;
}

.draw-price-card > strong {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 900;
}

.draw-price-card > strong svg {
  width: 15px;
  height: 15px;
  color: #7dd3fc;
}

.draw-price-card > em {
  color: #89b3ca;
  font-size: 8px;
  font-style: normal;
  font-weight: 600;
}

.draw-balance-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
  color: #718f9f;
  font-size: 8px;
  font-weight: 600;
}

.draw-balance-line span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.draw-balance-line svg {
  width: 12px;
  height: 12px;
  color: #78c9ec;
}

.draw-balance-line strong {
  color: #ccefff;
  font-family: var(--font-en);
  font-weight: 900;
}

.draw-progress-card > p,
.draw-duplicate-card > p {
  margin: 10px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.draw-progress-card .goal-mini-bar {
  margin-top: 10px;
}

.draw-progress-card .btn,
.draw-duplicate-card .btn {
  margin-top: 4px;
}

.draw-duplicate-card h2 {
  margin: 6px 0 0;
  color: var(--ink-strong);
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.muted-note {
  display: block;
  margin-top: 12px;
  color: #a0b0bc;
  font-size: 9px;
  font-weight: 600;
}

.star-progress-top {
  margin-top: 2px;
}

.level-dash {
  padding-top: 2px;
}

.level-dash-num {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 9px;
}

.level-dash-num strong {
  color: #294f6a;
  font-family: var(--font-en);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.level-dash-num span {
  color: #97aab7;
  font-size: 9px;
  font-weight: 700;
}

.level-dash p {
  margin: 8px 0 12px;
  color: #879eae;
  font-size: 9px;
}

.ticket-dash {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid #f1e1c4;
  border-radius: 9px;
  color: #9a7a3e;
  background: #fffbf1;
  font-size: 9px;
  font-weight: 700;
}

.ticket-dash svg {
  width: 16px;
  height: 16px;
  color: #d7972b;
}

.ticket-dash strong {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 900;
}

.ticket-dash span {
  margin-left: auto;
  color: #b19a6f;
  font-size: 7px;
  font-weight: 600;
}

.odds-panel {
  padding-bottom: 15px;
}

.odds-table {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.odds-row {
  display: grid;
  grid-template-columns: 1.2fr 0.6fr 1fr 0.9fr;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 7px;
  color: #718899;
  background: #f9fcfe;
  font-size: 9px;
  font-weight: 600;
}

.odds-row.tier-rare { background: #f5fbff; color: #34799a; }
.odds-row.tier-epic { background: #faf7ff; color: #7050a8; }
.odds-row.tier-mythic { background: #fff8fc; color: #a34d7a; }
.odds-row.tier-legendary { background: #fffdf4; color: #9d7623; }

.odds-name {
  color: #425e73;
  font-weight: 800;
}

.odds-table.upgrade-table .odds-row {
  grid-template-columns: 1.15fr 0.42fr 0.42fr 0.42fr 0.78fr 0.52fr;
  gap: 4px;
  font-size: 8px;
}

.odds-table.upgrade-table .odds-row > span:not(.odds-name) {
  text-align: center;
}

.odds-table .odds-head {
  color: #9aadb9;
  background: transparent;
  font-size: 7px;
  font-weight: 800;
}

.odds-table .odds-head > span {
  text-align: center;
}

.odds-table .odds-head > span:first-child {
  text-align: left;
}

.odds-note {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin: 10px 0 0;
  color: #8da2b0;
  font-size: 8px;
  line-height: 1.6;
}

.odds-note svg {
  width: 12px;
  height: 12px;
  flex: none;
  color: #d1a02e;
}

.chest-card {
  border-radius: 13px !important;
  box-shadow: none !important;
}

.chest-card-copy > span:last-child {
  line-height: 1.4;
  white-space: normal;
}

.duplicate-toolbar {
  margin-bottom: 14px !important;
}

.wish-panel .tarot-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.reading-stage {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  align-items: center;
  gap: 20px;
  min-height: 300px;
  padding: 30px;
  border-radius: 24px;
  color: #f5fbff;
  background:
    radial-gradient(circle at 20% 25%, rgba(80, 127, 193, 0.28), transparent 14rem),
    linear-gradient(135deg, #162b42, #0c1d2e);
}

.reading-stage-art {
  position: relative;
  height: 220px;
}

.reading-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(135, 199, 232, 0.16);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.reading-orbit.orbit-b {
  width: 280px;
  height: 280px;
  border-style: dashed;
  opacity: 0.55;
}

.reading-mini-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 78px;
  height: 120px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(144, 212, 242, 0.32);
  border-radius: 10px;
  color: #8dd7f5;
  background: linear-gradient(155deg, #1c405c, #0a1b2a);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}

.reading-mini-card:nth-child(3) { transform: translate(-50%, -50%) rotate(-16deg) translateX(-55px); opacity: 0.6; }
.reading-mini-card:nth-child(4) { z-index: 2; transform: translate(-50%, -50%) rotate(-1deg); }
.reading-mini-card:nth-child(5) { transform: translate(-50%, -50%) rotate(15deg) translateX(55px); opacity: 0.6; }

.reading-mini-card svg {
  width: 28px;
  height: 28px;
}

.reading-stage-copy .eyebrow {
  color: #83bfd9 !important;
}

.reading-stage-copy h2 {
  margin: 8px 0 8px;
  color: #f3fbff;
  font-size: clamp(27px, 3.5vw, 38px);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1.12;
}

.reading-stage-copy > p {
  max-width: 450px;
  margin: 0;
  color: #9eb9ca;
  font-size: 10px;
  line-height: 1.7;
}

.reading-stage-copy .reading-actions {
  margin-top: 17px;
}

.reading-empty-hint {
  display: block;
  margin-top: 10px;
  color: #89a7b8;
  font-size: 8px;
}

.reading-guide h2 {
  margin: 5px 0 10px;
  color: var(--ink-strong);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.reading-guide p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.reading-guide ol {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reading-guide li {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 9px;
  padding: 8px 0;
  border-top: 1px solid #eef4f8;
}

.reading-guide li strong {
  color: #45637a;
  font-size: 10px;
  font-weight: 900;
}

.reading-guide li span {
  color: #869ba9;
  font-size: 9px;
  line-height: 1.5;
}

/* Cooking, food codex, bag */

.craft-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 15px;
}

.craft-board {
  padding: 15px;
  border: 1px solid #e1eef6;
  border-radius: 15px;
  background:
    radial-gradient(circle at 50% 0, rgba(133, 210, 235, 0.12), transparent 16rem),
    #fbfdff;
}

.craft-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.craft-slot {
  min-height: 106px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 5px;
  border: 1.5px dashed #cfe1ed;
  border-radius: 11px;
  color: #8fa6b4;
  background: rgba(255, 255, 255, 0.65);
  text-align: center;
}

.craft-slot.is-filled {
  border-style: solid;
  border-color: #cfe5f2;
  color: #35596f;
  background: #fff;
  box-shadow: 0 3px 12px rgba(37, 92, 128, 0.06);
}

.craft-slot.is-filled:hover {
  border-color: #8ec8e4;
  transform: translateY(-2px);
}

.craft-slot.is-empty > span {
  color: #b5cbd7;
  font-family: var(--font-en);
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
}

.craft-slot.is-empty > em {
  color: #b6c7d2;
  font-size: 7px;
  font-style: normal;
}

.craft-slot-emoji {
  font-size: 31px;
  line-height: 1.1;
}

.craft-slot > strong {
  max-width: 100%;
  overflow: hidden;
  color: #45657a;
  font-size: 9px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.craft-slot > em {
  color: #9cb0bd;
  font-size: 7px;
  font-style: normal;
}

.craft-actions {
  display: flex;
  gap: 6px;
  margin-top: 11px;
}

.craft-actions .btn {
  flex: 1;
  min-height: 40px !important;
  padding: 7px 9px !important;
  font-size: 10px !important;
}

.craft-result {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 11px;
  padding: 10px 12px;
  border: 1px solid #dcebf4;
  border-radius: 10px;
  background: #f7fcff;
}

.craft-result.is-success {
  border-color: #cbe9d5;
  background: #f4fcf7;
}

.craft-result.is-air {
  border-color: #e7edf2;
  background: #fafcfd;
}

.craft-result-emoji {
  width: 37px;
  height: 37px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #fff;
  font-size: 25px;
}

.craft-result strong {
  display: block;
  color: #3d677a;
  font-size: 11px;
  font-weight: 900;
}

.craft-result.is-success strong {
  color: #337a54;
}

.craft-result.is-air strong {
  color: #8095a3;
}

.craft-result span:not(.craft-result-emoji) {
  display: block;
  margin-top: 2px;
  color: #9aadb9;
  font-size: 8px;
}

.craft-note {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin: 11px 0 0;
  color: #94a8b5;
  font-size: 8px;
  line-height: 1.6;
}

.craft-note svg {
  width: 12px;
  height: 12px;
  flex: none;
  color: #d5a12e;
}

.craft-pantry {
  min-width: 0;
  padding: 3px 0;
}

.craft-pantry-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  color: #49687d;
  font-size: 10px;
  font-weight: 900;
}

.craft-pantry-head span {
  color: #9eafbb;
  font-family: var(--font-en);
  font-size: 8px;
  font-weight: 700;
}

.craft-item-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 264px;
  overflow-y: auto;
  padding: 1px 4px 1px 1px;
}

.craft-item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px;
  border: 1px solid #e4eef5;
  border-radius: 9px;
  background: #fff;
  text-align: left;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.craft-item:hover:not(:disabled) {
  border-color: #a9d4e9;
  transform: translateY(-1px);
}

.craft-item:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.craft-item-emoji {
  width: 30px;
  flex: none;
  text-align: center;
  font-size: 23px;
  line-height: 1;
}

.craft-item-copy {
  min-width: 0;
}

.craft-item-copy strong {
  display: block;
  overflow: hidden;
  color: #486477;
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.craft-item-copy em {
  display: block;
  margin-top: 2px;
  color: #9aafbc;
  font-size: 7px;
  font-style: normal;
}

.craft-item.food {
  border-color: #dceee3;
  background: #fbfefc;
}

.craft-empty {
  min-height: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #8fa5b3;
  text-align: center;
}

.craft-empty > svg {
  width: 32px;
  height: 32px;
  color: #a9c6d7;
}

.craft-empty strong {
  color: #607d8f;
  font-size: 10px;
  font-weight: 900;
}

.craft-empty span {
  font-size: 8px;
}

.craft-guide-card > p,
.craft-air-card > p {
  margin: 8px 0 13px;
  color: #849ba9;
  font-size: 9px;
  line-height: 1.7;
}

.craft-guide-card h2,
.craft-air-card h2 {
  margin: 5px 0 0;
  color: #314f66;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.food-catalog-note {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin: 0 0 13px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #7c9aab;
  background: #f4fbfe;
  font-size: 8px;
  line-height: 1.6;
}

.food-catalog-note svg {
  width: 13px;
  height: 13px;
  flex: none;
  color: #5fa6c8;
}

.food-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.food-card {
  position: relative;
  display: grid;
  grid-template-columns: 35px 1fr;
  align-items: center;
  gap: 6px;
  min-height: 76px;
  padding: 9px;
  overflow: hidden;
  border: 1px solid #e5eef4;
  border-radius: 10px;
  background: #fff;
}

.food-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--food-tone, #8bbdd5);
  opacity: 0.8;
}

.food-card.is-unknown {
  opacity: 0.78;
  background: #fbfcfd;
}

.food-card.is-known {
  border-color: #d7eaf2;
  background: #fcfeff;
}

.food-card.tone-1 { --food-tone: #e6b55a; }
.food-card.tone-2 { --food-tone: #e58b83; }
.food-card.tone-3 { --food-tone: #85bf91; }
.food-card.tone-4 { --food-tone: #78b5d4; }
.food-card.tone-5 { --food-tone: #b39ad8; }

.food-emoji {
  grid-row: span 1;
  font-size: 24px;
  line-height: 1;
  text-align: center;
}

.food-card-copy {
  min-width: 0;
}

.food-card-copy strong {
  display: block;
  overflow: hidden;
  color: #3d5b6f;
  font-size: 9px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.food-card-copy span {
  display: block;
  margin-top: 2px;
  color: #91a7b4;
  font-size: 7px;
}

.food-card > em {
  grid-column: 1 / -1;
  padding-top: 5px;
  border-top: 1px dashed #edf3f7;
  color: #a0b1bc;
  font-size: 7px;
  font-style: normal;
  font-weight: 700;
}

.bag-resource-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.bag-resource-grid > div {
  padding: 10px;
  border: 1px solid #e8f1f7;
  border-radius: 9px;
  background: #fbfdff;
}

.bag-resource-grid span {
  display: flex;
  align-items: center;
  gap: 3px;
  color: #91a6b4;
  font-size: 7px;
  font-weight: 700;
}

.bag-resource-grid svg {
  width: 12px;
  height: 12px;
}

.bag-resource-grid strong {
  display: block;
  margin-top: 2px;
  color: #2f536c;
  font-family: var(--font-en);
  font-size: 17px;
  font-weight: 900;
}

.bag-item-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.bag-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 8px;
  border: 1px solid #e8f1f7;
  border-radius: 8px;
  background: #fcfdff;
}

.bag-item.is-empty {
  opacity: 0.45;
}

.bag-item > span {
  font-size: 20px;
  line-height: 1;
}

.bag-item strong {
  min-width: 0;
  overflow: hidden;
  color: #526e80;
  font-size: 8px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bag-item em {
  margin-left: auto;
  color: #9aadb9;
  font-family: var(--font-en);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.bag-item.food {
  border-color: #dceee4;
  background: #fbfefc;
}

.bag-item.air {
  border-style: dashed;
  border-color: #dce6ed;
  color: #91a4b1;
  background: #fafcfd;
}

.craft-empty.small {
  min-height: 86px;
  margin-top: 7px;
  border: 1px dashed #dce8f0;
  border-radius: 9px;
}

.bag-tarot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.bag-tarot-chips span {
  padding: 5px 8px;
  border: 1px solid var(--chip-accent, #cfe2ed);
  border-radius: 6px;
  color: #506d7e;
  background: #fbfdff;
  font-size: 8px;
  font-weight: 700;
}

.chest-ingredient-reward {
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #d7ecdf;
  border-radius: 9px;
  background: #f7fcf8;
}

.chest-ingredient-label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #4d8a68;
  font-size: 8px;
  font-weight: 900;
}

.chest-ingredient-label svg {
  width: 13px;
  height: 13px;
}

.chest-ingredient-reward > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.chest-ingredient-reward > div span {
  padding: 3px 5px;
  border-radius: 5px;
  color: #668576;
  background: #fff;
  font-size: 8px;
  font-weight: 700;
}

/* Debt goal and restaurant */

.top-resource.coin {
  border-color: #ecd9a8;
  color: #806016;
  background: #fffaf0;
}

.top-resource.coin svg {
  color: #d19b16;
}

.top-resource.coin.is-complete {
  border-color: #bddfc8;
  color: #387b55;
  background: #f4fcf6;
}

.home-debt-badge {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-debt-badge > span {
  color: #a18a55;
  font-family: var(--font-en);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.home-debt-badge > strong {
  color: #3e5265;
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
}

.home-debt-badge > em {
  color: #a1a18f;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
}

.home-debt-badge .goal-mini-bar {
  margin: 7px 0 9px;
}

.home-shop-link {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 6px 7px;
  border: 1px solid #eddfbc;
  border-radius: 7px;
  color: #96742d;
  background: #fffdf7;
  font-size: 8px;
  font-weight: 800;
  text-align: left;
}

.home-shop-link svg {
  width: 13px;
  height: 13px;
  flex: none;
}

.home-shop-link:hover {
  background: #fff8e8;
}

.mobile-debt-line {
  display: none;
}

/* Restaurant scene */

.shop-stage {
  position: relative;
  min-height: 310px;
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(circle at 72% 28%, rgba(255, 214, 129, 0.16), transparent 15rem),
    linear-gradient(155deg, #0b2237, #06121d 70%);
  box-shadow: 0 12px 32px rgba(11, 34, 51, 0.18);
}

.shop-stage.is-complete {
  background:
    radial-gradient(circle at 70% 22%, rgba(255, 228, 154, 0.22), transparent 16rem),
    linear-gradient(155deg, #14362e, #071b17 70%);
}

.shop-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.shop-stars i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #c4ecff;
  box-shadow: 0 0 7px #8ed8f5;
  opacity: 0.55;
  animation: shopTwinkle 3.2s ease-in-out var(--d) infinite;
}

.shop-building {
  position: absolute;
  left: 50%;
  bottom: 44px;
  width: 236px;
  height: 195px;
  transform: translateX(-50%) scale(1.14);
  transform-origin: bottom center;
  filter: drop-shadow(0 13px 18px rgba(0, 0, 0, 0.26));
}

.shop-building::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 0;
  height: 128px;
  border: 1px solid rgba(116, 194, 223, 0.22);
  border-radius: 3px 3px 7px 7px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 50%, transparent 50% 100%),
    linear-gradient(155deg, #1b415a, #102b3e);
  background-size: 19px 19px, auto;
}

.shop-awning {
  position: absolute;
  z-index: 3;
  left: 12px;
  right: 12px;
  top: 13px;
  height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  border-radius: 5px 5px 12px 12px;
  color: #784a25;
  background: repeating-linear-gradient(90deg, #f7e4b6 0 24px, #cf9b51 24px 48px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
}

.shop-awning span {
  position: relative;
  z-index: 2;
  color: #6f4822;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 900;
}

.shop-sign {
  position: absolute;
  z-index: 4;
  top: 62px;
  left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  padding: 5px 12px;
  border: 1px solid #d9ad5d;
  border-radius: 4px;
  color: #5b3b17;
  background: #fff3ce;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  white-space: nowrap;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
  animation: signSway 5s ease-in-out infinite;
}

.shop-window {
  position: absolute;
  z-index: 2;
  left: 30px;
  bottom: 44px;
  width: 117px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 4px solid #193b50;
  border-radius: 4px;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 210, 116, 0.7), transparent 65%),
    #e9b96a;
  box-shadow: 0 0 0 1px rgba(255, 220, 151, 0.24), 0 0 26px rgba(255, 190, 88, 0.28);
  animation: windowGlow 4s ease-in-out infinite;
}

.shop-window::before,
.shop-window::after {
  content: "";
  position: absolute;
  background: #193b50;
}

.shop-window::before {
  width: 3px;
  top: 0;
  bottom: 0;
  left: 50%;
}

.shop-window::after {
  height: 3px;
  left: 0;
  right: 0;
  top: 52%;
}

.shop-chef {
  position: relative;
  z-index: 2;
  font-size: 30px;
  filter: drop-shadow(0 2px 0 rgba(75, 39, 11, 0.16));
}

.shop-oven {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 49px;
  height: 20px;
  transform: translateX(-50%);
  border-radius: 50% 50% 4px 4px;
  background: rgba(92, 47, 15, 0.22);
}

.shop-door {
  position: absolute;
  z-index: 2;
  right: 30px;
  bottom: 0;
  width: 55px;
  height: 101px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 7px;
  border: 4px solid #173a50;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  color: #d5eeff;
  background: linear-gradient(155deg, #245972, #112f43);
}

.shop-door::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 52%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #e9c36c;
}

.shop-door span {
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.shop-counter {
  position: absolute;
  z-index: 2;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 9px;
  border-radius: 2px;
  background: #0d2434;
}

.shop-coin-rain {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.shop-coin-rain span {
  position: absolute;
  top: 54px;
  left: var(--x);
  color: #f6c95f;
  opacity: 0;
  animation: shopCoinFall 3.6s ease-in var(--d) infinite;
}

.shop-coin-rain svg {
  width: 14px;
  height: 14px;
  filter: drop-shadow(0 0 4px rgba(255, 208, 101, 0.5));
}

.shop-stage-caption {
  position: absolute;
  z-index: 4;
  left: 27px;
  bottom: 23px;
  max-width: 230px;
  text-align: left;
}

.shop-stage-caption .eyebrow {
  color: #7dc9e5 !important;
  font-size: 7px !important;
}

.shop-stage-caption h2 {
  margin: 4px 0 4px;
  color: #f2fbff;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.shop-stage-caption p {
  margin: 0;
  color: #87aabd;
  font-size: 8px;
  line-height: 1.55;
}

.shop-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 15px;
  margin-top: 15px;
}

.shop-live-panel,
.shop-boost-panel {
  position: relative;
}

.shop-level-chip {
  padding: 4px 7px;
  border: 1px solid #e9d6a6;
  border-radius: 6px;
  color: #977321;
  background: #fffaf0;
  font-family: var(--font-en);
  font-size: 8px;
  font-weight: 900;
}

.shop-balance-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px;
  margin: 9px 0 8px;
}

.shop-balance-line strong {
  color: #2a5068;
  font-family: var(--font-en);
  font-size: clamp(29px, 4vw, 41px);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
}

.shop-balance-line span {
  color: #a1b0b7;
  font-size: 9px;
  font-weight: 700;
}

.shop-debt-bar {
  height: 8px;
  overflow: hidden;
  border: 1px solid #f0e1bc;
  border-radius: 99px;
  background: #fbf4e2;
}

.shop-debt-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f1bf50, #f6d985);
  transition: width 0.7s ease;
}

.shop-debt-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: #a39370;
  font-size: 8px;
  font-weight: 700;
}

.shop-debt-meta span:last-child {
  color: #9c7b2d;
  font-family: var(--font-en);
  font-weight: 900;
}

.shop-rate-line {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 17px;
  padding: 10px;
  border: 1px solid #e9f2f7;
  border-radius: 9px;
  background: #f9fcfe;
}

.shop-rate-coin {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #d59b14;
  background: #fff5d7;
}

.shop-rate-coin svg {
  width: 16px;
  height: 16px;
}

.shop-rate-line strong {
  color: #345d70;
  font-family: var(--font-en);
  font-size: 17px;
  font-weight: 900;
}

.shop-rate-line > span:last-child {
  margin-left: auto;
  color: #9aadb8;
  font-size: 8px;
}

.shop-breakdown {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  margin-top: 11px;
}

.shop-breakdown > div {
  padding: 7px;
  border: 1px solid #eef4f8;
  border-radius: 7px;
  background: #fcfdff;
}

.shop-breakdown span {
  display: block;
  color: #99aab5;
  font-size: 7px;
}

.shop-breakdown strong {
  display: block;
  margin-top: 2px;
  color: #546f80;
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 900;
}

.shop-boost-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f5f8;
  color: #91a4b1;
  font-size: 8px;
  font-weight: 600;
}

.shop-boost-row strong {
  color: #526e7e;
  font-size: 9px;
  font-weight: 800;
  text-align: right;
}

.shop-boost-panel .goal-mini-bar {
  margin: 5px 0 4px;
}

.shop-total {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding: 9px 0;
  border-top: 1px dashed #e7eff4;
  color: #95a6b1;
  font-size: 8px;
  font-weight: 700;
}

.shop-total strong {
  color: #7d651f;
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 900;
}

.shop-boost-panel .btn {
  width: 100%;
  margin-top: 10px;
  min-height: 34px !important;
  font-size: 9px !important;
}

.shop-notes {
  margin-top: 15px;
}

.shop-note-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 10px;
}

.shop-note-grid > div {
  padding: 10px;
  border: 1px solid #edf3f7;
  border-radius: 8px;
  background: #fbfdff;
}

.shop-note-grid strong {
  display: block;
  color: #4d6879;
  font-size: 9px;
  font-weight: 900;
}

.shop-note-grid span {
  display: block;
  margin-top: 3px;
  color: #92a5b1;
  font-size: 7px;
  line-height: 1.55;
}

.shop-locked-panel {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.shop-locked-art {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border: 1px dashed #c9dfea;
  border-radius: 22px;
  color: #7eb4ce;
  background: #f4fbfe;
}

.shop-locked-art svg {
  width: 38px;
  height: 38px;
}

.shop-locked-panel h2 {
  margin: 7px 0 5px;
  color: #385970;
  font-size: 23px;
  font-weight: 900;
}

.shop-locked-panel > p {
  max-width: 370px;
  margin: 0 0 15px;
  color: #8da3b0;
  font-size: 9px;
  line-height: 1.7;
}

/* Story */

.modal-card:has(.story-panel) {
  border-color: rgba(129, 204, 235, 0.18) !important;
  color: #eaf8ff;
  background:
    radial-gradient(circle at 50% 0, rgba(91, 177, 219, 0.12), transparent 22rem),
    #091a28;
}

.modal-card:has(.story-panel) .modal-head h2 {
  color: #f2fbff;
}

.modal-card:has(.story-panel) .modal-head p {
  color: #7298ac;
}

.modal-card:has(.story-panel) .modal-close {
  color: #b6d7e7;
  background: rgba(255, 255, 255, 0.07);
}

.story-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.story-scene {
  position: relative;
  min-height: 188px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(129, 204, 235, 0.18);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 211, 111, 0.18), transparent 10rem),
    linear-gradient(150deg, #112d42, #081722);
}

.story-scene::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(143, 207, 232, 0.16);
  border-radius: 10px;
}

.story-scene-label {
  position: relative;
  z-index: 2;
  color: #75c3e2;
  font-family: var(--font-en);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.24em;
}

.story-scene > strong {
  position: relative;
  z-index: 2;
  color: #ffe0a0;
  font-family: var(--font-en);
  font-size: clamp(42px, 7vw, 67px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  text-shadow: 0 0 28px rgba(255, 202, 89, 0.25);
}

.story-scene-sub {
  position: relative;
  z-index: 2;
  color: #88a9b9;
  font-size: 9px;
  letter-spacing: 0.18em;
}

.story-stamp {
  position: absolute;
  z-index: 3;
  right: 25px;
  bottom: 23px;
  padding: 4px 9px;
  border: 2px solid rgba(239, 131, 123, 0.5);
  border-radius: 4px;
  color: #ee9a91;
  font-size: 8px;
  font-weight: 900;
  transform: rotate(-8deg);
}

.story-shop::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 218px;
  height: 132px;
  transform: translateX(-50%);
  border: 1px solid rgba(122, 187, 214, 0.22);
  border-radius: 4px 4px 8px 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 50%, transparent 50% 100%),
    linear-gradient(160deg, #1b415a, #0e2a3c);
  background-size: 17px 17px, auto;
}

.story-shop::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 133px;
  width: 228px;
  height: 25px;
  transform: translateX(-50%);
  border-radius: 4px 4px 8px 8px;
  background: repeating-linear-gradient(90deg, #f7e4b6 0 22px, #cf9b51 22px 44px);
  opacity: 0.9;
}

.story-shop .story-shop-sign {
  position: relative;
  z-index: 4;
  margin-top: 33px;
  padding: 7px 17px;
  border: 1px solid #d9ad5d;
  border-radius: 4px;
  color: #654517;
  background: #fff1c9;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.15em;
  transform: rotate(-2deg);
  animation: storySignSway 5s ease-in-out infinite;
}

.story-shop-window {
  position: relative;
  z-index: 4;
  width: 98px;
  height: 59px;
  display: grid;
  place-items: center;
  margin-top: 13px;
  border: 4px solid #1a4058;
  border-radius: 4px;
  color: #efbe67;
  background: #f1c578;
  box-shadow: 0 0 26px rgba(255, 198, 92, 0.25);
}

.story-shop-window svg {
  width: 30px;
  height: 30px;
}

.story-shop-coin {
  position: absolute;
  left: 50%;
  top: 30px;
  color: #f6c95f;
  animation: storyCoin 3.4s ease-in-out infinite;
}

.story-shop-coin.second {
  left: 41%;
  top: 58px;
  animation-delay: 1.3s;
  opacity: 0.7;
}

.story-shop-coin svg {
  width: 19px;
  height: 19px;
}

.story-copy {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.story-copy p {
  margin: 0;
  color: #acc9d7;
  font-size: 11px;
  line-height: 1.75;
}

.story-copy p:first-child {
  color: #d9edf6;
}

.story-note {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid rgba(236, 208, 139, 0.2);
  border-radius: 8px;
  color: #e0c77e;
  background: rgba(255, 233, 180, 0.06);
  font-size: 9px;
  line-height: 1.6;
}

.story-note svg {
  width: 14px;
  height: 14px;
  flex: none;
}

@keyframes shopTwinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 0.95; transform: scale(1.25); }
}

@keyframes signSway {
  0%, 100% { transform: translateX(-50%) rotate(-1.5deg); }
  50% { transform: translateX(-50%) rotate(1.5deg); }
}

@keyframes storySignSway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

@keyframes windowGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 220, 151, 0.24), 0 0 20px rgba(255, 190, 88, 0.2); }
  50% { box-shadow: 0 0 0 1px rgba(255, 220, 151, 0.4), 0 0 34px rgba(255, 190, 88, 0.38); }
}

@keyframes shopCoinFall {
  0% { opacity: 0; transform: translateY(-10px) rotate(-15deg); }
  15% { opacity: 0.95; }
  75% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(185px) rotate(210deg); }
}

@keyframes storyCoin {
  0%, 100% { opacity: 0.25; transform: translateY(0) rotate(-8deg); }
  50% { opacity: 0.9; transform: translateY(-14px) rotate(8deg); }
}

/* Profile */

.profile-layout {
  max-width: 940px !important;
  margin: 0 auto;
}

.profile-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 27px 29px !important;
  border: 0 !important;
  border-radius: 23px !important;
  color: #eaf8ff;
  background:
    radial-gradient(circle at 90% 0, rgba(90, 186, 235, 0.2), transparent 18rem),
    linear-gradient(135deg, #15364f, #0e2639) !important;
  box-shadow: 0 12px 30px rgba(17, 43, 64, 0.16) !important;
}

.profile-avatar {
  width: 76px !important;
  height: 76px !important;
  flex: none;
  border-radius: 21px !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

.profile-hero-copy {
  flex: 1;
  min-width: 0;
}

.profile-hero-copy .eyebrow {
  color: #88c5e2 !important;
}

.profile-hero-copy h1 {
  margin: 5px 0 6px;
  color: #f3fbff;
  font-size: clamp(25px, 3.5vw, 34px);
  font-weight: 900;
  letter-spacing: -0.045em;
}

.profile-hero-copy > p {
  max-width: 600px;
  margin: 0;
  color: #a5c2d3;
  font-size: 10px;
  line-height: 1.65;
}

.profile-resource-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 13px;
}

.profile-resource-row span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid rgba(160, 211, 237, 0.18);
  border-radius: 6px;
  color: #b5d6e8;
  background: rgba(255, 255, 255, 0.05);
  font-size: 8px;
  font-weight: 700;
}

.profile-resource-row svg {
  width: 12px;
  height: 12px;
  color: #87ccec;
}

.settings-trigger {
  align-self: flex-start;
  color: #c5e3f2 !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

.profile-stats {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 8px !important;
  margin-top: 14px !important;
}

.profile-stat {
  padding: 14px !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: none !important;
}

.profile-stat-head {
  color: #8ca1b0 !important;
  font-size: 8px !important;
}

.profile-stat-head svg {
  width: 12px !important;
  height: 12px !important;
}

.profile-stat strong {
  margin-top: 6px !important;
  color: #284b65 !important;
  font-family: var(--font-en);
  font-size: 23px !important;
}

.profile-stat strong small {
  color: #9bafbc !important;
  font-size: 8px !important;
}

.profile-section {
  padding: 22px !important;
  margin-top: 15px !important;
  border: 1px solid var(--line) !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: none !important;
}

.profile-section .section-title {
  font-size: 18px !important;
}

.achievement {
  border-radius: 12px !important;
  box-shadow: none !important;
}

.achievement-icon {
  border-radius: 9px !important;
}

.history-row {
  border-radius: 10px !important;
}

.profile-settings-row {
  padding: 13px !important;
  border-radius: 11px !important;
  border: 1px solid #edf3f7 !important;
  background: #fbfdff !important;
}

.redeem-section {
  border-color: #eadcb6 !important;
  background: linear-gradient(135deg, #fffdf7, #fffaf0) !important;
}

.redeem-section-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.redeem-section-icon {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #ad8124;
  background: #fff3d3;
}

.redeem-section-icon svg {
  width: 22px;
  height: 22px;
}

.redeem-section-copy {
  flex: 1;
  min-width: 0;
}

.redeem-section-copy h2 {
  margin: 3px 0 3px;
  color: #69521e;
  font-size: 17px;
  font-weight: 900;
}

.redeem-section-copy p {
  margin: 0;
  color: #a18c5f;
  font-size: 9px;
  line-height: 1.6;
}

.redeem-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: none;
}

.redeem-section-actions .btn {
  min-height: 36px !important;
  padding: 7px 11px !important;
  font-size: 9px !important;
}

.redeem-form label {
  display: block;
  margin-bottom: 6px;
  color: #5c7487;
  font-size: 10px;
  font-weight: 800;
}

.redeem-form input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid #d9e8f2;
  border-radius: 10px;
  color: #1b3a52;
  background: #fbfdff;
  font-family: var(--font-en);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.redeem-form input:focus {
  border-color: #7cbbe4;
  outline: none;
  box-shadow: 0 0 0 3px rgba(82, 165, 220, 0.12);
}

.redeem-form input.is-invalid {
  border-color: #e9898d;
  animation: shake 0.35s ease;
}

.redeem-form > p {
  margin: 7px 0 0;
  color: #9bafbc;
  font-size: 9px;
}

.redeem-form .redeem-error {
  min-height: 15px;
  color: #c94b51;
  font-weight: 700;
}

/* Dev console */

.dev-console {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dev-console-status {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 9px;
  border: 1px solid #dcebf5;
  border-radius: 10px;
  background: #f7fcff;
}

.dev-console-status span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border-radius: 5px;
  color: #52748b;
  background: #fff;
  font-size: 8px;
  font-weight: 700;
}

.dev-console-status svg {
  width: 12px;
  height: 12px;
  color: #4e9bc6;
}

.dev-console-section {
  padding: 13px;
  border: 1px solid #e5eff6;
  border-radius: 11px;
  background: #fcfdff;
}

.dev-console-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.dev-console-section-head h3 {
  margin: 0;
  color: #2d526d;
  font-size: 12px;
  font-weight: 900;
}

.dev-console-section-head span {
  color: #9bacb9;
  font-size: 8px;
}

.dev-amount-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
}

.dev-amount-row label {
  color: #748b9c;
  font-size: 9px;
  font-weight: 800;
}

.dev-amount-row input {
  width: 130px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid #dbe8f1;
  border-radius: 7px;
  color: #2a506b;
  background: #fff;
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 800;
}

.dev-button-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.dev-button-grid.chest {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dev-button-grid .btn {
  min-height: 35px !important;
  padding: 5px 7px !important;
  border-radius: 7px !important;
  font-size: 8px !important;
}

.dev-button-grid .btn.danger {
  color: #b14f54 !important;
  border-color: #f2d7d8 !important;
  background: #fff7f7 !important;
}

.dev-console-note {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin: 0;
  color: #9aabb8;
  font-size: 8px;
  line-height: 1.6;
}

.dev-console-note svg {
  width: 13px;
  height: 13px;
  flex: none;
  color: #c89222;
}

/* Challenge */

.challenge-lobby {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.challenge-lobby-banner {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px;
  border-radius: 14px;
  color: #e5f6ff;
  background:
    radial-gradient(circle at 90% 0, rgba(97, 187, 232, 0.25), transparent 15rem),
    linear-gradient(135deg, #133149, #0b2032);
}

.challenge-ticket-visual {
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #ffd184;
  background: rgba(255, 209, 132, 0.12);
}

.challenge-ticket-visual svg {
  width: 25px;
  height: 25px;
}

.challenge-lobby-banner > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.challenge-lobby-banner .eyebrow {
  color: #7dc1df !important;
  font-size: 7px !important;
}

.challenge-lobby-banner h3 {
  margin: 3px 0;
  color: #f3fbff;
  font-size: 17px;
  font-weight: 900;
}

.challenge-lobby-banner p {
  margin: 0;
  color: #9ebacb;
  font-size: 9px;
  line-height: 1.55;
}

.challenge-lobby-banner > strong {
  color: #ffd27f;
  font-family: var(--font-en);
  font-size: 28px;
  font-weight: 900;
}

.challenge-tier-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.challenge-tier-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 14px;
  overflow: hidden;
  border: 1px solid #e6eef4;
  border-radius: 14px;
  background: #fff;
}

.challenge-tier-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--challenge-accent);
}

.challenge-tier-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.challenge-tag {
  padding: 3px 6px;
  border-radius: 4px;
  color: #426780;
  background: #eef7fc;
  font-size: 8px;
  font-weight: 900;
}

.challenge-en {
  color: #9fb0bc;
  font-family: var(--font-en);
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.challenge-tier-card h3 {
  margin: 10px 0 5px;
  color: #294d67;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.challenge-tier-card > p {
  min-height: 38px;
  margin: 0;
  color: #879dab;
  font-size: 9px;
  line-height: 1.6;
}

.challenge-meta-row,
.challenge-reward-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.challenge-meta-row span,
.challenge-reward-row span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 5px;
  border-radius: 4px;
  color: #8299a8;
  background: #f5f9fc;
  font-size: 7px;
  font-weight: 700;
}

.challenge-meta-row svg,
.challenge-reward-row svg {
  width: 10px;
  height: 10px;
}

.challenge-reward-row {
  padding-top: 7px;
  border-top: 1px solid #f0f5f8;
}

.challenge-reward-row span {
  color: #a17b2c;
  background: #fffbf1;
}

.challenge-tier-card .btn {
  width: 100%;
  min-height: 34px !important;
  margin-top: auto;
  padding: 5px 7px !important;
  font-size: 8px !important;
}

.challenge-lobby-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
  color: #99aab6;
  font-size: 8px;
}

.challenge-lobby-foot > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.challenge-lobby-foot svg {
  width: 13px;
  height: 13px;
}

.challenge-intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 11px 0 2px;
  padding: 6px 10px;
  border: 1px solid #f1ddb9;
  border-radius: 8px;
  color: #9a742a;
  background: #fffbf1;
  font-size: 9px;
  font-weight: 800;
}

.challenge-intro-badge svg {
  width: 15px;
  height: 15px;
}

.challenge-result-panel {
  width: min(540px, 100%);
  margin: 14px auto 0;
  padding: 14px 17px;
  border: 1px solid #dceaf4;
  border-radius: 14px;
  background: #f9fcff;
}

.challenge-result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.challenge-result-top > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.challenge-result-top span {
  color: #93a7b5;
  font-family: var(--font-en);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.challenge-result-top strong {
  color: #355871;
  font-size: 13px;
  font-weight: 900;
}

.challenge-result-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #edf3f7;
}

.challenge-result-rewards span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 5px;
  color: #738b9c;
  background: #eef7fc;
  font-size: 7px;
  font-weight: 700;
}

.challenge-result-rewards svg {
  width: 11px;
  height: 11px;
}

.chest-ticket-reward {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  color: #9a7328;
  background: #fff8e7;
  font-size: 11px;
  font-weight: 800;
}

.chest-ticket-reward svg {
  width: 18px;
  height: 18px;
  color: #d7992d;
}

.chest-ticket-reward strong {
  font-family: var(--font-en);
  font-size: 17px;
  font-weight: 900;
}

/* Practice + mistakes reuse a cleaner surface */

.practice-layout,
.mistakes-layout {
  max-width: 980px !important;
  margin: 0 auto;
}

.practice-hero,
.mistake-hero {
  min-height: 0 !important;
  padding: 24px 26px !important;
  border: 1px solid #e1edf5 !important;
  border-radius: 20px !important;
  background: linear-gradient(120deg, #f7fcff, #edf7ff) !important;
  box-shadow: none !important;
}

.practice-hero h2,
.mistake-hero h2 {
  margin: 6px 0 6px !important;
  color: #24445d !important;
  font-size: 25px !important;
  font-weight: 900 !important;
  letter-spacing: -0.04em;
}

.practice-hero p,
.mistake-hero p {
  color: #7890a0 !important;
  font-size: 10px !important;
}

.practice-mascot,
.mistake-mascot {
  display: none !important;
}

.practice-grid {
  gap: 10px !important;
  margin-top: 14px !important;
}

.practice-card {
  padding: 18px !important;
  border: 1px solid #e3edf4 !important;
  border-radius: 15px !important;
  background: #fff !important;
  box-shadow: none !important;
}

.practice-card.featured {
  background: linear-gradient(120deg, #fff8f8, #fff) !important;
  border-color: #f1dddd !important;
}

.practice-icon {
  border-radius: 10px !important;
}

.practice-card h3 {
  color: #294b64 !important;
  font-size: 15px !important;
}

.practice-card p {
  color: #8198a7 !important;
  font-size: 9px !important;
}

.practice-tip {
  border-radius: 11px !important;
  background: #f7fcff !important;
  border: 1px solid #e3eff7 !important;
  color: #7590a1 !important;
  font-size: 9px !important;
}

.mistake-group {
  padding: 18px !important;
  border: 1px solid #e2edf4 !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: none !important;
}

.mistake-item {
  border-radius: 11px !important;
}

/* Lesson surfaces */

.lesson-screen {
  background: #f5f9fd !important;
}

.lesson-content {
  border-radius: 18px !important;
  box-shadow: 0 7px 24px rgba(29, 63, 90, 0.05) !important;
}

.option {
  border-radius: 12px !important;
  box-shadow: 0 2px 0 #e0eaf2 !important;
}

.option:hover:not(:disabled) {
  border-color: #b8d8ee !important;
  background: #fbfdff !important;
}

.feedback-card,
.hint-card,
.intro-card {
  border-radius: 18px !important;
}

.lesson-footer {
  background: rgba(245, 249, 253, 0.94) !important;
}

/* Gacha cinematic */

.gacha-shaking .app-shell {
  animation: screenShake 0.45s ease both;
}

.gacha-cinematic {
  position: fixed;
  inset: 0;
  z-index: 2000;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #f5fcff;
  background: #061521;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.gacha-cinematic.is-active {
  opacity: 1;
}

.gacha-cinematic-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 44%, rgba(80, 186, 236, 0.27), transparent 15rem),
    radial-gradient(circle at 50% 60%, rgba(76, 99, 204, 0.22), transparent 26rem),
    #061521;
}

.gacha-cinematic-rays {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 980px;
  height: 980px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(112, 209, 249, 0.25) 0deg 2deg, transparent 2deg 15deg);
  mask-image: radial-gradient(circle, #000 0 24%, transparent 67%);
  animation: raysSpin 12s linear infinite;
  opacity: 0.65;
}

.gacha-cinematic-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gacha-particle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: #b7efff;
  box-shadow: 0 0 8px #75d2f5;
  opacity: 0;
  animation: gachaParticle 1.6s ease-out var(--d) infinite;
}

.gacha-cinematic-core {
  position: relative;
  z-index: 3;
  width: 340px;
  height: 340px;
  display: grid;
  place-items: center;
  transform: scale(0.65);
  opacity: 0;
  transition: transform 0.55s cubic-bezier(0.2, 0.9, 0.2, 1.18), opacity 0.3s ease;
}

.gacha-cinematic-core::before {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 224, 143, 0.33), transparent 38%),
    radial-gradient(circle, rgba(95, 210, 255, 0.4), transparent 70%);
  filter: blur(3px);
  animation: coreGlow 2.2s ease-in-out infinite;
}

.gacha-cinematic.is-ten .gacha-cinematic-core::before {
  width: 300px;
  height: 300px;
  background:
    radial-gradient(circle, rgba(255, 214, 118, 0.44), transparent 36%),
    radial-gradient(circle, rgba(150, 113, 255, 0.42), transparent 70%);
}

.gacha-cinematic.is-active .gacha-cinematic-core {
  transform: scale(1);
  opacity: 1;
}

.gacha-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(120, 220, 255, 0.28);
  border-radius: 50%;
}

.gacha-ring.ring-a {
  width: 230px;
  height: 230px;
  border-style: dashed;
  animation: orbitSpin 14s linear infinite;
}

.gacha-ring.ring-b {
  width: 300px;
  height: 300px;
  opacity: 0.65;
  animation: orbitSpin 21s linear infinite reverse;
}

.gacha-ring.ring-c {
  width: 380px;
  height: 380px;
  border-color: rgba(255, 221, 142, 0.13);
  animation: orbitSpin 30s linear infinite;
}

.gacha-summon-card {
  position: relative;
  z-index: 3;
  width: 146px;
  height: 228px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(139, 224, 255, 0.75);
  border-radius: 14px;
  color: #82ddff;
  background:
    radial-gradient(circle at 50% 30%, rgba(90, 199, 240, 0.42), transparent 5rem),
    linear-gradient(155deg, #1f4b69, #081927);
  box-shadow: 0 0 45px rgba(95, 204, 245, 0.32), inset 0 0 0 5px rgba(255, 255, 255, 0.05);
  animation: summonPulse 1.8s ease-in-out infinite;
}

.gacha-summon-card > svg {
  width: 36px;
  height: 36px;
}

.gacha-summon-card > span:last-child {
  color: #9ed9ee;
  font-family: var(--font-en);
  font-size: 6px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.gacha-summon-spark {
  position: absolute;
  top: 12px;
  right: 14px;
  color: #ffe5a0;
  font-size: 9px;
}

.gacha-ghost-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100px;
  height: 156px;
  border: 1px solid rgba(129, 210, 245, 0.18);
  border-radius: 12px;
  background: linear-gradient(155deg, rgba(32, 83, 114, 0.55), rgba(7, 22, 36, 0.4));
}

.gacha-ghost-card.ghost-a {
  transform: rotate(-17deg) translate(-58px, 18px);
}

.gacha-ghost-card.ghost-b {
  transform: rotate(16deg) translate(58px, 18px);
}

.gacha-sigil {
  position: absolute;
  z-index: 4;
  right: 34px;
  bottom: 33px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 217, 128, 0.3);
  border-radius: 50%;
  color: #ffe1a0;
  background: rgba(255, 218, 130, 0.08);
}

.gacha-sigil svg {
  width: 18px;
  height: 18px;
}

.gacha-cinematic-copy {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.gacha-cinematic-copy span {
  color: #70bad8;
  font-family: var(--font-en);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.gacha-cinematic-copy strong {
  color: #f4fcff;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.gacha-cinematic-copy p {
  margin: 2px 0 0;
  color: #6e95a9;
  font-size: 8px;
}

.gacha-cinematic-flash {
  position: absolute;
  inset: 0;
  background: #dff8ff;
  opacity: 0;
  pointer-events: none;
}

.gacha-cinematic.is-active .gacha-cinematic-flash {
  animation: gachaStartFlash 0.48s ease-out both;
}

.gacha-cinematic.is-ten .gacha-cinematic-flash {
  background: #fff2cc;
}

.gacha-cinematic.is-revealing .gacha-cinematic-flash {
  animation: gachaFlash 0.42s ease-out both;
}

.gacha-cinematic.is-ten .gacha-cinematic-rays {
  background: repeating-conic-gradient(from 0deg, rgba(255, 220, 139, 0.26) 0deg 2deg, transparent 2deg 13deg);
}

.gacha-cinematic.is-ten .gacha-summon-card {
  border-color: rgba(255, 220, 139, 0.8);
  color: #ffe3a0;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 211, 113, 0.35), transparent 5rem),
    linear-gradient(155deg, #4b3b2d, #18130e);
  box-shadow: 0 0 65px rgba(255, 205, 103, 0.4), inset 0 0 0 5px rgba(255, 255, 255, 0.06);
}

.gacha-cinematic.is-revealing .gacha-cinematic-core {
  transform: scale(1.14);
  opacity: 0;
  transition: transform 0.42s ease-in, opacity 0.35s ease 0.06s;
}

.gacha-cinematic.is-revealing .gacha-cinematic-copy {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.draw-results-aura {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.draw-results-aura i {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(99, 189, 229, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.draw-results-aura i:nth-child(2) {
  width: 600px;
  height: 600px;
  border-style: dashed;
}

.draw-results-aura i:nth-child(3) {
  width: 780px;
  height: 780px;
  border-color: rgba(255, 211, 120, 0.08);
}

.draw-results-grid.is-single {
  grid-template-columns: minmax(0, 190px);
  justify-content: center;
  padding: 4px 0 2px;
}

.draw-results-grid .tarot-card.compact {
  aspect-ratio: 0.58;
}

.draw-result-item {
  animation: drawCardIn 0.55s cubic-bezier(0.18, 0.86, 0.28, 1.12) both;
  animation-delay: calc(var(--i) * 65ms);
}

.draw-reward-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 220px;
  padding: 14px 10px;
  overflow: hidden;
  border: 1px solid rgba(137, 210, 241, 0.3);
  border-radius: 14px;
  color: #eaf8ff;
  background:
    radial-gradient(circle at 50% 35%, rgba(77, 188, 234, 0.3), transparent 7rem),
    linear-gradient(155deg, #12354f, #071827);
  box-shadow: 0 8px 20px rgba(8, 29, 45, 0.14);
}

.draw-reward-item.ticket {
  border-color: rgba(244, 201, 109, 0.32);
  background:
    radial-gradient(circle at 50% 35%, rgba(239, 181, 64, 0.26), transparent 7rem),
    linear-gradient(155deg, #3a3021, #17130d);
}

.draw-reward-item.ingredient {
  border-color: rgba(119, 204, 157, 0.3);
  background:
    radial-gradient(circle at 50% 35%, rgba(88, 188, 135, 0.28), transparent 7rem),
    linear-gradient(155deg, #183a2a, #0b1d14);
}

.draw-reward-item.ingredient .draw-reward-icon {
  border-color: rgba(128, 224, 168, 0.3);
  background: rgba(255, 255, 255, 0.06);
  font-size: 26px;
  line-height: 1;
}

.draw-reward-item.ingredient > em {
  color: #7fae91;
}

.draw-reward-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(147, 222, 250, 0.3);
  border-radius: 50%;
  color: #7dd9fa;
  background: rgba(255, 255, 255, 0.055);
}

.draw-reward-item.ticket .draw-reward-icon {
  color: #ffd486;
  border-color: rgba(255, 211, 134, 0.3);
}

.draw-reward-icon svg {
  width: 28px;
  height: 28px;
}

.draw-reward-item > strong {
  color: #f3fcff;
  font-family: var(--font-en);
  font-size: 28px;
  font-weight: 900;
  line-height: 1.1;
}

.draw-reward-item > span:not(.draw-reward-icon) {
  color: #a9cfe0;
  font-size: 9px;
  font-weight: 700;
}

.draw-reward-item > em {
  color: #6e9baf;
  font-family: var(--font-en);
  font-size: 6px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.draw-reward-item.ticket > em {
  color: #a58a57;
}

.draw-results-grid .tarot-card {
  animation: none;
}

.draw-results-grid .tarot-card:hover {
  transform: none;
}

.draw-results-note {
  position: relative;
  z-index: 2;
}

/* Animations */

@keyframes orbitSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes cardFloat {
  0%, 100% { transform: translate(-50%, -50%) rotate(-2deg) translateY(0); }
  50% { transform: translate(-50%, -50%) rotate(1deg) translateY(-7px); }
}

@keyframes summonPulse {
  0%, 100% { box-shadow: 0 0 42px rgba(95, 204, 245, 0.26), inset 0 0 0 5px rgba(255, 255, 255, 0.05); }
  50% { box-shadow: 0 0 70px rgba(117, 221, 255, 0.46), inset 0 0 0 5px rgba(255, 255, 255, 0.09); }
}

@keyframes raysSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes gachaParticle {
  0% { opacity: 0; transform: translateY(12px) rotate(var(--r)) scale(0.5); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-90px) rotate(calc(var(--r) + 180deg)) scale(0.1); }
}

@keyframes gachaFlash {
  0% { opacity: 0; }
  12% { opacity: 0.95; }
  100% { opacity: 0; }
}

@keyframes gachaStartFlash {
  0% { opacity: 0; }
  8% { opacity: 0.4; }
  32% { opacity: 0.05; }
  100% { opacity: 0; }
}

@keyframes coreGlow {
  0%, 100% { transform: scale(0.9); opacity: 0.55; }
  50% { transform: scale(1.12); opacity: 0.95; }
}

@keyframes screenShake {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-3px, 2px); }
  40% { transform: translate(3px, -2px); }
  60% { transform: translate(-2px, -1px); }
  80% { transform: translate(2px, 1px); }
}

@keyframes drawCardIn {
  0% { opacity: 0; transform: translateY(22px) scale(0.88) rotate(2deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

/* UI v2 responsive */

@media (max-width: 1060px) {
  .home-v2 {
    grid-template-columns: minmax(0, 1fr) 285px;
    gap: 18px;
  }

  .nav-tab {
    min-width: 54px !important;
    padding: 0 9px !important;
  }

  .nav-tab span {
    display: none;
  }

  .nav-tab.active {
    padding: 0 11px !important;
  }

  .unit-select-wrap > span {
    display: none;
  }
}

@media (max-width: 860px) {
  .topbar-inner {
    width: calc(100% - 32px) !important;
  }

  .page {
    width: calc(100% - 32px) !important;
    padding-top: 24px !important;
  }

  .home-v2 {
    grid-template-columns: 1fr;
  }

  .home-aside {
    display: none !important;
  }

  .mobile-debt-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    margin-bottom: 12px;
    padding: 9px 11px;
    border: 1px solid #efe0b8;
    border-radius: 11px;
    color: #92742e;
    background: #fffdf7;
    text-align: left;
  }

  .mobile-debt-line > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #9e833f;
    font-size: 8px;
    font-weight: 800;
  }

  .mobile-debt-line > span:first-child svg {
    width: 13px;
    height: 13px;
    color: #d19b16;
  }

  .mobile-debt-line > strong {
    color: #5c4613;
    font-family: var(--font-en);
    font-size: 14px;
    font-weight: 900;
  }

  .mobile-debt-line > em {
    color: #a99b77;
    font-size: 7px;
    font-style: normal;
  }

  .mobile-debt-line > b {
    margin-left: auto;
    color: #9d7d2f;
    font-family: var(--font-en);
    font-size: 8px;
    font-weight: 900;
  }

  .mobile-debt-bar {
    order: 6;
    display: block;
    width: 100%;
    height: 4px;
    overflow: hidden;
    border-radius: 99px;
    background: #f3ead4;
  }

  .mobile-debt-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #e4b444;
  }

  .mobile-home-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    gap: 7px;
    padding: 11px 12px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
  }

  .mobile-home-strip > div {
    min-width: 0;
  }

  .mobile-home-strip > div span {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #94a8b6;
    font-size: 7px;
    font-weight: 700;
  }

  .mobile-home-strip > div span svg {
    width: 10px;
    height: 10px;
  }

  .mobile-home-strip > div strong {
    display: block;
    margin-top: 2px;
    color: #31536b;
    font-family: var(--font-en);
    font-size: 12px;
    font-weight: 900;
  }

  .mobile-home-strip > div strong em {
    color: #9aadb9;
    font-size: 7px;
    font-style: normal;
    font-weight: 600;
  }

  .mobile-home-strip > .btn {
    min-height: 31px !important;
    padding: 5px 8px !important;
    border-radius: 7px !important;
    font-size: 8px !important;
  }

  .home-hero-side {
    display: none;
  }

  .home-hero {
    align-items: flex-start;
  }

  .wish-panel .tarot-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .draw-stage,
  .reading-stage {
    grid-template-columns: 0.8fr 1.2fr;
    padding: 23px;
  }

  .draw-stage-art {
    height: 230px;
    transform: scale(0.82);
  }

  .draw-card-back {
    width: 100px;
    height: 158px;
  }

  .profile-stats {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .challenge-tier-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .craft-layout {
    grid-template-columns: 1fr;
  }

  .food-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .bag-resource-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .bag-item-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .shop-note-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .topbar-inner {
    width: calc(100% - 24px) !important;
    height: 60px !important;
    gap: 10px !important;
  }

  .brand-mark {
    width: 32px !important;
    height: 32px !important;
  }

  .brand-name strong {
    font-size: 14px !important;
  }

  .brand-name span {
    display: none;
  }

  .nav-tabs {
    display: none !important;
  }

  .top-sound {
    display: none !important;
  }

  .top-stat.streak {
    display: none !important;
  }

  .top-resource {
    height: 32px;
    padding: 0 9px;
  }

  .avatar-btn {
    width: 34px !important;
    height: 34px !important;
  }

  .page {
    width: calc(100% - 24px) !important;
    padding: 19px 0 90px !important;
  }

  .home-hero {
    display: block;
    padding-bottom: 20px;
  }

  .mobile-home-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 10px;
    gap: 6px;
  }

  .mobile-home-strip > .btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .home-hero h1 {
    font-size: 32px;
  }

  .home-hero p {
    font-size: 10px;
  }

  .home-hero-actions {
    gap: 6px;
    margin-top: 14px;
  }

  .home-hero-actions .btn {
    flex: 1;
    min-width: 0;
    padding: 8px 9px !important;
    font-size: 10px !important;
  }

  .unit-switcher {
    flex-wrap: wrap;
    gap: 9px;
    padding: 12px;
  }

  .unit-switcher-progress {
    display: none;
  }

  .unit-select-wrap {
    width: 100%;
    justify-content: space-between;
    padding: 9px 0 0;
    border-top: 1px solid #edf3f7;
    border-left: 0;
  }

  .unit-select-wrap > span {
    display: inline;
  }

  .unit-select-wrap select {
    flex: 1;
    max-width: none;
  }

  .home-aside {
    grid-template-columns: 1fr;
  }

  .unit-copy {
    max-width: 100% !important;
  }

  .unit-mascot {
    display: none !important;
  }

  .unit-hero {
    padding: 15px 48px 15px 15px !important;
  }

  .unit-fold-btn {
    top: 10px;
    right: 10px;
    padding: 5px;
  }

  .unit-fold-btn span {
    display: none;
  }

  .unit-fold-btn svg {
    width: 13px;
    height: 13px;
  }

  .unit-copy h2 {
    font-size: 18px !important;
  }

  .unit-copy > p {
    font-size: 9px !important;
  }

  .node-unit {
    width: 146px !important;
  }

  .node-row {
    min-height: 108px !important;
  }

  .path-node {
    width: 58px !important;
    height: 58px !important;
  }

  .node-caption {
    width: 142px !important;
  }

  .wish-header {
    display: block;
    margin-bottom: 16px;
  }

  .wish-header h1 {
    font-size: 39px;
  }

  .wish-balance {
    justify-content: flex-start;
    margin-top: 12px;
    max-width: none;
  }

  .wish-balance > span {
    padding: 6px 7px;
    font-size: 7px;
  }

  .wish-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    overflow: visible;
  }

  .wish-tab {
    flex: none;
    justify-content: center;
    min-width: 0;
    padding: 0 5px;
    font-size: 8px;
  }

  .wish-tab em {
    display: none;
  }

  .wish-panel {
    padding: 16px;
    border-radius: 17px;
  }

  .wish-panel-head {
    margin-bottom: 12px;
  }

  .wish-panel-head h2 {
    font-size: 16px;
  }

  .wish-big-number {
    font-size: 26px;
  }

  .wish-two-col {
    grid-template-columns: 1fr;
  }

  .draw-stage,
  .reading-stage {
    display: block;
    min-height: 0;
    padding: 18px;
    border-radius: 19px;
  }

  .draw-stage-art {
    height: 195px;
    margin: -12px auto -10px;
    transform: scale(0.75);
  }

  .draw-stage-copy h2 {
    font-size: 31px;
  }

  .draw-stage-copy > p {
    font-size: 9px;
  }

  .draw-price-grid {
    margin-top: 14px;
  }

  .draw-price-card {
    padding: 10px;
  }

  .draw-price-card > strong {
    font-size: 17px;
  }

  .draw-balance-line {
    font-size: 7px;
  }

  .reading-stage-art {
    height: 180px;
    margin: -10px auto -4px;
    transform: scale(0.8);
  }

  .reading-stage-copy h2 {
    font-size: 29px;
  }

  .reading-stage-copy > p {
    font-size: 9px;
  }

  .wish-panel .tarot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .craft-slots {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .craft-slot {
    min-height: 82px;
    padding: 5px 3px;
  }

  .craft-slot-emoji {
    font-size: 25px;
  }

  .craft-slot > strong {
    font-size: 8px;
  }

  .craft-item-grid {
    max-height: none;
  }

  .food-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bag-resource-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .bag-item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bag-resource-grid > div {
    padding: 8px;
  }

  .bag-resource-grid strong {
    font-size: 15px;
  }

  .shop-stage {
    min-height: 336px;
  }

  .shop-building {
    bottom: 91px;
    transform: translateX(-50%) scale(0.82);
    transform-origin: bottom center;
  }

  .shop-stage-caption {
    left: 16px;
    right: 16px;
    bottom: 14px;
    max-width: none;
  }

  .shop-stage-caption h2 {
    font-size: 21px;
  }

  .shop-dashboard {
    grid-template-columns: 1fr;
  }

  .shop-note-grid {
    grid-template-columns: 1fr;
  }

  .shop-balance-line strong {
    font-size: 31px;
  }

  .shop-breakdown {
    grid-template-columns: 1fr 1fr;
  }

  .story-scene {
    min-height: 160px;
  }

  .story-scene > strong {
    font-size: 39px;
  }

  .story-copy p {
    font-size: 10px;
  }

  .top-resource.coin {
    max-width: 104px;
  }

  .top-resource.coin span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .odds-row {
    grid-template-columns: 1.2fr 0.55fr 1fr 0.8fr;
    gap: 4px;
    font-size: 8px;
  }

  .profile-hero {
    display: block;
    padding: 20px !important;
  }

  .profile-avatar {
    width: 56px !important;
    height: 56px !important;
    margin-bottom: 10px;
  }

  .profile-hero-copy h1 {
    font-size: 26px;
  }

  .profile-stats {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .profile-stat:nth-child(5) {
    grid-column: span 2;
  }

  .profile-section {
    padding: 16px !important;
  }

  .redeem-section-row {
    flex-wrap: wrap;
  }

  .redeem-section-copy {
    flex: 1;
    min-width: calc(100% - 62px);
  }

  .redeem-section-actions {
    width: 100%;
  }

  .redeem-section-actions .btn {
    flex: 1;
  }

  .dev-button-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dev-button-grid.chest {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .challenge-tier-grid {
    grid-template-columns: 1fr;
  }

  .challenge-lobby-banner {
    align-items: flex-start;
  }

  .challenge-lobby-banner > strong {
    font-size: 22px;
  }

  .challenge-lobby-foot {
    display: block;
  }

  .challenge-lobby-foot .text-link {
    margin-top: 7px;
  }

  .gacha-cinematic-core {
    width: 250px;
    height: 250px;
  }

  .gacha-ring.ring-c {
    width: 310px;
    height: 310px;
  }

  .gacha-summon-card {
    width: 105px;
    height: 165px;
  }

  .gacha-cinematic-copy {
    bottom: 9%;
  }

  .gacha-cinematic-copy strong {
    font-size: 20px;
  }

  .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-tab {
    height: 55px !important;
    border-radius: 10px !important;
    font-size: 8px !important;
  }

  .bottom-tab svg {
    width: 19px !important;
    height: 19px !important;
  }

  .bottom-tab.active {
    background: #edf5ff !important;
  }

  .bottom-tab.active::after {
    display: none;
  }

  .bottom-tab .nav-badge {
    top: 4px !important;
    right: calc(50% - 23px) !important;
  }

  .modal-card {
    border-radius: 18px !important;
  }

  .modal-card.wide {
    width: calc(100% - 20px) !important;
    max-height: 91vh !important;
  }

  .practice-hero,
  .mistake-hero {
    padding: 18px !important;
  }

  .practice-hero h2,
  .mistake-hero h2 {
    font-size: 21px !important;
  }
}

@media (max-width: 390px) {
  .wish-tab {
    min-width: 0;
    gap: 3px;
    font-size: 7.5px;
  }

  .wish-tab svg {
    width: 12px;
    height: 12px;
  }

  .wish-tab em {
    display: none;
  }

  .draw-price-grid {
    grid-template-columns: 1fr;
  }

  .draw-stage-art {
    height: 170px;
  }

  .home-hero h1 {
    font-size: 29px;
  }

  .profile-resource-row span {
    font-size: 7px;
  }
}

@media (max-width: 680px) {
  .chest-aggregate {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px;
  }

  .chest-aggregate-art {
    align-self: center;
    width: 100px;
    height: 100px;
  }

  .chest-aggregate-copy h3 {
    font-size: 18px;
  }

  .chest-aggregate-copy h3 strong {
    font-size: 22px;
  }

  .chest-aggregate-copy > .btn {
    width: 100%;
  }
}
