@font-face {
  font-family: "DM Sans";
  src: url("/assets/dm-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #12284a;
  --muted: #4b6178;
  --white: #fff;
  --sky: #eaf5ff;
  --sky-strong: #ceeaff;
  --mint: #dff8e8;
  --mint-strong: #c5f1d7;
  --lilac: #f1ebff;
  --green: #168043;
  --green-dark: #0e6333;
  --line: #dbe6ee;
  --round: 26px;
  --width: 1216px;
  --shadow: 0 16px 35px #1937500c;
  --header-inset: 12px;
  --header-clearance: 102px;
  --puzzle-checking: #7250b7;
  --puzzle-guarded: #ffe6ab;
  --puzzle-blocked: #d9e8ff;
}

* { box-sizing: border-box; }
html { scroll-padding-top: var(--header-clearance); }
body {
  min-width: 0;
  margin: 0;
  background:
    radial-gradient(ellipse 84% 100% at 5% 0%, #e8f2fa, #e8f2fa00),
    radial-gradient(ellipse 82% 100% at 95% 0%, #e7f5ec, #e7f5ec00),
    var(--white);
  background-repeat: no-repeat;
  background-size: 100% clamp(860px, 96vw, 1340px);
  color: var(--ink);
  font: 16px/1.55 "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#app { min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; }
main:focus { outline: none; }
.route-enter { animation: route-enter .3s ease-out; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, input, select, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; background: none; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #7761cb;
  outline-offset: 4px;
}
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { letter-spacing: -.045em; line-height: 1.09; font-weight: 750; }
h1 { font-size: clamp(36px, 4vw, 56px); }
h2 { font-size: clamp(24px, 2.8vw, 38px); }
h3 { font-size: 20px; }
em { font-family: Georgia, serif; font-weight: 500; color: var(--green-dark); }
small { font-size: 13px; }
img, svg { vertical-align: middle; }
svg.icon { width: 21px; height: 21px; flex: none; }
.section-width { width: min(var(--width), calc(100% - 72px)); margin-inline: auto; }

.skip {
  position: fixed; z-index: 100; left: 18px; top: 10px; padding: 12px 18px;
  background: var(--green-dark); color: white; border-radius: 14px; transform: translateY(-150%);
}
.skip:focus { transform: translateY(0); }
.avatar { border-radius: 50%; width: 48px; height: 48px; object-fit: cover; flex: none; background: var(--sky); }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  width: fit-content; min-height: 50px; padding: 12px 22px; border-radius: 99px;
  font-weight: 700; line-height: 1.25; text-align: center; font-size: 15px;
  border: 1px solid transparent; transition: background .18s, box-shadow .18s, transform .18s;
}
.button svg { width: 18px; height: 18px; transition: translate .18s ease; }
.button:not(:disabled):hover > .icon { translate: 3px 0; }
.button.primary { background: var(--green); color: white; box-shadow: 0 3px 0 #0e63332b; }
.button.primary:hover:not(:disabled) { background: var(--green-dark); transform: translateY(-1px); }
.button.outline { background: #fff; border-color: #bacedc; color: var(--ink); }
.button.outline:hover:not(:disabled), .button.white:hover:not(:disabled) { background: #f5fbff; border-color: #95baca; }
.button.white { background: white; border-color: white; }
.button:not(:disabled):active { transform: translateY(1px); }
.button.compact { min-height: 44px; padding: 9px 17px; font-size: 14px; }
.text-link {
  display: inline-flex; align-items: center; gap: 7px; min-height: 42px;
  padding: 0; font-weight: 650; font-size: 14px;
}
.text-link .icon { width: 16px; height: 16px; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.tone-0 { background: var(--mint); }
.tone-1 { background: var(--sky); }
.tone-2 { background: var(--lilac); }

.topbar {
  position: sticky; top: max(var(--header-inset), env(safe-area-inset-top)); z-index: 30;
  flex: none; width: min(1320px, calc(100% - 48px));
  margin: max(var(--header-inset), env(safe-area-inset-top)) auto 0;
  border: 1px solid #dbe6eec9; border-radius: 999px; background: rgb(250 253 255 / 84%);
  box-shadow: 0 5px 24px #22466713, inset 0 1px 0 #ffffffb3;
  -webkit-backdrop-filter: blur(15px) saturate(120%);
  backdrop-filter: blur(15px) saturate(120%);
}
.topbar-inner {
  min-height: 74px; padding-inline: clamp(18px, 2.5vw, 34px);
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
}
.brand { display: block; flex: none; }
.brand-image { width: 132px; height: auto; }
.site-nav, .club-nav, .session-nav { display: flex; align-items: center; }
.site-nav { gap: clamp(15px, 1.9vw, 30px); font-size: 15px; font-weight: 650; white-space: nowrap; }
.site-nav > a, .site-nav .play-menu > summary { display: flex; align-items: center; gap: 5px; min-height: 44px; border-radius: 9px; }
.site-nav a:hover, .site-nav a[aria-current="page"], .play-menu > summary:hover { color: var(--green-dark); }
.site-lingua-link .icon { width: 16px; height: 16px; }
.external-arrow { transform: rotate(-40deg); }
.play-menu { position: relative; }
.play-menu > summary { cursor: pointer; list-style: none; }
.play-menu > summary::-webkit-details-marker { display: none; }
.play-menu-chevron { width: 16px; height: 16px; transform: rotate(90deg); transition: transform .15s ease; }
.play-menu[open] > summary .play-menu-chevron { transform: rotate(-90deg); }
.site-nav .play-menu-panel {
  position: absolute; inset-block-start: calc(100% + 8px); inset-inline-start: -13px; min-width: 184px; width: max-content;
  padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: white;
  box-shadow: 0 12px 34px #22466724; animation: route-enter .15s ease-out;
}
.play-menu-panel a { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 6px 10px; border-radius: 10px; font-size: 14px; }
.play-menu-panel a:is(:hover, [aria-current="page"]) { background: var(--mint); color: var(--green-dark); }
.play-menu-panel a .icon { width: 18px; height: 18px; color: var(--green-dark); }
.club-nav { gap: 4px; padding: 4px; border: 1px solid #e5eef4; border-radius: 99px; background: #f1f7fb; }
.club-nav a {
  display: flex; align-items: center; gap: 7px; min-height: 42px;
  padding: 9px clamp(10px, 1.1vw, 15px); border-radius: 99px;
  color: #435b75; font-size: 13px; font-weight: 700; white-space: nowrap;
}
.club-nav a[aria-current="page"] { background: var(--mint); color: var(--green-dark); }
.club-nav a:hover { color: var(--green-dark); }
.club-nav .icon { width: 18px; height: 18px; }
.session-nav { min-inline-size: 0; gap: clamp(8px, 1.15vw, 16px); white-space: nowrap; }
.header-account { min-inline-size: 0; gap: 7px; }
.header-account > .icon { width: 17px; height: 17px; }
.header-account .avatar { flex: none; width: 24px; height: 24px; border: 1px solid white; }
.header-account-name { min-inline-size: 0; max-inline-size: min(9rem, 28vw); overflow: hidden; text-overflow: ellipsis; }
.language-flag {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  box-shadow: 0 0 0 1px #12284a24;
}
.language-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  flex: none; min-width: 42px; min-height: 42px;
  padding: 0 10px; border-radius: 99px; border: 1px solid var(--line); background: white;
  color: var(--ink); font-size: 12px; font-weight: 800;
}
.language-toggle .language-flag { width: 20px; height: 20px; }
.language-toggle:hover { background: var(--sky); border-color: #a9c3d7; }
.xp-pill {
  display: inline-flex; align-items: center; gap: 6px; background: var(--mint);
  color: var(--green-dark); border-radius: 99px; padding: 7px 12px; font-weight: 800; font-size: 13px;
  white-space: nowrap;
}
.xp-pill .icon { width: 17px; height: 17px; }
.mobile-menu { display: none; }

.landing-hero { width: min(1296px, calc(100% - 48px)); padding-block: clamp(22px, 3.5vw, 46px); }
.landing-stage {
  position: relative; isolation: isolate; display: grid; align-items: center; overflow: hidden;
  min-height: clamp(456px, 44vw, 545px); border-radius: 38px; background: #e0e9fc;
}
.landing-copy {
  position: relative; z-index: 1; width: max-content; max-width: 46%;
  padding: 42px clamp(30px, 4.35vw, 64px);
}
.landing-label {
  display: flex; align-items: center; gap: 8px; color: #23456c;
  font-size: 14px; font-weight: 800;
}
.landing-label .icon { width: 18px; height: 18px; }
.landing-copy h1 {
  font-size: clamp(38px, 4.1vw, 58px); margin: 15px 0 17px;
  line-height: 1.06; letter-spacing: -.05em; overflow-wrap: anywhere;
}
.landing-copy h1 em {
  display: block; margin-top: 4px; font-size: .76em; line-height: 1.13;
  letter-spacing: -.045em; text-wrap: balance;
}
.hero-description { font-size: 18px; color: #304b66; max-width: 40ch; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.hero-actions .button { min-height: 52px; }
.home-resume-caption { color: #365475; font-size: 14px; font-weight: 700; margin-top: 9px; }
.landing-buddies {
  display: inline-flex; align-items: center; gap: 10px; min-height: 45px; margin-top: 21px;
  color: #253e62; font-size: 14px; font-weight: 750;
}
.landing-buddies:hover { color: var(--green-dark); text-decoration: underline; text-underline-offset: 4px; }
.landing-buddies > .icon { width: 13px; height: 13px; }
.landing-buddy-portraits { display: flex; flex: none; }
.landing-buddy-portraits .avatar { width: 33px; height: 33px; border: 2px solid #f7fbff; }
.landing-buddy-portraits .avatar + .avatar { margin-inline-start: -8px; }
.landing-art {
  position: absolute; inset: 0 0 0 18%; overflow: hidden;
}
.landing-art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, #e0e9fc 0%, #e0e9fcdf 8%, transparent 34%);
  pointer-events: none;
}
.landing-art picture { display: block; width: 100%; height: 100%; }
.landing-art img { width: 100%; height: 100%; object-fit: cover; object-position: right 24%; }
.route-enter .landing-art img { animation: scene-enter .65s ease-out; }

.land-learning { background: #f0f8ff; padding-block: 48px 54px; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 24px; }
.section-title p { margin-top: 9px; color: var(--muted); }
.lesson-showcase { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 16px; }
.lesson-showcase-art {
  display: block; width: 100%; height: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: var(--round); background: var(--mint);
}
.lesson-previews { display: grid; grid-auto-rows: 1fr; gap: 12px; }
.lesson-preview {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 15px;
  min-height: 100px; border-radius: var(--round); padding: 18px; background: var(--white);
  border: 1px solid #deebf4; box-shadow: var(--shadow); transition: transform .18s;
}
.lesson-preview:hover, .lesson-card:hover, .option:hover { transform: translateY(-3px); }
.lesson-preview p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.preview-piece { display: grid; place-items: center; width: 61px; height: 65px; background: var(--mint); border-radius: 19px; }
.lesson-preview.tone-1 .preview-piece { background: var(--sky-strong); }
.lesson-preview.tone-2 .preview-piece { background: var(--lilac); }
.chess-piece { width: 78%; height: 78%; filter: drop-shadow(0 2px 1px #15362d32); pointer-events: none; }

.landing-features { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding-block: 60px; }
.feature {
  position: relative; isolation: isolate; overflow: hidden; min-height: 286px;
  border-radius: var(--round); display: flex; align-items: center; padding: 33px;
}
.feature.feature-bao {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
  align-items: stretch; padding: 0; background: var(--sky);
}
.feature-heroes { background: var(--lilac); }
.feature-heroes .feature-copy { position: relative; z-index: 1; width: min(64%, 315px); }
.feature-bao .feature-copy { align-self: center; padding: clamp(19px, 2.5vw, 33px); }
.feature-bao-art { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.feature p { color: var(--muted); margin: 12px 0 18px; }
.feature-friends { position: absolute; right: -7px; bottom: 4px; width: 200px; height: 170px; }
.feature-friends img { position: absolute; width: 99px; height: 99px; border: 4px solid white; }
.feature-friends img:nth-child(1) { left: 8px; bottom: 4px; transform: rotate(-9deg); }
.feature-friends img:nth-child(2) { right: 12px; bottom: 20px; transform: rotate(9deg); }
.feature-friends img:nth-child(3) { right: 53px; bottom: 77px; }
.parent-strip {
  display: flex; align-items: center; gap: 19px; border-top: 1px solid var(--line);
  padding-block: 28px 42px;
}
.parent-strip > .icon { color: var(--green-dark); width: 29px; height: 29px; }
.parent-strip h2 { font-size: 25px; }
.parent-strip p { color: var(--muted); margin-top: 4px; }
.parent-strip .button { margin-inline-start: auto; flex: none; }

.landing-leaders, .landing-together { padding-bottom: clamp(33px, 4.7vw, 59px); }
.landing-puzzle { padding-top: clamp(30px, 4.6vw, 58px); }
.daily-puzzle-card {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 390px);
  grid-template-areas: "intro board" "actions board";
  gap: 22px clamp(28px, 6vw, 90px); padding: clamp(26px, 4vw, 58px);
  border: 1px solid #e3dcf5; border-radius: clamp(24px, 3.4vw, 39px);
  background: linear-gradient(130deg, #f2ecff, #eef1ff 62%, #e6f7f2);
}
.daily-puzzle-card.archived { background: linear-gradient(130deg, #edf8ff, #edf0ff 72%, #f4efff); }
.daily-puzzle-card:has(.puzzle-load-state) { display: block; }
.puzzle-load-state h2 { font-size: clamp(26px, 3.2vw, 36px); }
.puzzle-load-state p { margin-top: 8px; color: var(--muted); }
.puzzle-intro { grid-area: intro; align-self: end; }
.puzzle-date { display: flex; gap: 8px; align-items: center; color: #55477e; font-size: 14px; font-weight: 750; }
.puzzle-date .icon { width: 19px; height: 19px; }
.puzzle-intro h2 { font-size: clamp(32px, 4.6vw, 56px); margin-top: 11px; }
.puzzle-objective { color: var(--muted); font-size: clamp(16px, 1.6vw, 21px); margin-top: 7px; }
.puzzle-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.puzzle-turn, .puzzle-xp, .puzzle-difficulty, .puzzle-theme {
  display: flex; align-items: center; gap: 7px; padding: 6px 11px;
  border-radius: 99px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 750;
}
.puzzle-difficulty { width: fit-content; white-space: nowrap; }
.puzzle-difficulty.level-easy { background: #dcf5e6; color: #245f3b; }
.puzzle-difficulty.level-medium { background: #fff1d6; color: #76501b; }
.puzzle-difficulty.level-hard { background: #ede1fc; color: #5d4083; }
.puzzle-theme { width: fit-content; max-width: 100%; background: #e5f0fc; color: #2d5077; }
.puzzle-side { width: 12px; height: 12px; flex: none; border-radius: 50%; border: 1px solid #7c90a6; background: #f3faff; }
.puzzle-side.black { border-color: #354355; background: #354355; }
.puzzle-xp { background: #ffe8a9; color: #604207; }
.puzzle-xp.earned { background: #d9f7e4; color: var(--green-dark); }
.puzzle-xp .icon { width: 16px; height: 16px; }
.puzzle-board { grid-area: board; align-self: center; min-width: 0; }
.puzzle-actions { grid-area: actions; align-self: start; }
.puzzle-coach {
  display: flex; align-items: center; gap: 12px; max-width: 450px; min-height: 62px;
  padding: 10px 14px 10px 10px; border-radius: 18px; background: #ffffffc9;
  color: var(--ink); font-size: 15px;
}
.puzzle-coach.earned { color: var(--green-dark); background: #effcf4; }
.puzzle-coach .avatar { width: 40px; height: 40px; }
.puzzle-coach-copy { min-width: 0; }
.puzzle-explain-toggle { min-height: 44px; color: var(--green-dark); text-align: start; }
.puzzle-explanation {
  max-width: 450px; margin-top: 10px; padding: 13px 15px;
  border: 1px solid #dbe4f4; border-radius: 16px; background: #fff;
  color: var(--ink); font-size: 14px;
}
.puzzle-explanation > p { white-space: pre-line; overflow-wrap: anywhere; }
.puzzle-explanation-key {
  display: flex; flex-wrap: wrap; gap: 5px 14px;
  list-style: none; margin: 9px 0 0; padding: 0; color: var(--muted); font-size: 12px;
}
.puzzle-explanation-key li { display: flex; align-items: center; gap: 6px; }
.puzzle-review-marker { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.puzzle-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; margin-top: 13px; }
.puzzle-announcement { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.puzzles-page { padding-block: clamp(23px, 3.6vw, 46px) clamp(36px, 5vw, 64px); }
.premium-page { padding-block: clamp(23px, 3.6vw, 46px) clamp(36px, 5vw, 64px); }
.premium-hero {
  display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
  align-items: stretch; overflow: hidden; border-radius: var(--round); background: linear-gradient(135deg, #e9f4ff, #e9e5fd);
}
.premium-hero-copy { align-self: center; padding: clamp(25px, 4.5vw, 60px); }
.premium-hero h1 { margin-block: 10px 14px; font-size: clamp(34px, 4.7vw, 65px); line-height: 1.02; overflow-wrap: anywhere; }
.premium-hero-copy > p { font-size: clamp(16px, 1.65vw, 21px); color: var(--muted); }
.premium-hero img { width: 100%; height: 100%; min-height: 270px; object-fit: cover; }
.premium-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-block: clamp(16px, 3vw, 34px); }
.premium-card { padding: clamp(20px, 3vw, 34px); border: 1px solid var(--line); border-radius: 24px; background: var(--white); }
.premium-card h2, .premium-card h3 { margin: 0 0 8px; }
.premium-card p { margin: 0 0 12px; }
.premium-paid { background: #edf8f0; border-color: #cfe6d6; }
.premium-benefits { display: grid; gap: 8px; padding: 0; margin-block: 14px 18px; list-style: none; }
.premium-benefits li { display: flex; align-items: flex-start; gap: 10px; font-weight: 650; }
.premium-benefits svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--green-dark); }
#premium-training { scroll-margin-top: 110px; }
.premium-exercises { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 14px 18px; }
.premium-exercise {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 3px 9px; min-height: 44px;
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 13px; font-weight: 750;
}
.premium-exercise:hover, .premium-exercise[aria-current="page"] { background: #eaf8ef; border-color: #a5cdb2; }
.premium-exercise small { color: var(--green-dark); }
.premium-training { max-width: none; }
.premium-review { margin-top: 22px; }
.premium-access { max-width: 590px; margin-top: 14px; }
.membership-panel .identity-actions { flex-wrap: wrap; gap: 8px; }
.membership-status { font-weight: 750; color: var(--green-dark); }
.premium-checkout { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.premium-checkout label { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.premium-feedback { color: var(--green-dark); font-weight: 700; }
@media (max-width: 700px) {
  .premium-hero, .premium-plans { grid-template-columns: minmax(0, 1fr); }
  .premium-hero img { min-height: 0; height: auto; }
}
.puzzle-page-links { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.practice-card { background: linear-gradient(130deg, #eaf9ed, #edf8ff 66%, #f3eeff); }
.practice-progress { display: grid; gap: 5px; max-width: 250px; color: var(--green-dark); font-size: 13px; font-weight: 750; }
.practice-progress progress { background: #dcece8; }
.practice-progress progress::-webkit-progress-bar { background: #dcece8; }
.practice-card .practice-progress { margin-top: 13px; }
.practice-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin: 0; padding: 0; list-style: none; }
.practice-series-link, .practice-complete {
  display: flex; align-items: center; gap: 13px; padding: clamp(14px, 2vw, 23px);
  border: 1px solid #dbe8ef; border-radius: 23px; background: var(--sky);
}
.practice-series-link:hover { border-color: #98bea7; background: #eaf8ef; }
.practice-series-copy { display: grid; gap: 6px; flex: 1; min-width: 0; }
.practice-series-copy > strong { overflow-wrap: anywhere; font-size: clamp(16px, 2vw, 22px); }
.practice-series-link > .icon { flex: none; color: var(--muted); }
.practice-piece {
  display: grid; place-items: center; width: 54px; height: 54px; flex: none;
  border-radius: 16px; background: #e1f3e8;
}
.practice-piece svg { width: 37px; height: 37px; }
.practice-complete { align-items: start; background: #edf9f1; }
.puzzle-archive { margin-top: clamp(26px, 4.2vw, 50px); }
.puzzle-archive-toolbar { display: grid; gap: 14px; }
.puzzle-archive-heading {
  display: grid; grid-template-columns: minmax(0, 1fr) min(43%, 264px); align-items: center;
  overflow: hidden; border-radius: 22px; background: var(--lilac);
}
.puzzle-archive-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; min-width: 0; padding: clamp(14px, 3vw, 30px); }
.puzzle-archive-art { width: 100%; height: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.puzzle-archive-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; min-width: 0; }
.archive-select {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 14px; font-weight: 750;
}
.archive-select select {
  min-height: 44px; max-width: 100%; padding: 7px 10px;
  border: 1px solid #bacedc; border-radius: 12px; background: white; color: var(--ink);
}
.puzzle-archive-count {
  display: flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 99px;
  background: var(--mint); color: var(--green-dark); font-size: 13px; font-weight: 750;
}
.puzzle-archive-count .icon { width: 15px; height: 15px; }
.puzzle-archive-count[hidden] { display: none; }
.puzzle-archive-sync:not([hidden]) {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px;
  color: var(--muted); font-size: 14px;
}
.puzzle-archive-list {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
  list-style: none; margin: 16px 0 0; padding: 0;
}
.puzzle-archive-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 13px; min-height: 62px;
  border: 1px solid var(--line); border-radius: 16px; background: #f9fcff;
  font-size: 15px; font-weight: 750; transition: background .18s, border-color .18s;
}
.puzzle-archive-link:hover { border-color: #a9c3d7; background: var(--sky); }
.puzzle-archive-link[aria-current="page"] { border-color: #8dbca2; background: #ebf9f0; }
.archive-entry-copy { display: flex; align-items: center; flex-wrap: wrap; flex: 1; gap: 4px 7px; min-width: 0; }
.archive-entry-copy :is(.puzzle-difficulty, .puzzle-theme) { padding: 3px 7px; font-size: 12px; }
.archive-date-icon {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px;
  border-radius: 11px; background: #e9efff; color: #4e5890;
}
.archive-date-icon .icon, .puzzle-archive-link .archive-chevron { width: 17px; height: 17px; }
.archive-solved {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px;
  border-radius: 99px; background: var(--mint); color: var(--green-dark);
  font-size: 12px; white-space: nowrap;
}
.archive-solved[hidden] { display: none; }
.archive-solved .icon { width: 13px; height: 13px; }
.puzzle-archive-link .archive-chevron { color: var(--muted); }
.puzzle-archive [data-action="archive-older"] { margin-top: 16px; }
.archive-empty { margin-top: 13px; padding: 18px 20px; border-radius: 16px; background: var(--sky); color: var(--muted); }
.archive-calendar-state { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 15px; }
.home-leaders-content { min-height: 85px; }
.home-leaders-status { padding: 22px; border-radius: 19px; background: var(--sky); color: var(--muted); }
.home-leaders-empty {
  display: flex; align-items: center; gap: clamp(14px, 3vw, 30px); min-height: 153px;
  padding: clamp(16px, 2.5vw, 28px); border: 1px solid #d4e9e0; border-radius: var(--round);
  background: linear-gradient(112deg, #e7faef, #f3fbff);
}
.home-leaders-empty h3 { font-size: clamp(21px, 2.4vw, 29px); }
.home-leaders-empty p { color: var(--muted); margin-block: 5px 13px; }
.home-leaders-art { width: clamp(76px, 13vw, 133px); flex: none; }
.home-leader-list, .landing-together-grid { display: grid; gap: 14px; }
.home-leader-list { grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; padding: 0; margin: 0; }
.home-leader-list li {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 85px; padding: 13px; border: 1px solid #dce8f0; border-radius: 20px; background: #f8fcff;
}
.home-leader-list li:first-child .leaderboard-rank { background: #fff0c6; color: #634710; }
.home-leader-list .avatar { width: 44px; height: 44px; }
.home-leader-player { line-height: 1.3; overflow-wrap: anywhere; }
.home-leader-player small, .home-leader-rating small { display: block; color: var(--muted); }
.home-leader-rating { text-align: end; font-variant-numeric: tabular-nums; }
.home-leader-rating strong { display: block; color: var(--green-dark); font-size: 22px; line-height: 1.2; letter-spacing: -.04em; }
.home-leader-rating small { font-size: 12px; line-height: 1.2; }
.landing-together-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-play-card {
  display: flex; flex-direction: column; overflow: hidden; border: 1px solid #dce8f0;
  border-radius: var(--round); background: #f2f9ff;
}
.home-play-card:nth-child(2) { background: #f4efff; border-color: #e8e0f5; }
.home-play-art { width: 100%; aspect-ratio: 2.05; object-fit: cover; object-position: center top; }
.home-play-copy { display: flex; flex: 1; flex-direction: column; padding: clamp(18px, 2.7vw, 30px); }
.home-play-copy h3 { font-size: clamp(22px, 2.5vw, 30px); }
.home-play-copy p { color: var(--muted); margin-block: 6px 16px; }
.home-play-copy .button { margin-top: auto; }

.site-footer { border-top: 1px solid var(--line); background: #f4f8ff; }
.footer-inner { padding-top: clamp(25px, 4.3vw, 54px); }
.footer-links {
  display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: clamp(18px, 4vw, 56px);
  padding-block: clamp(23px, 3.6vw, 43px);
}
.footer-brand .brand { width: fit-content; }
.footer-brand .brand-image { width: 132px; }
.footer-brand p { margin-top: 8px; color: var(--muted); font-size: 15px; }
.footer-links nav { display: grid; gap: 4px; align-content: start; }
.footer-links nav h3 { font-size: 16px; letter-spacing: -.015em; margin-bottom: 7px; }
.footer-links nav a {
  width: fit-content; padding-block: 4px; color: var(--muted); font-weight: 650; font-size: 15px;
}
.footer-links nav a:hover { color: var(--green-dark); text-decoration: underline; text-underline-offset: 4px; }
.footer-social { margin-top: 17px; }
.footer-social-links { display: flex; flex-wrap: wrap; gap: 7px; }
.footer-links .footer-social-links a {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid #dae6f3; border-radius: 14px; background: white;
  transition: background .18s, border-color .18s, translate .18s;
}
.footer-links .footer-social-links a:hover { translate: 0 -2px; border-color: #a6cabc; background: var(--mint); }
.footer-social-links img { width: 20px; height: 20px; object-fit: contain; }
.footer-lingua-link {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 14px; padding: 7px 12px;
  border: 1px solid #d6e2f3; border-radius: 13px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 750;
}
.footer-lingua-link:hover { border-color: #afc5e4; background: #eaf3ff; }
.footer-lingua-link .icon { width: 16px; height: 16px; }
.footer-lingua-link .icon:first-child { color: #ac482d; fill: #ffbc9a; }
.footer-lingua-link .external-arrow { color: #43608a; }
.footer-promos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); }
.footer-apps, .footer-lingua {
  display: grid; grid-template-columns: minmax(0, 1.48fr) minmax(0, 1fr); align-items: center;
  min-height: 227px; overflow: hidden;
}
.footer-apps { background: linear-gradient(116deg, #e7f5ff, #edeaff); }
.footer-lingua { background: linear-gradient(119deg, #f0eaff 4%, #e7efff 60%, #ffebe5); }
.footer-apps-copy, .footer-lingua-copy { padding: clamp(21px, 2.7vw, 34px); padding-inline-end: 0; }
.footer-promos h2 { font-size: clamp(25px, 2.85vw, 34px); }
.footer-lingua-copy p { margin-top: 7px; max-width: 31ch; color: var(--muted); font-size: 15px; }
.footer-stores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 293px; gap: 9px; margin-top: 14px; }
.footer-store {
  display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0;
  min-height: 61px; padding: 8px 12px; border: 1px solid #b7cadf; border-radius: 12px; background: #fffafaeb;
}
.footer-store > span { color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1.2; }
.footer-store img { width: 100%; max-width: 113px; height: 26px; object-fit: contain; object-position: left center; filter: brightness(0); opacity: .85; }
.footer-apps-art, .footer-lingua-art { object-fit: contain; object-position: bottom center; justify-self: center; align-self: end; }
.footer-apps-art { width: min(100%, 270px); max-height: 227px; transform: translateY(14px); }
.footer-lingua-art { width: min(100%, 223px); transform: translateY(10px); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-block: 9px; border-top: 1px solid var(--line); color: var(--muted);
}
.footer-bottom .text-link { color: var(--green-dark); }
.footer-bottom .icon { transform: rotate(-90deg); }
.footer-legal { display: flex; flex-wrap: wrap; align-items: center; gap: 2px clamp(12px, 2.3vw, 29px); }
.footer-legal a { padding-block: 7px; font-size: 14px; font-weight: 700; }
.footer-legal a:hover { color: var(--green-dark); text-decoration: underline; text-underline-offset: 4px; }

.start-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(34px, 6vw, 96px); align-items: center; max-width: 1030px; padding-block: 54px 66px;
}
.start-layout h1 { margin: 14px 0 13px; }
.start-layout p { color: var(--muted); }
.back-link { color: var(--green-dark); }
.start-layout form { margin-top: 22px; }
label { display: block; margin-bottom: 7px; font-weight: 700; font-size: 14px; }
input {
  display: block; width: 100%; min-height: 49px; padding: 10px 14px; border-radius: 13px;
  color: var(--ink); background: white; border: 1px solid #b9ccdb;
}
input::placeholder { color: #61768b; }
.start-art { overflow: hidden; border-radius: 72px 30px 30px 30px; background: var(--sky); }
.start-art img { width: 100%; }
.start-art figcaption { padding: 17px 18px; font-size: 15px; font-weight: 650; text-align: center; }
.start-heroes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 15px; }
.start-hero-link { display: flex; color: var(--green-dark); margin-block: 2px 10px; }
.start-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.form-status { color: #872a45 !important; font-size: 14px; }
.form-status:not(:empty) { margin-top: 8px; }

.auth-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  max-width: 1050px; min-height: 545px; margin-block: clamp(22px, 4vw, 52px);
  border: 1px solid var(--line); border-radius: 34px; overflow: hidden;
  box-shadow: var(--shadow);
}
.auth-story { position: relative; display: grid; align-items: center; min-width: 0; background: var(--sky); }
.auth-sign-in .auth-story-image {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center;
}
.auth-register .auth-story {
  padding: clamp(14px, 2.5vw, 34px);
  background: radial-gradient(ellipse at 20% 3%, #edfff2, transparent 66%), #c7eedb;
}
.auth-register .auth-story::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-conic-gradient(#fff5 0% 25%, transparent 0% 50%) 0 0 / 100px 100px;
  mask-image: linear-gradient(139deg, #000 0%, transparent 32%, transparent 70%, #000);
}
.auth-register .auth-story-image {
  position: relative; width: 100%; border-radius: 25px; box-shadow: 0 17px 36px #24624e24;
}
.auth-panel { display: grid; place-items: center; padding: 33px clamp(25px, 4.3vw, 65px); }
.auth-form-wrap { width: 100%; max-width: 375px; min-width: 0; }
.auth-form-wrap > .back-link { margin-inline-start: -3px; }
.auth-form-wrap h1 { font-size: clamp(34px, 3.7vw, 51px); margin: 8px 0 10px; }
.auth-register h1 { font-size: clamp(32px, 3.3vw, 43px); }
.auth-form-wrap p { color: var(--muted); }
.auth-form { display: grid; gap: 15px; margin-top: 25px; }
.social-sign-in { display: grid; gap: 8px; margin-top: 16px; }
.social-auth-button {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 9px; align-items: center;
  min-height: 48px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 13px;
  color: var(--ink); background: #fff; text-align: start; font-weight: 750;
}
.social-auth-button:hover:not(:disabled) { border-color: #a4c6de; background: #f5faff; }
.social-auth-button:disabled { color: #47617c; cursor: default; }
.social-auth-button > svg { width: 19px; height: 19px; }
.social-auth-button > span { overflow-wrap: anywhere; }
.social-auth-button small { color: var(--muted); font-size: 11px; text-align: end; }
.social-auth-note { font-size: 14px; color: var(--muted); }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin-top: 15px; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; background: var(--line); flex: 1; }
.auth-divider + .auth-form { margin-top: 13px; }
.auth-field input { min-height: 51px; background: #f9fcff; }
.auth-field input:focus { background: white; }
.auth-field small { display: block; margin-top: 5px; color: var(--muted); }
.auth-password { position: relative; }
.auth-password input { padding-inline-end: 78px; }
.auth-password button {
  position: absolute; inset-inline-end: 4px; top: 50%; translate: 0 -50%;
  min-width: 57px; min-height: 43px; border-radius: 10px; color: var(--green-dark);
  font-size: 14px; font-weight: 750;
}
.auth-password button:hover { background: var(--mint); }
.auth-password button:focus-visible { outline-offset: -2px; }
.auth-form .form-status:empty { display: none; }
.auth-form .form-status:not(:empty) { margin-top: 0; }
.auth-form .button { width: 100%; min-height: 52px; margin-top: 2px; }
.auth-switch { margin-top: 16px; font-size: 14px; }
.auth-switch .text-link { color: var(--green-dark); font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.auth-switch p .text-link { margin-inline-start: 3px; }
.auth-switch .auth-guest-link { color: var(--muted); min-height: 38px; font-weight: 650; }
.auth-legal { margin-top: 12px; font-size: 13px; }
.auth-legal a { color: var(--green-dark); }
.auth-legal a { font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.auth-guest {
  display: flex; align-items: center; gap: 10px; margin-top: 17px;
  border-radius: 14px; padding: 10px; background: var(--mint); overflow-wrap: anywhere;
}
.auth-guest .avatar { width: 40px; height: 40px; }
.auth-guest strong, .auth-guest small { display: block; }
.auth-guest small { color: var(--muted); }

.club-page, .lessons-page, .game-page, .lesson-page, .account-page, .heroes-page, .team-page, .parents-page { padding-block: 38px 52px; }
.play-page { padding-block: clamp(25px, 4vw, 45px) 52px; }
.play-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 2vw, 20px); }
.play-mode-card {
  display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--round);
  background: var(--sky); transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.play-mode-card:hover { transform: translateY(-3px); border-color: #bbd4e6; box-shadow: var(--shadow); }
.play-mode-friend .play-mode-art { object-position: center top; }
.play-mode-practice { background: var(--mint); }
.play-mode-friend { background: var(--lilac); }
.play-mode-rated { background: #fff1dd; }
.play-mode-art {
  display: block; width: 100%; height: auto; max-height: 190px; aspect-ratio: 2 / 1;
  object-fit: cover; object-position: center 27%;
}
.play-mode-copy {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: clamp(9px, 1.5vw, 15px);
  align-items: start; padding: clamp(13px, 2.2vw, 23px);
}
.play-mode-copy h2 { font-size: clamp(20px, 2.9vw, 29px); overflow-wrap: anywhere; }
.play-mode-copy p { color: var(--muted); margin-top: 5px; line-height: 1.42; }
.play-mode-icon {
  display: grid; place-items: center; width: clamp(36px, 4vw, 47px); aspect-ratio: 1;
  border-radius: 13px; background: #ffffffc9; color: var(--green-dark);
}
.play-mode-arrow { align-self: center; color: var(--green-dark); }
.screen-title {
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  margin-bottom: 27px;
}
.screen-title h1 { overflow-wrap: anywhere; }
.screen-title p { margin-top: 9px; color: var(--muted); }
.club-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, .85fr); gap: 19px; }
.next-card {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center;
  background: var(--sky); border-radius: var(--round); overflow: hidden;
}
.next-card > div { padding: 29px 0 29px 29px; }
.next-scene { display: block; width: 100%; height: 100%; min-height: 283px; object-fit: cover; }
.card-label { color: var(--green-dark); font-size: 13px; font-weight: 800; margin-bottom: 8px; }
.next-card p:not(.card-label) { margin-block: 11px 17px; color: var(--muted); }
.club-countdown { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.club-countdown strong { color: var(--green-dark); font-variant-numeric: tabular-nums; }
.progress-card {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  background: var(--mint); border-radius: var(--round); padding: 24px;
}
.progress-heading { display: flex; align-items: center; gap: 10px; }
.progress-heading h2 { font-size: 22px; }
.progress-heading span, .progress-card > p:not(.points) { color: var(--muted); font-size: 14px; }
.points { font-size: 32px; line-height: 1.15; font-weight: 800; letter-spacing: -.04em; color: var(--green-dark); margin-block: 15px 11px; }
.points span { font-size: 14px; font-weight: 700; letter-spacing: 0; }
progress { appearance: none; border: 0; display: block; width: 100%; height: 8px; border-radius: 99px; background: #eff7f1; overflow: hidden; }
progress::-webkit-progress-bar { background: #eff7f1; }
progress::-webkit-progress-value { background: var(--green); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--green); border-radius: 99px; }
.progress-card > p:not(.points) { margin-top: 11px; }
.club-learning { margin-top: 24px; }
.club-learning h2 { font-size: clamp(22px, 2.5vw, 28px); }
.club-learning-stages {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px;
  list-style: none; margin: 12px 0 0; padding: 0;
}
.club-learning-stage {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; align-items: center;
  gap: 8px; height: 100%; padding: clamp(11px, 1.5vw, 17px);
  border: 1px solid var(--line); border-radius: 17px; background: #f8fbff;
}
.club-learning-stage:hover, .club-learning-stage[aria-current="step"] { background: var(--mint); border-color: #a4d9b9; }
.club-stage-icon {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: white; color: var(--green-dark);
}
.club-stage-icon .icon { width: 19px; height: 19px; }
.club-learning-stage strong { grid-column: 1 / -1; line-height: 1.25; overflow-wrap: anywhere; }
.club-stage-count {
  grid-column: 2; grid-row: 1; text-align: end; overflow-wrap: anywhere;
  font-size: 13px; font-weight: 700; color: var(--muted);
}
.club-learning-stage progress { grid-column: 1 / -1; }
.club-puzzle-card {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(125px, .6fr) minmax(0, 1.3fr);
  align-items: center; gap: 18px clamp(16px, 3.5vw, 44px); margin-top: 18px; padding: clamp(15px, 2.5vw, 22px);
  border: 1px solid #e2ddf8; border-radius: var(--round); background: #f5f1ff;
}
.club-puzzle-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.club-puzzle-heading h2 { font-size: clamp(20px, 2vw, 25px); }
.club-puzzle-heading p, .club-puzzle-progress p { color: var(--muted); font-size: 14px; }
.club-puzzle-icon { display: grid; place-items: center; flex: none; width: 47px; height: 47px; border-radius: 15px; background: #e9e0fc; color: #5c4190; }
.club-puzzle-icon .icon { width: 24px; height: 24px; }
.club-puzzle-progress { display: grid; gap: 6px; }
.club-puzzle-progress progress { background: #fff; }
.club-puzzle-progress progress::-webkit-progress-bar { background: #fff; }
.club-puzzle-card .puzzle-page-links { justify-content: flex-end; }
.club-friend-card {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 18px;
  margin-top: 18px; padding: clamp(15px, 2.5vw, 22px);
  border: 1px solid #d9ecdf; border-radius: var(--round); background: #effaf3;
}
.club-friend-heading { display: flex; align-items: center; min-width: 0; gap: 12px; }
.club-friend-heading h2 { overflow-wrap: anywhere; font-size: clamp(20px, 2vw, 25px); }
.club-friend-heading p { margin-top: 3px; color: var(--muted); font-size: 14px; }
.club-friend-heading .avatar, .club-friend-icon { flex: none; width: 47px; height: 47px; }
.club-friend-icon { display: grid; place-items: center; border-radius: 15px; background: #daf2e3; color: var(--green-dark); }
.club-friend-history {
  margin-top: 18px; padding: clamp(15px, 2.5vw, 22px); border: 1px solid #dce9f4;
  border-radius: var(--round); background: #f3f8fd;
}
.club-friend-history h2 { font-size: clamp(21px, 2.4vw, 29px); }
.game-history-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-block: 12px 8px; }
.game-history-filters .button { min-height: 44px; }
.game-history-filters [aria-pressed="true"] { background: var(--mint); color: var(--green-dark); border-color: #acd3ba; }
.club-friend-history :is([data-friend-history], [data-personal-puzzles]) > p { margin-top: 7px; color: var(--muted); }
.club-friend-history :is([data-friend-history], [data-personal-puzzles]) > .button { margin-top: 10px; }
.club-personal-puzzles { background: #f2faf4; border-color: #d9ecdf; scroll-margin-top: var(--header-clearance); }
[data-personal-next]:empty { display: none; }
.friend-history-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  list-style: none; padding: 0; margin: 12px 0 0;
}
.friend-history-game {
  display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, max-content) auto;
  align-items: center; gap: 10px; min-height: 64px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 15px; background: #fff;
}
.friend-history-game:hover { background: #ebf8f0; border-color: #b4d9c0; }
.friend-history-game .avatar { width: 39px; height: 39px; }
.friend-history-player { display: grid; gap: 2px; overflow-wrap: anywhere; line-height: 1.3; }
.friend-history-player small, .friend-history-result { color: var(--muted); }
.friend-history-result { max-width: 15ch; text-align: end; overflow-wrap: anywhere; font-size: 13px; font-weight: 700; }
.friend-history-result .rating-change { display: block; margin-top: 2px; color: var(--green-dark); }
.friend-history-result .rating-change.down { color: #a33d48; }
.friend-history-game > .icon { width: 16px; height: 16px; color: var(--green-dark); }
.club-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-top: 22px; }
.option {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 13px; padding: 17px; border-radius: 20px; text-align: start; transition: transform .18s;
}
.option strong, .option small { display: block; }
.option small { color: var(--muted); }

.learning-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); align-items: center; overflow: hidden;
  border-radius: 32px; background: linear-gradient(125deg, #e8f5ff, #ddf6e8);
}
.learning-hero-copy { padding: clamp(24px, 4.25vw, 57px); }
.learning-hero h1 { font-size: clamp(37px, 5.05vw, 68px); line-height: 1; }
.learning-next { color: var(--muted); font-weight: 700; margin-top: 13px; overflow-wrap: anywhere; }
.learning-progress { display: grid; gap: 7px; max-width: 290px; margin-block: 17px 20px; }
.learning-progress progress { background: white; }
.learning-progress progress::-webkit-progress-bar { background: white; }
.learning-progress span { color: var(--green-dark); font-size: 13px; font-weight: 750; }
.learning-hero-art { width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: center 39%; }
.learning-map { margin-top: clamp(25px, 4vw, 45px); }
.lesson-list {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
  list-style: none; padding: 0; margin: 15px 0 0;
}
.lesson-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px;
  height: 100%; padding: 20px; border: 1px solid transparent; border-radius: var(--round);
  min-height: 150px; transition: transform .18s, box-shadow .18s;
}
.lesson-card[aria-current="step"] { border-color: #7bbd94; box-shadow: 0 3px 0 #3a91582d; }
.lesson-piece { width: 68px; height: 79px; display: grid; place-items: center; background: #ffffffbf; border-radius: 20px; }
.lesson-card h3 { font-size: 23px; }
.lesson-card p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.lesson-meta { color: var(--green-dark); font-weight: 700; font-size: 13px; margin-top: 12px; display: flex; align-items: center; gap: 4px; }
.lesson-meta .icon { width: 17px; height: 17px; }
.quiz-invitation {
  display: flex; align-items: center; gap: 14px; margin-top: 24px; padding: 20px;
  border-radius: var(--round); border: 1px solid #dfd7f7; background: #faf8ff;
}
.quiz-invitation h2 { font-size: 24px; }
.quiz-invitation p { color: var(--muted); margin-top: 3px; font-size: 14px; }
.quiz-invitation .button { margin-inline-start: auto; flex: none; }
.quiz-cover, .quiz-dialog-art { display: block; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 13px; flex: none; }
.quiz-cover { width: 116px; }
.quiz-dialog-art { width: 101px; }

.board-page-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.step-progress { display: flex; align-items: center; gap: 13px; font-weight: 750; font-size: 14px; color: var(--green-dark); white-space: nowrap; }
.step-progress progress { width: clamp(75px, 14vw, 170px); }
.board-layout { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); gap: clamp(25px, 4vw, 56px); align-items: start; max-width: 1048px; margin-inline: auto; }
.board-side { min-width: 0; }
.lesson-answers { display: flex; flex-wrap: wrap; gap: 7px; margin-block: 14px 0; }
.lesson-answers button { min-height: 44px; white-space: normal; }
.lesson-answers .primary:disabled { opacity: 1; }
.board-palette {
  --tile-light: #f5faed;
  --tile-dark: #82b795;
  --board-rim: #cae9d3;
  --board-edge: #88b39a;
  --board-shadow: #15462421;
  --coordinate-light: #425a40;
  --coordinate-dark: #192e23;
  --last-move: #c8e77b;
  --selected-tile: #bce4a5;
  --selected-ring: #186f40;
  --move-dot: #134d3277;
  --capture-ring: #174f37bd;
  --board-grain: none;
}
.board-palette[data-board-style="sky"] {
  --tile-light: #edf7ff;
  --tile-dark: #87b4d3;
  --board-rim: #d3eafa;
  --board-edge: #6f9bbd;
  --board-shadow: #23527727;
  --coordinate-light: #354f67;
  --coordinate-dark: #203846;
  --last-move: #f2de8c;
  --selected-tile: #c7eaff;
  --selected-ring: #245c85;
  --move-dot: #184365a8;
  --capture-ring: #184365dd;
}
.board-palette[data-board-style="lilac"] {
  --tile-light: #f6efff;
  --tile-dark: #ac9bcb;
  --board-rim: #e8dcfa;
  --board-edge: #9483b5;
  --board-shadow: #49347826;
  --coordinate-light: #594673;
  --coordinate-dark: #312643;
  --last-move: #f2df90;
  --selected-tile: #e2d2ff;
  --selected-ring: #604884;
  --move-dot: #46316aa3;
  --capture-ring: #46316ada;
}
.board-palette[data-board-style="honeywood"] {
  --tile-light: #faedda;
  --tile-dark: #be8e65;
  --board-rim: #e5c5a0;
  --board-edge: #ab7e53;
  --board-shadow: #68452128;
  --coordinate-light: #62472f;
  --coordinate-dark: #302219;
  --last-move: #f0cd72;
  --selected-tile: #f8e5a9;
  --selected-ring: #80521f;
  --move-dot: #5c3b20a6;
  --capture-ring: #5c3b20d9;
  --board-grain: repeating-linear-gradient(96deg, transparent 0 6px, #6d411514 7px 8px, transparent 9px 13px, #fff9ec2b 14px 15px);
}
.board-palette[data-board-style="rose"] {
  --tile-light: #fff0f5;
  --tile-dark: #d29ab6;
  --board-rim: #f7dce9;
  --board-edge: #bb7e9b;
  --board-shadow: #71234924;
  --coordinate-light: #654155;
  --coordinate-dark: #4c2639;
  --last-move: #f8e091;
  --selected-tile: #f9ccdf;
  --selected-ring: #903c67;
  --move-dot: #6a2c4b9f;
  --capture-ring: #6a2c4bda;
}
.board-palette[data-board-style="moonlight"] {
  --tile-light: #dce5f3;
  --tile-dark: #8595b0;
  --board-rim: #435673;
  --board-edge: #293952;
  --board-shadow: #1c2d4b38;
  --coordinate-light: #3a4c69;
  --coordinate-dark: #142438;
  --last-move: #efda9a;
  --selected-tile: #c6dbff;
  --selected-ring: #30486b;
  --move-dot: #203755b2;
  --capture-ring: #203755e0;
}
.board-frame {
  padding: 8px; border-radius: 18px; background: var(--board-rim);
  box-shadow: 0 5px 0 var(--board-edge), 0 11px 26px var(--board-shadow);
}
.board {
  width: 100%; aspect-ratio: 1; display: grid; grid-template-rows: repeat(8, minmax(0, 1fr)); border-radius: 11px;
  overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.rank { display: grid; min-height: 0; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.square { position: relative; display: grid; place-items: center; padding: 0; min-width: 0; min-height: 0; outline: none; }
.square.light { background: var(--board-grain) var(--tile-light); color: var(--coordinate-light); }
.square.dark { background: var(--board-grain) var(--tile-dark); color: var(--coordinate-dark); }
.square.previous { background: var(--last-move); }
.square.selected { box-shadow: inset 0 0 0 3px var(--selected-ring); background: var(--selected-tile); }
.square.in-check { background: #f5b2a4; }
.square:focus-visible { outline-offset: -3px; z-index: 1; }
.square.moving-piece { z-index: 2; }
.rank-label, .file-label { position: absolute; font-size: clamp(7px, .95vw, 11px); line-height: 1; font-weight: 750; z-index: 2; }
.rank-label { left: 4px; top: 4px; }
.file-label { right: 4px; bottom: 4px; }
.square > .chess-piece { width: 88%; height: 88%; position: absolute; inset: 6%; }
.square.moving-piece > .chess-piece { animation: chess-slide .22s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes chess-slide {
  from { transform: translate(var(--move-x), var(--move-y)); }
  to { transform: translate(0, 0); }
}
.target-star { color: #8c5409; display: grid; place-items: center; border-radius: 50%; background: #ffe297; width: 55%; height: 55%; z-index: 2; }
.target-star .icon { width: 72%; height: 72%; fill: #f7b72a; }
.target-capture { position: absolute; z-index: 2; top: 2px; right: 2px; color: #7d4a14; line-height: 0; }
.target-capture .icon { width: 15px; height: 15px; fill: #ffda67; }
.legal-mark { position: absolute; z-index: 1; inset: 39%; border-radius: 50%; background: var(--move-dot); pointer-events: none; }
.legal-mark.capture { inset: 1px; border: 3px solid var(--capture-ring); background: none; }
.square.hint-target { box-shadow: inset 0 0 0 3px #8967ce; }
:is(.square, .puzzle-review-marker).puzzle-review-guarded {
  background: var(--puzzle-guarded); box-shadow: inset 0 0 0 2px #bb8833; color: var(--ink);
}
:is(.square, .puzzle-review-marker).puzzle-review-blocked {
  background: var(--puzzle-blocked); box-shadow: inset 0 0 0 2px #708fbd; color: var(--ink);
}
:is(.square, .puzzle-review-marker).puzzle-review-checking { box-shadow: inset 0 0 0 3px var(--puzzle-checking); color: var(--ink); }
.board-guide { padding: 24px; border: 1px solid var(--line); border-radius: var(--round); background: #f8fbff; }
.guide-buddy { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; color: var(--green-dark); font-weight: 750; }
.guide-buddy .avatar { width: 40px; height: 40px; border: 2px solid white; }
.first-move-heading { display: flex; align-items: center; gap: 12px; }
.first-move-heading .avatar { width: 50px; height: 50px; flex: none; border: 2px solid white; }
.board-guide h1 { font-size: clamp(30px, 4vw, 44px); }
.board-guide h2 { font-size: 30px; }
.board-guide p:not(.card-label) { color: var(--muted); margin-top: 9px; }
.game-bao-art { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 17px; margin-top: 18px; }
.instruction { display: flex; align-items: flex-start; gap: 9px; margin-top: 16px; padding: 13px 15px; border-radius: 15px; background: var(--lilac); color: #40396a; font-size: 15px; }
.instruction.success { background: var(--mint); color: var(--green-dark); }
.opening-tip { background: var(--mint); color: var(--green-dark); }
.opening-tip :is(strong, span) { display: block; }
.instruction .icon { width: 18px; height: 18px; margin-top: 2px; }
.practice-objective { margin: 0 0 10px; padding: 9px 12px; }
.guide-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 17px; }
.segmented { display: flex; align-items: stretch; padding: 4px; background: var(--sky); border-radius: 99px; gap: 3px; flex: none; }
.segmented :is(a, button) { display: grid; place-items: center; min-height: 42px; min-width: 103px; border-radius: 99px; font-size: 14px; font-weight: 700; padding: 7px 12px; }
.segmented :is(a[aria-current="page"], button[aria-pressed="true"]) { background: white; color: var(--green-dark); box-shadow: 0 2px 6px #1b526213; }
.puzzle-archive-filters { flex-wrap: wrap; max-width: 100%; }
.puzzle-archive-filters > button { min-height: 44px; min-width: 0; padding-inline: clamp(8px, 2.5vw, 16px); }
.puzzle-archive-filters > button:hover { color: var(--green-dark); }
.game-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; max-width: 100%; }
.game-toolbar .segmented { max-width: 100%; min-width: 0; }
.game-toolbar .segmented a { text-align: center; line-height: 1.25; overflow-wrap: anywhere; hyphens: auto; }
.game-mode-picker { display: none; }
.board-style-button { gap: 8px; white-space: nowrap; }
.board-style-button > .icon { width: 14px; height: 14px; transform: rotate(90deg); }
.checker-pattern {
  background-image: var(--board-grain),
    conic-gradient(var(--tile-dark) 25%, var(--tile-light) 0 50%, var(--tile-dark) 0 75%, var(--tile-light) 0);
  background-size: auto, 50% 50%;
}
.board-swatch {
  display: block; width: 20px; height: 20px; flex: none;
  border: 1px solid var(--board-edge); border-radius: 5px;
}
.bao-level {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px;
  margin-bottom: 12px; color: var(--ink); font-size: 14px; font-weight: 750;
}
.bao-level-options { max-width: 100%; }
.bao-level-options > button { min-width: 0; min-height: 44px; padding-inline: 13px; }
.player-bar { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.player-bar .avatar { width: 42px; height: 42px; }
.player-bar strong, .player-bar small { display: block; }
.player-bar strong { overflow-wrap: anywhere; }
.player-bar small { color: var(--muted); }
.player-bar > span { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: auto; font-size: 13px; font-weight: 700; color: var(--muted); }
.player-bar > span .icon { width: 16px; height: 16px; }
.player-bar > .turn-chip, .friend-player-status .turn-chip { padding: 6px 10px; border-radius: 99px; background: var(--mint); color: var(--green-dark); white-space: nowrap; }
.friend-player-status .turn-chip { font-size: 13px; font-weight: 700; }
.player-bottom { margin: 16px 0 0; }
.history { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
.history ol { list-style: none; margin: 8px 0 0; padding: 0; max-height: 155px; overflow: auto; font: 14px/1.55 "DM Sans", system-ui, sans-serif; }
.history li { display: grid; grid-template-columns: 30px 1fr 1fr; padding: 5px; }
.history li:nth-child(odd) { background: var(--sky); }
.history li > span:first-child { color: var(--muted); }
.restart-link { color: var(--green-dark); }

.friend-lobby {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center;
  border-radius: 30px; overflow: hidden; background: linear-gradient(130deg, var(--sky), var(--mint));
}
.friend-lobby-copy { padding: clamp(23px, 4.5vw, 55px); }
.friend-lobby-copy h2 { font-size: clamp(30px, 4vw, 53px); }
.friend-lobby-copy p { max-width: 35ch; margin: 11px 0 18px; color: var(--muted); }
.friend-lobby-art { width: 100%; height: 100%; object-fit: cover; }
.friend-host { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; color: var(--green-dark); overflow-wrap: anywhere; }
.friend-host .avatar { width: 37px; height: 37px; border: 2px solid white; }
.friend-notice {
  width: min(100%, 1048px); margin: 0 auto 15px; padding: 17px 20px;
  border-radius: 18px; background: var(--sky); color: var(--muted);
}
.friend-notice h2 { color: var(--ink); margin-bottom: 7px; }
.friend-invite {
  display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.3fr); align-items: center; gap: 15px;
  width: min(100%, 1048px); margin: 0 auto 18px; padding: 18px 22px; border-radius: 22px; background: var(--mint);
}
.friend-invite h2 { font-size: clamp(23px, 2.8vw, 30px); }
.friend-invite p { margin-top: 4px; color: var(--muted); font-size: 14px; }
.friend-invite-controls { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; min-width: 0; }
.friend-invite-controls input { flex: 1 1 153px; min-width: 0; min-height: 44px; font-size: 14px; }
.friend-invite-controls button { flex: none; }
.player-bar > .friend-empty-avatar {
  display: grid; place-items: center; width: 42px; height: 42px; flex: none; margin-inline-start: 0;
  border-radius: 50%; background: var(--sky); color: #325580;
}
.player-bar .friend-empty-avatar .icon { width: 20px; height: 20px; }
.friend-guide h2 { font-size: 25px; }
.friend-rematch {
  margin-top: 13px; padding: 13px 15px; border: 1px solid #e4dcf6; border-radius: 15px;
  background: #f6f2ff;
}
.friend-rematch p { color: var(--ink); font-size: 14px; }
.friend-rematch .guide-actions { margin-top: 9px; gap: 8px; }
.friend-result .restart-link { display: inline-block; margin-top: 12px; }
.friend-page .turn-chip { text-align: center; white-space: normal; }
.replay-controls {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 13px;
  margin-top: 12px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 15px; background: var(--sky);
}
.replay-controls p { color: var(--ink); font-size: 14px; font-weight: 750; }
.replay-buttons { display: flex; gap: 5px; }
.replay-control {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid #c8deed; border-radius: 10px; background: #fff; color: var(--ink);
}
.replay-control:hover:not(:disabled) { background: var(--mint); border-color: #a7d5b7; }
.replay-control[data-replay-control="previous"] .icon { transform: rotate(180deg); }
.replay-control:is([data-replay-control="start"], [data-replay-control="final"])::after {
  content: ""; position: absolute; top: 15px; bottom: 15px; width: 1px; background: currentColor;
}
.replay-control[data-replay-control="start"]::after { left: 10px; }
.replay-control[data-replay-control="final"]::after { right: 10px; }
.friend-replay-guide .history ol { max-height: 215px; }
.friend-replay-page .board-side { scroll-margin-top: var(--header-clearance); }
.friend-replay-guide .history li { align-items: center; padding: 3px 5px; }
.replay-move { min-height: 44px; padding: 4px 9px; border-radius: 8px; text-align: start; font-weight: 700; }
.replay-move:hover, .replay-move[aria-current="step"] { background: var(--mint-strong); color: var(--green-dark); }
.replay-move.missed-mate { display: flex; align-items: center; gap: 6px; }
.replay-move.missed-mate .icon { width: 15px; height: 15px; color: #8b5314; }
.missed-mate-card { margin-top: 15px; padding: 13px 15px; border: 1px solid #edd9b4; border-radius: 15px; background: #fff7e8; }
.missed-mate-card > strong { display: flex; align-items: center; gap: 7px; color: #774b1c; }
.missed-mate-card .guide-actions { margin-top: 9px; }
.reward-dialog .missed-mate-card > strong, .reward-dialog .missed-mate-card .guide-actions { justify-content: center; }

.rated-lobby { display: grid; grid-template-columns: minmax(0, 2.75fr) minmax(250px, 1fr); gap: 18px; }
.rated-lobby .friend-lobby-copy { padding: clamp(23px, 3vw, 40px); }
.rated-lobby .friend-lobby-copy h2 { font-size: clamp(30px, 3.2vw, 46px); }
.rated-lobby .friend-lobby-art { min-height: 240px; }
.rated-intro .guide-actions { margin-block: 0 6px; }
.rated-intro .text-link, .rated-card-links .text-link { color: var(--green-dark); }
.rated-card {
  display: flex; flex-direction: column; justify-content: center; align-items: stretch;
  border: 1px solid #cceadd; border-radius: 30px; padding: clamp(20px, 2.3vw, 30px); background: #f1fcf5;
}
.rating-label, .rating-score { display: flex; align-items: center; gap: 9px; }
.rating-label { justify-content: space-between; }
.rating-label h2 { font-size: 23px; }
.rating-label .icon {
  width: 38px; height: 38px; padding: 8px; border-radius: 12px; background: var(--mint); color: var(--green-dark);
}
.rating-score strong { font-size: clamp(42px, 4.5vw, 61px); letter-spacing: -.06em; line-height: 1.2; }
.provisional-chip, .rating-change {
  padding: 4px 9px; border-radius: 99px; background: var(--mint); color: var(--green-dark);
  font-weight: 750; font-size: 12px;
}
.rated-card progress { margin-top: 12px; }
.rated-card p { margin-top: 6px; font-size: 14px; color: var(--muted); }
.rated-card-links { display: flex; flex-direction: column; align-items: flex-start; margin-top: 14px; padding-top: 8px; border-top: 1px solid #d2e9dc; }
.rated-card-links .text-link { min-height: 36px; }
.queue-status { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; color: var(--green-dark); font-weight: 700; }
.queue-spinner { width: 17px; height: 17px; border: 2px solid #9abfaf; border-top-color: var(--green-dark); border-radius: 50%; animation: queue-spin .8s linear infinite; }
@keyframes queue-spin { to { transform: rotate(360deg); } }
.rated-guide h2 { font-size: 25px; }
.rated-guide-controls { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: 8px; color: var(--muted); }
.rated-result {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 14px; padding: 13px 16px; border-radius: 16px; background: var(--mint);
}
.rated-result small, .rated-result strong { display: block; }
.rated-result small { color: var(--green-dark); font-weight: 650; }
.rated-result strong { font-size: 31px; line-height: 1.16; letter-spacing: -.045em; }
.rated-result .rating-change { background: white; font-size: 14px; }
.rating-change.down { color: #8a4326; }
.rated-settings select, .leaderboard-filter select {
  width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid #bacedc;
  border-radius: 12px; background: white; color: var(--ink);
}
.rated-settings label, .leaderboard-filter label { display: block; margin: 0 0 5px; }
.rated-settings .rated-opt-in {
  display: flex; align-items: start; gap: 10px; margin: 14px 0 0; padding: 12px;
  border-radius: 14px; background: var(--sky); cursor: pointer; line-height: 1.45;
}
.rated-opt-in input { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 2px 0 0; accent-color: var(--green); flex: none; }
.rated-opt-in small { display: block; margin-top: 4px; color: var(--muted); overflow-wrap: anywhere; }

.leaderboard-page { padding-block: 39px 56px; }
.leaderboard-panel { border: 1px solid var(--line); border-radius: var(--round); overflow: hidden; box-shadow: var(--shadow); }
.leaderboard-heading {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 13px 20px;
  padding: clamp(17px, 2.8vw, 29px); background: var(--sky);
}
.leaderboard-heading h2 { font-size: clamp(24px, 3vw, 32px); }
.leaderboard-heading p { color: var(--muted); margin-top: 6px; }
.leaderboard-filter { display: flex; gap: 8px; align-items: end; width: min(100%, 330px); }
.leaderboard-filter div { min-width: 0; flex: 1; }
.leaderboard-filter label { font-size: 13px; font-weight: 750; }
.leaderboard-table { width: 100%; border-collapse: collapse; text-align: start; }
.leaderboard-table thead { background: #f9fcff; font-size: 14px; color: var(--muted); }
.leaderboard-table th, .leaderboard-table td { padding: 12px clamp(8px, 2.4vw, 28px); border-top: 1px solid var(--line); }
.leaderboard-table :is(th, td):first-child { width: 1%; }
.leaderboard-table .leaderboard-numeric { width: 1%; text-align: end; font-variant-numeric: tabular-nums; }
.leaderboard-rank { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 4px; border-radius: 10px; background: var(--sky); font-weight: 750; }
.leaderboard-player { display: flex; gap: 10px; align-items: center; line-height: 1.25; overflow-wrap: anywhere; }
.leaderboard-player .avatar { width: 38px; height: 38px; }
.leaderboard-player small { display: block; color: var(--muted); font-weight: 500; margin-top: 3px; }
.leaderboard-message { padding: 22px; color: var(--muted); }
.leaderboard-message .button { margin-top: 12px; }
.leaderboard-empty { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 24px; }
.leaderboard-art { width: clamp(78px, 15vw, 170px); border-radius: 20px; }
.leaderboard-empty h3 { font-size: clamp(21px, 3vw, 29px); }
.leaderboard-empty p { color: var(--muted); margin-block: 6px 12px; }

.hero-spotlight {
  --hero-tone: #e2efff;
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); align-items: center;
  gap: 22px; padding: 26px clamp(25px, 5.6vw, 82px); border-radius: 32px;
  background: linear-gradient(108deg, #f7fbff 5%, var(--hero-tone) 72%);
}
.hero-spotlight:is([data-hero="noki"], [data-hero="cat"], [data-hero="koala"], [data-hero="otter"]) {
  --hero-tone: #dcf5e7;
}
.hero-spotlight:is([data-hero="fox"], [data-hero="bear"], [data-hero="rabbit"], [data-hero="red-panda"], [data-hero="capybara"], [data-hero="lion"], [data-hero="parrot"]) {
  --hero-tone: #fce9dd;
}
.hero-spotlight:is([data-hero="panda"], [data-hero="penguin"], [data-hero="axolotl"], [data-hero="kangaroo"], [data-hero="hedgehog"], [data-hero="raccoon"]) {
  --hero-tone: #eee5fb;
}
.hero-selected-label {
  display: flex; align-items: center; gap: 7px; margin-bottom: 8px;
  color: var(--green-dark); font-size: 14px; font-weight: 800;
}
.hero-selected-label .icon { width: 18px; height: 18px; }
.hero-spotlight h2 { font-size: clamp(44px, 5.2vw, 72px); }
.hero-spotlight h2 + p { color: var(--muted); margin-top: 8px; max-width: 360px; }
.hero-spotlight .button { margin-top: 19px; }
.hero-spotlight-art {
  justify-self: center; display: grid; place-items: center; width: min(100%, 282px); aspect-ratio: 1;
  padding: clamp(8px, 1.3vw, 16px); border: 1px solid #fff9; border-radius: 50%; background: #ffffff51;
}
.hero-spotlight-photo {
  width: 100%; height: auto; aspect-ratio: 1; border: 5px solid white; box-shadow: 0 9px 18px #263b5924;
  animation: portrait-enter .4s cubic-bezier(.2, .7, .25, 1);
}
.hero-collection { margin-top: 28px; }
.hero-collection h2 { font-size: clamp(24px, 3vw, 34px); }
.hero-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.hero-collection .hero-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.hero-choice { position: relative; display: grid; place-items: center; gap: 5px; padding: 8px 3px; border-radius: 16px; border: 1px solid transparent; font-size: 13px; font-weight: 700; }
.hero-choice .avatar { width: min(68px, 100%); height: auto; aspect-ratio: 1; border: 2px solid white; }
.hero-choice:hover { background: var(--sky); }
.hero-choice[aria-pressed="true"] { background: var(--mint); border-color: #87caa1; }
.hero-choice i { position: absolute; right: 3px; top: 53px; line-height: 0; display: grid; place-items: center; border-radius: 50%; width: 19px; height: 19px; background: var(--green); color: white; }
.hero-choice i .icon { width: 13px; height: 13px; }
.hero-collection .hero-choice {
  padding: 13px 5px 10px; gap: 7px; background: #f8fbfd; border-color: #e4ecf4;
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.hero-collection .hero-choice .avatar { width: min(78px, 100%); }
.hero-collection .hero-choice:hover { background: var(--sky); box-shadow: var(--shadow); }
.hero-collection .hero-choice[aria-pressed="true"] { background: var(--mint); border-color: #87caa1; }
.hero-collection .hero-choice i { top: auto; right: max(5px, calc(50% - 38px)); bottom: 35px; }
.badges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.badge { display: grid; place-items: center; gap: 5px; background: #f3f7fa; border-radius: 16px; text-align: center; padding: 16px 6px; }
.badge.earned { background: var(--lilac); }
.badge .icon { color: #536980; margin-bottom: 4px; }
.badge.earned .icon { color: #6547a2; }
.badge strong { font-size: 14px; }
.badge small { color: var(--muted); font-size: 12px; }

.account-overview, .account-body {
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px;
}
.account-identity, .account-level, .account-panel { border-radius: var(--round); padding: 24px; }
.account-identity { display: flex; align-items: center; gap: 22px; background: var(--mint); }
.account-identity h2 { overflow-wrap: anywhere; }
.account-avatar { width: 112px; height: 112px; border: 5px solid white; box-shadow: 0 7px 20px #21724725; }
.account-type { color: var(--green-dark); font-size: 13px; font-weight: 750; margin-bottom: 5px; }
.identity-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 8px; }
.identity-actions .text-link, .account-details .text-link { color: var(--green-dark); }
.identity-actions .text-link .icon { width: 14px; height: 14px; }
.account-level { background: var(--lilac); }
.account-level-heading { display: flex; justify-content: space-between; align-items: center; }
.account-level h2 { font-size: 22px; }
.level-spark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: white; color: #6c4aa8; }
.level-points { font-size: clamp(34px, 4vw, 48px); line-height: 1.05; letter-spacing: -.05em; font-weight: 850; margin-block: 2px 12px; }
.level-points span { font-size: 18px; letter-spacing: 0; }
.account-level progress, .account-level progress::-webkit-progress-bar { background: #fffaff; }
.account-level progress::-webkit-progress-value { background: #7956b6; }
.account-level progress::-moz-progress-bar { background: #7956b6; }
.account-level > p:last-child { margin-top: 8px; font-size: 13px; color: #5d4978; font-weight: 650; }
.account-body { margin-top: 18px; }
.account-column { display: grid; gap: 18px; align-content: start; min-width: 0; }
.account-panel { background: white; border: 1px solid var(--line); }
.account-panel h2 { font-size: 23px; }
.account-panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.account-panel-heading > span { font-size: 13px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.progress-list { list-style: none; padding: 0; margin: 9px 0 0; }
.progress-list li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding-block: 11px; border-bottom: 1px solid var(--line); min-height: 59px;
}
.progress-list li:last-child { border-bottom: none; padding-bottom: 0; }
.progress-list strong, .progress-list small, .progress-list time { display: block; }
.progress-list small, .progress-list time { color: var(--muted); font-size: 13px; }
.activity-icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px; background: var(--sky); color: #365780; }
.activity-icon .icon { width: 18px; height: 18px; }
.activity-points {
  font-size: 13px; font-weight: 800; white-space: nowrap; padding: 5px 8px;
  border-radius: 99px; background: var(--mint); color: var(--green-dark);
}
.activity-empty {
  display: grid; grid-template-columns: minmax(90px, 144px) minmax(0, 1fr); gap: 13px; align-items: center;
  margin-top: 14px; padding: 10px; background: var(--lilac); border-radius: 17px;
}
.activity-empty-art { width: 100%; border-radius: 12px; }
.activity-empty .text-link { color: var(--green-dark); }
.activity-empty p, .account-details > p { color: var(--muted); margin-top: 4px; }
.account-details > p { overflow-wrap: anywhere; }
.account-details .account-sync { font-size: 14px; margin: 11px 0 8px; }
.xp-guide { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 10px; font-size: 14px; color: var(--muted); }
.xp-guide summary { cursor: pointer; font-weight: 700; color: var(--ink); min-height: 34px; }
.xp-guide ul { padding: 0; list-style: none; margin: 2px 0 8px; }
.xp-guide li { display: flex; justify-content: space-between; gap: 10px; padding-block: 4px; }
.xp-guide li strong { white-space: nowrap; color: var(--green-dark); }

.team-gate {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center;
  border-radius: var(--round); overflow: hidden; background: var(--sky);
}
.team-gate-copy { padding: clamp(21px, 4vw, 48px); }
.team-gate-art { width: 100%; height: 100%; object-fit: cover; }
.team-gate p { margin: 10px 0 17px; color: var(--muted); max-width: 565px; }
.team-weekly {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); margin-bottom: 18px;
  overflow: hidden; border: 1px solid #dcece1; border-radius: var(--round); background: #eaf7ef;
}
.weekly-card-copy { padding: clamp(17px, 3vw, 33px); }
.weekly-card-icon {
  display: inline-grid; place-items: center; width: 42px; aspect-ratio: 1; margin-bottom: 9px;
  border-radius: 13px; background: white; color: var(--green-dark);
}
.weekly-card-copy h2 { font-size: clamp(24px, 3.1vw, 36px); overflow-wrap: anywhere; }
.weekly-card-copy p { color: var(--muted); margin-top: 6px; }
.weekly-card-progress { display: grid; gap: 7px; margin-top: 15px; color: var(--green-dark); }
.weekly-card-progress progress { width: min(100%, 340px); }
.weekly-card-copy .weekly-card-renewal { font-size: 13px; }
.weekly-card-copy .button { margin-top: 13px; }
.weekly-card-art { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.weekly-result { margin-top: 17px; padding-top: 12px; border-top: 1px solid #c9e1d2; }
.weekly-result h3 { font-size: 16px; }
.weekly-result p { font-size: 14px; }
.team-gate-copy > .icon, .team-form > .icon, .team-progress > .icon { color: var(--green-dark); width: 30px; height: 30px; margin-bottom: 12px; }
.team-forms, .team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.team-form, .team-progress, .invite-card, .teammates { border-radius: var(--round); padding: 24px; }
.team-form h2, .team-progress h2, .invite-card h2, .teammates h2 { font-size: 30px; }
.team-form label { margin-top: 19px; }
.team-form button { margin-top: 13px; }
.team-progress > p:not(.points), .invite-card p { color: var(--muted); margin-top: 9px; }
.invite-card { background: var(--lilac); }
.invite-card label { display: block; margin-top: 10px; }
.invite-card input { display: block; width: 100%; min-width: 0; margin: 5px 0 10px; }
.team-invite-code, .team-invite-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.team-invite-code { margin-top: 10px; }
.invite-card code {
  display: block; padding: 10px 12px; border-radius: 12px; width: fit-content; max-width: 100%;
  background: white; font-size: clamp(15px, 2vw, 22px); font-weight: 800; letter-spacing: .1em;
}
.teammates { margin-top: 20px; background: white; border: 1px solid var(--line); }
.teammates ul { list-style: none; padding: 0; margin: 10px 0 8px; }
.teammates li { display: flex; align-items: center; gap: 12px; padding-block: 9px; border-bottom: 1px solid var(--line); }
.teammates li strong { overflow-wrap: anywhere; }
.teammates li small { display: block; color: var(--muted); }
.teammates li button { margin-inline-start: auto; flex: none; }

.not-found-page { padding-block: clamp(24px, 4vw, 56px); }
.not-found-card {
  display: grid; grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr); align-items: center;
  overflow: hidden; border-radius: clamp(23px, 3vw, 36px); background: linear-gradient(150deg, #e0f4e9, #e9efff);
}
.not-found-copy { padding: clamp(22px, 4.25vw, 58px); }
.not-found-code { color: var(--green-dark); font-size: clamp(38px, 5.7vw, 78px); font-weight: 850; line-height: 1; letter-spacing: -.055em; }
.not-found-copy h1 { margin-top: 8px; font-size: clamp(28px, 3.9vw, 56px); line-height: 1.02; }
.not-found-actions { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: clamp(15px, 2.3vw, 27px); }
.not-found-art { width: 100%; height: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

.about-page { padding-block: clamp(28px, 4.2vw, 60px); }
.about-intro { margin: 0 auto clamp(20px, 3vw, 36px); text-align: center; }
.about-intro h1 { font-size: clamp(35px, 5.1vw, 68px); text-wrap: balance; }
.about-intro p {
  max-width: 50ch; margin: 13px auto 0; color: var(--muted);
  font-size: clamp(16px, 1.5vw, 20px); text-wrap: balance;
}
.about-hero-art { width: 100%; height: auto; border-radius: clamp(18px, 3vw, 36px); background: var(--mint); }
.about-guide {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); align-items: center;
  gap: clamp(22px, 5vw, 72px); margin-block: clamp(30px, 5vw, 70px);
  padding-inline: clamp(0px, 2.6vw, 34px);
}
.about-guide-intro p { max-width: 36ch; margin-block: 10px 18px; color: var(--muted); }
.about-paths { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.about-path {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: clamp(10px, 2vw, 17px); padding: 12px 15px; border: 1px solid var(--line); border-radius: 18px;
  background: #f8fbfd; transition: background .18s, border-color .18s;
}
.about-path:hover { border-color: #a6cfb5; background: #f3faf5; }
.about-path-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: var(--green-dark); }
.about-path strong { font-size: 17px; }
.about-path-detail { display: block; color: var(--muted); font-size: 14px; line-height: 1.4; }
.about-path .about-path-arrow { width: 18px; height: 18px; color: var(--green-dark); }
.about-lingua {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: clamp(12px, 2.3vw, 23px); padding: clamp(15px, 2.5vw, 27px);
  border-radius: 22px; background: #f1edfc;
}
.about-lingua-heart {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px;
  background: #ffe4d5; color: #ac482d;
}
.about-lingua-heart .icon { fill: #ffbc9a; }
.about-lingua h2 { font-size: clamp(20px, 2.25vw, 27px); }
.about-lingua p { margin-top: 4px; color: var(--muted); }

.parents-hero {
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); align-items: center;
  min-height: 400px; border-radius: 34px; overflow: hidden; background: #e0f5e7;
}
.parents-hero-copy { padding: clamp(25px, 4vw, 58px); }
.parents-label { color: var(--green-dark); font-size: 15px; font-weight: 850; }
.parents-hero h1 { font-size: clamp(41px, 5.2vw, 72px); line-height: 1; margin-block: 10px 15px; }
.parents-hero-copy h1 + p { max-width: 34ch; color: #304e56; font-size: 17px; }
.parents-hero-art {
  width: 100%; height: 100%; align-self: stretch; object-fit: cover; object-position: center 37%;
}
.parents-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.parents-first-visit { margin-block: clamp(33px, 5vw, 61px) clamp(22px, 3.5vw, 43px); }
.parents-steps {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px;
  list-style: none; margin: 17px 0 0; padding: 0;
}
.parents-steps li { padding: clamp(19px, 2.4vw, 29px); border-radius: 24px; }
.parents-steps li > span {
  display: grid; place-items: center; width: 43px; height: 43px; border-radius: 14px;
  background: #fffdfc; color: var(--green-dark); margin-bottom: 15px;
}
.parents-steps .tone-1 > span { color: #255785; }
.parents-steps .tone-2 > span { color: #695198; }
.parents-steps h3, .parents-note h3 { letter-spacing: -.025em; }
.parents-steps p, .parents-note p { color: var(--muted); margin-top: 6px; }
.parents-information {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start;
  gap: clamp(15px, 2vw, 24px);
}
.parents-information > section {
  padding: clamp(19px, 2.5vw, 32px); border-radius: 25px; border: 1px solid var(--line);
  overflow-wrap: anywhere; box-shadow: var(--shadow);
}
.parents-information h2 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 18px; }
.parents-account { background: #f8fcff; }
.parents-safety-note {
  display: flex; align-items: flex-start; gap: 10px; padding: 14px;
  margin-bottom: 22px; border-radius: 14px; background: #e8f5ed; color: #24593f;
}
.parents-safety-note .icon { margin-top: 2px; stroke-width: 1.5; }
.parents-note { display: flex; align-items: flex-start; gap: 13px; }
.parents-note + .parents-note { margin-top: 18px; }
.parents-note-icon {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px;
  border-radius: 13px; color: var(--green-dark);
}
.parents-note-icon.tone-1 { color: #255785; }
.parents-account-actions {
  display: grid; justify-items: start; gap: 6px;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line);
}
.parents-dashboard-links { display: flex; flex-wrap: wrap; gap: 10px; }
.parents-information .button { max-width: 100%; }
.parents-privacy { min-height: 44px; color: var(--green-dark); }
.parents-faq { background: var(--white); }
.parent-details { display: grid; gap: 8px; }
.parent-details details { border: 1px solid var(--line); border-radius: 14px; background: #f6f9fc; }
.parent-details details[open] { background: #eef7f1; border-color: #cde5d6; }
.parent-details summary {
  display: flex; align-items: center; justify-content: space-between; gap: 9px;
  min-height: 52px; padding: 12px 15px; border-radius: 13px;
  font-weight: 750; cursor: pointer; list-style: none;
}
.parent-details summary::-webkit-details-marker { display: none; }
.parent-details summary .icon { width: 17px; height: 17px; color: var(--green-dark); rotate: 90deg; stroke-width: 1.6; }
.parent-details details[open] summary .icon { rotate: -90deg; }
.parent-details details p { color: var(--muted); padding: 0 15px 14px; }
.parents-faq-actions { margin-top: 18px; }

.legal-page { max-width: 1040px; padding-block: clamp(24px, 4vw, 50px); }
.legal-intro {
  padding: clamp(24px, 4.5vw, 49px); border-radius: 30px;
  background: linear-gradient(117deg, var(--sky), var(--mint));
}
.legal-date { color: var(--green-dark); font-size: 14px; font-weight: 750; margin-top: 9px; }
.legal-summary { max-width: 66ch; color: var(--muted); margin-top: 12px; }
.legal-navigation { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 21px; }
.legal-navigation a {
  padding: 9px 13px; border-radius: 99px; border: 1px solid #bfd7de; background: white;
  color: var(--ink); font-size: 14px; font-weight: 750;
}
.legal-navigation a:hover, .legal-navigation a[aria-current="page"] {
  color: var(--green-dark); background: var(--mint); border-color: #81bd9b;
}
.legal-body {
  display: grid; grid-template-columns: minmax(0, .55fr) minmax(0, 1.65fr); align-items: start;
  gap: clamp(14px, 3vw, 35px); margin-top: 20px;
}
.legal-contents { display: grid; gap: 4px; padding: 19px; border: 1px solid var(--line); border-radius: 21px; }
.legal-contents h2, .legal-contact h2 { font-size: 19px; margin-bottom: 5px; }
.legal-contents a { padding-block: 5px; color: var(--muted); font-size: 14px; font-weight: 700; }
.legal-contents a:hover { color: var(--green-dark); text-decoration: underline; text-underline-offset: 3px; }
.legal-sections { min-width: 0; }
.legal-sections section { padding: 15px 0 20px; border-bottom: 1px solid var(--line); scroll-margin-top: 16px; }
.legal-sections section h2 { font-size: clamp(23px, 2.7vw, 30px); }
.legal-sections section p { margin-top: 8px; color: var(--muted); }
.legal-sections section a, .legal-contact a { color: var(--green-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.legal-sections code { overflow-wrap: anywhere; }
.legal-contact { margin-top: 18px; padding: 18px; border-radius: 16px; background: var(--sky); overflow-wrap: anywhere; }

dialog {
  width: min(480px, calc(100% - 28px)); max-height: calc(100dvh - 30px); margin: auto;
  border: none; border-radius: var(--round); padding: 0; color: var(--ink); box-shadow: 0 20px 55px #11213c35;
}
dialog::backdrop { background: #152b4961; backdrop-filter: blur(3px); }
.dialog-content { position: relative; padding: 27px; }
dialog[open] .dialog-content { animation: portrait-enter .24s ease-out; }
.dialog-content h2 { font-size: clamp(28px, 5vw, 37px); padding-inline-end: 36px; }
.dialog-content p { color: var(--muted); margin-top: 10px; }
.dialog-content form { margin-top: 17px; }
.dialog-content form .button { margin-top: 13px; }
.language-dialog { overflow: hidden; }
.language-dialog .dialog-content { display: flex; flex-direction: column; max-height: inherit; }
.language-options {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  min-height: 0; margin: 11px -8px -8px; padding: 8px; overflow: auto; overscroll-behavior: contain;
}
.language-options button {
  display: flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 8px 12px; text-align: start; border: 1px solid var(--line);
  border-radius: 12px; font-weight: 700;
}
.language-options button span { flex: 1; min-width: 0; }
.language-options button:hover { background: var(--sky); }
.language-options button[aria-pressed="true"] { background: var(--mint); color: var(--green-dark); border-color: #b2dbc4; }
.language-options .icon { width: 16px; height: 16px; }

@media (min-width: 1024px) {
  .language-dialog { width: 760px; }
  .language-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.training-page { padding-block: clamp(26px, 5vw, 62px); }
.training-page h1 { margin-block: 8px 16px; }
.training-intro {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center;
  gap: 18px; padding: clamp(18px, 4vw, 40px); border-radius: var(--round); background: var(--mint);
}
.training-intro img { width: 100%; height: auto; border-radius: 22px; }
.training-options, .training-heroes { display: grid; gap: 10px; margin-block: 16px; }
.training-options { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.training-heroes { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
.training-heroes [aria-current="page"] { background: var(--mint); border-color: var(--green); }
.training-options .option { height: 100%; }
.friend-time-choice { display: grid; gap: 5px; font-weight: 700; }
.friend-time-choice { margin-block: 12px; }
.friend-time-choice select, .club-detail-card select {
  min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); background: white;
}
.friend-time-choice select { width: 100%; }
.friend-time-label, .friend-clock { display: inline-flex; align-items: center; gap: 5px; }
.friend-player-status { display: flex; flex-wrap: wrap; justify-content: end; align-items: center; gap: 6px; margin-inline-start: auto; }
.friend-clock { border-radius: 999px; padding: 4px 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.friend-clock.clock-running { background: var(--mint); color: var(--green-dark); }
.club-feature { display: grid; align-items: start; gap: 18px; }
.club-feature > :is(.button, .back-link) { justify-self: start; }
.club-detail-card {
  display: grid; gap: 12px; padding: clamp(16px, 3vw, 28px); margin-block: 6px;
  border: 1px solid var(--line); border-radius: var(--round); background: white;
}
.club-detail-card p { color: var(--muted); }
.club-detail-card :is(select, input) { max-width: 100%; }
.club-detail-card form { display: grid; justify-items: start; gap: 6px; }
.club-detail-card .form-status:empty { display: none; }
.club-detail-list {
  display: grid; gap: 8px; padding: 0; margin: 0; list-style: none;
}
.club-detail-list li {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 10px; border-radius: 12px; background: var(--sky);
}
.club-detail-list li > :is(span:last-child, form, a) { margin-inline-start: auto; }
.club-detail-list small { display: block; color: var(--muted); }
.tournament-list, .adult-progress, .progress-share-code { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.adult-progress { list-style: none; padding: 0; margin: 0; }
.adult-progress li { padding: 6px 10px; border-radius: 12px; background: var(--mint); }
.progress-share-code { align-items: start; flex-direction: column; padding: 12px; background: var(--sky); border-radius: 14px; }
@media (max-width: 600px) {
  .training-intro { grid-template-columns: minmax(0, 1fr); }
  .training-heroes .option { padding: 8px; }
}
.hero-picker .hero-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.board-picker { width: min(620px, calc(100% - 28px)); }
.board-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.board-choice {
  position: relative; display: flex; flex-direction: column; gap: 9px; min-width: 0;
  padding: 8px; border: 1px solid var(--line); border-radius: 16px;
  background: white; text-align: start; transition: border-color .18s, background .18s;
}
.board-choice:hover { border-color: #9db8ad; background: #f8fbfa; }
.board-choice[aria-pressed="true"] { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); background: #f2fbf5; }
.board-preview-frame {
  display: block; width: 100%; padding: 4px; border-radius: 10px;
  background: var(--board-rim); box-shadow: inset 0 -2px 0 var(--board-edge);
}
.board-preview {
  display: grid; grid-template: repeat(4, minmax(0, 1fr)) / repeat(4, minmax(0, 1fr));
  place-items: center; aspect-ratio: 1; border-radius: 6px; overflow: hidden;
}
.board-preview > .chess-piece { width: 90%; height: 90%; }
.board-preview > .chess-piece:first-child { grid-area: 2 / 2; }
.board-preview > .chess-piece:last-child { grid-area: 3 / 3; }
.board-choice-label { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; padding-inline: 2px; }
.board-choice-label strong { font-size: 14px; }
.board-choice-label small { font-size: 11px; font-weight: 600; color: var(--muted); }
.board-choice-check {
  position: absolute; top: 12px; inset-inline-end: 12px; display: grid; place-items: center;
  width: 25px; height: 25px; border-radius: 50%; background: var(--green-dark); color: white;
  border: 2px solid white;
}
.board-choice-check > .icon { width: 14px; height: 14px; }
.close-button { position: absolute; top: 11px; inset-inline-end: 11px; width: 42px; height: 42px; border-radius: 50%; background: var(--sky); display: grid; place-items: center; }
.dialog-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-top: 17px; }
.reward-dialog .dialog-content { text-align: center; }
.reward-dialog h2 { padding-inline-end: 0; }
.reward-dialog .dialog-actions { justify-content: center; }
.reward-visual { position: relative; width: clamp(130px, 42vw, 184px); margin: 0 auto 13px; }
.reward-illustration { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 22px; }
.reward-visual > span { position: absolute; bottom: 0; right: 0; display: grid; place-items: center; border-radius: 50%; height: 40px; width: 40px; background: #ffe7a2; border: 3px solid white; color: #7b5819; }
.reward-points { margin-top: 13px; }
.reward-points[hidden] { display: none; }
.chapter-review, .chapter-save { margin-top: 15px; padding: 13px 15px; border-radius: 15px; text-align: start; }
.chapter-review { background: var(--mint); }
.chapter-review > strong { display: flex; align-items: center; gap: 7px; color: var(--green-dark); }
.chapter-review .icon { width: 18px; height: 18px; }
.chapter-review > p { margin-top: 8px; color: var(--muted); font-size: 14px; }
.chapter-review ul { margin: 5px 0 0; padding-inline-start: 19px; color: var(--muted); font-size: 14px; }
.chapter-review .puzzle-explanation-key { padding-inline-start: 0; margin-top: 9px; }
.chapter-review .puzzle-explanation-key li { margin-top: 0; }
.chapter-review li + li { margin-top: 3px; }
.chapter-save { background: #f2f8ff; }
.chapter-save p { margin-top: 0; font-size: 14px; color: var(--muted); }
.chapter-save .button { margin-top: 9px; }
.quiz-heading { display: flex; align-items: center; gap: 9px; font-size: 14px; margin-bottom: 16px; }
.quiz-heading small { display: block; color: var(--muted); }
.quiz-answers { display: grid; gap: 8px; margin-top: 15px; }
.quiz-answers button { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: start; min-height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--sky); padding: 9px 14px; font-weight: 650; }
.quiz-answers button.correct { background: var(--mint); color: var(--green-dark); opacity: 1; }
.quiz-answers button.incorrect { background: var(--lilac); }
.quiz-feedback { min-height: 26px; }
.quiz-dialog .button { margin-top: 13px; }
.promotions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
.promotions button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; background: var(--sky); border-radius: 13px; padding: 7px; min-height: 65px; }
.promotions .chess-piece { width: 44px; height: 44px; }
.notice {
  pointer-events: none; position: fixed; z-index: 41; left: 50%; bottom: 18px; translate: -50% 10px;
  background: var(--ink); color: white; border-radius: 99px; width: max-content; max-width: calc(100% - 26px);
  padding: 10px 16px; text-align: center; font-size: 14px; opacity: 0; transition: opacity .2s, translate .2s;
}
.notice.visible { opacity: 1; translate: -50% 0; }

@media (min-width: 1101px) and (max-width: 1250px) {
  .topbar-inner { padding-inline: 18px; gap: 14px; }
  .topbar .brand-image { width: 119px; }
  .site-nav { gap: 13px; font-size: 14px; }
  .session-nav { gap: 9px; }
  .session-nav > .header-account { padding-inline: 12px; }
}

@media (max-width: 1100px) {
  .site-nav, .club-nav { display: none; }
  .mobile-menu { display: block; }
  .mobile-menu > summary {
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 15px;
    background: var(--mint); color: var(--green-dark); list-style: none; cursor: pointer;
  }
  .mobile-menu > summary .icon { stroke-width: 1.75; }
  .mobile-menu > summary::-webkit-details-marker { display: none; }
  .mobile-menu:not([open]) .menu-close-icon, .mobile-menu[open] .menu-open-icon { display: none; }
  .mobile-menu-panel {
    position: absolute; inset-block-start: calc(100% + 8px); inset-inline-end: 0; width: min(100%, 390px);
    max-height: calc(100dvh - var(--header-clearance) - env(safe-area-inset-bottom) - 12px);
    overflow-y: auto; overscroll-behavior: contain; white-space: normal;
    padding: 7px; border: 1px solid var(--line); border-radius: 21px; background: white;
    box-shadow: 0 12px 34px #22466724; animation: route-enter .15s ease-out;
  }
  .mobile-menu-panel a, .mobile-menu-panel .play-menu > summary {
    display: flex; align-items: center; gap: 11px; padding: 7px 10px; min-height: 44px;
    border-radius: 12px; font-weight: 700; font-size: 15px;
  }
  .mobile-menu-panel .icon { width: 19px; height: 19px; color: var(--green-dark); }
  .mobile-menu-panel :is(a[aria-current="page"], a:hover, .play-menu > summary:hover) { background: var(--mint); }
  .mobile-menu-panel :is(.play-menu-chevron, .external-arrow) { margin-inline-start: auto; }
  .mobile-menu-panel .play-menu-panel { margin: 2px 0 5px 16px; padding-left: 6px; border-left: 2px solid var(--line); }
  .mobile-menu-panel .play-menu-panel a { font-size: 14px; }
  .mobile-menu-panel > .xp-pill { display: none; }
}

@media (min-width: 881px) and (max-width: 1200px) {
  .landing-art {
    top: auto; max-height: 100%; aspect-ratio: 1671 / 941;
    mask-image: linear-gradient(transparent, black 15%);
  }
}

@media (max-width: 1000px) {
  .section-width { width: calc(100% - 48px); }
  .topbar-inner { gap: 16px; padding-inline: 16px; }
  .hero-actions .button { font-size: 14px; padding-inline: 15px; }
  .hero-description { font-size: 16px; }
  .lesson-preview { gap: 10px; padding: 14px; }
  .feature { padding: 24px; }
  .feature-friends { scale: .85; transform-origin: bottom right; }
  .hero-collection .hero-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .lesson-card { padding: 15px; gap: 9px; }
  .lesson-piece { width: 51px; height: 66px; }
  .footer-promos { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 880px) {
  .puzzle-archive-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-leader-list { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .rated-lobby { grid-template-columns: minmax(0, 1fr); }
  .landing-stage { min-height: 0; border-radius: 28px; }
  .landing-copy { width: auto; max-width: none; padding: clamp(23px, 5vw, 38px); }
  .landing-copy h1 { font-size: 42px; margin-block: 13px 14px; }
  .hero-description { max-width: 43ch; }
  .hero-actions { gap: 8px; margin-top: 18px; }
  .hero-actions .button { min-height: 46px; padding-inline: 12px; gap: 8px; }
  .landing-buddies { margin-top: 12px; }
  .landing-art { position: relative; inset: auto; aspect-ratio: 1.53; }
  .landing-art::after { background: linear-gradient(#e0e9fc, transparent 16%); }
  .landing-art img { object-position: right center; }
}

@media (max-width: 760px) {
  .leaderboard-page { padding-block: 25px 33px; }
  :root { --header-inset: 8px; --header-clearance: calc(max(var(--header-inset), env(safe-area-inset-top)) + 68px); }
  .section-width { width: calc(100% - 34px); }
  .daily-puzzle-card {
    grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "board" "actions";
    gap: 16px; padding: clamp(13px, 4vw, 24px);
  }
  .puzzle-board, .puzzle-actions { width: min(100%, 420px); justify-self: center; }
  .puzzle-meta { margin-top: 12px; }
  .practice-list { grid-template-columns: minmax(0, 1fr); }
  .topbar {
    width: calc(100% - 20px); border-radius: 23px; background: rgb(250 253 255 / 93%);
    box-shadow: 0 4px 18px #22466713;
  }
  .topbar-inner { min-height: 57px; gap: 8px; padding-inline: 11px 7px; }
  .brand-image { width: 107px; }
  .session-nav { gap: 6px; }
  .session-nav > .header-account { gap: 5px; padding-inline: 10px; font-size: 13px; }
  .session-nav .header-account .avatar { width: 20px; height: 20px; }
  .session-nav > .xp-pill { display: none; }
  .mobile-menu-panel > .xp-pill { display: flex; width: fit-content; margin: 6px 0 0; }
  .session-nav > .language-toggle { width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; }
  .session-nav > .language-toggle:hover { background: var(--sky); }
  .session-nav > .language-toggle span { display: none; }
  .notice { bottom: calc(14px + env(safe-area-inset-bottom)); }

  .landing-hero { width: calc(100% - 20px); padding-block: 13px 24px; }
  .landing-stage { border-radius: 24px; }
  .landing-copy { text-align: center; padding: 23px clamp(15px, 4.75vw, 28px) 6px; }
  .landing-label { justify-content: center; font-size: 12px; }
  .landing-label .icon { width: 16px; height: 16px; }
  .landing-copy h1 { font-size: clamp(30px, 8.5vw, 42px); margin-block: 10px 11px; }
  .hero-description { margin-inline: auto; max-width: 36ch; font-size: 15px; line-height: 1.45; }
  .hero-actions {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch;
    max-width: 400px; margin: 15px auto 0;
  }
  .hero-actions .button { width: 100%; min-height: 48px; padding: 8px 11px; overflow-wrap: anywhere; }
  .landing-buddies { gap: 8px; min-height: 44px; margin-top: 6px; text-align: start; font-size: 13px; }
  .landing-buddy-portraits .avatar { width: 28px; height: 28px; }
  .landing-art { aspect-ratio: 1.43; }
  .landing-art::after { background: linear-gradient(#e0e9fc, #e0e9fc88 5%, transparent 15%); }

  .land-learning { padding-block: 30px 35px; }
  .section-title { gap: 12px; }
  .section-title p { font-size: 15px; line-height: 1.45; }
  .lesson-showcase { grid-template-columns: 1fr; gap: 12px; }
  .lesson-showcase-art { height: auto; max-height: 340px; }
  .lesson-previews { gap: 9px; }
  .lesson-preview { min-height: 84px; padding: 11px; }
  .lesson-preview h3 { font-size: 18px; }
  .preview-piece { width: 51px; height: 56px; border-radius: 14px; }
  .landing-features { grid-template-columns: 1fr; padding-block: 32px; gap: 13px; }
  .feature { min-height: 250px; }
  .feature-friends { scale: .68; }
  .feature p { font-size: 15px; }
  .parent-strip { padding-block: 22px; flex-wrap: wrap; gap: 9px 12px; }
  .parent-strip > div { flex: 1 0 70%; }
  .parent-strip .button { margin: 0 0 0 40px; }
  .footer-brand .brand-image { width: 106px; }
  .footer-links nav a { font-size: 14px; }
  .footer-bottom small { font-size: 12px; }
  .footer-bottom { flex-wrap: wrap; }
  .footer-legal { flex-basis: 100%; order: -1; }
  .legal-body { grid-template-columns: minmax(0, 1fr); }
  .legal-intro { border-radius: 23px; }
  .start-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; padding-block: 26px 34px; max-width: 520px; }
  .start-art { max-width: 360px; border-radius: 38px 22px 22px 22px; }
  .auth-layout {
    grid-template-columns: minmax(0, 1fr); min-height: 0; max-width: 520px; border-radius: 25px;
  }
  .auth-panel { grid-row: 1; padding: 17px clamp(18px, 5vw, 28px) 22px; }
  .auth-form-wrap h1 { margin-block: 5px 9px; }
  .auth-form { margin-top: 20px; }
  .auth-sign-in .auth-story { aspect-ratio: 1.55; }
  .auth-sign-in .auth-story-image { object-position: center 24%; }
  .auth-register .auth-story-image { border-radius: 18px; }
  .friend-invite { grid-template-columns: minmax(0, 1fr); padding: 15px 17px; gap: 10px; }
  .about-guide { grid-template-columns: minmax(0, 1fr); padding-inline: 0; }
  .about-lingua { grid-template-columns: auto minmax(0, 1fr); }
  .about-lingua .button { grid-column: 2; }
  .parents-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; border-radius: 27px; }
  .parents-hero-art { height: auto; aspect-ratio: 1.6; }
  .parents-actions .button { min-height: 46px; padding-inline: 15px; font-size: 14px; }
  .parents-steps { gap: 9px; }
  .parents-information { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .club-page, .lessons-page, .game-page, .lesson-page, .account-page, .heroes-page, .team-page, .parents-page { padding-block: 25px 33px; }
  .not-found-card { grid-template-columns: minmax(0, 1fr); }
  .not-found-actions .button { min-height: 44px; padding-inline: 14px; gap: 8px; font-size: 14px; }
  .not-found-art { height: auto; }
  .screen-title { flex-wrap: wrap; align-items: flex-start; margin-bottom: 18px; gap: 12px; }
  .screen-title p { font-size: 15px; }
  .club-grid { grid-template-columns: 1fr; gap: 13px; }
  .club-learning { margin-top: 19px; }
  .club-learning-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .club-learning-stages > li:last-child { grid-column: 1 / -1; }
  .club-puzzle-card { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 13px; }
  .club-friend-card { margin-top: 13px; }
  .club-friend-history { margin-top: 13px; }
  .friend-history-list { grid-template-columns: minmax(0, 1fr); }
  .club-puzzle-card .button { justify-self: start; }
  .club-puzzle-card .puzzle-page-links { justify-content: flex-start; }
  .next-card > div { padding: 22px 0 22px 22px; }
  .next-scene { min-height: 244px; }
  .progress-card { padding: 18px 20px; }
  .club-options { margin-top: 13px; gap: 9px; grid-template-columns: 1fr; }
  .option { min-height: 62px; }
  .lesson-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lesson-card { min-height: 124px; border-radius: 19px; padding: 12px; }
  .lesson-card h3 { font-size: 19px; }
  .lesson-card p, .lesson-meta { font-size: 13px; }
  .lesson-meta { margin-top: 6px; }
  .board-layout { grid-template-columns: minmax(0, 1fr); gap: 17px; max-width: 530px; }
  .board-page-bar { margin-bottom: 11px; }
  .game-page, .lesson-page { width: calc(100% - 24px); padding-top: 15px; }
  .game-page .screen-title { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; margin-bottom: 9px; }
  .game-page .screen-title h1 { font-size: clamp(27px, 6.8vw, 38px); }
  .game-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .game-toolbar:has(.board-style-button) { grid-template-columns: minmax(0, 1fr) auto; }
  .game-toolbar .segmented { display: none; }
  .game-mode-picker { display: block; position: relative; min-width: 0; margin: 0; }
  .game-mode-picker select {
    appearance: none; display: block; width: 100%; min-height: 44px; padding: 6px 30px 6px 11px;
    border: 1px solid #c5dbea; border-radius: 14px; background: var(--sky); color: var(--ink);
    font-size: 16px; font-weight: 720; text-overflow: ellipsis;
  }
  .game-mode-picker .icon {
    position: absolute; right: 10px; top: 50%; width: 15px; height: 15px;
    transform: translateY(-50%) rotate(90deg); pointer-events: none;
  }
  .game-toolbar .board-style-button {
    gap: 6px; max-width: min(44vw, 176px); padding: 7px 10px;
    font-size: 13px; white-space: normal; overflow-wrap: anywhere;
  }
  .board-style-button > .icon { display: none; }
  .board-swatch { width: 18px; height: 18px; }
  .board-frame { padding: 4px; border-radius: 12px; box-shadow: 0 3px 0 var(--board-edge), 0 8px 20px var(--board-shadow); }
  .board { border-radius: 7px; }
  .rank-label, .file-label { font-size: clamp(8px, 2vw, 10px); }
  .rank-label { left: 3px; top: 3px; }
  .file-label { right: 3px; bottom: 3px; }
  .legal-mark:not(.capture) { inset: 36%; }
  .player-bar { gap: 7px; min-height: 40px; margin-bottom: 5px; font-size: 14px; line-height: 1.28; }
  .player-bar > div { min-width: 0; }
  .player-bar .avatar, .player-bar > .friend-empty-avatar { width: 36px; height: 36px; }
  .player-bar small { font-size: 12px; }
  .player-bar > .turn-chip { max-width: 55%; padding: 5px 9px; white-space: normal; text-align: center; }
  .friend-player-status .turn-chip { max-width: 100%; white-space: normal; text-align: center; }
  .player-bottom { margin: 8px 0 0; }
  .practice-objective { margin-bottom: 7px; padding: 7px 10px; line-height: 1.25; }
  .board-guide { padding: 16px; }
  .board-guide h1 { font-size: clamp(25px, 6vw, 34px); }
  .first-move-heading .avatar { width: 44px; height: 44px; }
  .first-move-heading h1 { font-size: clamp(22px, 5.7vw, 30px); }
  .first-move-guide .instruction { margin-top: 9px; padding-block: 9px; }
  .first-move-guide .guide-actions { margin-top: 8px; }
  .game-guide .guide-buddy { display: none; }
  .game-guide h2 { font-size: 22px; }
  .lesson-page .board-guide { order: -1; }
  .lesson-page .board-layout { gap: 13px; }
  .lesson-page .board-page-bar .text-link { min-height: 36px; }
  .lesson-page .board-guide { padding: 13px 14px; }
  .lesson-page .guide-buddy { display: none; }
  .board-guide p:not(.card-label), .instruction { font-size: 14px; }
  .lesson-page .board-guide p:not(.card-label) { margin-top: 6px; }
  .lesson-page .instruction { margin-top: 8px; padding: 8px 10px; }
  .lesson-page .guide-actions { margin-top: 7px; }
  .guide-actions .button { min-height: 44px; padding: 9px 14px; font-size: 14px; }
  .lesson-page .card-label { margin-bottom: 3px; }
  .account-overview, .account-body { grid-template-columns: minmax(0, 1fr); }
  .account-overview, .account-body, .account-column { gap: 12px; }
  .account-body { margin-top: 12px; }
  .account-identity, .account-level, .account-panel { padding: 17px; }
  .account-identity { gap: 14px; }
  .account-avatar { width: 82px; height: 82px; border-width: 4px; }
  .hero-spotlight { border-radius: 25px; }
  .hero-collection { margin-top: 21px; }
  .hero-collection .hero-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .hero-grid { gap: 4px; }
  .hero-choice i { top: auto; bottom: 25px; }
}

@media (max-width: 600px) {
  .puzzle-archive-list { grid-template-columns: minmax(0, 1fr); }
  .puzzle-archive-filters { width: 100%; }
  .puzzle-archive-filters > button { flex: 1 0 auto; }
}

@media (max-width: 500px) {
  .language-toggle { min-width: 36px; min-height: 36px; padding: 0; }
  .language-toggle span { display: none; }
  .hero-actions .button > .icon { display: none; }
  .footer-links { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand p { font-size: 14px; }
  .footer-apps, .footer-lingua { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .footer-apps-copy, .footer-lingua-copy { padding: 20px 18px 9px; }
  .footer-apps-art { width: min(76%, 217px); max-height: 175px; transform: translateY(15px); }
  .footer-lingua-art { width: min(60%, 176px); }
  .landing-together-grid { grid-template-columns: minmax(0, 1fr); }
  .parents-dashboard-links, .parents-dashboard-links .button { width: 100%; }
  .landing-leaders .section-title { flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
  .home-leaders-empty { align-items: flex-start; gap: 12px; }
  .home-leaders-empty p, .home-play-copy p { font-size: 14px; line-height: 1.4; }
  .home-leaders-art { width: 64px; }
  .home-leader-list li { min-height: 73px; gap: 8px; padding: 10px; }
  .home-leader-list .avatar { width: 35px; height: 35px; }
  .hero-spotlight { grid-template-columns: minmax(0, 1fr); text-align: center; padding: 20px; gap: 13px; }
  .hero-spotlight-art { grid-row: 1; width: min(58%, 188px); }
  .hero-selected-label { justify-content: center; margin-bottom: 5px; font-size: 13px; }
  .hero-spotlight h2 + p { margin-inline: auto; }
  .hero-spotlight .button { margin-top: 13px; }
  .hero-collection .hero-choice { padding: 7px 3px 5px; gap: 3px; font-size: 12px; }
  .hero-collection .hero-choice i { right: 1px; bottom: 22px; }
  .parents-steps { grid-template-columns: minmax(0, 1fr); }
  .parents-steps li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; }
  .parents-steps li > span { grid-row: span 2; margin-bottom: 0; }
  .parents-steps p { margin-top: 4px; font-size: 15px; }
  .friend-lobby { grid-template-columns: minmax(0, 1fr); border-radius: 24px; }
  .friend-lobby-art { height: auto; aspect-ratio: 1.55; }
  .rated-lobby .friend-lobby-art { min-height: 0; }
  .rated-card { border-radius: 24px; }
  .leaderboard-table thead { font-size: 12px; }
  .leaderboard-table th, .leaderboard-table td { padding: 9px 6px; }
  .leaderboard-table th:first-child, .leaderboard-table td:first-child { padding-left: 10px; }
  .leaderboard-table .leaderboard-numeric:last-child { padding-right: 10px; }
  .leaderboard-player { gap: 6px; font-size: 14px; }
  .leaderboard-player small { font-size: 12px; }
  .leaderboard-player .avatar { width: 28px; height: 28px; }
  .leaderboard-empty { flex-wrap: wrap; text-align: center; gap: 10px; padding: 18px; }
  .board-picker .dialog-content { padding: 19px 16px; }
  .board-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
  .board-choice { padding: 6px; gap: 6px; }
  .feature { min-height: 210px; }
  .feature-heroes .feature-copy { width: 70%; }
  .feature.feature-bao { grid-template-columns: minmax(0, 1fr); }
  .feature-bao-art { grid-row: 1; height: auto; aspect-ratio: 3 / 2; }
  .feature-friends { scale: .71; }
  .section-title { align-items: flex-start; }
  .section-title .button { flex: none; padding-inline: 11px; font-size: 13px; }
  .section-title .button .icon { display: none; }
  .next-card { grid-template-columns: 1fr; }
  .next-card > div { padding: 21px; }
  .next-scene { min-height: 0; height: auto; aspect-ratio: 3 / 2; }
  .lesson-list { grid-template-columns: 1fr; }
  .lesson-card { min-height: 93px; }
  .lesson-card h3 { font-size: 20px; }
  .learning-hero { grid-template-columns: minmax(0, 1fr); border-radius: 25px; }
  .learning-hero-art { height: auto; aspect-ratio: 3 / 2; }
  .reward-dialog:has(.chapter-review) .reward-visual { width: 112px; }
  .quiz-invitation { display: grid; grid-template-columns: 80px minmax(0, 1fr); column-gap: 11px; padding: 15px; }
  .quiz-cover { width: 80px; }
  .quiz-invitation .button { grid-column: 2; justify-self: start; margin-inline-start: 0; }
  .team-gate { grid-template-columns: minmax(0, 1fr); }
  .play-mode-grid, .team-weekly { grid-template-columns: minmax(0, 1fr); }
  .play-mode-art { aspect-ratio: 2.35 / 1; }
  .team-weekly { margin-bottom: 12px; }
  .weekly-card-art { height: auto; aspect-ratio: 2.35 / 1; object-position: center top; }
  .team-gate-art { height: auto; aspect-ratio: 3 / 2; }
  .activity-empty { grid-template-columns: 88px minmax(0, 1fr); gap: 9px; font-size: 14px; }
  .team-forms, .team-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .team-form, .team-progress, .invite-card, .teammates { padding: 17px; }
}

.legal-page :is(h1, h2) { overflow-wrap: anywhere; hyphens: auto; }

@media (max-width: 450px) {
  .language-options { grid-template-columns: minmax(0, 1fr); }
  .teammates li { display: grid; grid-template-columns: auto minmax(0, 1fr); row-gap: 7px; }
  .teammates li button { grid-column: 2; justify-self: start; margin-inline-start: 0; max-width: 100%; overflow-wrap: anywhere; }
}

@media (max-width: 360px) {
  .brand-image { width: 94px; }
  .header-account > :is(.icon, .avatar) { display: none; }
  .hero-actions .button { font-size: 13px; padding-inline: 11px; }
  .feature-heroes .feature-copy { width: 76%; }
  .feature-friends { scale: .55; }
  .badges { gap: 5px; }
  .account-avatar { width: 66px; height: 66px; }
  .identity-actions { gap: 0 10px; }
  .badge strong { font-size: 12px; }
  .badge small { font-size: 10px; }
  .player-bar > span { font-size: 11px; }
}

@keyframes route-enter {
  from { opacity: .55; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scene-enter {
  from { transform: scale(1.035); }
  to { transform: scale(1); }
}
@keyframes portrait-enter {
  from { opacity: .65; transform: scale(.95); }
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Keep the character illustration and its open text area in their original positions. */
[dir="rtl"] .landing-stage { direction: ltr; }
[dir="rtl"] .landing-copy { direction: rtl; }
[dir="rtl"] :is(.link-arrow, .back-link .icon, .landing-buddies > .icon) { scale: -1 1; }
:is(:lang(ar), :lang(he), :lang(hi)) :is(h1, h2, h3, .landing-copy h1 em) { letter-spacing: normal; line-height: 1.2; }

.home-facts { display: grid; gap: 12px; margin-block: clamp(18px, 3vw, 34px) clamp(26px, 4vw, 56px); }
.home-trust, .home-numbers { list-style: none; margin: 0; padding: 0; }
.home-trust { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 18px; }
.home-trust li { padding: 8px 14px; border-radius: 999px; background: var(--mint); color: var(--green-dark); font-weight: 700; }
.home-trust li, .home-trust a { display: inline-flex; align-items: center; gap: 7px; }
.home-trust a { color: inherit; text-decoration: none; }
.home-trust a:hover { text-decoration: underline; }
.home-trust svg, .home-plan li svg { width: 18px; height: 18px; flex: none; }
.home-numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: min(100%, 480px); justify-self: center; color: var(--muted); text-align: center; font-size: .85rem; }
.home-numbers li { display: grid; gap: 2px; align-content: start; }
.home-numbers strong { color: var(--ink); font-size: 1.35rem; line-height: 1.2; }
.home-numbers li + li { border-inline-start: 1px solid var(--line); }
.home-plans, .home-guides { margin-block: clamp(38px, 6vw, 80px); }
.home-plan-grid, .home-guide-grid, .opponent-picker-grid { display: grid; gap: 12px; }
.home-plan-grid, .opponent-picker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-guide-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.home-plan { padding: clamp(20px, 4vw, 34px); background: #f1f9ff; border-radius: 24px; }
.home-plan-premium { background: #f5efff; }
.home-plan h3 { margin-top: 0; }
.home-plan ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 166px), 1fr)); gap: 8px 16px; padding: 0; margin: 12px 0 20px; list-style: none; }
.home-plan li { display: flex; gap: 6px; align-items: center; }
.home-plan li svg { color: var(--green-dark); }
.home-guide-grid .option, .opponent-picker-grid .option { min-width: 0; }
.opponent-picker-grid [aria-current="page"] { background: var(--mint); border-color: var(--green); }
.match-opponent { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; margin-block: 8px 16px; background: #f1f9ff; border-radius: 18px; }
.match-opponent div { display: grid; margin-inline-end: auto; }
.match-opponent small { color: var(--muted); }
.guide-article, .classrooms-page { margin-block: clamp(24px, 4vw, 48px); }
.guide-article-hero, .classrooms-hero { display: grid; align-items: center; gap: 22px; padding: clamp(22px, 5vw, 56px); background: #e8f6f3; border-radius: 28px; }
.guide-article-hero { grid-template-columns: minmax(0, 1fr) minmax(100px, 180px); margin-block: 16px 28px; }
.classrooms-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-bottom: 20px; background: #edf3ff; }
.guide-article-hero h1, .classrooms-hero h1 { margin-top: 0; }
.guide-article-hero-photo { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.classrooms-art { width: 100%; height: auto; border-radius: 18px; }
.guide-article-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, .8fr); gap: clamp(24px, 5vw, 64px); }
.guide-article-copy section { margin-block: 0 26px; }
.guide-article-copy h2, .classrooms-page .parents-steps h2 { font-size: clamp(1.2rem, 2.4vw, 1.65rem); }
.guide-example { margin: 0; }
.guide-example figcaption { padding-block: 10px; color: var(--muted); }
.guide-notation { font-weight: 800; overflow-wrap: anywhere; margin-block: 0 8px; }
@media (max-width: 650px) {
  .home-plan-grid, .guide-article-layout, .classrooms-hero { grid-template-columns: minmax(0, 1fr); }
  .guide-article-hero { grid-template-columns: minmax(0, 1fr) minmax(66px, 86px); gap: 12px; }
}
@media (max-width: 420px) {
  .opponent-picker-grid { grid-template-columns: minmax(0, 1fr); }
}
