:root {
  --ink: #17202a;
  --ink-soft: #3b4753;
  --paper: #fffdf7;
  --paper-soft: #f5f0e6;
  --line: rgba(23, 32, 42, 0.14);
  --coral: #ff6f61;
  --sun: #ffc94a;
  --mint: #34c9a4;
  --sky: #6bc4ff;
  --violet: #7b61ff;
  --rose: #ff8fb3;
  --shadow: 0 22px 48px rgba(23, 32, 42, 0.15);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
  background:
    linear-gradient(rgba(23, 32, 42, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 42, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, #fffdf7 0%, #edf9f5 52%, #fff4ef 100%);
  background-size:
    44px 44px,
    44px 44px,
    auto;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255, 201, 74, 0.34), transparent 34%),
    linear-gradient(245deg, rgba(107, 196, 255, 0.3), transparent 40%),
    linear-gradient(180deg, transparent 56%, rgba(52, 201, 164, 0.17));
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

button,
select,
input {
  font: inherit;
}

button {
  border: 0;
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

button:hover {
  transform: translateY(-2px);
  filter: saturate(1.08);
}

button:active {
  transform: translateY(1px) scale(0.98);
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(123, 97, 255, 0.34);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 12px;
  z-index: 10;
  width: min(1180px, calc(100vw - 32px));
  min-height: 66px;
  margin: 12px auto 0;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #fff;
  background: rgba(23, 32, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(23, 32, 42, 0.18);
  backdrop-filter: blur(16px);
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  padding: 7px 10px;
  font-size: 1.05rem;
  font-weight: 900;
}

.logo-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--ink);
  background: linear-gradient(135deg, var(--sun), var(--mint));
  border-radius: 50%;
  font-size: 0.88rem;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.52);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.site-nav a {
  min-height: 40px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.92rem;
  font-weight: 850;
  background: rgba(255, 255, 255, 0.07);
}

.site-nav a:hover,
.site-nav a.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.site-nav .nav-play {
  color: var(--ink);
  background: var(--sun);
}

.site-nav .nav-play:hover,
.site-nav .nav-play.is-active {
  color: var(--ink);
  background: #ffe087;
}

.auth-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: max-content;
}

.auth-link,
.user-pill {
  min-height: 40px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 900;
}

.auth-link {
  color: var(--ink);
  background: #fff;
}

.auth-link.is-active {
  background: var(--sun);
}

.auth-button {
  border: 0;
}

.user-pill-button {
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.user-pill {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.site-main {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 58px;
}

.hero-scene {
  min-height: min(700px, calc(100vh - 118px));
  padding: clamp(24px, 5vw, 64px);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(310px, 0.72fr);
  align-items: center;
  gap: clamp(24px, 5vw, 70px);
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(115deg, rgba(23, 32, 42, 0.98) 0%, rgba(28, 52, 62, 0.94) 48%, rgba(52, 201, 164, 0.72) 100%);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-scene::before,
.subpage-hero::before {
  content: "";
  position: absolute;
  inset: 18px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

.hero-scene::after {
  content: "";
  position: absolute;
  right: -8%;
  bottom: -22%;
  width: 46%;
  aspect-ratio: 1;
  background: rgba(255, 201, 74, 0.22);
  border-radius: 50%;
}

.hero-copy,
.hero-poster {
  position: relative;
  z-index: 1;
}

.hero-copy {
  max-width: 700px;
}

.hero-poster {
  justify-self: end;
  width: min(100%, 430px);
}

.hero-poster img {
  display: block;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.24);
}

.word-hero-card {
  position: relative;
  z-index: 1;
  justify-self: end;
  width: min(100%, 430px);
  min-height: 430px;
  padding: clamp(22px, 4vw, 38px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(237, 249, 245, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.24);
}

.word-hero-card strong {
  display: block;
  font-size: clamp(3.2rem, 8vw, 5.8rem);
  line-height: 0.95;
}

.word-hero-card em {
  color: rgba(23, 32, 42, 0.58);
  font-size: 1.2rem;
  font-style: normal;
  font-weight: 850;
}

.word-hero-card p {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
}

.word-hero-card small {
  color: rgba(23, 32, 42, 0.62);
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.55;
}

.freq-tag,
.word-part {
  width: max-content;
  max-width: 100%;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  color: var(--ink);
  background: var(--sun);
  font-size: 0.8rem;
  font-weight: 950;
}

.eyebrow,
.mini-label {
  display: block;
  margin: 0 0 8px;
  color: rgba(23, 32, 42, 0.62);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-scene .eyebrow,
.subpage-hero .eyebrow {
  color: var(--sun);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.45rem, 7vw, 6rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy h1,
.subpage-hero h1 {
  font-size: clamp(2.9rem, 9.2vw, 7.2rem);
}

.hero-text,
.subpage-hero p,
.planner-intro {
  max-width: 40rem;
  margin: 20px 0 0;
  font-size: clamp(1.04rem, 2vw, 1.3rem);
  font-weight: 720;
  line-height: 1.72;
}

.hero-text,
.subpage-hero p {
  color: rgba(255, 255, 255, 0.82);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-link,
.secondary-link,
.primary-action {
  min-height: 50px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 900;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.primary-link,
.primary-action {
  color: var(--ink);
  background: var(--sun);
  box-shadow: 0 12px 26px rgba(255, 201, 74, 0.26);
}

.secondary-link {
  color: inherit;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.primary-link:hover,
.secondary-link:hover,
.feature-card:hover {
  transform: translateY(-3px);
}

.page-band,
.cta-band,
.timeline-band {
  margin-top: clamp(28px, 5vw, 58px);
  padding-top: clamp(22px, 4vw, 38px);
  border-top: 1px solid var(--line);
}

.intro-band {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr);
  align-items: end;
  gap: 28px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2,
.cta-band h2 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(1.9rem, 5vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric-row article {
  min-height: 116px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
}

.metric-row article:nth-child(2) {
  color: var(--ink);
  background: var(--mint);
}

.metric-row article:nth-child(3) {
  color: var(--ink);
  background: var(--rose);
}

.metric-row article:nth-child(4) {
  color: var(--ink);
  background: var(--sun);
}

.metric-row strong {
  font-size: 0.82rem;
  color: inherit;
}

.metric-row span {
  font-size: clamp(1.05rem, 2.4vw, 1.55rem);
  font-weight: 900;
  line-height: 1.05;
}

.link-grid,
.lesson-grid,
.album-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-card,
.lesson-card,
.album-card {
  min-height: 100%;
  padding: 18px;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(23, 32, 42, 0.08);
}

.feature-card {
  min-height: 248px;
  justify-content: space-between;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.feature-card:hover {
  box-shadow: 0 20px 36px rgba(23, 32, 42, 0.14);
  background: #fff;
}

.accent-card {
  color: #fff;
  background: var(--ink);
}

.accent-card:hover {
  background: #21313f;
}

.card-icon,
.asset-badge {
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 950;
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 22px;
  background: var(--sun);
  font-size: 1rem;
}

.feature-card:nth-child(2) .card-icon {
  background: var(--mint);
}

.feature-card:nth-child(3) .card-icon {
  background: var(--sky);
}

.asset-badge {
  width: 86px;
  height: 86px;
  margin-bottom: 18px;
  background:
    linear-gradient(135deg, rgba(255, 201, 74, 0.95), rgba(107, 196, 255, 0.82));
  font-size: 1.2rem;
}

.feature-card h3,
.lesson-card h2,
.album-card h2 {
  margin: 0 0 10px;
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  line-height: 1.08;
}

.feature-card p,
.lesson-card p,
.album-card p,
.routine-list span,
.plan-list span {
  margin: 0;
  color: rgba(23, 32, 42, 0.68);
  font-weight: 700;
  line-height: 1.66;
}

.accent-card p {
  color: rgba(255, 255, 255, 0.72);
}

.word-list-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.word-list-preview span {
  min-height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid var(--line);
  font-weight: 900;
}

.subpage-hero {
  min-height: 420px;
  padding: clamp(26px, 6vw, 60px);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: end;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(115deg, rgba(23, 32, 42, 0.96), rgba(30, 71, 78, 0.82)),
    linear-gradient(135deg, var(--mint), var(--sky));
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.subpage-hero::after {
  content: "Aa";
  position: absolute;
  right: clamp(22px, 7vw, 86px);
  top: clamp(30px, 8vw, 76px);
  color: rgba(255, 255, 255, 0.12);
  font-size: clamp(6rem, 19vw, 15rem);
  font-weight: 950;
  line-height: 1;
}

.subpage-hero > * {
  position: relative;
  z-index: 1;
}

.lesson-grid,
.album-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 20px;
}

.lesson-card,
.album-card {
  min-height: 286px;
  justify-content: start;
}

.routine-list,
.plan-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.routine-list li,
.plan-list li {
  padding: 16px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.routine-list strong,
.plan-list strong {
  font-size: 1.04rem;
}

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.planner-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 32px));
  min-height: calc(100vh - 102px);
  margin: 0 auto;
  padding: 28px 0 58px;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 0.58fr);
  gap: 18px;
  align-items: start;
}

.challenge-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 32px));
  min-height: calc(100vh - 102px);
  margin: 0 auto;
  padding: 28px 0 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: 18px;
  align-items: stretch;
}

.challenge-card {
  height: 100%;
  min-height: 640px;
  padding: clamp(20px, 4vw, 34px);
  background: rgba(255, 253, 247, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.challenge-card .section-heading p:last-child {
  max-width: 48rem;
  margin: 12px 0 0;
  color: rgba(23, 32, 42, 0.68);
  font-weight: 760;
  line-height: 1.65;
}

.play-palace {
  display: grid;
  align-content: start;
}

.coca-picker {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 14px;
}

.range-tabs {
  max-height: 430px;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  gap: 8px;
  background: rgba(23, 32, 42, 0.04);
  border-radius: 8px;
}

.range-tabs button {
  min-height: 46px;
  padding: 0 12px;
  text-align: left;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.9rem;
}

.range-tabs button.is-active {
  color: #fff;
  background: var(--ink);
}

.unit-picker-body {
  padding: 14px;
  display: grid;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.unit-picker-title {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.unit-picker-title span {
  color: rgba(23, 32, 42, 0.62);
  font-size: 0.9rem;
  font-weight: 780;
}

.unit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.unit-card {
  min-height: 98px;
  padding: 12px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(23, 32, 42, 0.08);
}

.unit-card span,
.unit-card strong,
.unit-card small {
  display: block;
}

.unit-card strong {
  font-size: 1.15rem;
}

.unit-card small {
  color: rgba(23, 32, 42, 0.6);
  font-weight: 850;
}

.unit-card.is-active {
  background: var(--sun);
}

.unit-card.is-locked {
  color: rgba(23, 32, 42, 0.68);
  background: rgba(255, 255, 255, 0.55);
}

.unit-card.is-locked strong::after {
  content: " 锁";
}

.game-pick-list {
  display: grid;
  gap: 14px;
}

.game-pick {
  min-height: 150px;
  padding: 18px;
  display: grid;
  align-content: space-between;
  gap: 14px;
  text-align: left;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(23, 32, 42, 0.08);
}

.game-pick.is-active {
  background: rgba(52, 201, 164, 0.14);
  border-color: rgba(52, 201, 164, 0.68);
}

.game-pick strong {
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1;
}

.game-pick span {
  color: rgba(23, 32, 42, 0.64);
  font-weight: 760;
  line-height: 1.6;
}

.challenge-start {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.start-challenge {
  min-height: 58px;
  width: min(360px, 100%);
  border-radius: 8px;
  color: var(--ink);
  background: var(--sun);
  font-size: 1.35rem;
  box-shadow: 0 14px 30px rgba(255, 201, 74, 0.28);
}

.challenge-start p {
  margin: 0;
  color: rgba(23, 32, 42, 0.62);
  font-weight: 820;
}

.game-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 86px 20px 28px;
  color: #fff;
  background: #0f172a;
  overflow: auto;
}

.game-overlay.is-hidden,
.overlay-panel.is-hidden,
.overlay-result.is-hidden {
  display: none;
}

.game-overlay-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 2;
  min-height: 74px;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.game-overlay-header strong {
  font-size: 1.4rem;
}

.overlay-close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 1.8rem;
  line-height: 1;
}

.overlay-panel {
  width: min(760px, 100%);
}

.review-game,
.spelling-game,
.flip-game,
.overlay-result {
  min-height: min(620px, calc(100vh - 140px));
  padding: clamp(22px, 5vw, 46px);
  align-content: center;
  gap: 18px;
  background:
    linear-gradient(135deg, rgba(23, 32, 42, 0.98), rgba(68, 54, 93, 0.88)),
    linear-gradient(135deg, var(--violet), var(--rose));
  border-radius: 8px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
}

.review-game,
.spelling-game,
.flip-game,
.overlay-result {
  display: grid;
}

.review-card {
  display: grid;
  gap: 18px;
}

.review-card h2 {
  margin: 0;
  font-size: clamp(3.4rem, 12vw, 8rem);
  line-height: 0.9;
}

.word-card-top,
.word-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.phonetic {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(1.1rem, 3vw, 1.7rem);
  font-weight: 850;
}

.word-detail {
  display: grid;
  gap: 8px;
}

.word-detail.is-hidden {
  display: none;
}

.word-detail strong {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
}

.word-detail p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 760;
}

.review-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.status-btn {
  min-height: 52px;
  padding: 0 14px;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(23, 32, 42, 0.1);
}

.status-btn.known {
  background: var(--mint);
}

.status-btn.unsure {
  background: var(--sun);
}

.status-btn.unknown {
  color: #fff;
  background: var(--coral);
}

.game-prompt {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.sound-orb {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  color: var(--ink);
  background: linear-gradient(135deg, var(--sun), #fff1a8);
  font-size: 2rem;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
}

.game-prompt strong,
.overlay-result strong {
  font-size: clamp(2rem, 6vw, 4.4rem);
  line-height: 1;
}

.game-prompt span:last-child,
.game-message,
.overlay-result p {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 820;
}

.spelling-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.spelling-input-row input {
  min-height: 58px;
  padding: 0 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 900;
}

.spelling-input-row input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.game-message {
  min-height: 1.6rem;
  margin: 0;
  text-align: center;
}

.flip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.flip-head strong {
  font-size: clamp(1.4rem, 4vw, 2.4rem);
}

.flip-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.flip-card {
  position: relative;
  aspect-ratio: 1;
  min-height: 92px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: transparent;
  perspective: 1000px;
  box-shadow: none;
  cursor: pointer;
}

.flip-inner {
  position: absolute;
  inset: 0;
  display: block;
  transform: rotateY(0deg);
  transform-origin: center;
  transform-style: preserve-3d;
  transition: transform 560ms cubic-bezier(0.2, 0.72, 0.24, 1);
  will-change: transform;
}

.flip-card .flip-front,
.flip-card .flip-back {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 8px;
  text-align: center;
  overflow-wrap: anywhere;
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.flip-card .flip-front {
  color: #fff;
  border-bottom: 4px solid rgba(0, 0, 0, 0.2);
  font-weight: 950;
  transform: rotateY(180deg);
  font-size: clamp(0.84rem, 2vw, 1.08rem);
}

.flip-card .flip-back {
  background: #6366f1;
  color: rgba(255, 255, 255, 0.55);
  border-bottom: 4px solid #4338ca;
  font-size: 1.8rem;
  font-weight: 950;
}

.flip-card.is-flipped .flip-inner {
  transform: rotateY(180deg);
}

.flip-card.is-matched {
  opacity: 0;
  pointer-events: none;
  transform: scale(0);
  transition: opacity 500ms ease, transform 500ms ease;
}

.flip-red { background: #ef4444; }
.flip-orange { background: #f97316; }
.flip-amber { background: #f59e0b; }
.flip-lime { background: #84cc16; }
.flip-emerald { background: #10b981; }
.flip-cyan { background: #06b6d4; }
.flip-blue { background: #3b82f6; }
.flip-violet { background: #8b5cf6; }
.flip-purple { background: #a855f7; }
.flip-pink { background: #ec4899; }
.flip-rose { background: #f43f5e; }
.flip-slate { background: #64748b; }

.vocab-stats {
  display: grid;
  gap: 10px;
}

.vocab-stats span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: rgba(23, 32, 42, 0.68);
  font-weight: 850;
}

.vocab-stats strong {
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
}

.save-state {
  margin: 0;
  color: rgba(23, 32, 42, 0.68);
  font-weight: 760;
  line-height: 1.6;
}

.panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.vip-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(23, 32, 42, 0.62);
  backdrop-filter: blur(10px);
}

.vip-modal.is-hidden {
  display: none;
}

.vip-dialog {
  position: relative;
  width: min(720px, 100%);
  padding: clamp(22px, 5vw, 42px);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
}

.vip-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(23, 32, 42, 0.08);
  font-size: 1.5rem;
  line-height: 1;
}

.vip-dialog h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.vip-copy {
  max-width: 34rem;
  margin: 14px 0 22px;
  color: rgba(23, 32, 42, 0.68);
  font-weight: 760;
  line-height: 1.65;
}

.vip-plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.vip-plans article {
  min-height: 130px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.vip-plans span {
  color: rgba(23, 32, 42, 0.62);
  font-weight: 900;
}

.vip-plans strong {
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1;
}

.vip-buy {
  min-height: 40px;
  margin-top: 12px;
  border-radius: 8px;
  background: var(--sun);
}

.vip-message {
  min-height: 1.5rem;
  margin: 14px 0 0;
  color: rgba(23, 32, 42, 0.62);
  font-weight: 850;
}

.member-modal {
  position: fixed;
  inset: 0;
  z-index: 52;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(23, 32, 42, 0.62);
  backdrop-filter: blur(10px);
}

.member-modal.is-hidden {
  display: none;
}

.member-dialog {
  position: relative;
  width: min(620px, 100%);
  padding: clamp(22px, 5vw, 38px);
  display: grid;
  gap: 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
}

.member-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(23, 32, 42, 0.08);
  font-size: 1.5rem;
  line-height: 1;
}

.member-dialog h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1;
}

.member-profile {
  padding: 14px;
  display: grid;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.member-profile strong {
  font-size: 1.2rem;
}

.member-profile span,
.member-menu span,
.member-message {
  color: rgba(23, 32, 42, 0.62);
  font-weight: 780;
}

.member-menu {
  display: grid;
  gap: 10px;
}

.member-menu button {
  min-height: 76px;
  padding: 14px;
  display: grid;
  gap: 5px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(23, 32, 42, 0.08);
}

.member-menu button:hover {
  background: rgba(52, 201, 164, 0.12);
}

.member-menu button.is-active {
  background: rgba(52, 201, 164, 0.16);
  border-color: rgba(52, 201, 164, 0.68);
}

.member-menu strong {
  font-size: 1.08rem;
}

.member-message {
  min-height: 1.5rem;
  margin: 0;
}

.member-detail {
  display: grid;
  gap: 10px;
}

.member-info-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.member-info-grid span,
.wallet-total span,
.member-list span,
.empty-member-state {
  color: rgba(23, 32, 42, 0.62);
  font-weight: 780;
}

.member-info-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.wallet-total {
  padding: 16px;
  display: grid;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.wallet-total strong {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  line-height: 1;
}

.member-list {
  display: grid;
  gap: 10px;
}

.member-list article {
  padding: 14px;
  display: grid;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.empty-member-state {
  margin: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 58px;
}

.auth-hero {
  min-height: 360px;
  padding: clamp(26px, 6vw, 60px);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: end;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(115deg, rgba(23, 32, 42, 0.97), rgba(68, 54, 93, 0.84)),
    linear-gradient(135deg, var(--violet), var(--rose));
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-hero::before {
  content: "";
  position: absolute;
  inset: 18px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

.auth-hero::after {
  content: "@";
  position: absolute;
  right: clamp(24px, 8vw, 92px);
  top: clamp(28px, 7vw, 70px);
  color: rgba(255, 255, 255, 0.12);
  font-size: clamp(7rem, 22vw, 16rem);
  font-weight: 950;
  line-height: 1;
}

.auth-hero > * {
  position: relative;
  z-index: 1;
}

.auth-hero .eyebrow {
  color: var(--sun);
}

.auth-hero h1 {
  max-width: 860px;
  font-size: clamp(2.8rem, 8vw, 6.4rem);
}

.auth-hero p:last-child {
  max-width: 42rem;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1.04rem, 2vw, 1.26rem);
  font-weight: 720;
  line-height: 1.72;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.auth-card {
  padding: clamp(20px, 4vw, 34px);
  display: grid;
  gap: 16px;
  background: rgba(255, 253, 247, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(23, 32, 42, 0.08);
}

.accent-auth-card {
  background: rgba(237, 249, 245, 0.92);
}

.auth-card h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1;
}

.auth-card label {
  display: grid;
  gap: 8px;
  font-weight: 850;
}

.auth-card label span {
  color: rgba(23, 32, 42, 0.66);
  font-size: 0.9rem;
}

.auth-card input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 760;
}

.form-message {
  min-height: 1.5rem;
  margin: 0;
  color: var(--coral);
  font-weight: 850;
}

.auth-mobile-shell {
  min-height: calc(100vh - 142px);
  display: grid;
  place-items: center;
}

.phone-auth-card {
  width: min(460px, 100%);
  padding: clamp(24px, 5vw, 38px);
  display: grid;
  gap: 18px;
  background: rgba(255, 253, 247, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.phone-auth-card h1,
.auth-dialog-panel h2 {
  margin: 0;
  font-size: clamp(2.2rem, 8vw, 3.5rem);
  line-height: 1;
}

.auth-channel-tabs {
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  background: rgba(23, 32, 42, 0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auth-channel-tabs button {
  min-height: 42px;
  border-radius: 8px;
  background: transparent;
  color: rgba(23, 32, 42, 0.62);
}

.auth-channel-tabs button.is-active {
  color: #fff;
  background: var(--ink);
}

.mobile-auth-form {
  display: grid;
  gap: 15px;
}

.mobile-auth-form label {
  display: grid;
  gap: 8px;
  font-weight: 850;
}

.mobile-auth-form .auth-field-hidden {
  display: none;
}

.mobile-auth-form label > span {
  color: rgba(23, 32, 42, 0.66);
  font-size: 0.9rem;
}

.mobile-auth-form input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.code-button {
  min-width: 118px;
  min-height: 52px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--mint);
}

.code-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.2);
  opacity: 0.65;
}

.auth-submit {
  width: 100%;
  min-height: 54px;
}

.auth-agreement,
.check-line {
  margin: 0;
  color: rgba(23, 32, 42, 0.62);
  font-size: 0.9rem;
  font-weight: 780;
  line-height: 1.6;
}

.auth-agreement button,
.check-line button,
.auth-card-foot button {
  padding: 0;
  color: var(--violet);
  background: transparent;
  font-weight: 900;
}

.check-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.check-line input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
  accent-color: var(--mint);
}

.auth-card-foot {
  display: flex;
  justify-content: center;
  gap: 8px;
  color: rgba(23, 32, 42, 0.62);
  font-weight: 850;
}

.auth-dialog {
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(23, 32, 42, 0.58);
  backdrop-filter: blur(10px);
}

.auth-dialog.is-hidden {
  display: none;
}

.auth-dialog-panel {
  position: relative;
  width: min(460px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow-y: auto;
  padding: clamp(24px, 5vw, 36px);
  display: grid;
  gap: 17px;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(23, 32, 42, 0.08);
  font-size: 1.6rem;
  line-height: 1;
}

.legal-panel {
  width: min(680px, 100%);
}

.legal-copy {
  display: grid;
  gap: 10px;
  color: rgba(23, 32, 42, 0.78);
  font-weight: 760;
  line-height: 1.72;
}

.legal-copy p {
  margin: 0;
}

.planner-panel,
.plan-result {
  background: rgba(255, 253, 247, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.planner-panel {
  padding: clamp(24px, 5vw, 54px);
}

.planner-panel h1 {
  max-width: 780px;
}

.planner-intro {
  color: rgba(23, 32, 42, 0.72);
}

.planner-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-top: 32px;
}

.planner-form label {
  display: grid;
  gap: 8px;
  font-weight: 850;
}

.planner-form span {
  color: rgba(23, 32, 42, 0.66);
  font-size: 0.9rem;
}

.planner-form select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 820;
}

.plan-result {
  position: sticky;
  top: 96px;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.score-pill {
  min-width: 132px;
  padding: 14px;
  text-align: center;
  color: var(--ink);
  background: var(--sun);
  border: 1px solid rgba(23, 32, 42, 0.12);
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(255, 201, 74, 0.24);
}

.score-pill span {
  display: block;
  color: rgba(23, 32, 42, 0.64);
  font-size: 0.78rem;
  font-weight: 900;
}

.score-pill strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.site-footer {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 32px));
  margin: -36px auto 22px;
  padding: 14px 16px;
  display: grid;
  gap: 10px;
  text-align: center;
  color: rgba(23, 32, 42, 0.62);
  font-size: 0.86rem;
  font-weight: 800;
  background: rgba(255, 253, 247, 0.62);
  border: 1px solid rgba(23, 32, 42, 0.1);
  border-radius: 8px;
}

.footer-company,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
}

.footer-company strong {
  color: var(--ink);
}

.site-footer a,
.site-footer button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.62);
  border: 1px solid rgba(23, 32, 42, 0.1);
  color: rgba(23, 32, 42, 0.72);
  font-size: 0.86rem;
  font-weight: 900;
}

.site-footer button {
  cursor: pointer;
}

@media (max-width: 960px) {
  .hero-scene,
  .planner-shell,
  .challenge-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-poster,
  .word-hero-card {
    justify-self: start;
    width: min(100%, 520px);
  }

  .intro-band {
    grid-template-columns: 1fr;
  }

  .metric-row,
  .lesson-grid,
  .album-grid,
  .unit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .coca-picker {
    grid-template-columns: 1fr;
  }

  .range-tabs {
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .link-grid,
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .planner-form {
    grid-template-columns: 1fr 1fr;
  }

  .planner-form .primary-action {
    grid-column: 1 / -1;
  }

  .plan-result {
    position: static;
  }

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

@media (max-width: 640px) {
  .site-header,
  .site-main,
  .planner-shell,
  .challenge-shell,
  .auth-shell,
  .site-footer {
    width: min(100vw - 20px, 1180px);
  }

  .site-header {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .auth-actions {
    justify-content: stretch;
  }

  .site-nav a,
  .auth-link,
  .user-pill {
    flex: 1 1 calc(50% - 8px);
    padding-inline: 8px;
  }

  .site-main,
  .planner-shell,
  .challenge-shell,
  .auth-shell {
    padding-top: 14px;
  }

  .hero-scene,
  .planner-panel,
  .challenge-card,
  .auth-hero {
    padding: 24px;
  }

  .hero-scene::before,
  .subpage-hero::before,
  .auth-hero::before {
    inset: 10px;
  }

  .hero-copy h1,
  .subpage-hero h1,
  .auth-hero h1 {
    font-size: clamp(2.7rem, 15vw, 4.8rem);
  }

  .hero-actions,
  .cta-band {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-link,
  .secondary-link,
  .primary-action {
    width: 100%;
  }

  .metric-row,
  .lesson-grid,
  .album-grid,
  .unit-grid,
  .range-tabs,
  .flip-grid,
  .planner-form,
  .review-actions,
  .vip-plans {
    grid-template-columns: 1fr;
  }

  .unit-picker-title,
  .flip-head,
  .code-row,
  .spelling-input-row {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .routine-list li,
  .plan-list li {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .subpage-hero {
    min-height: 360px;
  }
}
