/* EverLearn — the EverlyceResearch palette (paper, ink, rust) applied to a
 * playful lesson path. No layout is borrowed from the research site: this is
 * a learning app first, built from the same warm paper stock.
 */

:root {
  --paper: #f3efe6;
  --paper-2: #ebe4d6;
  --paper-3: #e2d9c8;
  --card: #faf7f1;
  --card-2: #f6f1e7;
  --ink: #1c1915;
  --ink-2: #3b352d;
  --muted: #6f685e;
  --muted-2: #8b8174;
  --line: #e3dcd0;
  --line-2: #d3c8b7;
  --signal: #8f3418;
  --signal-dark: #6f2711;
  --signal-bright: #a84624;
  --signal-soft: #f3e6dc;
  --signal-softer: #f8f0e9;
  --inverse: #f7f3eb;
  --green: #3f6b4a;
  --green-soft: #e7eee2;
  --red: #a13b2b;
  --red-soft: #f6e4df;
  --amber: #9a6a1f;
  --board-light: #f6efe1;
  --board-dark: #c9b79b;
  --shadow-sm: 0 1px 2px rgba(28, 25, 21, 0.04);
  --shadow: 0 10px 30px -22px rgba(28, 25, 21, 0.35);
  --shadow-lg: 0 30px 70px -32px rgba(28, 25, 21, 0.5);
  --radius: 18px;
  --radius-sm: 12px;
  --serif: ui-serif, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--signal);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  line-height: 1.15;
}

:focus-visible {
  outline: 2.5px solid var(--signal);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: var(--signal-soft);
  color: var(--ink);
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 999;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--inverse);
  border-radius: 8px;
  transform: translateY(-150%);
  transition: transform 0.2s;
}

.skip-link:focus {
  transform: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.boot {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: var(--muted);
}

.boot img {
  animation: bob 1.6s ease-in-out infinite;
}

.boot p {
  font-size: 14px;
  letter-spacing: 0.02em;
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 200;
  background: var(--red-soft);
  border: 1px solid #e7c4bd;
  color: var(--red);
  padding: 14px 18px;
  border-radius: 12px;
}

/* ------------------------------------------------------------- shell */

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 16px 16px;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 20px;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.brand-text {
  min-width: 0;
  line-height: 1.1;
}

.brand-name {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-tag {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 2px;
}

.nav-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 10px 10px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 0 11px;
  border-radius: 11px;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 14px;
  border: 0;
  background: transparent;
  text-align: left;
  width: 100%;
}

.nav-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--muted);
}

.nav-link:hover {
  background: var(--card-2);
  text-decoration: none;
}

.nav-link.active {
  background: var(--signal-soft);
  color: var(--signal);
}

.nav-link.active svg {
  color: var(--signal);
}

.side-course {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 8px 12px;
}

.side-course-card {
  border: 1px solid var(--line);
  background: var(--card-2);
  border-radius: 14px;
  padding: 12px 13px;
}

.side-course-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--signal);
}

.side-course-title {
  margin-top: 5px;
  font-size: 14px;
  font-weight: 700;
}

.side-course-meta {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.side-user {
  border-top: 1px solid var(--line);
  padding: 13px 8px 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--inverse);
  background: var(--ink);
  flex-shrink: 0;
  text-transform: uppercase;
}

.avatar.tone-1 { background: #8f3418; }
.avatar.tone-2 { background: #4c5d3c; }
.avatar.tone-3 { background: #7a4a20; }
.avatar.tone-4 { background: #4a4f63; }
.avatar.tone-5 { background: #6a4a58; }

.side-user-name {
  min-width: 0;
  flex: 1;
}

.side-user-name strong {
  display: block;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-user-name span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.icon-button:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

/* ------------------------------------------------------------- content */

.content-area {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 40px 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 304px;
  gap: 38px;
  align-items: start;
}

.content-area.no-rail {
  max-width: 1040px;
  grid-template-columns: minmax(0, 1fr);
}

.main-col {
  min-width: 0;
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 34px;
}

.mobile-bar,
.mobile-nav {
  display: none;
}

/* ------------------------------------------------------------- type bits */

.eyebrow {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--signal);
}

.display {
  font-family: var(--serif);
  letter-spacing: -0.025em;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.tiny {
  font-size: 12px;
}

/* ------------------------------------------------------------- cards */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.card-head h3 {
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.card-head .tiny {
  color: var(--muted);
}

/* ------------------------------------------------------------- learn head */

.learn-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.learn-head h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 3.3vw, 42px);
  letter-spacing: -0.03em;
  margin-top: 6px;
}

.learn-head p {
  color: var(--muted);
  margin-top: 8px;
  max-width: 540px;
}

.head-stats {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 99px;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}

.stat-pill svg {
  width: 17px;
  height: 17px;
}

.stat-pill.flame svg { color: #b2541f; }
.stat-pill.bolt svg { color: var(--signal); }
.stat-pill.heart svg { color: var(--red); }

/* ------------------------------------------------------------- units/path */

.section-index {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 20px;
}

.section-index a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--card);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}

.section-index a span {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--signal);
  font-weight: 800;
}

.section-index a:hover {
  border-color: var(--signal);
  color: var(--ink);
  text-decoration: none;
}

.course-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 26px;
  box-shadow: var(--shadow-sm);
}

.course-strip img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.course-strip strong {
  display: block;
  font-size: 14px;
}

.course-strip span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.course-strip .progress-line {
  margin-left: auto;
  min-width: 130px;
  max-width: 220px;
  flex: 1;
}

.unit {
  margin-bottom: 30px;
  scroll-margin-top: 78px;
  animation: rise 0.35s ease both;
}

.unit-head {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 20px 24px 24px;
  color: var(--inverse);
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(247, 243, 235, 0.12), transparent 55%),
    linear-gradient(122deg, #1c1915, #373027);
  box-shadow: var(--shadow);
}

.unit.tone-signal .unit-head {
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(247, 243, 235, 0.16), transparent 55%),
    linear-gradient(122deg, #6f2711, #a84624);
}

.unit-head::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -80px;
  width: 190px;
  height: 190px;
  border: 22px solid rgba(247, 243, 235, 0.07);
  border-radius: 50%;
  pointer-events: none;
}

.unit-kicker {
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(247, 243, 235, 0.68);
}

.unit-head h2 {
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 28px);
  margin-top: 6px;
  letter-spacing: -0.02em;
}

.unit-head p {
  margin-top: 5px;
  font-size: 13.5px;
  color: rgba(247, 243, 235, 0.75);
  max-width: 480px;
}

.unit-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.progress-track {
  height: 8px;
  border-radius: 99px;
  background: rgba(247, 243, 235, 0.18);
  overflow: hidden;
  flex: 1;
}

.progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--inverse);
  transition: width 0.5s ease;
}

.progress-track.on-paper {
  background: var(--paper-2);
  height: 7px;
}

.progress-track.on-paper > span {
  background: var(--signal);
}

.unit-progress-text {
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(247, 243, 235, 0.78);
  white-space: nowrap;
}

.unit-body {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  margin: -14px 10px 0;
  padding: 34px 16px 16px;
  box-shadow: var(--shadow-sm);
}

.path {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0 8px;
}

.path::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 50%;
  border-left: 2px dashed var(--line-2);
  transform: translateX(-50%);
  opacity: 0.75;
}

.lesson-row {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 98px;
  z-index: 1;
}

.lesson-row:nth-child(3n + 1) { justify-content: flex-start; padding-left: 5%; }
.lesson-row:nth-child(3n + 2) { justify-content: center; }
.lesson-row:nth-child(3n) { justify-content: flex-end; padding-right: 5%; }

.lesson-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 132px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink);
}

.lesson-entry:disabled {
  cursor: not-allowed;
}

.lesson-node {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 2px solid var(--line-2);
  box-shadow: 0 4px 0 var(--line-2);
  color: var(--ink-2);
  transition: transform 0.16s, box-shadow 0.16s, background 0.16s;
}

.lesson-node svg {
  width: 27px;
  height: 27px;
}

.lesson-entry:not(:disabled):hover .lesson-node {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--line-2);
}

.lesson-entry:not(:disabled):active .lesson-node {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--line-2);
}

.lesson-entry.done .lesson-node {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--inverse);
  box-shadow: 0 4px 0 #000;
}

.lesson-entry.current .lesson-node {
  background: var(--signal);
  border-color: var(--signal-dark);
  color: var(--inverse);
  box-shadow: 0 4px 0 var(--signal-dark);
}

.lesson-entry.current .lesson-node::after {
  content: "";
  position: absolute;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: 2px solid rgba(143, 52, 24, 0.35);
  animation: halo 2.4s ease-out infinite;
}

.lesson-entry.current .lesson-node {
  position: relative;
}

.lesson-entry.locked .lesson-node {
  background: var(--paper-2);
  border-color: var(--line);
  color: var(--muted-2);
  box-shadow: 0 3px 0 var(--line);
}

.lesson-title {
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

.lesson-sub {
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
}

.lesson-entry.locked .lesson-title,
.lesson-entry.locked .lesson-sub {
  color: var(--muted-2);
}

.coming-soon {
  border: 1.5px dashed var(--line-2);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  background: transparent;
}

.coming-soon .cs-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  color: var(--muted);
  flex-shrink: 0;
}

.coming-soon strong {
  display: block;
  color: var(--ink-2);
  font-size: 13.5px;
}

.coming-soon span {
  display: block;
  font-size: 12px;
}

/* ------------------------------------------------------------- rail */

.goal-card {
  display: flex;
  gap: 16px;
  align-items: center;
}

.goal-ring {
  --pct: 0%;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: conic-gradient(var(--signal) var(--pct), var(--paper-2) 0);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.goal-ring-in {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--card);
  display: grid;
  place-content: center;
  text-align: center;
  line-height: 1.05;
}

.goal-ring-in strong {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.03em;
}

.goal-ring-in span {
  font-size: 9.5px;
  color: var(--muted);
  font-weight: 700;
}

.goal-copy h3 {
  font-size: 14px;
  font-weight: 750;
}

.goal-copy p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.goal-done {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--green);
}

.goal-done svg {
  width: 14px;
  height: 14px;
}

.streak-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.flame-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--signal-soft);
  color: var(--signal);
  flex-shrink: 0;
}

.flame-circle svg {
  width: 24px;
  height: 24px;
}

.streak-number {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.streak-label {
  font-size: 12px;
  color: var(--muted);
}

.week-dots {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 15px;
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--muted-2);
}

.week-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  color: var(--paper-2);
}

.week-dot.on {
  background: var(--signal);
  color: var(--inverse);
}

.week-dot svg {
  width: 13px;
  height: 13px;
}

.heart-row {
  display: flex;
  gap: 5px;
  margin-bottom: 9px;
}

.heart-row svg {
  width: 22px;
  height: 22px;
  color: var(--paper-3);
}

.heart-row svg.full {
  color: var(--red);
}

.heart-note {
  font-size: 12px;
  color: var(--muted);
}

.mini-rank {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.mini-rank strong {
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: -0.03em;
}

.mini-rank span {
  font-size: 12px;
  color: var(--muted);
}

.tip-card {
  background: var(--ink);
  color: var(--inverse);
  border: 0;
}

.tip-card .eyebrow {
  color: #e8c9a8;
}

.tip-card p {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.35;
}

/* ------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.14s, box-shadow 0.14s, background 0.14s;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-signal {
  background: var(--signal);
  border-color: var(--signal-dark);
  color: var(--inverse);
  box-shadow: 0 4px 0 var(--signal-dark);
}

.btn-signal:hover {
  background: var(--signal-bright);
}

.btn-signal:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--signal-dark);
}

.btn-ink {
  background: var(--ink);
  border-color: #000;
  color: var(--inverse);
  box-shadow: 0 4px 0 #000;
}

.btn-ink:hover {
  background: #2d2821;
}

.btn-ink:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #000;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-2);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--card);
}

.btn-soft {
  background: var(--signal-soft);
  border-color: transparent;
  color: var(--signal);
}

.btn-soft:hover {
  background: #eed9ca;
}

.btn-danger {
  background: var(--red);
  border-color: #7d2b1f;
  color: #fff;
  box-shadow: 0 4px 0 #7d2b1f;
}

.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: 15px; padding: 0 24px; }
.btn-sm { min-height: 36px; font-size: 12.5px; padding: 0 13px; border-radius: 9px; }

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--signal);
  padding: 0;
  font-weight: 700;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------- landing */

.landing {
  background:
    radial-gradient(90% 60% at 85% 0%, rgba(143, 52, 24, 0.07), transparent 60%),
    var(--paper);
}

.landing-nav {
  max-width: 1160px;
  margin: 0 auto;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.landing-brand:hover {
  text-decoration: none;
}

.landing-brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero {
  max-width: 1160px;
  margin: 0 auto;
  padding: 54px 28px 84px;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: 56px;
  align-items: center;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(44px, 6vw, 74px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  margin-top: 14px;
  max-width: 620px;
}

.hero h1 em {
  font-style: italic;
  color: var(--signal);
}

.hero-lead {
  margin-top: 22px;
  max-width: 480px;
  font-size: 17.5px;
  color: var(--muted);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-note {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}

.hero-note svg {
  width: 15px;
  height: 15px;
  color: var(--green);
}

.hero-art {
  position: relative;
  padding: 22px;
}

.hero-board {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  transform: rotate(-1.2deg);
}

.hero-board .board-wrap {
  box-shadow: var(--shadow-lg);
}

.float-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 10px 13px;
  box-shadow: 0 20px 40px -22px rgba(28, 25, 21, 0.55);
  font-size: 12px;
  font-weight: 700;
  animation: bob 3.4s ease-in-out infinite;
}

.float-card small {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

.float-card .fc-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--signal-soft);
  color: var(--signal);
  flex-shrink: 0;
}

.float-card .fc-icon svg {
  width: 17px;
  height: 17px;
}

.float-card.fc-one {
  top: 2%;
  right: -2%;
}

.float-card.fc-two {
  bottom: 4%;
  left: -4%;
  animation-delay: -1.4s;
}

.feature-band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.features {
  max-width: 1160px;
  margin: 0 auto;
  padding: 44px 28px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}

.feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--signal-soft);
  color: var(--signal);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.feature-icon svg {
  width: 21px;
  height: 21px;
}

.feature h3 {
  font-size: 15px;
  font-weight: 750;
}

.feature p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.course-preview {
  max-width: 1160px;
  margin: 0 auto;
  padding: 72px 28px 88px;
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 48px;
  align-items: center;
}

.course-preview h2 {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 46px);
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.course-preview p {
  margin-top: 14px;
  color: var(--muted);
  max-width: 360px;
}

.preview-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 6px;
  border-bottom: 1px solid var(--line);
}

.preview-row:last-child {
  border-bottom: 0;
}

.preview-num {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 14px;
  color: var(--signal);
  flex-shrink: 0;
}

.preview-row strong {
  display: block;
  font-size: 13.5px;
}

.preview-row span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

.preview-row .preview-lock {
  margin-left: auto;
  color: var(--muted-2);
}

.preview-row .preview-lock svg {
  width: 16px;
  height: 16px;
}

.landing-footer {
  border-top: 1px solid var(--line);
  background: var(--card);
}

.landing-footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 26px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------- auth */

.auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(400px, 0.96fr);
}

.auth-art {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(90% 80% at 10% 0%, rgba(184, 90, 50, 0.28), transparent 55%),
    linear-gradient(145deg, #171410, #2c251c 62%, #3c2a1e);
  color: var(--inverse);
  padding: 44px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;
}

.auth-art::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border: 42px solid rgba(247, 243, 235, 0.05);
  border-radius: 50%;
  right: -180px;
  bottom: -180px;
  pointer-events: none;
}

.auth-art-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
}

.auth-art-brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.auth-quote {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: clamp(30px, 3.5vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  max-width: 560px;
}

.auth-quote span {
  color: #e8c9a8;
}

.auth-art-board {
  width: min(320px, 64%);
  position: relative;
  z-index: 1;
  transform: rotate(-2deg);
  opacity: 0.94;
}

.auth-art-board .board-wrap {
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  padding: 8px;
  border-radius: 14px;
}

.auth-art-note {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(247, 243, 235, 0.66);
}

.auth-art-note svg {
  width: 15px;
  height: 15px;
  color: #c9a778;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 24px;
  background: var(--paper);
}

.auth-card {
  width: min(412px, 100%);
}

.auth-card .brand {
  padding: 0 0 26px;
}

.auth-card h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 3.2vw, 38px);
  letter-spacing: -0.035em;
}

.auth-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.auth-form {
  margin-top: 26px;
}

.passkey-callout {
  margin-top: 22px;
}

.passkey-callout + .auth-form {
  margin-top: 16px;
}

.passkey-callout .btn {
  width: 100%;
}

.passkey-callout .hint {
  margin-top: 8px;
  text-align: center;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 0;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}

.passkey-list {
  margin-top: 10px;
}

.passkey-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.passkey-row:last-child {
  border-bottom: 0;
}

.passkey-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--signal-soft);
  color: var(--signal);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.passkey-icon svg {
  width: 18px;
  height: 18px;
}

.passkey-meta strong {
  display: block;
  font-size: 12.5px;
}

.passkey-meta span {
  display: block;
  margin-top: 1px;
  font-size: 10.5px;
  color: var(--muted);
}

.passkey-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 2px;
}

.passkey-empty strong {
  display: block;
  font-size: 12.5px;
}

.passkey-empty span {
  display: block;
  margin-top: 1px;
  font-size: 10.5px;
  color: var(--muted);
}

.field {
  margin-bottom: 16px;
}

.label {
  display: block;
  font-size: 12.5px;
  font-weight: 750;
  margin-bottom: 7px;
}

.input-wrap {
  position: relative;
}

.input {
  width: 100%;
  height: 50px;
  border: 1.5px solid var(--line-2);
  border-radius: 11px;
  background: var(--card);
  padding: 0 14px;
  color: var(--ink);
  font-size: 14.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input::placeholder {
  color: var(--muted-2);
}

.input:focus {
  outline: none;
  border-color: var(--signal);
  box-shadow: 0 0 0 4px rgba(143, 52, 24, 0.1);
}

.input.has-action {
  padding-right: 54px;
}

.input-action {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.input-action:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.hint {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.form-error {
  background: var(--red-soft);
  border: 1px solid #e7c4bd;
  color: var(--red);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  margin-bottom: 16px;
  font-weight: 600;
}

.form-success {
  background: var(--green-soft);
  border: 1px solid #c9d8c1;
  color: var(--green);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  margin-bottom: 16px;
  font-weight: 600;
}

.auth-submit {
  margin-top: 4px;
}

.auth-alt {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.auth-alt a,
.auth-alt button {
  font-weight: 750;
}

.auth-fine {
  margin-top: 18px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
}

/* ------------------------------------------------------------- board */

.board-wrap {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 10px;
  background: var(--ink);
  border-radius: 17px;
  box-shadow: var(--shadow);
}

.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  aspect-ratio: 1;
  border-radius: 9px;
  overflow: hidden;
  user-select: none;
  touch-action: manipulation;
}

.sq {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "DejaVu Sans", "Liberation Serif", serif;
}

.sq.light { background: var(--board-light); }
.sq.dark { background: var(--board-dark); }

.sq.interactive {
  cursor: pointer;
}

.sq.interactive:hover {
  filter: brightness(1.035);
}

.sq.sel {
  background: #e5c68f;
}

.sq.last {
  background: #e0c79e;
}

.sq.last.dark {
  background: #b9a17c;
}

.sq.check {
  background: radial-gradient(circle, rgba(161, 59, 43, 0.85), rgba(161, 59, 43, 0.45) 42%, transparent 72%);
}

.sq.correct-square::before,
.sq.wrong-square::before {
  content: "";
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  border: 4px solid var(--green);
  opacity: 0.85;
  pointer-events: none;
}

.sq.wrong-square::before {
  border-color: var(--red);
}

.sq.hint::after {
  content: "";
  position: absolute;
  width: 20%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(28, 25, 21, 0.3);
  pointer-events: none;
}

.sq.hint-capture::after {
  content: "";
  position: absolute;
  inset: 6%;
  width: auto;
  aspect-ratio: auto;
  border-radius: 50%;
  background: transparent;
  border: 5px solid rgba(28, 25, 21, 0.26);
  pointer-events: none;
}

.piece {
  position: relative;
  z-index: 2;
  font-size: clamp(25px, 6.9vw, 45px);
  line-height: 1;
  transform: translateY(-1px);
  pointer-events: none;
}

.board-wrap.small .piece {
  font-size: clamp(17px, 4.4vw, 30px);
}

.piece.white {
  color: #fcf8f0;
  text-shadow:
    0 1px 0 #5b5245,
    1px 0 0 #5b5245,
    -1px 0 0 #5b5245,
    0 -1px 0 #5b5245,
    0 2px 3px rgba(28, 25, 21, 0.45);
}

.piece.black {
  color: #1c1915;
  text-shadow: 0 1px 1px rgba(247, 243, 235, 0.35);
}

.coord {
  position: absolute;
  z-index: 3;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  opacity: 0.55;
  pointer-events: none;
}

.coord.file {
  right: 4px;
  bottom: 3px;
}

.coord.rank {
  left: 4px;
  top: 3px;
}

.sq.light .coord { color: var(--board-dark); }
.sq.dark .coord { color: var(--board-light); }

.board-wrap.flipped .coord.file { right: auto; left: 4px; bottom: 3px; }
.board-wrap.flipped .coord.rank { left: auto; right: 4px; top: 3px; }

/* ------------------------------------------------------------- lesson */

.lesson-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.lesson-top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(243, 239, 230, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.lesson-top-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 13px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.lesson-close {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.lesson-close:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.lesson-close svg {
  width: 20px;
  height: 20px;
}

.lesson-title-mini {
  font-size: 12.5px;
  font-weight: 750;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.lesson-progress {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 80px;
}

.seg {
  flex: 1;
  height: 9px;
  border-radius: 99px;
  background: var(--paper-3);
  transition: background 0.25s;
}

.seg.done {
  background: var(--signal);
}

.seg.now {
  background: var(--signal);
  opacity: 0.45;
}

.lesson-hearts {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  font-size: 13px;
  color: var(--red);
  flex-shrink: 0;
}

.lesson-hearts svg {
  width: 19px;
  height: 19px;
}

.lesson-main {
  flex: 1;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 20px 210px;
}

.question-area {
  animation: rise 0.28s ease both;
}

.lesson-intro {
  width: min(700px, 100%);
  margin: 0 auto 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--signal);
  border-radius: 10px;
  background: var(--card);
  text-align: left;
}

.lesson-intro p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.q-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.q-prompt {
  font-family: var(--serif);
  font-size: clamp(25px, 3.2vw, 35px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-align: center;
  max-width: 700px;
  margin: 0 auto 20px;
}

.q-board {
  width: min(452px, 100%);
  margin: 0 auto;
}

.q-board .board-wrap {
  max-width: 452px;
}

.q-helper {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 11px;
  min-height: 18px;
}

.reset-move {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--signal);
  font-weight: 700;
  font-size: 12px;
  padding: 2px 4px;
}

.reset-move:hover {
  text-decoration: underline;
}

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(680px, 100%);
  margin: 8px auto 0;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 10px 16px;
  text-align: left;
  border: 1.5px solid var(--line-2);
  border-radius: 13px;
  background: var(--card);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 650;
  box-shadow: 0 3px 0 var(--line);
  transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s, background 0.14s;
}

.option:hover {
  border-color: var(--signal);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 var(--line);
}

.option:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--line);
}

.option-key {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1.5px solid var(--line-2);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  flex-shrink: 0;
}

.option.selected {
  border-color: var(--signal);
  background: var(--signal-softer);
  box-shadow: 0 3px 0 var(--signal-soft);
}

.option.selected .option-key {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--inverse);
}

.option.correct {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: 0 3px 0 #cfdcc6;
}

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

.option.wrong {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 3px 0 #e6c7c1;
}

.option.wrong .option-key {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.promotion {
  width: min(452px, 100%);
  margin: 12px auto 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.promotion span {
  font-size: 11.5px;
  font-weight: 750;
  color: var(--muted);
  margin-right: auto;
}

.promotion button {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  border: 1.5px solid var(--line-2);
  background: var(--paper);
  font-size: 22px;
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", serif;
  line-height: 1;
  display: grid;
  place-items: center;
}

.promotion button:hover {
  border-color: var(--signal);
  background: var(--signal-soft);
}

.lesson-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 14px 20px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 58%, rgba(243, 239, 230, 0));
  pointer-events: none;
}

.lesson-bottom-inner {
  max-width: 820px;
  margin: 0 auto;
  pointer-events: auto;
}

.check-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.check-row .btn {
  min-width: 180px;
}

.feedback {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 -10px 40px -28px rgba(28, 25, 21, 0.5);
  animation: pop 0.24s ease both;
}

.feedback.ok {
  background: var(--green-soft);
  border-color: #c7d8bd;
}

.feedback.bad {
  background: var(--red-soft);
  border-color: #e5c2ba;
}

.feedback-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--green);
  color: #fff;
}

.feedback.bad .feedback-icon {
  background: var(--red);
}

.feedback-icon svg {
  width: 20px;
  height: 20px;
}

.feedback-copy {
  flex: 1;
  min-width: 0;
}

.feedback-title {
  font-weight: 800;
  font-size: 15px;
  color: var(--green);
}

.feedback.bad .feedback-title {
  color: var(--red);
}

.feedback-copy p {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 2px;
  line-height: 1.45;
}

.feedback-answer {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--red);
  margin-top: 3px;
}

.feedback .btn {
  flex-shrink: 0;
}

/* ------------------------------------------------------------- result */

.result-wrap {
  width: min(560px, 100%);
  margin: 18px auto 0;
  text-align: center;
  animation: rise 0.35s ease both;
}

.result-trophy {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  background: var(--signal-soft);
  color: var(--signal);
  border: 2px solid #e7cbb8;
}

.result-trophy svg {
  width: 38px;
  height: 38px;
}

.result-wrap.failed .result-trophy {
  background: var(--paper-2);
  border-color: var(--line-2);
  color: var(--muted);
}

.result-wrap h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 4.4vw, 44px);
  letter-spacing: -0.035em;
}

.result-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.result-score {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  margin: 24px auto;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--green) var(--pct, 0%), var(--paper-2) 0);
}

.result-score-in {
  width: 94px;
  height: 94px;
  border-radius: 50%;
  background: var(--card);
  display: grid;
  place-content: center;
  line-height: 1;
}

.result-score-in strong {
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: -0.03em;
}

.result-score-in span {
  font-size: 9px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 3px;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 24px 0;
}

.result-stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 8px;
}

.result-stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.02em;
}

.result-stat span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 3px;
  font-weight: 700;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-note {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
}

/* ------------------------------------------------------------- modal */

.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(28, 25, 21, 0.48);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade 0.18s ease both;
}

.modal {
  position: relative;
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  box-shadow: var(--shadow-lg);
  animation: pop 0.22s ease both;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.modal-close:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--signal-soft);
  color: var(--signal);
  margin-bottom: 16px;
}

.modal-icon svg {
  width: 26px;
  height: 26px;
}

.modal h2 {
  font-family: var(--serif);
  font-size: 27px;
  letter-spacing: -0.03em;
  padding-right: 24px;
}

.modal-kicker {
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 6px;
}

.modal p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.modal-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--paper-2);
  border-radius: 99px;
  padding: 6px 10px;
}

.modal-meta svg {
  width: 13px;
  height: 13px;
  color: var(--signal);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 22px;
}

/* ------------------------------------------------------------- leaderboard */

.lb-head {
  margin-bottom: 24px;
}

.lb-head h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 3.4vw, 42px);
  letter-spacing: -0.03em;
  margin-top: 6px;
}

.lb-head p {
  margin-top: 8px;
  color: var(--muted);
}

.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-items: end;
  margin: 26px 0 18px;
}

.podium-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.podium-card.first {
  padding-top: 24px;
  padding-bottom: 24px;
  border-color: #d9c2a9;
  background: linear-gradient(180deg, #fbf5ea, var(--card));
}

.podium.one {
  grid-template-columns: minmax(0, 260px);
  justify-content: center;
}

.podium.two {
  grid-template-columns: repeat(2, minmax(0, 210px));
  justify-content: center;
}

.podium-card .avatar {
  width: 46px;
  height: 46px;
  margin: 0 auto 8px;
}

.podium-card.first .avatar {
  width: 58px;
  height: 58px;
  font-size: 18px;
}

.podium-name {
  font-weight: 800;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-xp {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.podium-medal {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 7px;
  background: var(--paper-2);
  color: var(--muted);
}

.podium-card.first .podium-medal {
  background: #d9b269;
  color: #fff;
}

.podium-card.second .podium-medal {
  background: #c9c3b8;
  color: #fff;
}

.podium-card.third .podium-medal {
  background: #c08a58;
  color: #fff;
}

.lb-card {
  padding: 6px 0;
  overflow: hidden;
}

.lb-table {
  width: 100%;
}

.lb-row {
  display: grid;
  grid-template-columns: 44px 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.lb-row:last-child {
  border-bottom: 0;
}

.lb-row.me {
  background: var(--signal-softer);
}

.lb-pos {
  font-weight: 800;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.lb-row .avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.lb-name {
  font-weight: 700;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-streak {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 1px;
}

.lb-streak svg {
  width: 11px;
  height: 11px;
  color: #b2541f;
}

.lb-xp {
  text-align: right;
  font-weight: 800;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.lb-xp span {
  display: block;
  font-size: 9.5px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lb-me-row {
  margin-top: 14px;
}

.lb-empty {
  text-align: center;
  padding: 46px 20px;
}

.lb-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--muted);
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
}

.lb-empty h3 {
  font-family: var(--serif);
  font-size: 22px;
}

.lb-empty p {
  margin-top: 5px;
  font-size: 13px;
  color: var(--muted);
}

/* ------------------------------------------------------------- play */

.play-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.play-head h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 3.7vw, 46px);
  letter-spacing: -0.035em;
  margin-top: 6px;
}

.play-head p {
  color: var(--muted);
  margin-top: 8px;
  max-width: 620px;
}

.play-head-game {
  align-items: center;
}

.play-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.play-lobby-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 328px;
  gap: 22px;
  align-items: start;
}

.rating-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: -8px 0 18px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.rating-pill {
  padding: 5px 12px;
  border-radius: 99px;
  background: var(--ink);
  color: var(--inverse);
  font-size: 12px;
  font-weight: 800;
}

.rating-suggest {
  margin-left: auto;
  padding: 5px 10px;
  border-radius: 99px;
  background: var(--signal-soft);
  color: var(--signal);
  font-weight: 750;
}

.adaptive-panel {
  padding: 22px;
  background:
    radial-gradient(120% 150% at 100% 0%, rgba(143, 52, 24, 0.09), transparent 58%),
    var(--card);
}

.adaptive-main {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.adaptive-avatar {
  width: 56px;
  height: 56px;
  font-size: 22px;
  flex-shrink: 0;
}

.adaptive-copy {
  min-width: 0;
  flex: 1;
}

.adaptive-copy h2 {
  font-family: var(--serif);
  font-size: 27px;
  letter-spacing: -0.03em;
}

.adaptive-copy p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.adaptive-elo {
  display: grid;
  grid-template-columns: auto auto;
  gap: 1px 9px;
  align-items: baseline;
  padding: 9px 12px;
  border-radius: 11px;
  background: var(--paper-2);
  flex-shrink: 0;
}

.adaptive-elo span {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.adaptive-elo strong {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: -0.02em;
}

.adaptive-elo strong:last-child {
  color: var(--signal);
}

.adaptive-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.pool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.pool-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 99px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 10.5px;
}

.pool-chip strong {
  color: var(--ink-2);
  font-size: 11px;
}

.pool-chip.active {
  background: var(--signal);
  color: var(--inverse);
}

.pool-chip.active strong {
  color: var(--inverse);
}

.adaptive-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.recommended-tag {
  align-self: flex-start;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--signal-soft);
  color: var(--signal);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

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

.opponent-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 15px;
  padding: 15px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.opponent-card:hover {
  border-color: var(--signal);
  transform: translateY(-1px);
}

.opponent-card.selected {
  border-color: var(--signal);
  background: var(--signal-softer);
  box-shadow: 0 0 0 3px var(--signal-soft);
}

.opponent-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.opponent-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--paper-2);
  color: var(--signal);
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.opponent-card.selected .opponent-badge {
  background: var(--signal);
  color: var(--inverse);
}

.opponent-name {
  font-size: 14px;
  font-weight: 800;
}

.opponent-rating {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 700;
}

.opponent-title {
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--signal);
}

.opponent-desc {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
  min-height: 33px;
}

.opponent-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 700;
}

.strength-dots {
  color: var(--signal);
  letter-spacing: 1px;
}

.play-setup {
  position: sticky;
  top: 34px;
  padding: 20px;
}

.play-setup h2 {
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: -0.03em;
  margin-top: 5px;
}

.color-choice {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 16px 0 10px;
}

.color-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 5px;
  border: 1.5px solid var(--line-2);
  border-radius: 11px;
  background: var(--card);
  font-size: 11.5px;
  font-weight: 750;
}

.color-option:hover {
  border-color: var(--signal);
}

.color-option.selected {
  border-color: var(--signal);
  background: var(--signal-softer);
  box-shadow: 0 0 0 3px var(--signal-soft);
}

.color-king {
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", serif;
  font-size: 24px;
  line-height: 1.1;
  color: var(--ink);
}

.color-king.white {
  color: #b9a78e;
  text-shadow: 0 0 1px #5b5245;
}

.color-option small {
  font-size: 9px;
  color: var(--muted);
  font-weight: 600;
}

.setup-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 10px 0 16px;
}

.setup-facts span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 99px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 700;
}

.setup-facts svg {
  width: 12px;
  height: 12px;
  color: var(--signal);
}

.play-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 26px;
  border-radius: 16px;
  background:
    radial-gradient(110% 150% at 100% 0%, rgba(247, 243, 235, 0.12), transparent 60%),
    linear-gradient(122deg, #1c1915, #373027);
  color: var(--inverse);
  box-shadow: var(--shadow);
}

.play-banner:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.play-banner-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(247, 243, 235, 0.1);
  color: #e8c9a8;
  flex-shrink: 0;
}

.play-banner-icon svg {
  width: 24px;
  height: 24px;
}

.play-banner-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.play-banner-copy .eyebrow {
  color: #e8c9a8;
}

.play-banner-copy strong {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: -0.02em;
}

.play-banner-copy > span:last-child {
  font-size: 11.5px;
  color: rgba(247, 243, 235, 0.68);
}

.play-banner .btn {
  flex-shrink: 0;
  background: var(--inverse);
  border-color: transparent;
  color: var(--ink);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}

.recent-card {
  margin-top: 22px;
}

.recent-list {
  display: flex;
  flex-direction: column;
}

.recent-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.recent-row:last-child {
  border-bottom: 0;
}

.recent-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper-2);
  color: var(--signal);
  font-size: 11px;
  font-weight: 800;
}

.recent-meta strong {
  display: block;
  font-size: 12.5px;
}

.recent-meta > span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
}

.result-pill {
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.result-pill.won {
  background: var(--green-soft);
  color: var(--green);
}

.result-pill.lost {
  background: var(--red-soft);
  color: var(--red);
}

.result-pill.draw {
  background: var(--paper-2);
  color: var(--muted);
}

.recent-xp {
  font-size: 11px;
  font-weight: 750;
  color: var(--muted);
  white-space: nowrap;
}

.recent-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.recent-empty .lb-empty-icon {
  margin: 0;
}

.recent-empty strong {
  display: block;
  font-size: 13px;
}

.recent-empty p {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.play-help {
  margin-top: 16px;
}

.play-help-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.play-help-grid > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.play-help-grid svg {
  width: 20px;
  height: 20px;
  color: var(--signal);
  margin-bottom: 2px;
}

.play-help-grid strong {
  font-size: 12.5px;
  color: var(--ink);
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
}

.play-board-column {
  min-width: 0;
}

.player-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 9px 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.your-bar {
  margin-top: 10px;
  margin-bottom: 0;
}

.player-bar .avatar {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.bot-avatar {
  background: var(--signal);
}

.player-meta {
  min-width: 0;
}

.player-meta strong {
  display: block;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-meta > span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
}

.bot-title {
  display: inline-block;
  margin-left: 3px;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  vertical-align: middle;
}

.captured-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
  max-width: 38%;
}

.captured-piece {
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", serif;
  font-size: 18px;
  line-height: 1;
  margin-left: -3px;
}

.captured-piece.white {
  color: #fcf8f0;
  text-shadow: 0 0 1px #5b5245, 0 1px 0 #5b5245;
}

.captured-piece.black {
  color: var(--ink);
}

.captured-empty {
  font-size: 9.5px;
  color: var(--muted-2);
}

.material-diff {
  min-width: 20px;
  text-align: right;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--muted);
}

.material-diff.positive {
  color: var(--green);
}

.play-board {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.play-board .board-wrap {
  max-width: 560px;
}

.play-board .piece {
  font-size: clamp(26px, 5.2vw, 48px);
}

.game-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 34px;
}

.game-status-card {
  padding: 15px 16px;
}

.turn-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.turn-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted-2);
  flex-shrink: 0;
}

.turn-dot.you {
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.turn-dot.them {
  background: var(--signal);
  box-shadow: 0 0 0 4px var(--signal-soft);
}

.turn-dot.over {
  background: var(--muted-2);
}

.turn-line strong {
  display: block;
  font-size: 13px;
}

.turn-line > div > span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
}

.thinking-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: auto;
}

.thinking-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--signal);
  animation: thinking 1.1s ease-in-out infinite;
}

.thinking-dots i:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots i:nth-child(3) { animation-delay: 0.3s; }

.game-status-note {
  margin-top: 10px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.game-actions-card {
  padding: 10px;
}

.game-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.game-actions .btn {
  flex: 1;
  min-height: 34px;
  padding: 0 8px;
  font-size: 11px;
}

.btn-count {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: rgba(28, 25, 21, 0.08);
  font-size: 9px;
}

.game-moves-card {
  padding: 14px 16px;
}

.move-list {
  max-height: 232px;
  overflow-y: auto;
  padding-right: 2px;
}

.move-row {
  display: grid;
  grid-template-columns: 24px 1fr 1fr;
  gap: 6px;
  padding: 2px 0;
  font-size: 12px;
  border-radius: 4px;
}

.move-num {
  color: var(--muted-2);
  font-weight: 700;
}

.move-san {
  font-family: var(--mono);
  font-weight: 600;
}

.move-san.w { color: var(--ink); }
.move-san.b { color: var(--ink-2); }
.move-list-empty { padding: 6px 0; }

.game-coach-card {
  background: var(--ink);
  color: var(--inverse);
  border: 0;
}

.game-coach-card .eyebrow {
  color: #e8c9a8;
}

.game-coach-card p {
  margin-top: 7px;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.35;
}

.hint-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  padding: 4px 9px;
  border-radius: 99px;
  background: rgba(247, 243, 235, 0.14);
  color: var(--inverse);
  font-size: 10px;
  font-weight: 800;
}

.hint-chip svg {
  width: 12px;
  height: 12px;
  color: #e8c9a8;
}

.game-over-card {
  border-color: #d9c2a9;
  background: linear-gradient(180deg, #fbf5ea, var(--card));
}

.game-over-card strong {
  display: block;
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: -0.02em;
}

.game-over-card p {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}

.game-over-actions {
  display: flex;
  gap: 6px;
  margin-top: 11px;
  flex-wrap: wrap;
}

.game-over-actions .btn {
  flex: 1;
}

.play-mobile-actions {
  display: none;
  gap: 6px;
  margin-top: 10px;
}

.play-mobile-actions .btn {
  flex: 1;
  padding: 0 6px;
}

.play-profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.sq.hint-move::before {
  content: "";
  position: absolute;
  inset: 7%;
  border: 3px dashed var(--signal);
  border-radius: 50%;
  opacity: 0.9;
  pointer-events: none;
}

.game-result-modal {
  text-align: center;
}

.game-result-modal .result-trophy {
  margin: 6px auto 14px;
}

.game-result-modal h2 {
  padding: 0;
}

.game-result-modal p {
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}

.muted-trophy {
  background: var(--paper-2);
  border-color: var(--line-2);
  color: var(--muted);
}

.elo-change {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 16px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--paper-2);
}

.elo-change > span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.elo-change strong {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: -0.02em;
}

.elo-change strong i {
  font-style: normal;
  color: var(--muted);
  padding: 0 2px;
}

.elo-change em {
  font-style: normal;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
}

.elo-change.up em {
  background: var(--green-soft);
  color: var(--green);
}

.elo-change.down em {
  background: var(--red-soft);
  color: var(--red);
}

.game-result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 20px 0;
}

.game-result-stats > div {
  background: var(--paper-2);
  border-radius: 11px;
  padding: 10px 6px;
}

.game-result-stats strong {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.02em;
}

.game-result-stats span {
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

@keyframes thinking {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

/* ------------------------------------------------------------- profile */

.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.profile-head .avatar {
  width: 68px;
  height: 68px;
  font-size: 25px;
}

.profile-head h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 3.2vw, 38px);
  letter-spacing: -0.03em;
}

.profile-head p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.level-card {
  background:
    radial-gradient(100% 140% at 100% 0%, rgba(247, 243, 235, 0.12), transparent 60%),
    linear-gradient(122deg, #1c1915, #373027);
  color: var(--inverse);
  border: 0;
  overflow: hidden;
}

.level-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.level-top .eyebrow {
  color: #e8c9a8;
}

.level-number {
  font-family: var(--serif);
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.04em;
  margin-top: 4px;
}

.level-xp {
  text-align: right;
  font-size: 12px;
  color: rgba(247, 243, 235, 0.68);
}

.level-xp strong {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  color: var(--inverse);
}

.level-card .progress-track {
  background: rgba(247, 243, 235, 0.18);
  margin-top: 18px;
}

.level-card .progress-track > span {
  background: #e8c9a8;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.stat-grid.four {
  grid-template-columns: repeat(4, 1fr);
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px;
}

.stat-card strong {
  display: block;
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-card span {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}

.achievements {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.achievement {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  opacity: 0.45;
}

.achievement.unlocked {
  opacity: 1;
  border-color: #d9c2a9;
  background: linear-gradient(180deg, #fbf5ea, var(--card));
}

.achievement-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--paper-2);
  color: var(--muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.achievement.unlocked .achievement-icon {
  background: var(--signal-soft);
  color: var(--signal);
}

.achievement-icon svg {
  width: 17px;
  height: 17px;
}

.achievement strong {
  display: block;
  font-size: 12px;
}

.achievement span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
}

.settings-goals {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.goal-option {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1.5px solid var(--line-2);
  background: var(--card);
  font-weight: 700;
  font-size: 12.5px;
}

.goal-option:hover {
  border-color: var(--signal);
}

.goal-option.active {
  background: var(--signal);
  border-color: var(--signal-dark);
  color: var(--inverse);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.settings-row strong {
  display: block;
  font-size: 13px;
}

.settings-row span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  z-index: 120;
  background: var(--ink);
  color: var(--inverse);
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 12.5px;
  font-weight: 650;
  box-shadow: var(--shadow-lg);
  animation: pop 0.2s ease both;
  max-width: calc(100vw - 32px);
}

/* ------------------------------------------------------------- misc */

.loading-block {
  min-height: 50vh;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.error-block {
  max-width: 480px;
  margin: 60px auto;
  text-align: center;
}

.error-block h1 {
  font-family: var(--serif);
  font-size: 32px;
  letter-spacing: -0.03em;
}

.error-block p {
  color: var(--muted);
  margin: 10px 0 20px;
}

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid var(--paper-3);
  border-top-color: var(--signal);
  animation: spin 0.8s linear infinite;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}

/* ------------------------------------------------------------- motion */

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

@keyframes pop {
  from { opacity: 0; transform: scale(0.97) translateY(5px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes halo {
  0% { transform: scale(0.92); opacity: 0.8; }
  70%, 100% { transform: scale(1.24); opacity: 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

/* ------------------------------------------------------------- responsive */

@media (max-width: 1000px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
  .play-lobby-grid,
  .play-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .play-setup,
  .game-side {
    position: static;
  }
  .game-side {
    display: grid;
    grid-template-columns: 1fr;
  }
  .game-moves-card,
  .game-coach-card,
  .game-over-card {
    grid-column: 1 / -1;
  }
  .game-actions-card {
    display: none;
  }
  .play-mobile-actions {
    display: flex;
  }
  .play-help-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .content-area {
    grid-template-columns: minmax(0, 1fr);
    max-width: 860px;
  }
  .rail {
    display: none;
  }
  .head-stats {
    display: none;
  }
}

@media (max-width: 960px) {
  .hero {
    gap: 36px;
    padding-top: 34px;
  }
  .course-preview {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .course-preview p {
    max-width: 560px;
  }
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-art {
    display: none;
  }
  .auth-panel {
    min-height: 100dvh;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    display: none;
  }
  .mobile-bar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 50;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    height: 60px;
    background: rgba(250, 247, 241, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }
  .mobile-bar .brand {
    padding: 0;
    gap: 9px;
  }
  .mobile-bar .brand img {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }
  .mobile-bar .brand-name {
    font-size: 18px;
  }
  .mobile-bar .brand-tag {
    display: none;
  }
  .mobile-stats {
    margin-left: auto;
    display: flex;
    gap: 5px;
  }
  .mobile-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 800;
    padding: 0 8px;
    height: 30px;
    border-radius: 99px;
    background: var(--paper-2);
  }
  .mobile-stat svg {
    width: 14px;
    height: 14px;
  }
  .mobile-stat.flame svg { color: #b2541f; }
  .mobile-stat.heart svg { color: var(--red); }
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: rgba(250, 247, 241, 0.97);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 5px 0;
    font-size: 9.5px;
    font-weight: 750;
    color: var(--muted);
    border-radius: 9px;
  }
  .mobile-nav a:hover {
    text-decoration: none;
  }
  .mobile-nav a svg {
    width: 21px;
    height: 21px;
  }
  .mobile-nav a.active {
    color: var(--signal);
    background: var(--signal-softer);
  }
  .content-area {
    padding: 24px 18px 100px;
    gap: 0;
  }
  .learn-head h1 {
    font-size: 30px;
  }
  .learn-head {
    margin-bottom: 20px;
  }
  .leave-desktop {
    display: none;
  }
}

@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 28px 20px 56px;
    text-align: left;
  }
  .hero-art {
    order: -1;
    padding: 8px 10px 20px;
    max-width: 430px;
    margin: 0 auto;
    width: 100%;
  }
  .hero h1 {
    font-size: clamp(40px, 11vw, 58px);
  }
  .hero-lead {
    font-size: 16px;
  }
  .float-card {
    font-size: 10.5px;
    padding: 8px 10px;
  }
  .float-card .fc-icon {
    width: 25px;
    height: 25px;
  }
  .float-card.fc-one { right: 0; }
  .float-card.fc-two { left: 0; }
  .features {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 32px 20px;
  }
  .course-preview {
    padding: 48px 20px 60px;
  }
  .landing-nav {
    padding: 16px 20px;
  }
  .landing-nav-actions .btn-ghost {
    display: none;
  }
  .landing-footer-inner {
    padding: 20px;
    flex-direction: column;
    align-items: flex-start;
  }
  .options {
    grid-template-columns: 1fr;
  }
  .lesson-main {
    padding: 20px 14px 240px;
  }
  .lesson-top-inner {
    padding: 10px 12px;
    gap: 8px;
  }
  .lesson-title-mini {
    display: none;
  }
  .lesson-bottom {
    padding: 12px 12px calc(14px + env(safe-area-inset-bottom));
  }
  .feedback {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
  }
  .feedback-copy {
    flex-basis: calc(100% - 52px);
  }
  .feedback .btn {
    width: 100%;
  }
  .check-row .btn {
    width: 100%;
    min-width: 0;
  }
  .result-stats {
    gap: 7px;
  }
  .result-stat strong {
    font-size: 19px;
  }
  .podium-card {
    padding: 12px 6px;
  }
  .podium-name {
    font-size: 10.5px;
  }
  .lb-row {
    grid-template-columns: 32px 30px minmax(0, 1fr) auto;
    padding: 9px 12px;
    gap: 8px;
  }
  .lb-row .avatar {
    width: 28px;
    height: 28px;
    font-size: 10.5px;
  }
  .lb-name {
    font-size: 12.5px;
  }
  .profile-head .avatar {
    width: 56px;
    height: 56px;
    font-size: 21px;
  }
  .stat-grid,
  .stat-grid.four {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .play-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .play-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .level-grid {
    grid-template-columns: 1fr;
  }
  .play-banner {
    flex-wrap: wrap;
  }
  .play-banner .btn {
    width: 100%;
  }
  .game-side {
    grid-template-columns: 1fr;
  }
  .recent-row {
    grid-template-columns: 30px minmax(0, 1fr) auto;
  }
  .recent-xp {
    display: none;
  }
  .achievements {
    grid-template-columns: 1fr;
  }
  .auth-panel {
    padding: 28px 18px;
  }
  .auth-card .brand {
    padding-bottom: 20px;
  }
  .unit-head {
    padding: 16px 18px 22px;
  }
  .unit-body {
    margin-left: 5px;
    margin-right: 5px;
    padding-left: 10px;
    padding-right: 10px;
  }
  .lesson-row:nth-child(3n + 1) { padding-left: 1%; }
  .lesson-row:nth-child(3n) { padding-right: 1%; }
  .lesson-entry {
    width: 108px;
  }
  .lesson-node {
    width: 60px;
    height: 60px;
  }
  .lesson-entry.current .lesson-node::after {
    width: 74px;
    height: 74px;
  }
  .path::before {
    left: 50%;
  }
  .goal-card {
    align-items: center;
  }
}

@media (max-width: 420px) {
  .lesson-row:nth-child(3n + 1),
  .lesson-row:nth-child(3n),
  .lesson-row:nth-child(3n + 2) {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }
  .path::before {
    left: 50%;
  }
  .lesson-entry {
    width: 120px;
  }
}
