:root {
  --ink: #101a37;
  --muted: #667085;
  --line: #cfdbec;
  --paper: #f6f9ff;
  --surface: #ffffff;
  --primary: #255edb;
  --primary-dark: #173f98;
  --accent: #f5bd3b;
  --teal: #18a3a6;
  --violet: #7c3aed;
  --rose: #ef4444;
  --success: #197a55;
  --danger: #ba2f3c;
  --shadow: 0 18px 50px rgba(20, 33, 61, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 72px);
  background: rgba(251, 252, 255, 0.9);
  border-bottom: 1px solid rgba(216, 222, 232, 0.8);
  backdrop-filter: blur(16px);
}

.site-header,
.game-shell {
  position: relative;
  z-index: 1;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, var(--primary), #31a8a1);
}

.brand-logo {
  width: 78px;
  height: 52px;
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff;
}

.main-nav,
.header-actions,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.main-nav {
  flex: 1 1 auto;
  justify-content: center;
  gap: clamp(6px, 1vw, 14px);
}

.main-nav a {
  color: var(--muted);
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.main-nav a[href="/game.html"] {
  padding: 10px 18px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 10px;
  color: #ffffff;
  background: linear-gradient(135deg, #ff7a18, #ef4444 52%, #7c3aed);
  box-shadow: 0 12px 28px rgba(239, 68, 68, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  font-size: 1.08rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0;
  transform: translateY(0);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.main-nav a[href="/game.html"]:hover {
  color: #ffffff;
  box-shadow: 0 16px 36px rgba(239, 68, 68, 0.34), 0 0 0 4px rgba(245, 189, 59, 0.18);
  filter: saturate(1.08);
  transform: translateY(-2px);
}

.language-switcher {
  position: relative;
  display: flex;
  align-items: center;
}

.language-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #cbd8ee;
  border-radius: 999px;
  color: var(--muted);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 245, 255, 0.94));
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.language-toggle:focus-visible,
.language-option:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}

.language-caret {
  color: var(--primary);
  font-size: 0.78rem;
}

.language-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 220px;
  max-height: min(420px, 75vh);
  padding: 8px;
  overflow: auto;
  border: 1px solid #cbd8ee;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
}

.language-menu[hidden] {
  display: none;
}

.language-option {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

.language-option:hover,
.language-option.is-active {
  background: #edf4ff;
}

.language-flag {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 16px;
  flex: 0 0 24px;
  overflow: hidden;
  border: 1px solid rgba(16, 26, 55, 0.18);
  border-radius: 3px;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.12);
}

.flag-bg { background: linear-gradient(#ffffff 0 33.33%, #00966e 33.33% 66.66%, #d62612 66.66%); }
.flag-de { background: linear-gradient(#000000 0 33.33%, #dd0000 33.33% 66.66%, #ffce00 66.66%); }
.flag-fr { background: linear-gradient(90deg, #0055a4 0 33.33%, #ffffff 33.33% 66.66%, #ef4135 66.66%); }
.flag-es { background: linear-gradient(#aa151b 0 25%, #f1bf00 25% 75%, #aa151b 75%); }
.flag-it { background: linear-gradient(90deg, #009246 0 33.33%, #ffffff 33.33% 66.66%, #ce2b37 66.66%); }
.flag-ro { background: linear-gradient(90deg, #002b7f 0 33.33%, #fcd116 33.33% 66.66%, #ce1126 66.66%); }
.flag-ru { background: linear-gradient(#ffffff 0 33.33%, #0039a6 33.33% 66.66%, #d52b1e 66.66%); }

.flag-gb {
  background:
    linear-gradient(27deg, transparent 0 42%, #ffffff 42% 48%, #c8102e 48% 52%, #ffffff 52% 58%, transparent 58%),
    linear-gradient(-27deg, transparent 0 42%, #ffffff 42% 48%, #c8102e 48% 52%, #ffffff 52% 58%, transparent 58%),
    linear-gradient(90deg, transparent 0 42%, #ffffff 42% 58%, transparent 58%),
    linear-gradient(0deg, transparent 0 34%, #ffffff 34% 66%, transparent 66%),
    linear-gradient(90deg, transparent 0 46%, #c8102e 46% 54%, transparent 54%),
    linear-gradient(0deg, transparent 0 42%, #c8102e 42% 58%, transparent 58%),
    #012169;
}

.flag-tr {
  background: #e30a17;
}

.flag-tr::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 3px 0 0 #e30a17;
}

.flag-tr::after {
  content: "★";
  position: absolute;
  top: 1px;
  right: 4px;
  color: #ffffff;
  font-size: 7px;
  line-height: 1;
}

.language-switcher-floating {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 50;
}

.language-switcher-floating label > span {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.35);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button-primary {
  color: white;
  background: var(--primary);
}

.button-primary:hover {
  background: var(--primary-dark);
}

.button-secondary {
  color: var(--primary);
  background: #e9f0ff;
  border-color: rgba(37, 94, 219, 0.22);
}

.button-secondary:hover {
  color: var(--primary-dark);
  background: #dbeafe;
  border-color: rgba(37, 94, 219, 0.4);
}

.button-ghost {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}

.button-soft {
  color: var(--primary-dark);
  background: #e9f0ff;
}

.button-large {
  min-height: 50px;
  padding: 0 22px;
}

.button-full {
  width: 100%;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  min-height: calc(100vh - 78px);
  padding: clamp(36px, 7vw, 96px) clamp(18px, 5vw, 72px);
  background:
    linear-gradient(115deg, rgba(35, 100, 210, 0.08), rgba(49, 168, 161, 0.08)),
    radial-gradient(circle at 82% 28%, rgba(244, 185, 66, 0.2), transparent 30%);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero h1,
.section-heading h1,
.section-heading h2 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.35rem, 5vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.section-heading h1,
.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.hero-copy {
  max-width: 650px;
  margin: 24px 0 30px;
  color: #3b4a66;
  font-size: 1.18rem;
  line-height: 1.65;
}

.hero-panel {
  position: relative;
  min-height: 500px;
}

.progress-card,
.formula-card,
.task-card,
.auth-card,
.profile-card,
.price-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.progress-card {
  width: min(100%, 420px);
  padding: 28px;
}

.card-label {
  display: block;
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 700;
}

.progress-card strong {
  display: block;
  margin-bottom: 18px;
  font-size: 4rem;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ebf3;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #31a8a1);
}

.formula-card {
  position: absolute;
  right: 0;
  top: 180px;
  display: grid;
  gap: 8px;
  padding: 28px;
}

.formula-card > span {
  font-size: 2rem;
  font-weight: 800;
}

.formula-card small,
.task-card small {
  color: var(--muted);
  font-weight: 600;
}

.task-card {
  position: absolute;
  left: 44px;
  bottom: 36px;
  display: grid;
  gap: 8px;
  width: 230px;
  padding: 26px;
}

.task-card span {
  color: var(--success);
  font-size: 3rem;
  font-weight: 800;
}

.section-band {
  padding: 26px clamp(18px, 5vw, 72px);
  background: var(--ink);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
}

.stats-grid div {
  color: white;
}

.stats-grid strong {
  display: block;
  font-size: 1.8rem;
}

.stats-grid span {
  color: rgba(255, 255, 255, 0.76);
}

.content-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px clamp(18px, 5vw, 32px);
}

.section-heading {
  margin-bottom: 28px;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.collection-card {
  display: flex;
  flex-direction: column;
  min-height: 390px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.collection-card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  background: #edf3ff;
}

.collection-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.collection-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.collection-card h3 {
  margin: 0;
  font-size: 1.25rem;
}

.collection-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.collection-card .button {
  margin-top: auto;
}

.badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: #e9f0ff;
  font-size: 0.82rem;
  font-weight: 800;
}

.skeleton {
  height: 360px;
  border-radius: 8px;
  background: linear-gradient(90deg, #eef2f7, #f8fafc, #eef2f7);
}

.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #eef5ff, #ffffff 55%, #fff7df);
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px;
}

.auth-brand {
  position: absolute;
  top: 28px;
  left: 28px;
}

.auth-brand .auth-logo {
  width: auto;
  height: 44px;
  border-radius: 0;
  background: transparent;
}

.auth-card {
  width: min(100%, 460px);
  padding: 32px;
}

.auth-card h1,
.profile-card h1,
.profile-card h2,
.price-card h2 {
  margin: 0 0 10px;
}

.auth-card p,
.profile-card p {
  color: var(--muted);
  line-height: 1.55;
}

form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

input:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(35, 100, 210, 0.14);
}

select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  font: inherit;
}

.form-message {
  min-height: 24px;
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.form-message.success {
  color: var(--success);
}

.form-message.warning {
  color: #9a6700;
}

.form-message.error {
  color: var(--rose);
}

.auth-link {
  margin-bottom: 0;
}

.auth-link a {
  color: var(--primary);
  font-weight: 800;
}

.premium-access-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid rgba(245, 189, 59, 0.36);
  border-radius: 8px;
  color: #10213f;
  background:
    radial-gradient(circle at 8% 20%, rgba(245, 189, 59, 0.28), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(233, 240, 255, 0.86));
  box-shadow: 0 18px 40px rgba(20, 33, 61, 0.1);
}

.premium-access-banner div {
  display: grid;
  gap: 4px;
}

.premium-access-banner strong {
  font-size: 1.05rem;
  font-weight: 950;
}

.premium-access-banner span {
  color: var(--muted);
  font-weight: 800;
}

.is-preview-mode .problem-card,
.model-section.is-preview-locked {
  position: relative;
}

.is-preview-mode .answer-form input:disabled,
.is-preview-mode .answer-form button:disabled,
.model-section.is-preview-locked input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.hero-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 6px;
  padding: 0;
  border: 0;
}

.grade-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 10px;
  padding: 0;
  border: 0;
}

.grade-picker legend {
  grid-column: 1 / -1;
  margin-bottom: 4px;
  color: var(--ink);
  font-weight: 900;
}

.grade-option {
  position: relative;
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 82px;
  padding: 12px;
  border: 1px solid rgba(37, 94, 219, 0.16);
  border-radius: 8px;
  color: #10213f;
  background: linear-gradient(145deg, rgba(233, 240, 255, 0.9), rgba(255, 255, 255, 0.82));
  box-shadow: 0 12px 24px rgba(20, 33, 61, 0.08);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.grade-option:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 94, 219, 0.42);
  box-shadow: 0 18px 34px rgba(20, 33, 61, 0.13);
}

.grade-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.grade-option::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(37, 94, 219, 0.38);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
}

.grade-option:has(input:checked)::after {
  border-color: var(--primary);
  background:
    radial-gradient(circle, var(--primary) 0 46%, transparent 49%),
    rgba(255, 255, 255, 0.92);
}

.grade-option:has(input:checked) {
  border-color: rgba(37, 94, 219, 0.72);
  background: linear-gradient(145deg, rgba(219, 234, 254, 0.96), rgba(232, 252, 249, 0.86));
  box-shadow: 0 20px 38px rgba(37, 94, 219, 0.16);
}

.grade-option strong {
  color: #10213f;
  font-size: 2rem;
  font-weight: 950;
  line-height: 1;
}

.grade-option span {
  color: var(--muted);
  font-weight: 850;
}

.hero-picker legend {
  grid-column: 1 / -1;
  margin-bottom: 4px;
  color: var(--ink);
  font-weight: 900;
}

.hero-option {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 248px;
  padding: 12px;
  border: 1px solid rgba(37, 94, 219, 0.16);
  border-radius: 14px;
  background:
    radial-gradient(circle at 22% 14%, rgba(255, 255, 255, 0.92), transparent 34%),
    linear-gradient(145deg, rgba(233, 240, 255, 0.92), rgba(255, 255, 255, 0.8));
  box-shadow: 0 14px 28px rgba(20, 33, 61, 0.08);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.hero-option:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 94, 219, 0.42);
  box-shadow: 0 20px 38px rgba(20, 33, 61, 0.14);
}

.hero-option input {
  position: absolute;
  inset: 14px 14px auto auto;
  z-index: 2;
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.hero-option:has(input:checked) {
  border-color: rgba(37, 94, 219, 0.72);
  background:
    radial-gradient(circle at 22% 14%, rgba(255, 255, 255, 0.94), transparent 34%),
    linear-gradient(145deg, rgba(219, 234, 254, 0.95), rgba(232, 252, 249, 0.82));
  box-shadow: 0 22px 44px rgba(37, 94, 219, 0.18);
}

.hero-portrait {
  display: block;
  width: 100%;
  aspect-ratio: 1.12;
  border-radius: 14px;
  background-image: url("/assets/mathpro-heroes.png");
  background-repeat: no-repeat;
  background-size: 222% 240%;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.55),
    0 12px 26px rgba(15, 23, 42, 0.14);
}

.hero-portrait-fractions {
  background-position: 8% 0%;
}

.hero-portrait-geometry {
  background-position: 92% 0%;
}

.hero-portrait-algebra {
  background-position: 8% 88%;
}

.hero-portrait-space {
  background-position: 92% 88%;
}

.hero-option:has(input:checked) .hero-portrait {
  outline: 3px solid rgba(37, 94, 219, 0.82);
  outline-offset: 3px;
}

.hero-avatar-image {
  display: block;
  background-image: url("/assets/mathpro-heroes.png");
  background-repeat: no-repeat;
  background-size: 222% 240%;
  text-indent: -9999px;
  overflow: hidden;
}

.hero-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  font-size: 1.35rem;
  font-weight: 950;
}

.hero-option strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.12;
}

.hero-option small {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.3;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  max-width: 920px;
}

.profile-card,
.price-card {
  padding: 28px;
}

.profile-card.is-hero-fractions {
  background:
    radial-gradient(circle at 12% 12%, rgba(245, 189, 59, 0.28), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 214, 0.72));
}

.profile-card.is-hero-geometry {
  background:
    radial-gradient(circle at 12% 12%, rgba(96, 165, 250, 0.26), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(219, 234, 254, 0.76));
}

.profile-card.is-hero-algebra {
  background:
    radial-gradient(circle at 12% 12%, rgba(124, 58, 237, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(237, 233, 254, 0.7));
}

.profile-card.is-hero-space {
  background:
    radial-gradient(circle at 12% 12%, rgba(24, 163, 166, 0.24), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(232, 252, 249, 0.72));
}

.profile-meta {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid rgba(37, 94, 219, 0.14);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 14%, rgba(255, 255, 255, 0.92), transparent 34%),
    linear-gradient(145deg, rgba(233, 240, 255, 0.9), rgba(232, 252, 249, 0.72));
}

.profile-hero .hero-icon {
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  font-size: 1.7rem;
}

.profile-hero-avatar {
  flex: 0 0 auto;
  width: 70px;
  height: 70px;
  border-radius: 12px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.58),
    0 12px 24px rgba(15, 23, 42, 0.16);
}

.profile-progress-panel {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid rgba(37, 94, 219, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.profile-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.profile-progress-head span,
.profile-progress-card span {
  color: var(--muted);
  font-weight: 850;
}

.profile-progress-head strong {
  display: block;
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 2.4rem);
  line-height: 1;
}

.profile-progress-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.profile-progress-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(37, 94, 219, 0.12);
  border-radius: 8px;
  background: rgba(233, 240, 255, 0.72);
}

.profile-progress-card strong {
  color: var(--ink);
  font-size: clamp(1.05rem, 2vw, 1.38rem);
  font-weight: 950;
  overflow-wrap: anywhere;
}

.profile-hero strong,
.profile-hero small {
  display: block;
}

.profile-hero strong {
  color: var(--ink);
  font-weight: 950;
}

.profile-hero small {
  color: var(--muted);
  font-weight: 750;
}

.profile-friend-requests {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.profile-friend-requests h2 {
  margin: 0;
}

.friend-request {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbff;
}

.friend-request div {
  display: grid;
  gap: 3px;
}

.friend-request span {
  color: var(--muted);
  font-weight: 800;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.price-card {
  display: grid;
  gap: 16px;
  box-shadow: none;
}

.pricing-page {
  max-width: 1500px;
}

.pricing-hero {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  margin-bottom: 18px;
  text-align: center;
}

.pricing-hero h1 {
  margin: 0;
  color: #06194b;
  font-size: clamp(3.5rem, 7vw, 6.1rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.pricing-hero h1 strong {
  color: #ff5a00;
}

.pricing-hero p {
  margin: 8px 0 0;
  color: #06194b;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 800;
}

.pricing-hero-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vw, 42px);
  color: #1457e8;
  font-size: clamp(3rem, 6vw, 5rem);
}

.pricing-page .pricing-grid {
  align-items: stretch;
  gap: 24px;
}

.price-plan-card {
  position: relative;
  align-content: start;
  gap: 18px;
  min-height: 100%;
  padding: clamp(20px, 2.2vw, 26px);
  overflow: hidden;
  border-color: #d8e3f5;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.94)),
    radial-gradient(circle at 15% 0%, rgba(37, 99, 235, 0.09), transparent 30%);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.price-plan-card.featured {
  border: 1px solid #ff6a00;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(255, 250, 246, 0.97)),
    radial-gradient(circle at 90% 4%, rgba(255, 106, 0, 0.12), transparent 28%);
  box-shadow: 0 22px 55px rgba(255, 106, 0, 0.13);
}

.price-plan-ribbon {
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  padding: 10px 8px;
  border-radius: 0 14px 0 10px;
  color: #fff;
  background: #ff5a00;
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
}

.price-plan-head {
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: center;
  gap: 16px;
  min-height: 150px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e4eaf5;
}

.price-plan-icon {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 12px;
  background: #edf4ff;
  font-size: 2rem;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.06);
}

.price-plan-head h2 {
  margin: 0 0 6px;
  font-size: clamp(2rem, 2.8vw, 2.65rem);
  line-height: 1.05;
}

.price-plan-head h2 span {
  color: #2563eb;
}

.price-plan-xp .price-plan-head h2 span,
.price-plan-xp .price-plan-head p {
  color: #148b2d;
}

.price-plan-lab .price-plan-head h2 span,
.price-plan-lab .price-plan-head p {
  color: #1457e8;
}

.price-plan-ultimate .price-plan-head h2 span,
.price-plan-ultimate .price-plan-head p {
  color: #ff5a00;
}

.price-plan-head p,
.price-plan-head small,
.price-plan-cost p,
.price-plan-safe,
.pricing-note p,
.pricing-trust-row small {
  margin: 0;
  color: #60708a;
  font-weight: 700;
  line-height: 1.35;
}

.price-plan-head p {
  font-size: 1.35rem;
  font-weight: 950;
}

.price-plan-head small {
  display: block;
  max-width: 34ch;
}

.price-plan-cost {
  display: grid;
  place-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e4eaf5;
  text-align: center;
}

.price-plan-cost .price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  color: var(--ink);
}

.price-plan-cost .price strong {
  color: #1457e8;
  font-size: clamp(3.1rem, 4.6vw, 4.3rem);
  line-height: 0.9;
}

.price-plan-cost .price span {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 900;
}

.price-plan-xp .price-plan-cost .price strong {
  color: #16882b;
}

.price-plan-ultimate .price-plan-cost .price strong {
  color: #ff5a00;
}

.price-year-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100%, 320px);
  min-height: 42px;
  padding: 8px 14px;
  border: 0;
  border-radius: 10px;
  color: #0b2160;
  background: #edf5ed;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.price-year-pill span {
  padding: 4px 9px;
  border-radius: 999px;
  color: #fff;
  background: #158a2c;
  font-size: 0.7rem;
  white-space: nowrap;
}

.price-plan-lab .price-year-pill {
  color: #1457e8;
  background: #eaf1ff;
}

.price-plan-lab .price-year-pill span {
  background: #1457e8;
}

.price-plan-ultimate .price-year-pill {
  color: #ff5a00;
  background: #fff0e5;
}

.price-plan-ultimate .price-year-pill span {
  background: #ff5a00;
}

.ultimate-trainer-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 22px;
  border: 1px solid #eadcff;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(250, 245, 255, 0.96), rgba(239, 246, 255, 0.92)),
    radial-gradient(circle at 92% 12%, rgba(124, 58, 237, 0.16), transparent 32%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.82);
}

.ultimate-trainer-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: #7c3aed;
  font-size: 1.25rem;
  font-weight: 950;
}

.ultimate-trainer-title span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
}

.ultimate-trainer-panel p:not(.ultimate-trainer-title) {
  margin: 0;
  color: #60708a;
  font-weight: 850;
  line-height: 1.45;
}

.ultimate-trainer-panel small {
  display: block;
  color: #60708a;
  font-weight: 800;
  line-height: 1.35;
}

.ultimate-trainer-panel ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #60708a;
  font-weight: 900;
}

.ultimate-trainer-panel li {
  position: relative;
  padding-left: 26px;
}

.ultimate-trainer-panel li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 1px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #7c3aed;
  font-size: 0.72rem;
  font-weight: 950;
}

.price-feature-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.price-card .price-feature-list {
  padding-left: 0;
}

.price-feature-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  color: var(--ink);
}

.price-feature-list li > span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #34a853;
  font-size: 0.88rem;
  font-weight: 900;
}

.price-plan-ultimate .price-feature-list li:nth-child(n + 2) > span {
  background: #ff5a00;
  color: #fff;
  font-size: 0.88rem;
}

.price-feature-list strong {
  display: block;
  margin-bottom: 3px;
  font-size: 1rem;
}

.price-feature-list small {
  display: block;
  color: #60708a;
  font-weight: 700;
  line-height: 1.35;
}

.price-reward-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(239, 247, 239, 0.98), rgba(249, 250, 244, 0.98));
}

.price-plan-ultimate .price-reward-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: linear-gradient(90deg, rgba(255, 244, 232, 0.98), rgba(255, 249, 242, 0.98));
}

.price-reward-strip div {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  column-gap: 8px;
  min-height: 64px;
  padding: 8px;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  text-align: center;
}

.price-reward-strip div:last-child {
  border-right: 0;
}

.price-reward-strip span {
  grid-row: span 2;
  font-size: 1.8rem;
}

.price-reward-strip strong {
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
}

.price-reward-strip small {
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 900;
}

.feature-new-badge {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(90deg, #c4b5fd, #8b5cf6);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 950;
  vertical-align: middle;
}

.price-plan-actions {
  display: grid;
  gap: 12px;
}

.price-plan-card .button {
  min-height: 52px;
  justify-content: center;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 900;
}

.price-plan-card .button-primary {
  background: linear-gradient(90deg, #2563eb, #1d9fb1);
}

.price-plan-xp .button-primary {
  background: linear-gradient(90deg, #16882b, #22a83a);
}

.price-plan-ultimate .button-primary {
  background: linear-gradient(90deg, #ff6a00, #ff3d00);
}

.price-plan-card .button-secondary {
  color: var(--ink);
  background: linear-gradient(180deg, #f6f8fb, #edf1f7);
  border-color: transparent;
}

.price-plan-safe {
  justify-self: center;
  padding-top: 2px;
  color: var(--ink);
  font-size: 0.86rem;
  text-align: center;
}

.pricing-note {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  margin-top: 26px;
  padding: 18px 24px;
  border: 1px solid #dbe7fb;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.07);
}

.pricing-note-icon {
  display: grid;
  width: 70px;
  height: 58px;
  place-items: center;
  border-radius: 16px;
  background: #edf4ff;
  font-size: 2.2rem;
}

.pricing-note strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.08rem;
}

.pricing-note-badge {
  display: grid;
  min-width: 120px;
  min-height: 70px;
  place-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  color: #7c3aed;
  background: #fff;
  box-shadow: 0 14px 28px rgba(124, 58, 237, 0.11);
  font-weight: 900;
  text-align: center;
}

.pricing-trust-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
  padding: 18px 26px;
  border: 1px solid #dbe7fb;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.07);
}

.pricing-trust-row div {
  display: grid;
  grid-template-columns: 50px 1fr;
  align-items: center;
  column-gap: 14px;
}

.pricing-trust-row span {
  display: grid;
  grid-row: span 2;
  width: 50px;
  height: 50px;
  place-items: center;
  color: #1457e8;
  font-size: 2rem;
}

.pricing-trust-row strong {
  color: #06194b;
  font-weight: 950;
}

.price-card.featured:not(.price-plan-card) {
  border-color: rgba(35, 100, 210, 0.55);
  box-shadow: var(--shadow);
}

.price {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 800;
}

.price span {
  color: var(--muted);
  font-size: 1rem;
}

.price-card ul {
  display: grid;
  gap: 10px;
  padding-left: 20px;
  color: #344054;
}

.centered {
  text-align: center;
}

.game-page {
  position: relative;
  background:
    linear-gradient(90deg, rgba(23, 63, 152, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 63, 152, 0.045) 1px, transparent 1px),
    linear-gradient(145deg, #eaf3ff 0%, #f8fbff 44%, #fff5dc 100%);
  background-size: 34px 34px, 34px 34px, auto;
}

.game-page .site-header {
  display: none;
}

.game-page::before {
  content: "π  √x  ∑  Δ  3/5  y=2x+1  ∠  %  x²";
  position: fixed;
  inset: auto 0 12px;
  z-index: -1;
  color: rgba(16, 26, 55, 0.045);
  font-size: clamp(3rem, 9vw, 8rem);
  font-weight: 900;
  white-space: nowrap;
  transform: rotate(-2deg);
  pointer-events: none;
}

.game-shell {
  max-width: 1820px;
  margin: 0 auto;
  padding: 18px clamp(18px, 2.8vw, 34px) 70px;
}

.game-topbar {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(560px, 0.92fr);
  align-items: start;
  gap: 18px;
  margin-bottom: 20px;
}

.game-topbar h1 {
  max-width: 850px;
  margin: 0;
  color: #101a3d;
  font-size: clamp(3.3rem, 5.6vw, 5.8rem);
  line-height: 0.92;
  letter-spacing: 0;
  text-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

.game-topbar h1::after {
  content: " ✦";
  color: #facc15;
  font-size: 0.42em;
  vertical-align: top;
}

.game-topbar h1::first-letter {
  letter-spacing: 0;
}

.game-tagline {
  margin: 10px 0 0;
  color: #10213f;
  font-size: clamp(1.05rem, 1.45vw, 1.34rem);
  font-weight: 950;
}

.game-page .eyebrow {
  color: #2563eb;
  font-size: 0.95rem;
  letter-spacing: 0;
}

.game-topbar > div:first-child {
  flex: 1;
  min-width: 0;
}

.topbar-actions {
  position: relative;
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 250px;
  align-items: stretch;
  justify-content: flex-end;
  gap: 16px;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 14px 18px;
  border: 1px solid rgba(37, 94, 219, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 34px rgba(20, 33, 61, 0.12);
  backdrop-filter: blur(18px);
}

.player-avatar {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 12px;
  color: white;
  background: linear-gradient(135deg, var(--primary), #31a8a1);
  font-weight: 900;
  font-size: 1.35rem;
}

.player-avatar.hero-avatar-image {
  background-color: #edf4ff;
  background-image: url("/assets/mathpro-heroes.png");
  background-repeat: no-repeat;
  background-size: 222% 240%;
  color: transparent;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.6),
    0 8px 18px rgba(15, 23, 42, 0.14);
}

.player-avatar.hero-portrait-fractions {
  background-position: 8% 0%;
}

.player-avatar.hero-portrait-geometry {
  background-position: 92% 0%;
}

.player-avatar.hero-portrait-algebra {
  background-position: 8% 88%;
}

.player-avatar.hero-portrait-space {
  background-position: 92% 88%;
}

.player-card [data-player-subtitle],
.team-card span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.player-card > div {
  flex: 1;
  min-width: 0;
}

.player-card strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #101a3d;
  font-size: clamp(1rem, 1.15vw, 1.22rem);
  line-height: 1.12;
}

.player-card strong::after {
  content: "✎";
  color: #667085;
  font-size: 0.76em;
}

.xp-track {
  height: 9px;
  overflow: hidden;
  margin: 10px 0 6px;
  border-radius: 999px;
  background: #e6ebf3;
}

.xp-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.player-card small {
  color: var(--muted);
  font-weight: 800;
}

.game-dashboard {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.game-dashboard article,
.game-panel,
.problem-card {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 250, 255, 0.86));
  box-shadow: 0 20px 52px rgba(20, 33, 61, 0.12);
  backdrop-filter: blur(18px);
}

.game-dashboard article {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-width: 0;
  min-height: 138px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  border-color: rgba(37, 94, 219, 0.12);
  box-shadow: 0 15px 36px rgba(20, 33, 61, 0.1);
}

.game-dashboard article::after {
  content: "";
  position: absolute;
  inset: auto 14px 0;
  height: 4px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--primary), var(--teal), var(--accent));
}

.math-lab {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.math-lab-card {
  position: relative;
  min-height: 174px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.78)),
    #ffffff;
  box-shadow: 0 20px 52px rgba(20, 33, 61, 0.12);
  backdrop-filter: blur(18px);
}

.math-lab-card::after {
  content: "";
  position: absolute;
  inset: auto 16px 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--rose));
}

.algebra-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(420px, 1fr));
  gap: 10px;
  max-height: 360px;
  margin-top: 14px;
  overflow: auto;
  padding-right: 4px;
}

.algebra-group {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(37, 94, 219, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(233, 240, 255, 0.64));
}

.algebra-group h3 {
  margin: 0 0 8px;
  color: var(--primary-dark);
  font-size: 0.92rem;
  font-weight: 950;
  letter-spacing: 0;
}

.formula-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.formula-card-game,
.graph-card {
  grid-column: span 2;
}

.formula-stack strong {
  display: block;
  padding: 9px 11px;
  border: 1px solid rgba(37, 94, 219, 0.12);
  border-radius: 8px;
  color: #0f2747;
  background: rgba(233, 240, 255, 0.72);
  font-size: clamp(0.94rem, 1.15vw, 1.24rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.18;
  overflow-x: auto;
  white-space: nowrap;
}

.math-frac {
  display: inline-grid;
  grid-template-rows: auto 1px auto;
  align-items: center;
  justify-items: center;
  min-width: 2.2em;
  margin: 0 0.12em;
  vertical-align: middle;
  white-space: nowrap;
  line-height: 1;
}

.math-frac > span {
  display: block;
  padding: 0 0.2em;
}

.math-frac::before {
  content: "";
  grid-row: 2;
  width: 100%;
  border-top: 2px solid currentColor;
}

.math-frac > span:first-child {
  grid-row: 1;
  padding-bottom: 0.12em;
}

.math-frac > span:last-child {
  grid-row: 3;
  padding-top: 0.12em;
}

.algebra-groups::-webkit-scrollbar {
  width: 8px;
}

.algebra-groups::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(37, 94, 219, 0.28);
}

.graph-card svg,
.geometry-svg {
  width: 100%;
  margin-top: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.graph-card svg {
  height: 360px;
  touch-action: none;
}

.graph-card {
  min-height: 433px;
}

.diagram-card {
  grid-column: 1 / -1;
}

.geometry-stage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.geometry-tile {
  display: grid;
  align-content: start;
  justify-items: center;
  min-height: 226px;
  padding: 12px 10px;
  border: 1px solid rgba(37, 94, 219, 0.12);
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.92), transparent 34%),
    linear-gradient(145deg, rgba(219, 234, 254, 0.84), rgba(255, 255, 255, 0.62));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 14px 30px rgba(20, 33, 61, 0.08);
}

.geometry-svg {
  width: min(100%, 144px);
  height: 112px;
  filter: drop-shadow(0 14px 16px rgba(20, 33, 61, 0.13));
}

.geometry-svg text {
  fill: #14213d;
  font-size: 14px;
  font-weight: 950;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 4px;
  stroke-linejoin: round;
}

/* Interactive educational 3D scenes */
.model-output {
  grid-template-columns: minmax(460px, 1.2fr) minmax(320px, 0.68fr);
}

.model-canvas {
  display: flex;
  min-height: 560px;
  padding: 12px;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
}

.model-scene-toolbar {
  display: flex;
  gap: 8px;
  padding: 2px 2px 10px;
  flex-wrap: wrap;
}

.model-scene-toolbar button {
  min-height: 44px;
  border: 1px solid rgba(37, 94, 219, 0.22);
  border-radius: 9px;
  padding: 0 14px;
  color: #10213f;
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.model-scene-toolbar button[aria-pressed="true"] {
  color: #fff;
  border-color: #255edb;
  background: #255edb;
  box-shadow: 0 7px 18px rgba(37, 94, 219, 0.22);
}

.model-scene-toolbar button:focus-visible,
.model-scene-viewport:focus-within {
  outline: 3px solid rgba(245, 189, 59, 0.9);
  outline-offset: 2px;
}

.model-scene-viewport {
  position: relative;
  display: grid;
  min-height: 470px;
  flex: 1;
  place-items: center;
  border-radius: 10px;
  background: radial-gradient(circle at 38% 22%, rgba(255,255,255,.98), rgba(219,234,254,.76) 56%, rgba(191,219,254,.54));
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.model-scene-viewport.is-panning { cursor: move; }
.model-scene-viewport.is-dragging { cursor: grabbing; }

.model-canvas .model-scene-svg {
  width: min(100%, 760px);
  height: 100%;
  min-height: 460px;
  overflow: visible;
}

.model-canvas .model-scene-svg .model-face {
  stroke: rgba(30, 41, 59, 0.8) !important;
  stroke-width: 1.15 !important;
  stroke-linejoin: round;
}

.model-canvas .model-scene-svg .is-back-face { opacity: 0.18; }

.model-canvas .model-scene-svg.is-smooth-model .model-face {
  stroke: none !important;
  fill-opacity: 0.48;
}

.model-canvas .model-scene-svg .model-edge {
  fill: none !important;
  stroke: #172554 !important;
  stroke-width: 2.15 !important;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.model-canvas .model-scene-svg .is-hidden-edge {
  stroke: #64748b !important;
  stroke-width: 1.45 !important;
  stroke-dasharray: 7 7;
  opacity: 0.42;
}

.model-canvas .model-scene-svg .model-shadow {
  fill: rgba(15, 23, 42, 0.12) !important;
  stroke: none !important;
  filter: blur(2px);
}

.model-canvas .model-scene-svg .model-measure {
  pointer-events: none;
}

.model-canvas .model-scene-svg .model-measure-line,
.model-canvas .model-scene-svg .model-measure-cap,
.model-canvas .model-scene-svg .model-right-angle {
  fill: none;
  stroke: #be123c !important;
  stroke-width: 2.2 !important;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.model-canvas .model-scene-svg .model-measure.is-construction .model-measure-line {
  stroke-dasharray: 7 5;
}

.model-canvas .model-scene-svg .model-measure-radius .model-measure-line,
.model-canvas .model-scene-svg .model-measure-radius .model-measure-cap { stroke: #0369a1 !important; }
.model-canvas .model-scene-svg .model-measure-height .model-measure-line,
.model-canvas .model-scene-svg .model-measure-height .model-measure-cap { stroke: #dc2626 !important; }
.model-canvas .model-scene-svg .model-measure-apothem .model-measure-line,
.model-canvas .model-scene-svg .model-measure-apothem .model-measure-cap { stroke: #7c3aed !important; }
.model-canvas .model-scene-svg .model-measure-slant .model-measure-line,
.model-canvas .model-scene-svg .model-measure-slant .model-measure-cap { stroke: #d97706 !important; }

.model-canvas .model-scene-svg .model-measure-label rect {
  fill: rgba(255, 255, 255, 0.94) !important;
  stroke: rgba(37, 94, 219, 0.22) !important;
  stroke-width: 1 !important;
}

.model-canvas .model-scene-svg .model-measure-label text {
  fill: #10213f;
  stroke: none;
  font-size: 16px;
  font-weight: 950;
}

.model-scene-hint {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
}

.model-results strong {
  display: grid;
  gap: 4px;
  white-space: normal;
}

.model-result-formula { color: #10213f !important; }
.model-result-value { color: #255edb !important; font-size: 1.14em; }

.model-field-error {
  color: #b91c1c;
  font-size: 0.76rem;
  font-weight: 800;
}

.model-controls input[aria-invalid="true"] {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

@media (max-width: 860px) {
  .model-output { grid-template-columns: minmax(0, 1fr); }
  .model-canvas { min-height: 470px; padding: 10px; }
  .model-scene-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .model-scene-toolbar button { padding: 0 8px; }
  .model-scene-viewport { min-height: 370px; }
  .model-canvas .model-scene-svg { min-height: 360px; }
}

@media (prefers-reduced-motion: reduce) {
  .model-scene-toolbar button { transition: none !important; }
}

.geometry-svg .measure-line,
.solid-svg .measure-line {
  fill: none;
  stroke: #dc2626;
  stroke-width: 2.8px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.geometry-svg .construction-line,
.solid-svg .construction-line {
  fill: none;
  stroke: #dc2626;
  stroke-width: 2.6px;
  stroke-dasharray: 5 4;
  stroke-linecap: round;
}

.geometry-svg .right-angle,
.solid-svg .right-angle {
  fill: none;
  stroke: #14213d;
  stroke-width: 2.2px;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.geometry-svg .hidden-edge,
.solid-svg .hidden-edge {
  fill: none;
  stroke: #64748b;
  stroke-width: 2.4px;
  stroke-dasharray: 5 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.geometry-svg .diagram-label,
.solid-svg .diagram-label {
  paint-order: stroke fill;
  stroke: rgba(255, 255, 255, 0.98);
  stroke-width: 5px;
  stroke-linejoin: round;
  pointer-events: none;
}

.geometry-tile strong {
  color: #10213f;
  font-size: 0.98rem;
  font-weight: 950;
  line-height: 1.1;
  text-align: center;
}

.geometry-tile small {
  margin-top: 5px;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
}

.geometry-formulas {
  display: grid;
  gap: 5px;
  width: 100%;
  margin-top: 10px;
}

.geometry-formulas > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 7px;
  border: 1px solid rgba(37, 94, 219, 0.12);
  border-radius: 7px;
  color: #0f2747;
  background: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  overflow-x: auto;
  white-space: nowrap;
}

[data-coordinate-point] {
  cursor: grab;
  filter: drop-shadow(0 5px 8px rgba(239, 68, 68, 0.28));
  outline: none;
  transition: r 0.16s ease, filter 0.16s ease;
}

[data-coordinate-point]:hover,
[data-coordinate-point]:focus {
  r: 10;
  filter: drop-shadow(0 8px 12px rgba(239, 68, 68, 0.38));
}

[data-coordinate-point].is-dragging {
  cursor: grabbing;
}

.coordinate-readout {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-top: 10px;
  padding: 0 12px;
  border-radius: 8px;
  color: #0f2747;
  background: rgba(233, 240, 255, 0.82);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.solids-card {
  grid-column: 1 / -1;
}

.solid-stage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.solid-tile {
  display: grid;
  align-content: start;
  justify-items: center;
  min-height: 226px;
  padding: 12px 10px;
  border: 1px solid rgba(37, 94, 219, 0.12);
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.92), transparent 34%),
    linear-gradient(145deg, rgba(219, 234, 254, 0.84), rgba(255, 255, 255, 0.62));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 14px 30px rgba(20, 33, 61, 0.08);
}

.solid-svg {
  width: min(100%, 144px);
  height: 112px;
  filter: drop-shadow(0 14px 16px rgba(20, 33, 61, 0.13));
}

.solid-svg text {
  fill: #10213f;
  font-size: 14px;
  font-weight: 950;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.solid-tile strong {
  color: #10213f;
  font-size: 0.98rem;
  font-weight: 950;
  line-height: 1.1;
  text-align: center;
}

.solid-tile small {
  margin-top: 5px;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
}

.solid-formulas {
  display: grid;
  gap: 5px;
  width: 100%;
  margin-top: 10px;
}

.solid-formulas > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 7px;
  border: 1px solid rgba(37, 94, 219, 0.12);
  border-radius: 7px;
  color: #0f2747;
  background: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  overflow-x: auto;
  white-space: nowrap;
}

.models-page {
  background:
    linear-gradient(115deg, rgba(37, 94, 219, 0.08), rgba(24, 163, 166, 0.08)),
    var(--paper);
}

.models-shell {
  max-width: 1280px;
}

.models-intro,
.model-section {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.82)),
    #ffffff;
  box-shadow: var(--shadow);
}

.models-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
  align-items: end;
  gap: 24px;
  margin-bottom: 18px;
  padding: clamp(22px, 4vw, 34px);
}

.models-intro h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.models-intro p {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.models-note {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 8px;
  color: #10213f;
  background: #e9f0ff;
}

.models-note strong {
  font-size: 1.05rem;
}

.models-note span {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.model-section {
  display: grid;
  grid-template-columns: minmax(240px, 0.28fr) minmax(0, 1fr);
  gap: 22px;
  margin-top: 18px;
  padding: clamp(18px, 3vw, 28px);
}

.model-copy h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  line-height: 1.1;
}

.model-copy p {
  color: var(--muted);
  line-height: 1.55;
}

.model-controls {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.model-controls label {
  display: grid;
  gap: 6px;
  color: #10213f;
  font-weight: 900;
}

.model-controls input {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-weight: 850;
}

.model-output {
  display: grid;
  grid-template-columns: minmax(380px, 1fr) minmax(360px, 0.72fr);
  gap: 14px;
  min-width: 0;
}

.model-canvas,
.model-results {
  border: 1px solid rgba(37, 94, 219, 0.12);
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.92), transparent 34%),
    linear-gradient(145deg, rgba(219, 234, 254, 0.86), rgba(255, 255, 255, 0.72));
}

.model-canvas {
  display: grid;
  min-height: 430px;
  place-items: center;
  overflow: hidden;
}

.model-canvas svg {
  width: min(100%, 680px);
  min-height: 410px;
  filter: none;
}

.model-canvas svg path,
.model-canvas svg polygon,
.model-canvas svg circle,
.model-canvas svg ellipse,
.model-canvas svg rect {
  stroke: #111827 !important;
  stroke-width: 1.8 !important;
  fill-opacity: 0.24;
  opacity: 1;
}

.model-canvas .model-floor {
  display: none;
}

.model-canvas .model-highlight {
  display: none;
  fill: none;
  stroke: rgba(17, 24, 39, 0.38);
  stroke-width: 1.6 !important;
  stroke-linecap: round;
  opacity: 0.45;
}

.model-canvas .model-face {
  fill-opacity: 0.24;
  stroke: #111827;
  stroke-width: 1.8 !important;
  stroke-linejoin: round;
  opacity: 1;
}

.model-canvas .model-edge {
  fill: none;
  stroke: #111827 !important;
  stroke-width: 1.7 !important;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 1;
}

.model-canvas .back-edge {
  stroke-dasharray: 6 6;
  stroke: #6b7280 !important;
  stroke-width: 1.4 !important;
  opacity: 0.62;
}

.model-canvas .model-measure {
  fill: none;
  stroke: #111827 !important;
  stroke-width: 1.6 !important;
  stroke-linecap: round;
  opacity: 0.82;
}

.model-canvas .model-measure.dashed {
  stroke-dasharray: 6 6;
}

.model-canvas text {
  fill: #10213f;
  font-size: 22px;
  font-weight: 950;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.96);
  stroke-width: 5px;
  stroke-linejoin: round;
}

.model-results {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
}

.model-results article {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(37, 94, 219, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.model-results span {
  color: var(--muted);
  font-weight: 850;
}

.model-results strong {
  color: #10213f;
  font-size: clamp(0.98rem, 1.25vw, 1.18rem);
  line-height: 1.22;
  overflow: visible;
  white-space: nowrap;
}

.model-results strong .math-frac,
.model-results strong .math-frac span {
  color: inherit;
  font-weight: inherit;
}

.home-game {
  background:
    linear-gradient(115deg, rgba(37, 94, 219, 0.08), rgba(24, 163, 166, 0.08)),
    var(--paper);
}

.game-hero {
  position: relative;
  min-height: calc(100vh - 78px);
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 18%, rgba(96, 165, 250, 0.32), transparent 30%),
    radial-gradient(circle at 78% 24%, rgba(245, 189, 59, 0.28), transparent 28%),
    linear-gradient(135deg, #f8fbff 0%, #e9f0ff 58%, #eefcfb 100%);
}

.game-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(37, 94, 219, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 94, 219, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 86%);
}

.game-hero > * {
  position: relative;
  z-index: 1;
}

.game-hero h1 {
  max-width: 760px;
}

.hero-main-action {
  min-width: 250px;
  box-shadow: 0 18px 34px rgba(37, 94, 219, 0.24);
}

.hero-game-stage {
  position: relative;
  min-height: 520px;
  border-radius: 8px;
}

.hero-avatar-card,
.home-card,
.world-card {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.8)),
    #ffffff;
  box-shadow: 0 22px 58px rgba(20, 33, 61, 0.13);
  backdrop-filter: blur(18px);
}

.hero-avatar-card {
  position: absolute;
  right: 8%;
  bottom: 58px;
  width: min(320px, 78%);
  padding: 18px;
  animation: float-card 4s ease-in-out infinite;
}

.hero-avatar-card strong {
  display: block;
  font-size: 1.35rem;
}

.hero-avatar-card span {
  display: block;
  margin: 6px 0 12px;
  color: var(--muted);
  font-weight: 800;
}

.flying-symbol {
  position: absolute;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 8px;
  color: #10213f;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 34px rgba(20, 33, 61, 0.14);
  font-size: 1.85rem;
  font-weight: 950;
  animation: float-symbol 5s ease-in-out infinite;
}

.flying-symbol.s1 { left: 7%; top: 20%; color: var(--primary); }
.flying-symbol.s2 { right: 18%; top: 11%; animation-delay: -1.2s; }
.flying-symbol.s3 { left: 18%; bottom: 20%; color: var(--teal); animation-delay: -2s; }
.flying-symbol.s4 { right: 4%; top: 42%; color: var(--rose); animation-delay: -3s; }

.particle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 24px rgba(245, 189, 59, 0.7);
  animation: particle-drift 6s ease-in-out infinite;
}

.particle.p1 { left: 36%; top: 18%; }
.particle.p2 { right: 34%; top: 54%; animation-delay: -2s; background: var(--teal); }
.particle.p3 { left: 44%; bottom: 18%; animation-delay: -4s; background: var(--rose); }

.orbital-shape {
  position: absolute;
  transform-style: preserve-3d;
  animation: spin-shape 8s linear infinite;
}

.triangle-shape {
  left: 25%;
  top: 29%;
  width: 0;
  height: 0;
  border-left: 76px solid transparent;
  border-right: 76px solid transparent;
  border-bottom: 132px solid rgba(245, 189, 59, 0.72);
  filter: drop-shadow(0 22px 28px rgba(20, 33, 61, 0.18));
}

.cube-shape {
  right: 23%;
  top: 30%;
  width: 122px;
  height: 122px;
  border: 6px solid rgba(37, 94, 219, 0.86);
  background: rgba(96, 165, 250, 0.18);
  box-shadow: 24px 24px 0 rgba(24, 163, 166, 0.24);
}

.home-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 34px clamp(18px, 5vw, 42px);
}

.world-map,
.quick-actions,
.home-grid {
  display: grid;
  gap: 16px;
}

.world-map {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.world-card {
  position: relative;
  display: grid;
  gap: 16px;
  min-height: 330px;
  padding: 20px;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.world-card:hover {
  transform: translateY(-8px) scale(1.025);
  box-shadow: 0 34px 76px rgba(20, 33, 61, 0.2);
}

.world-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 0;
  height: 4px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--primary), var(--teal), var(--accent));
}

.world-illustration {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 8px;
  background: rgba(233, 240, 255, 0.9);
  font-size: 3rem;
}

.world-status {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--primary-dark);
  background: #e9f0ff;
  font-size: 0.78rem;
  font-weight: 950;
}

.world-card h3,
.home-card h2 {
  margin: 10px 0 8px;
  font-size: clamp(1.28rem, 2vw, 1.8rem);
  line-height: 1.08;
}

.world-card p,
.home-card p {
  color: var(--muted);
  line-height: 1.5;
}

.world-card strong {
  display: block;
  margin: 16px 0 9px;
}

.is-locked {
  filter: saturate(0.78);
}

.is-locked .world-status {
  color: #7a2e36;
  background: rgba(239, 68, 68, 0.12);
}

.home-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-card {
  padding: 20px;
  min-width: 0;
}

.mission-progress-row,
.xp-stat-row,
.profile-rpg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mission-progress-row strong,
.xp-stat-row strong {
  font-size: 1.65rem;
}

.profile-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  font-size: 1.65rem;
  font-weight: 950;
}

.quick-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quick-action {
  display: grid;
  min-height: 132px;
  place-items: center;
  gap: 8px;
  padding: 18px;
  border-radius: 8px;
  color: white;
  box-shadow: 0 20px 48px rgba(20, 33, 61, 0.16);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.quick-action:hover {
  transform: translateY(-6px) scale(1.03);
  filter: brightness(1.05);
}

.quick-action span {
  font-size: 2.2rem;
}

.quick-action strong {
  font-size: 1.12rem;
}

.quick-action.play { background: linear-gradient(135deg, #255edb, #18a3a6); }
.quick-action.test { background: linear-gradient(135deg, #7c3aed, #255edb); }
.quick-action.theory { background: linear-gradient(135deg, #197a55, #18a3a6); }
.quick-action.rank { background: linear-gradient(135deg, #f59e0b, #ef4444); }

.bottom-grid {
  align-items: stretch;
}

.leaderboard-home ol {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.leaderboard-home li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: rgba(233, 240, 255, 0.74);
}

.leaderboard-home em {
  grid-column: 2;
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.reward-card,
.assistant-card {
  display: grid;
  align-content: start;
  justify-items: start;
}

.reward-chest,
.assistant-robot {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin: 10px 0 16px;
  border-radius: 8px;
  background: #e9f0ff;
  font-size: 3.2rem;
}

.reward-chest.is-claimed {
  animation: reward-pop 0.5s ease;
  background: rgba(245, 189, 59, 0.24);
}

.assistant-robot {
  animation: float-card 4s ease-in-out infinite;
}

.assistant-task {
  width: 100%;
  min-height: 58px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(233, 240, 255, 0.74);
  font-weight: 850;
}

@keyframes float-symbol {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-22px) rotate(8deg); }
}

@keyframes particle-drift {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.65; }
  50% { transform: translate(24px, -26px) scale(1.4); opacity: 1; }
}

@keyframes spin-shape {
  0% { transform: rotateX(0deg) rotateY(0deg); }
  100% { transform: rotateX(360deg) rotateY(360deg); }
}

@keyframes float-card {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.cube3d,
.pyramid3d {
  position: relative;
  transform-style: preserve-3d;
  animation: math-spin 9s linear infinite;
}

.cube3d {
  width: 68px;
  height: 68px;
  transform: rotateX(-22deg) rotateY(32deg);
}

.cube3d .face {
  position: absolute;
  inset: 0;
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.72);
  background: rgba(37, 94, 219, 0.72);
  box-shadow: inset 0 0 22px rgba(255, 255, 255, 0.18);
}

.cube3d .front { transform: translateZ(34px); }
.cube3d .back { transform: rotateY(180deg) translateZ(34px); background: rgba(24, 163, 166, 0.62); }
.cube3d .right { transform: rotateY(90deg) translateZ(34px); background: rgba(245, 189, 59, 0.72); }
.cube3d .left { transform: rotateY(-90deg) translateZ(34px); background: rgba(124, 58, 237, 0.58); }
.cube3d .top { transform: rotateX(90deg) translateZ(34px); background: rgba(96, 165, 250, 0.72); }
.cube3d .bottom { transform: rotateX(-90deg) translateZ(34px); background: rgba(239, 68, 68, 0.54); }

.pyramid3d {
  width: 74px;
  height: 74px;
  transform: rotateX(-20deg) rotateY(-28deg);
}

.pyramid3d .tri,
.pyramid3d .base {
  position: absolute;
  display: block;
  left: 0;
  top: 0;
  transform-style: preserve-3d;
}

.pyramid3d .tri {
  width: 0;
  height: 0;
  border-left: 37px solid transparent;
  border-right: 37px solid transparent;
  border-bottom: 78px solid rgba(245, 189, 59, 0.82);
  transform-origin: 50% 100%;
  filter: drop-shadow(0 10px 16px rgba(20, 33, 61, 0.14));
}

.pyramid3d .front { transform: rotateX(64deg) translateZ(20px); }
.pyramid3d .right { transform: rotateY(90deg) rotateX(64deg) translateZ(20px); border-bottom-color: rgba(37, 94, 219, 0.7); }
.pyramid3d .left { transform: rotateY(-90deg) rotateX(64deg) translateZ(20px); border-bottom-color: rgba(24, 163, 166, 0.72); }
.pyramid3d .back { transform: rotateY(180deg) rotateX(64deg) translateZ(20px); border-bottom-color: rgba(124, 58, 237, 0.58); }

.pyramid3d .base {
  width: 74px;
  height: 74px;
  background: rgba(239, 68, 68, 0.38);
  transform: rotateX(90deg) translateZ(-36px);
  border: 2px solid rgba(255, 255, 255, 0.62);
}

@keyframes math-spin {
  0% {
    transform: rotateX(-22deg) rotateY(0deg);
  }
  100% {
    transform: rotateX(-22deg) rotateY(360deg);
  }
}

.game-dashboard span {
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 950;
}

.game-dashboard strong {
  display: block;
  margin-top: 8px;
  color: #101a3d;
  font-size: clamp(1.8rem, 2.4vw, 2.55rem);
  font-variant-numeric: tabular-nums;
  line-height: 0.98;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.game-dashboard strong.is-long {
  font-size: clamp(0.94rem, 1.05vw, 1.25rem);
}

.game-dashboard strong.is-extra-long {
  font-size: clamp(0.78rem, 0.9vw, 1rem);
}

.stat-buy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.stat-plus-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  box-shadow: 0 10px 22px rgba(37, 94, 219, 0.24);
  font: inherit;
  font-size: 1.35rem;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.game-quick-panel {
  padding: 0;
  border-radius: 14px;
}

.stat-plus-button:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 14px 28px rgba(37, 94, 219, 0.3);
}

.game-dashboard .unlock-copy {
  font-size: clamp(0.86rem, 1vw, 1rem);
  line-height: 1.35;
}

.joker-shop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 22, 44, 0.34);
  backdrop-filter: blur(6px);
}

.joker-shop[hidden] {
  display: none;
}

.joker-shop-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 236, 153, 0.72), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.94));
  box-shadow: 0 28px 80px rgba(20, 33, 61, 0.32);
}

.joker-shop-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  font: inherit;
  font-size: 1.25rem;
  font-weight: 950;
  cursor: pointer;
}

.joker-shop-card h2 {
  margin: 0 0 8px;
}

.joker-shop-copy {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.48;
  font-weight: 700;
}

.joker-shop-balance {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.game-dashboard article::before {
  content: "";
  position: absolute;
  inset: -42px -36px auto auto;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.16), transparent 68%);
  pointer-events: none;
}

.stat-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff, #eaf3ff);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 16px 26px rgba(37, 99, 235, 0.14);
  font-size: 2.9rem;
  line-height: 1;
}

.stat-card-score .stat-icon { background: linear-gradient(145deg, #fff7d6, #ffffff); }
.stat-card-coins .stat-icon { background: linear-gradient(145deg, #fff2b6, #fff8dd); }
.stat-card-gems .stat-icon { background: linear-gradient(145deg, #f5edff, #eff6ff); }
.joker-stat-card .stat-icon { background: linear-gradient(145deg, #dbeafe, #f5edff); }
.answer-stat-card .stat-icon { background: linear-gradient(145deg, #dff7ff, #e9f0ff); }
.stat-card-streak .stat-icon { background: linear-gradient(145deg, #fff0df, #fff7d6); }

.joker-shop-balance span {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  color: var(--primary-dark);
  background: rgba(233, 240, 255, 0.82);
  font-weight: 900;
}

.joker-pack-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.joker-shop-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.joker-shop-section h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 1rem;
}

.joker-pack {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  min-height: 74px;
  padding: 12px;
  border: 1px solid rgba(37, 94, 219, 0.18);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 26px rgba(20, 33, 61, 0.08);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.joker-pack:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 94, 219, 0.38);
  box-shadow: 0 16px 34px rgba(20, 33, 61, 0.14);
}

.joker-pack strong {
  font-size: 1.04rem;
}

.joker-pack span {
  color: var(--primary);
  font-weight: 950;
}

.joker-pack.is-locked {
  opacity: 0.58;
}

.joker-pack.answer-pack {
  border-color: rgba(37, 99, 235, 0.22);
  background:
    radial-gradient(circle at 100% 0%, rgba(96, 165, 250, 0.18), transparent 34%),
    rgba(255, 255, 255, 0.94);
}

.joker-pack.is-focused {
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.16);
}

.joker-shop-feedback {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 900;
}

.joker-shop-feedback.is-success {
  color: #047857;
}

.joker-shop-feedback.is-error {
  color: #b45309;
}

.rpg-strip,
.rpg-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.rpg-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px;
  align-items: stretch;
}

.rpg-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.coach-only-grid {
  grid-template-columns: 1fr;
}

.rpg-card,
.system-card {
  border: 1px solid rgba(37, 94, 219, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 42px rgba(20, 33, 61, 0.1);
  backdrop-filter: blur(18px);
}

.rpg-card {
  display: grid;
  gap: 10px;
  padding: 28px 32px;
}

.rpg-card strong {
  color: #101a3d;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.12;
}

.rpg-card p,
.system-card p,
.admin-preview p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.rpg-kicker {
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-actions,
.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.event-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 14px;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, #8a3ffc, var(--primary));
  font-size: 1.15rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.daily-mission-card {
  grid-template-columns: 205px minmax(0, 1fr);
  align-items: end;
  min-height: 330px;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 20%, rgba(96, 165, 250, 0.22), transparent 26%),
    radial-gradient(circle at 92% 18%, rgba(138, 63, 252, 0.14), transparent 24%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(238, 246, 255, 0.9));
}

.daily-mission-hero {
  align-self: stretch;
  min-height: 264px;
  border-radius: 14px 14px 0 0;
  background-image:
    linear-gradient(180deg, transparent 68%, rgba(248, 251, 255, 0.95)),
    url("/assets/mathpro-heroes.png");
  background-repeat: no-repeat;
  background-size: 240% 260%;
  background-position: 7% 2%;
  filter: drop-shadow(0 18px 26px rgba(20, 33, 61, 0.18));
}

.daily-mission-content {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.daily-mission-answer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}

.daily-mission-answer input {
  min-width: 0;
  min-height: 64px;
  border: 1px solid rgba(37, 94, 219, 0.18);
  border-radius: 8px;
  padding: 0 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font: inherit;
  font-weight: 850;
}

.daily-mission-answer .button {
  min-height: 64px;
  min-width: 132px;
}

.daily-mission-answer input:disabled {
  color: #047857;
  background: #d1fae5;
}

.daily-mission-feedback {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-weight: 850;
}

.daily-mission-feedback.is-correct {
  color: #047857;
}

.daily-mission-feedback.is-wrong {
  color: #b45309;
}

.daily-reward-card {
  position: relative;
  grid-template-columns: minmax(0, 1fr) 250px;
  align-items: center;
  min-height: 330px;
  overflow: hidden;
  border-color: rgba(245, 189, 59, 0.42);
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 236, 153, 0.96), transparent 28%),
    radial-gradient(circle at 88% 14%, rgba(96, 165, 250, 0.26), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 214, 0.86));
  box-shadow: 0 24px 58px rgba(245, 158, 11, 0.2), 0 18px 44px rgba(20, 33, 61, 0.1);
}

.daily-reward-card::before {
  content: "";
  position: absolute;
  inset: -60% auto auto -10%;
  width: 42%;
  height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  transform: rotate(18deg);
  animation: rewardShine 4.2s ease-in-out infinite;
}

.reward-orbit {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-self: center;
  width: 220px;
  height: 190px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 42% 68%, rgba(56, 189, 248, 0.38), transparent 34%),
    radial-gradient(circle at 72% 32%, rgba(250, 204, 21, 0.38), transparent 36%),
    transparent;
  box-shadow: none;
}

.reward-chest {
  font-size: 7.4rem;
  filter: drop-shadow(0 18px 22px rgba(20, 33, 61, 0.22));
  animation: rewardBounce 2.4s ease-in-out infinite;
}

.reward-spark {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #f43f5e;
  box-shadow: 0 0 18px rgba(244, 63, 94, 0.72);
  animation: rewardSpark 2.8s ease-in-out infinite;
}

.spark-one {
  top: 12px;
  right: 16px;
}

.spark-two {
  bottom: 18px;
  left: 14px;
  width: 8px;
  height: 8px;
  background: #2563eb;
  box-shadow: 0 0 18px rgba(37, 99, 235, 0.7);
  animation-delay: 0.55s;
}

.spark-three {
  right: 10px;
  bottom: 18px;
  width: 7px;
  height: 7px;
  background: #22c55e;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.7);
  animation-delay: 1.1s;
}

.daily-reward-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 7px;
  grid-column: 1;
  min-width: 0;
}

.reward-loot {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.reward-loot span {
  min-width: 0;
  padding: 16px 12px;
  border: 1px solid rgba(245, 189, 59, 0.38);
  border-radius: 8px;
  color: #10213f;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  font-size: clamp(0.78rem, 1.2vw, 0.92rem);
  font-weight: 950;
}

.reward-button {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  width: 100%;
  min-height: 62px;
  border: 0;
  color: #ffffff;
  background: linear-gradient(135deg, #f59e0b, #ef4444 48%, #2563eb);
  box-shadow: 0 14px 28px rgba(239, 68, 68, 0.24);
}

.reward-button:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 18px 36px rgba(239, 68, 68, 0.3);
}

.reward-button:disabled {
  cursor: default;
  color: #047857;
  background: #d1fae5;
  box-shadow: none;
  transform: none;
}

@keyframes rewardShine {
  0%, 62% {
    transform: translateX(-120%) rotate(18deg);
  }
  100% {
    transform: translateX(360%) rotate(18deg);
  }
}

@keyframes rewardBounce {
  0%, 100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-7px) rotate(3deg);
  }
}

@keyframes rewardSpark {
  0%, 100% {
    opacity: 0.45;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.25);
  }
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(240px, 310px);
  gap: 18px;
  align-items: start;
}

.game-side,
.mission-list,
.tag-list {
  display: grid;
  gap: 14px;
}

.game-panel {
  padding: 18px;
}

.game-panel h2,
.problem-card h2 {
  margin: 0 0 14px;
}

.activity-wide {
  position: relative;
  margin-bottom: 26px;
  padding: 30px 32px 24px;
  overflow: hidden;
  border-color: rgba(37, 94, 219, 0.12);
  background:
    radial-gradient(circle at 8% 18%, rgba(96, 165, 250, 0.16), transparent 26%),
    radial-gradient(circle at 94% 25%, rgba(138, 63, 252, 0.13), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 251, 255, 0.9));
}

.activity-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.activity-head h2 {
  margin: 0;
  color: #101a3d;
  font-size: clamp(1.45rem, 2.2vw, 2.3rem);
}

.activity-tools,
.activity-legend,
.activity-month-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.activity-tools {
  justify-content: flex-end;
}

.activity-legend {
  padding: 10px 14px;
  border-radius: 9px;
  background: rgba(233, 240, 255, 0.74);
  box-shadow: inset 0 0 0 1px rgba(37, 94, 219, 0.08);
}

.activity-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.legend-dot.zero {
  background: #ef4444;
}

.legend-dot.low {
  background: #facc15;
}

.legend-dot.mid {
  background: #60a5fa;
}

.legend-dot.high {
  background: #1e3a8a;
}

.section-menu {
  position: relative;
  z-index: 70;
}

.section-menu[open] {
  z-index: 10000;
}

.section-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 0 20px;
  border: 1px solid rgba(35, 100, 210, 0.2);
  border-radius: 10px;
  color: white;
  background: linear-gradient(135deg, #2f6df4, #1747c9);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.26);
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.section-menu summary::-webkit-details-marker {
  display: none;
}

.section-menu summary::after {
  content: "▾";
  margin-left: 8px;
  font-size: 0.75rem;
}

.section-menu[open] summary::after {
  transform: rotate(180deg);
}

.section-menu-content {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 10001;
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
  width: min(760px, calc(100vw - 32px));
  max-height: min(72vh, 720px);
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 28px 70px rgba(20, 33, 61, 0.24);
  backdrop-filter: blur(20px);
}

.menu-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(216, 222, 232, 0.9);
  border-radius: 12px;
  background: #fbfcff;
}

.menu-card h3 {
  margin: 0;
}

.game-menu-links {
  display: grid;
  gap: 8px;
}

.game-menu-links a {
  display: flex;
  min-height: 42px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(37, 94, 219, 0.14);
  border-radius: 8px;
  color: #10213f;
  background: linear-gradient(180deg, #ffffff, #eef5ff);
  font-weight: 900;
  text-decoration: none;
}

.game-menu-links a:hover {
  border-color: rgba(37, 94, 219, 0.32);
  color: var(--primary);
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.mode-chip {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.mode-chip.is-active {
  color: white;
  border-color: var(--primary);
  background: var(--primary);
}

.mode-chip:disabled {
  color: #98a2b3;
  cursor: not-allowed;
  background: #f3f5f8;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mini-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary-dark);
  background: #e9f0ff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.mission {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.mission.is-complete {
  border-color: rgba(245, 183, 35, 0.55);
  background:
    linear-gradient(90deg, rgba(255, 248, 221, 0.78), rgba(251, 252, 255, 0.95) 56%),
    #fbfcff;
}

.mission div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.mission span {
  color: var(--muted);
  font-weight: 800;
}

.mission-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mission-footer small {
  color: #5279b7;
  font-weight: 850;
}

.mission-claim-button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(90deg, #2563eb, #16a34a);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 900;
  white-space: nowrap;
}

.mission-claim-button:hover {
  filter: brightness(1.04);
}

.mini-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ebf3;
}

.mini-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.arena {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(16, 47, 96, 0.08), rgba(244, 185, 66, 0.08)),
    rgba(255, 255, 255, 0.72);
  box-shadow: 0 24px 60px rgba(20, 33, 61, 0.14);
  backdrop-filter: blur(18px);
}

.boss-hud {
  display: none;
  gap: 10px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid rgba(138, 63, 252, 0.35);
  border-radius: 8px;
  background: rgba(138, 63, 252, 0.08);
}

.boss-hud.is-visible {
  display: grid;
}

.boss-hud > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.boss-hud span {
  color: #6941c6;
  font-weight: 900;
}

.boss-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(138, 63, 252, 0.18);
}

.boss-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8a3ffc, #f43f5e);
}

.problem-card {
  position: relative;
  margin: 18px;
  padding: clamp(20px, 3vw, 34px);
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 16%, rgba(34, 211, 238, 0.24), transparent 30%),
    radial-gradient(circle at 86% 4%, rgba(245, 189, 59, 0.3), transparent 28%),
    radial-gradient(circle at 74% 92%, rgba(244, 63, 94, 0.12), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(236, 245, 255, 0.9)),
    #ffffff;
  border: 1px solid rgba(37, 94, 219, 0.18);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 24px 64px rgba(20, 33, 61, 0.16);
}

.problem-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(37, 94, 219, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 94, 219, 0.055) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.62), transparent 80%);
}

.problem-card > * {
  position: relative;
  z-index: 1;
}

.training-decor {
  position: absolute;
  z-index: 0;
  color: rgba(37, 94, 219, 0.13);
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  font-weight: 950;
  line-height: 1;
  pointer-events: none;
  animation: floatMath 6s ease-in-out infinite;
}

.decor-plus {
  top: 72px;
  right: 34px;
}

.decor-pi {
  left: 28px;
  bottom: 118px;
  color: rgba(245, 158, 11, 0.18);
  animation-delay: 1.2s;
}

.decor-root {
  right: 24%;
  bottom: 24px;
  color: rgba(20, 163, 166, 0.16);
  animation-delay: 2.1s;
}

.round-meta,
.arena-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.round-meta span {
  color: var(--muted);
  font-weight: 900;
}

.training-round-meta {
  padding: 12px;
  border: 1px solid rgba(37, 94, 219, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 12px 26px rgba(20, 33, 61, 0.07);
}

.training-round-meta > div {
  display: grid;
  gap: 4px;
}

.training-round-meta strong {
  color: #10213f;
  font-size: clamp(1.04rem, 1.7vw, 1.38rem);
  line-height: 1.08;
}

.timer-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  color: #10213f !important;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(37, 94, 219, 0.1);
}

.training-boost {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid rgba(37, 94, 219, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(37, 94, 219, 0.09), rgba(245, 189, 59, 0.12)),
    rgba(255, 255, 255, 0.76);
  box-shadow: 0 14px 30px rgba(20, 33, 61, 0.08);
}

.training-boost span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.training-boost strong {
  display: block;
  margin-top: 3px;
  color: #10213f;
  font-size: 1.02rem;
}

.training-chip-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.training-chip {
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid rgba(37, 94, 219, 0.18);
  border-radius: 8px;
  color: #10213f !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(233, 240, 255, 0.82));
  font-size: 0.82rem !important;
  font-weight: 950 !important;
  box-shadow: 0 8px 18px rgba(20, 33, 61, 0.08);
}

.training-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.training-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(37, 94, 219, 0.14);
  border-radius: 8px;
  color: #10213f;
  background: rgba(233, 240, 255, 0.78);
  font-size: 0.76rem;
  font-weight: 900;
}

.training-tag.is-nvo {
  border-color: rgba(245, 189, 59, 0.34);
  background: rgba(245, 189, 59, 0.2);
}

.training-tag.is-verified {
  border-color: rgba(31, 154, 146, 0.28);
  background: rgba(31, 154, 146, 0.14);
}

.question-arena {
  position: relative;
  margin-top: 18px;
  padding: clamp(18px, 3vw, 28px);
  overflow: hidden;
  border: 1px solid rgba(37, 94, 219, 0.16);
  border-radius: 8px;
  background:
    radial-gradient(circle at 88% 12%, rgba(245, 189, 59, 0.23), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(233, 240, 255, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.mobile-menu-toggle {
  display: none;
}

[data-question] sup {
  font-size: 0.62em;
  line-height: 0;
  vertical-align: super;
}

.question-aura {
  position: absolute;
  width: 180px;
  height: 180px;
  right: -54px;
  top: -72px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(245, 189, 59, 0.34), transparent 68%);
  animation: pulseAura 3.8s ease-in-out infinite;
}

.question-stage-label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-bottom: 14px;
  padding: 0 12px;
  border-radius: 8px;
  color: #0f766e;
  background: rgba(204, 251, 241, 0.82);
  font-size: 0.86rem;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(20, 163, 166, 0.18);
}

.problem-card h2 {
  margin: 0;
  font-size: clamp(1.32rem, 2.55vw, 2.55rem);
  line-height: 1.14;
  white-space: pre-line;
}

.problem-card h2[data-boss="true"] {
  color: #8a3ffc;
}

.problem-card p {
  color: var(--muted);
  line-height: 1.55;
}

.question-visual {
  display: none;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid rgba(37, 94, 219, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.question-visual.is-visible {
  display: grid;
  place-items: center;
}

.question-visual svg {
  width: min(100%, 360px);
  height: auto;
  filter: drop-shadow(0 12px 16px rgba(20, 33, 61, 0.1));
}

.question-visual text {
  fill: #10213f;
  font-size: 17px;
  font-weight: 950;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.training-progress {
  height: 12px;
  margin: 14px 0 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(37, 94, 219, 0.12);
  box-shadow: inset 0 1px 2px rgba(20, 33, 61, 0.08);
}

.training-progress span {
  display: block;
  width: 24%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--teal), var(--accent));
  transition: width 0.28s ease;
}

.answer-form {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.answer-form input {
  min-height: 58px;
  border: 2px solid rgba(37, 94, 219, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 28px rgba(20, 33, 61, 0.1);
  font-size: 1.14rem;
  font-weight: 800;
}

.answer-form .button {
  min-height: 58px;
  min-width: 128px;
  box-shadow: 0 12px 24px rgba(37, 94, 219, 0.22);
}

.arena-actions {
  margin-top: 14px;
}

.arena-actions .button {
  min-width: 170px;
}

.button-joker {
  border: 0;
  color: #10213f;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.92), transparent 36%),
    linear-gradient(135deg, #facc15, #22c55e 52%, #2563eb);
  box-shadow: 0 14px 28px rgba(245, 158, 11, 0.22);
}

.button-joker:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(245, 158, 11, 0.3);
}

.button-joker.is-empty {
  color: var(--primary-dark);
  background: #e9f0ff;
  box-shadow: inset 0 0 0 1px rgba(37, 94, 219, 0.16);
}

.button-answer-reveal {
  border: 0;
  color: #ffffff;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.button-answer-reveal:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.32);
}

.button-answer-reveal.is-empty {
  color: var(--primary-dark);
  background: #e9f0ff;
  box-shadow: inset 0 0 0 1px rgba(37, 94, 219, 0.16);
}

.feedback {
  min-height: 30px;
  margin: 16px 0 0;
  font-weight: 900;
}

.feedback.is-success {
  color: var(--success);
}

.feedback.is-error {
  color: var(--danger);
}

.feedback.is-joker {
  padding: 12px;
  border: 1px solid rgba(245, 158, 11, 0.32);
  border-radius: 8px;
  color: #92400e;
  background: rgba(255, 247, 214, 0.84);
}

.reward-pop {
  animation: reward-pop 0.36s ease;
}

@keyframes floatMath {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(-4deg);
  }
  50% {
    transform: translate3d(0, -12px, 0) rotate(5deg);
  }
}

@keyframes pulseAura {
  0%, 100% {
    opacity: 0.58;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes reward-pop {
  0% {
    transform: scale(0.96);
    opacity: 0.65;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.arena-systems {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0 18px 18px;
}

.system-card {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.system-card h3 {
  margin: 0;
}

.duel-board {
  display: grid;
  gap: 10px;
  min-height: 72px;
  padding: 12px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 92% 10%, rgba(245, 189, 59, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(233, 240, 255, 0.94), rgba(255, 255, 255, 0.82));
  box-shadow: inset 0 0 0 1px rgba(37, 94, 219, 0.12);
}

.duel-board span {
  color: var(--muted);
  font-weight: 800;
}

.duel-cups {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #10213f;
  background: #fff7d6;
  font-weight: 900;
}

.duel-cups strong {
  color: #b45309;
}

.duel-join-form,
.duel-answer-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
}

.duel-answer-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.duel-join-form input,
.duel-answer-form input {
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgba(37, 94, 219, 0.18);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-weight: 850;
}

.duel-code-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(37, 94, 219, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.duel-code-card strong {
  color: var(--primary);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: 0;
}

.duel-player-list,
.duel-scoreboard {
  display: grid;
  gap: 8px;
}

.duel-player-list span,
.duel-scoreboard span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.duel-scoreboard b {
  color: var(--primary-dark);
}

.duel-code-inline,
.duel-message,
.duel-warning {
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(204, 251, 241, 0.7);
  color: #0f766e;
  font-weight: 900;
}

.duel-warning {
  background: #fff7d6;
  color: #92400e;
}

.raid-board {
  background:
    radial-gradient(circle at 90% 12%, rgba(244, 63, 94, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(255, 247, 237, 0.94), rgba(255, 255, 255, 0.84));
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.12);
}

.raid-code-card strong {
  color: #dc2626;
}

.raid-hp {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.14);
  box-shadow: inset 0 1px 2px rgba(20, 33, 61, 0.1);
}

.raid-hp span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ef4444, #f59e0b);
  transition: width 0.24s ease;
}

.leaderboard {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard li,
.team-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f4f7fb;
  font-weight: 800;
}

.leaderboard strong {
  color: var(--primary);
}

.compact-form {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.friend-tag {
  display: inline-flex;
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: #e9f0ff;
  font-weight: 800;
}

.friend-tag small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.1;
}

.friend-feedback,
.friend-empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.friend-feedback.is-success {
  color: #047857;
}

.friend-feedback.is-error {
  color: #dc2626;
}

.team-card {
  align-items: flex-start;
  flex-direction: column;
  margin-top: 12px;
}

.daily-card {
  display: grid;
  gap: 12px;
}

.daily-card h3 {
  margin: 0;
  font-size: 1.22rem;
}

.daily-card p,
.muted-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.daily-steps,
.xp-rewards,
.badge-grid {
  display: grid;
  gap: 8px;
}

.daily-steps {
  grid-template-columns: 1fr 1fr;
}

.daily-steps span,
.xp-rewards strong,
.badge-tile {
  padding: 10px;
  border-radius: 8px;
  background: #f4f7fb;
  font-weight: 900;
}

.xp-rewards {
  grid-template-columns: 1fr 1fr;
}

.xp-rewards strong {
  color: var(--success);
}

.badge-tile {
  display: grid;
  gap: 4px;
  opacity: 0.6;
}

.badge-tile span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.badge-tile.is-unlocked {
  opacity: 1;
  color: var(--primary-dark);
  background: #e9f0ff;
  outline: 2px solid rgba(35, 100, 210, 0.18);
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(var(--days-in-month, 31), minmax(30px, 1fr));
  gap: 6px;
  padding: 0 0 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow-x: auto;
}

.activity-cell {
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1;
  border-radius: 7px;
  color: white;
  background: #ef4444;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 10px 18px rgba(20, 33, 61, 0.11);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.activity-cell strong {
  font-size: clamp(1rem, 1.15vw, 1.22rem);
  line-height: 1;
}

.activity-cell em {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.activity-cell.is-today {
  outline: 3px solid rgba(37, 99, 235, 0.55);
  outline-offset: 3px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.8),
    0 0 0 5px rgba(255, 255, 255, 0.9),
    0 16px 28px rgba(37, 99, 235, 0.24);
}

.activity-cell:hover {
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 10px 22px rgba(20, 33, 61, 0.22);
  filter: saturate(1.12);
}

.activity-cell.zero {
  background: #ef4444;
}

.activity-cell.low {
  color: #14213d;
  background: #facc15;
}

.activity-cell.low em {
  color: rgba(20, 33, 61, 0.72);
}

.activity-cell.mid {
  background: #60a5fa;
}

.activity-cell.high {
  background: #1e3a8a;
}

.activity-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
}

.stat-lines {
  display: grid;
  gap: 8px;
}

.stat-lines div,
.leaderboard-slab,
.achievement,
.coach-card,
.guild-chat p,
.notification-list p {
  padding: 16px 18px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 0 0 1px rgba(37, 94, 219, 0.08);
}

.activity-illustration {
  position: absolute;
  z-index: 0;
  display: grid;
  place-items: center;
  width: 90px;
  height: 90px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(219, 234, 254, 0.72));
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.14);
  font-size: 3.35rem;
  transform: rotate(-9deg);
}

.activity-illustration-left {
  left: 28px;
  top: 28px;
}

.activity-illustration-right {
  right: 42px;
  top: 34px;
  transform: rotate(11deg);
}

.activity-wide > *:not(.activity-illustration) {
  position: relative;
  z-index: 1;
}

.activity-wide .activity-head > div:first-child {
  padding-left: 110px;
}

.stat-lines span,
.leaderboard-slab span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.guild-chat {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.guild-chat p,
.notification-list p {
  margin: 0;
  color: #344054;
  font-weight: 700;
  line-height: 1.45;
}

.world-grid,
.inventory-grid,
.battle-pass,
.achievement-list,
.notification-list,
.leaderboard-tabs {
  display: grid;
  gap: 10px;
}

.world-card,
.inventory-grid span,
.pass-tier {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 8px;
  background: #f4f7fb;
  font-weight: 900;
}

.world-card {
  opacity: 0.58;
}

.world-card.is-open {
  opacity: 1;
  color: var(--primary-dark);
  background: #e9f0ff;
}

.world-card span,
.pass-tier span,
.pass-tier em {
  color: var(--muted);
  font-size: 0.84rem;
  font-style: normal;
  font-weight: 800;
}

.pass-tier {
  border-left: 4px solid #d0d5dd;
}

.home-game .world-card {
  position: relative;
  display: grid;
  gap: 16px;
  min-height: 330px;
  padding: 20px;
  overflow: hidden;
  opacity: 1;
  font-weight: inherit;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.8)),
    #ffffff;
  box-shadow: 0 22px 58px rgba(20, 33, 61, 0.13);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.home-game .world-card:hover {
  transform: translateY(-8px) scale(1.025);
  box-shadow: 0 34px 76px rgba(20, 33, 61, 0.2);
}

.home-game .world-card span {
  font-size: 0.78rem;
}

.home-game .world-card p {
  color: var(--muted);
  font-weight: 600;
}

.pass-tier.is-unlocked {
  border-left-color: var(--success);
  background: #ecfdf3;
}

.coach-card {
  display: grid;
  gap: 14px;
}

.coach-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.coach-panel {
  grid-column: 1 / -1;
}

.coach-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.coach-summary div,
.coach-focus,
.coach-topic,
.coach-insights article,
.coach-recommendations,
.coach-chart,
.coach-skill-panel,
.coach-skill,
.coach-plan {
  padding: 14px;
  border-radius: 8px;
  background: #f4f7fb;
}

.coach-summary span,
.coach-topic span,
.coach-insights span,
.coach-skill span,
.coach-plan span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.coach-skill-panel {
  display: grid;
  gap: 12px;
}

.coach-skill-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.coach-skill {
  display: grid;
  gap: 8px;
  background: #ffffff;
}

.coach-skill div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.coach-skill strong {
  color: var(--primary);
}

.coach-skill small {
  color: var(--muted);
  font-weight: 800;
}

.coach-summary strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(1.2rem, 2vw, 2rem);
}

.coach-focus {
  border-left: 4px solid var(--primary);
}

.coach-focus h3 {
  margin: 4px 0 8px;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
}

.coach-insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.coach-insights article {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(37, 94, 219, 0.12);
}

.coach-insights article.is-warning {
  border-left: 4px solid #ef4444;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(254, 242, 242, 0.84));
}

.coach-insights article.is-good {
  border-left: 4px solid #10b981;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(236, 253, 245, 0.84));
}

.coach-insights strong {
  color: var(--ink);
  font-size: clamp(1.05rem, 1.6vw, 1.32rem);
}

.coach-recommendations {
  display: grid;
  gap: 10px;
  background: #ffffff;
}

.coach-recommendations > strong,
.coach-chart > strong {
  color: var(--ink);
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
}

.coach-recommendations > div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(37, 94, 219, 0.12);
  border-radius: 8px;
  background: rgba(233, 240, 255, 0.7);
}

.coach-recommendations > div > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  font-weight: 950;
}

.coach-recommendations p {
  display: grid;
  gap: 3px;
}

.coach-recommendations small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.coach-chart {
  display: grid;
  gap: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(233, 240, 255, 0.78));
}

.coach-chart svg {
  width: 100%;
  min-height: 142px;
}

.coach-chart line {
  stroke: rgba(20, 33, 61, 0.22);
  stroke-width: 1.2;
}

.coach-chart-fill {
  fill: rgba(37, 94, 219, 0.1);
  stroke: none;
}

.coach-chart-line {
  fill: none;
  stroke: #255edb;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.coach-chart circle {
  stroke: #ffffff;
  stroke-width: 2;
}

.coach-chart circle.low {
  fill: #ef4444;
}

.coach-chart circle.mid {
  fill: #f5bd3b;
}

.coach-chart circle.high {
  fill: #18a3a6;
}

.coach-chart text {
  fill: #10213f;
  font-size: 10px;
  font-weight: 900;
}

.coach-topic-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.coach-topic {
  display: grid;
  gap: 10px;
}

.coach-topic > div:first-child {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.coach-plan {
  display: grid;
  gap: 8px;
  background: #e9f0ff;
}

.achievement {
  display: grid;
  gap: 8px;
}

.achievement div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.achievement span {
  color: var(--muted);
  font-weight: 800;
}

.rpg-strip {
  gap: 22px;
}

.rpg-strip .rpg-card {
  min-height: 206px;
  padding: 16px 18px;
  border-radius: 8px;
}

.daily-mission-card {
  position: relative;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.daily-mission-hero {
  align-self: end;
  height: 178px;
  min-height: 0;
  border-radius: 0 0 8px 8px;
  background-size: 220% 235%;
  background-position: 5% 0%;
}

.daily-mission-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 70px;
  height: 58px;
  border-radius: 14px;
  color: #f6d365;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(233, 222, 255, 0.82)),
    #f4edff;
  box-shadow: 0 16px 28px rgba(99, 102, 241, 0.18);
  font-size: 1.9rem;
  transform: rotate(7deg);
  pointer-events: none;
}

.daily-mission-content {
  gap: 7px;
  padding-right: 0;
}

.daily-mission-content .rpg-kicker,
.daily-reward-copy .rpg-kicker {
  font-size: 0.82rem;
}

.daily-mission-content strong,
.daily-reward-copy strong {
  font-size: clamp(1.16rem, 1.5vw, 1.42rem);
}

.daily-mission-content p,
.daily-reward-copy p {
  font-size: 0.84rem;
  line-height: 1.3;
}

.daily-mission-reward {
  min-height: 42px;
  font-size: 0.9rem;
}

.daily-mission-answer {
  margin-top: 4px;
}

.daily-mission-answer input,
.daily-mission-answer .button {
  min-height: 44px;
}

.daily-mission-answer .button {
  min-width: 104px;
}

.daily-mission-feedback {
  min-height: 0;
}

.daily-reward-card {
  grid-template-columns: minmax(0, 1fr) 190px;
  grid-template-rows: auto auto auto;
  gap: 12px 18px;
  align-items: start;
  align-content: start;
  min-height: 200px;
  padding-right: 24px;
}

.daily-reward-card::before {
  display: none;
}

.daily-reward-copy {
  gap: 6px;
  grid-column: 1;
  grid-row: 1;
  align-self: end;
}

.daily-reward-copy .rpg-kicker {
  color: #f97316;
}

.reward-orbit {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  width: 174px;
  height: 104px;
  border-radius: 0;
  background: transparent;
}

.reward-chest {
  font-size: 4.9rem;
}

.reward-spark {
  width: 7px;
  height: 7px;
}

.reward-loot {
  grid-column: 1 / -1;
  grid-row: 2;
  gap: 12px;
}

.reward-loot span {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border-color: rgba(37, 94, 219, 0.12);
  background: rgba(255, 255, 255, 0.84);
  font-size: 0.88rem;
}

.reward-loot b {
  font-size: 1.28rem;
  line-height: 1;
}

.reward-button {
  grid-column: 1 / -1;
  grid-row: 3;
  min-height: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f59e0b, #f97316 35%, #ec4899);
}

.game-dashboard .stat-card-coins,
.game-dashboard .stat-card-gems {
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  min-height: 92px;
  padding: 18px;
  border-color: rgba(96, 165, 250, 0.2);
  background:
    linear-gradient(135deg, rgba(30, 56, 141, 0.96), rgba(5, 13, 54, 0.98)),
    #07153f;
  box-shadow: 0 18px 34px rgba(5, 13, 54, 0.28);
}

.game-dashboard .stat-card-coins::before,
.game-dashboard .stat-card-gems::before {
  display: none;
}

.game-dashboard .stat-card-coins span:not(.stat-icon),
.game-dashboard .stat-card-gems span:not(.stat-icon) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.game-dashboard .stat-card-coins strong,
.game-dashboard .stat-card-gems strong {
  color: #ffffff;
  font-size: clamp(1.7rem, 2.4vw, 2.25rem);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.24);
}

.game-dashboard .stat-card-coins .stat-icon,
.game-dashboard .stat-card-gems .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.38),
    0 10px 18px rgba(0, 0, 0, 0.24);
  font-size: 2.2rem;
}

.game-dashboard .stat-card-coins .stat-icon {
  background:
    radial-gradient(circle at 35% 30%, #fff8ad 0 12%, transparent 13%),
    linear-gradient(145deg, #fcd34d, #f59e0b 58%, #b45309);
}

.game-dashboard .stat-card-gems .stat-icon {
  background:
    linear-gradient(145deg, rgba(125, 211, 252, 0.94), rgba(37, 99, 235, 0.98)),
    #2563eb;
}

.game-dashboard .stat-card-coins .stat-buy-row,
.game-dashboard .stat-card-gems .stat-buy-row {
  justify-content: flex-start;
  gap: 8px;
}

.game-dashboard .stat-card-coins .stat-plus-button,
.game-dashboard .stat-card-gems .stat-plus-button {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(147, 197, 253, 0.34);
  background: linear-gradient(135deg, #3657e9, #152b9f);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.22);
}

.daily-reward-card {
  isolation: isolate;
  grid-template-rows: auto 1fr auto;
  border-color: rgba(91, 70, 255, 0.54);
  background:
    radial-gradient(circle at 85% 20%, rgba(179, 70, 255, 0.34), transparent 35%),
    radial-gradient(circle at 28% 84%, rgba(16, 185, 129, 0.28), transparent 35%),
    linear-gradient(145deg, #080b38 0%, #10074a 48%, #05021d 100%);
  box-shadow: 0 22px 48px rgba(5, 13, 54, 0.32);
}

.daily-reward-card::after {
  content: "i";
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(199, 210, 254, 0.6);
  border-radius: 999px;
  color: #c7d2fe;
  font-size: 0.82rem;
  font-weight: 950;
}

.daily-reward-copy .rpg-kicker {
  color: #facc15;
}

.daily-reward-copy strong,
.daily-reward-copy p {
  color: #ffffff;
}

.daily-reward-copy p {
  color: rgba(255, 255, 255, 0.82);
}

.daily-reward-card .reward-orbit {
  overflow: visible;
}

.reward-chest {
  position: relative;
  z-index: 2;
  display: block;
  width: 144px;
  height: 94px;
  margin-top: 8px;
  border-radius: 16px 16px 18px 18px;
  color: transparent;
  background:
    radial-gradient(circle at 50% -12%, #ffe16a 0 24%, transparent 25%),
    linear-gradient(90deg, transparent 0 43%, #1e40af 44% 56%, transparent 57%),
    linear-gradient(180deg, #b45309 0 12%, #f59e0b 13% 36%, #9a3412 37% 45%, #7c2d12 46% 100%);
  box-shadow:
    inset 0 4px 0 rgba(255, 236, 153, 0.76),
    inset 0 -9px 0 rgba(69, 26, 3, 0.36),
    0 18px 26px rgba(0, 0, 0, 0.35);
  font-size: 0;
  animation: rewardBounce 2.4s ease-in-out infinite;
}

.reward-chest::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: -24px;
  height: 50px;
  border-radius: 44px 44px 10px 10px;
  background:
    linear-gradient(90deg, transparent 0 42%, #1d4ed8 43% 57%, transparent 58%),
    linear-gradient(180deg, #facc15 0 32%, #f97316 33% 100%);
  box-shadow:
    inset 0 5px 0 rgba(255, 255, 255, 0.36),
    0 6px 0 #78350f;
  transform: rotate(-10deg);
  transform-origin: left bottom;
}

.reward-chest::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 42px;
  width: 28px;
  height: 34px;
  border: 4px solid #60a5fa;
  border-radius: 8px;
  background: linear-gradient(180deg, #fef3c7, #f59e0b);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.42);
  transform: translateX(-50%);
}

.reward-crystal,
.reward-coin {
  position: absolute;
  z-index: 1;
  display: block;
  pointer-events: none;
}

.reward-crystal {
  width: 38px;
  height: 58px;
  clip-path: polygon(50% 0, 92% 28%, 74% 100%, 26% 100%, 8% 28%);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), transparent 28%),
    linear-gradient(145deg, #67e8f9, #2563eb 55%, #1e1b4b);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.68);
}

.reward-crystal-left {
  left: 0;
  bottom: 14px;
  transform: rotate(-14deg);
}

.reward-crystal-right {
  right: 2px;
  bottom: 6px;
  transform: rotate(15deg) scale(0.92);
}

.reward-coin {
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: radial-gradient(circle at 42% 30%, #fff8ad, #f59e0b 48%, #b45309 100%);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.66);
}

.reward-coin-one {
  left: 20px;
  bottom: 4px;
  transform: rotate(-9deg);
}

.reward-coin-two {
  right: 42px;
  bottom: 0;
  transform: rotate(8deg);
}

.daily-reward-card .reward-loot {
  display: none;
}

.daily-reward-card .reward-button {
  grid-row: 3;
  align-self: end;
  min-height: 44px;
  border-radius: 999px;
  background: linear-gradient(180deg, #22c55e, #15803d);
  box-shadow: 0 14px 24px rgba(34, 197, 94, 0.25);
}

.quest-game-board {
  position: relative;
  grid-template-columns: minmax(230px, 292px) minmax(0, 1fr) minmax(260px, 324px);
  gap: 20px;
  margin-top: 24px;
  padding: 18px;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(rgba(116, 187, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(116, 187, 255, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, #061746 0%, #07306d 52%, #16a6c8 100%);
  background-size: 34px 34px, 34px 34px, auto;
  box-shadow: 0 28px 76px rgba(7, 24, 68, 0.28);
}

.quest-game-board .game-side {
  gap: 16px;
}

.quest-game-board .game-panel,
.quest-game-board .system-card,
.quest-game-board .problem-card {
  border: 1px solid rgba(219, 232, 255, 0.82);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(239, 247, 255, 0.94)),
    #ffffff;
  box-shadow: 0 16px 38px rgba(6, 20, 53, 0.22);
}

.quest-game-board .game-panel h2,
.quest-game-board .system-card h3 {
  color: #1557d8;
  font-size: 1.02rem;
  line-height: 1.1;
  text-transform: uppercase;
}

.quest-game-board .game-panel label {
  display: grid;
  gap: 8px;
  color: #10213f;
  font-weight: 900;
}

.quest-game-board .game-panel select,
.quest-game-board .game-panel input {
  min-height: 48px;
  border: 1px solid rgba(37, 94, 219, 0.2);
  border-radius: 8px;
  color: #10213f;
  background: rgba(255, 255, 255, 0.95);
  font: inherit;
  font-weight: 850;
}

.quest-game-board .mode-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quest-game-board .mode-chip {
  min-height: 48px;
  padding: 0 10px;
  border-color: rgba(37, 94, 219, 0.18);
  color: #10213f;
  background: linear-gradient(180deg, #ffffff, #eef5ff);
  box-shadow: 0 10px 22px rgba(20, 33, 61, 0.08);
}

.quest-game-board .mode-chip.is-active {
  color: #ffffff;
  border-color: #2563eb;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.26);
}

.quest-game-board .arena {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.quest-game-board .problem-card {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 20px;
  overflow: visible;
}

.quest-game-board .problem-card::before {
  opacity: 0;
}

.quest-game-board .training-decor {
  display: none;
}

.quest-game-board .training-round-meta {
  margin: 0;
  padding: 18px;
  border-color: rgba(37, 94, 219, 0.16);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(236, 245, 255, 0.9));
}

.quest-game-board .training-round-meta span {
  color: #10213f;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.quest-game-board .training-round-meta strong {
  font-size: clamp(1.45rem, 2.4vw, 2.1rem);
}

.quest-game-board .timer-pill {
  min-height: 44px;
  padding: 0 18px;
  border-color: rgba(37, 94, 219, 0.18);
  background: rgba(255, 255, 255, 0.96);
}

.quest-game-board .training-boost {
  margin-top: 0;
  border-color: rgba(37, 94, 219, 0.14);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(237, 246, 255, 0.86));
  box-shadow: none;
}

.quest-game-board .training-chip {
  min-height: 38px;
  padding: 9px 14px;
}

.quest-game-board .question-arena {
  min-height: 470px;
  margin-top: 0;
  padding: 26px;
  border-color: rgba(37, 94, 219, 0.16);
  background:
    linear-gradient(rgba(37, 94, 219, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 94, 219, 0.075) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 247, 255, 0.92));
  background-size: 28px 28px, 28px 28px, auto;
}

.quest-game-board .question-aura {
  display: none;
}

.problem-hero-character {
  position: absolute;
  right: 12px;
  top: 8px;
  z-index: 0;
  width: min(26%, 190px);
  min-width: 132px;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  background-image: url("/assets/mathpro-heroes.png");
  background-repeat: no-repeat;
  background-size: 220% 220%;
  background-position: 2% 2%;
  filter: drop-shadow(0 18px 18px rgba(20, 33, 61, 0.16));
  pointer-events: none;
}

.quest-game-board .question-stage-label {
  z-index: 1;
  width: fit-content;
  margin-bottom: 18px;
  color: #047857;
  background: rgba(204, 251, 241, 0.9);
}

.quest-game-board .problem-card h2 {
  z-index: 1;
  max-width: calc(100% - 205px);
  font-size: clamp(1.35rem, 2.2vw, 2.25rem);
}

.quest-game-board .problem-card p {
  z-index: 1;
  max-width: calc(100% - 195px);
}

.quest-game-board .question-visual {
  position: relative;
  z-index: 1;
  min-height: 210px;
  margin-top: 12px;
  padding: 14px;
  border-color: rgba(37, 94, 219, 0.12);
  background: rgba(255, 255, 255, 0.42);
}

.quest-game-board .question-visual svg {
  width: min(100%, 520px);
}

.quest-game-board .training-progress {
  margin: 0;
}

.quest-game-board .answer-form {
  align-items: center;
  margin-top: 0;
  padding: 16px;
  border: 1px solid rgba(37, 94, 219, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 34px rgba(6, 20, 53, 0.16);
}

.quest-game-board .answer-form input,
.quest-game-board .answer-form .button {
  min-height: 56px;
}

.quest-game-board .answer-form .button {
  min-width: 150px;
  color: #ffffff;
  background: linear-gradient(135deg, #10b981, #16a34a);
  box-shadow: 0 14px 26px rgba(22, 163, 74, 0.24);
}

.quest-game-board .arena-actions {
  align-items: stretch;
  justify-content: center;
  margin-top: 0;
}

.quest-game-board .arena-actions .button {
  min-width: min(100%, 164px);
}

@media (max-width: 1360px) {
  .quest-game-board {
    grid-template-columns: 1fr;
  }

  .quest-game-board .game-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quest-game-board .game-side:last-child {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(37, 94, 219, 0.24);
    border-radius: 10px;
    color: var(--primary-dark);
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(20, 33, 61, 0.1);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
  }

  .mobile-menu-toggle:focus-visible {
    outline: 3px solid rgba(245, 189, 59, 0.85);
    outline-offset: 2px;
  }

  .site-header > .main-nav,
  .site-header > .language-switcher,
  .site-header > .header-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .site-header:not(.is-menu-open) > .language-switcher,
  .site-header:not(.is-menu-open) > .header-actions {
    display: none;
  }

  .site-header > .main-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .site-header > .main-nav[hidden] {
    display: none;
  }

  .site-header > .main-nav a {
    display: flex;
    min-height: 44px;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(233, 240, 255, 0.7);
  }

  .site-header > .main-nav a[href="/game.html"] {
    color: #ffffff;
    background: linear-gradient(135deg, #ff7a18, #ef4444 52%, #7c3aed);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }

  .site-header > .header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .site-header > .language-switcher {
    justify-content: flex-start;
  }

  .hero-actions {
    flex-wrap: wrap;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .game-hero {
    min-height: auto;
  }

  .hero-panel {
    min-height: 390px;
  }

  .hero-game-stage {
    min-height: 420px;
  }

  .collection-grid,
  .pricing-grid,
  .pricing-trust-row,
  .profile-layout,
  .world-map,
  .home-grid,
  .quick-actions,
  .models-intro,
  .model-section,
  .model-output,
  .stats-grid,
  .math-lab,
  .game-dashboard,
  .game-layout,
  .rpg-strip,
  .rpg-grid,
  .coach-skill-grid,
  .arena-systems {
    grid-template-columns: 1fr;
  }

  .game-topbar {
    align-items: flex-start;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .activity-head {
    flex-direction: column;
  }

  .activity-tools {
    width: 100%;
    justify-content: flex-start;
  }

  .pricing-note {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .pricing-hero {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .pricing-hero-icons {
    font-size: 2.5rem;
  }

  .price-plan-head {
    grid-template-columns: 56px 1fr;
  }

  .price-plan-icon {
    width: 50px;
    height: 50px;
  }

  .price-plan-ribbon {
    max-width: calc(100% - 32px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pricing-note-badge {
    min-height: 54px;
  }

  .daily-mission-answer {
    grid-template-columns: 1fr;
  }

  .daily-mission-answer .button {
    width: 100%;
  }

  .daily-reward-card {
    grid-template-columns: 1fr;
  }

  .reward-orbit {
    grid-column: 1;
    grid-row: auto;
    width: 160px;
    height: 130px;
  }

  .reward-chest {
    font-size: 5.4rem;
  }

  .reward-loot {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .model-canvas {
    min-height: 340px;
  }

  .model-canvas svg {
    min-height: 320px;
  }

  .training-boost {
    align-items: stretch;
    flex-direction: column;
  }

  .training-round-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .timer-pill {
    width: fit-content;
  }

  .training-chip-row {
    justify-content: flex-start;
  }

  .section-menu {
    width: 100%;
  }

  .section-menu summary {
    justify-content: center;
    width: 100%;
  }

  .section-menu-content {
    left: 0;
    right: auto;
    grid-template-columns: 1fr;
    width: min(100%, calc(100vw - 32px));
  }

  .activity-stats {
    grid-template-columns: 1fr;
  }

  .profile-progress-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .coach-summary,
  .coach-insights,
  .coach-topic-list {
    grid-template-columns: 1fr;
  }

  .player-card {
    width: 100%;
  }

  .diagram-card,
  .formula-card-game,
  .graph-card,
  .solids-card {
    grid-column: 1 / -1;
  }

  .algebra-groups {
    grid-template-columns: 1fr;
  }

  .graph-card svg {
    height: 300px;
  }

  .geometry-stage,
  .solid-stage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .formula-card {
    right: 8px;
  }

  .task-card {
    left: 0;
  }

  .world-card {
    min-height: 260px;
  }

  .mission-progress-row,
  .xp-stat-row,
  .profile-rpg-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (min-width: 861px) and (max-width: 1180px) {
  .game-topbar {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    grid-template-columns: minmax(0, 1fr) 220px;
  }

  .game-dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rpg-strip {
    grid-template-columns: 1fr;
  }

  .math-lab {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .world-map,
  .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .geometry-stage,
  .solid-stage {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .game-shell {
    padding-inline: 12px;
  }

  .hero h1 {
    font-size: 2.45rem;
  }

  .game-topbar h1 {
    font-size: 3rem;
  }

  .game-dashboard article {
    grid-template-columns: 62px minmax(0, 1fr);
    min-height: 104px;
    padding: 16px;
  }

  .stat-icon {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    font-size: 2.1rem;
  }

  .activity-wide {
    padding: 20px 14px;
  }

  .activity-wide .activity-head > div:first-child {
    padding-left: 0;
  }

  .activity-illustration {
    display: none;
  }

  .daily-mission-card,
  .daily-reward-card {
    grid-template-columns: 1fr;
  }

  .daily-mission-hero {
    min-height: 210px;
  }

  .reward-orbit {
    grid-column: 1;
    grid-row: auto;
    width: 160px;
    height: 130px;
  }

  .reward-chest {
    font-size: 5.4rem;
  }

  .game-hero h1 {
    font-size: 2.7rem;
  }

  .auth-card {
    padding: 24px;
  }

  .grade-picker,
  .hero-picker,
  .profile-progress-grid {
    grid-template-columns: 1fr;
  }

  .profile-progress-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-game-stage {
    min-height: 340px;
  }

  .flying-symbol {
    width: 48px;
    height: 48px;
    font-size: 1.35rem;
  }

  .triangle-shape {
    transform: scale(0.72);
  }

  .cube-shape {
    width: 84px;
    height: 84px;
  }

  .hero-avatar-card {
    right: 4%;
    bottom: 28px;
  }

  .formula-card,
  .task-card {
    position: static;
    width: 100%;
    margin-top: 14px;
  }

  .answer-form,
  .compact-form,
  .duel-join-form,
  .duel-answer-form,
  .mode-grid,
  .model-output,
  .daily-steps,
  .xp-rewards {
    grid-template-columns: 1fr;
  }

  .answer-form .button,
  .arena-actions .button {
    width: 100%;
  }

  .geometry-stage,
  .solid-stage {
    grid-template-columns: 1fr;
  }

  .quest-game-board {
    padding: 12px;
    border-radius: 14px;
  }

  .quest-game-board .problem-card {
    padding: 14px;
  }

  .quest-game-board .question-arena {
    min-height: auto;
  }

  .problem-hero-character {
    display: none;
  }

  .quest-game-board .problem-card h2,
  .quest-game-board .problem-card p {
    max-width: none;
  }

  .helper-grid {
    grid-template-columns: 1fr;
  }
}

.topic-page {
  background:
    radial-gradient(circle at 12% 8%, rgba(96, 165, 250, 0.2), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(245, 189, 59, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(233, 240, 255, 0.9), rgba(255, 255, 255, 0.92)),
    var(--paper);
}

.topic-shell {
  width: min(100% - 32px, 1360px);
  margin: 0 auto;
  padding: 24px 0 44px;
}

.archive-anchor {
  scroll-margin-top: 92px;
}

.marketing-home {
  color: #10213f;
  background:
    linear-gradient(rgba(37, 94, 219, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 94, 219, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, #eef6ff 0%, #ffffff 42%, #fff8e3 100%);
  background-size: 44px 44px, 44px 44px, auto;
}

.marketing-hero {
  min-height: calc(100vh - 76px);
  padding-top: clamp(32px, 5vw, 72px);
  padding-bottom: clamp(32px, 5vw, 72px);
  background:
    linear-gradient(135deg, rgba(248, 251, 255, 0.96), rgba(233, 240, 255, 0.88) 56%, rgba(255, 247, 214, 0.72)),
    #f8fbff;
}

.marketing-hero-copy {
  max-width: 780px;
}

.marketing-hero-copy h1 {
  max-width: 820px;
  font-size: clamp(3rem, 7.2vw, 6.4rem);
  letter-spacing: 0;
}

.marketing-hero-copy .hero-copy {
  max-width: 740px;
  font-size: clamp(1.06rem, 1.5vw, 1.34rem);
}

.hero-copy-strong {
  color: #10213f;
  font-weight: 900;
}

.hero-proof-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
  max-width: 740px;
}

.hero-proof-row span {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(37, 94, 219, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 30px rgba(20, 33, 61, 0.08);
}

.hero-proof-row strong,
.hero-proof-row small {
  display: block;
}

.hero-proof-row strong {
  font-size: 1.05rem;
  font-weight: 950;
}

.hero-proof-row small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.marketing-stage {
  min-height: 560px;
}

.marketing-player-card {
  right: 5%;
  bottom: 70px;
  width: min(360px, 82%);
}

.mini-battle-card {
  position: absolute;
  left: 5%;
  bottom: 130px;
  width: min(260px, 72%);
  padding: 16px;
  border: 1px solid rgba(245, 189, 59, 0.36);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 247, 214, 0.88));
  box-shadow: 0 20px 48px rgba(20, 33, 61, 0.13);
  animation: float-card 4.6s ease-in-out infinite;
}

.mini-battle-card strong,
.mini-battle-card span {
  display: block;
}

.mini-battle-card strong {
  font-size: 1.2rem;
  font-weight: 950;
}

.mini-battle-card span {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 850;
}

.quest-stage {
  isolation: isolate;
  display: grid;
  place-items: center;
}

.quest-aura {
  position: absolute;
  inset: 8% 6% 6%;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 42%, rgba(37, 94, 219, 0.2), transparent 34%),
    radial-gradient(circle at 46% 50%, rgba(24, 163, 166, 0.18), transparent 42%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(233, 240, 255, 0.24));
  box-shadow:
    inset 0 0 80px rgba(37, 94, 219, 0.12),
    0 30px 90px rgba(20, 33, 61, 0.12);
  transform: perspective(800px) rotateX(58deg) rotateZ(-12deg);
}

.quest-orbit {
  position: absolute;
  border: 2px solid rgba(37, 94, 219, 0.22);
  border-radius: 999px;
  transform: rotate(-14deg);
  animation: quest-orbit-spin 14s linear infinite;
}

.orbit-one {
  width: 420px;
  height: 180px;
}

.orbit-two {
  width: 300px;
  height: 128px;
  border-color: rgba(245, 189, 59, 0.34);
  animation-duration: 10s;
  animation-direction: reverse;
}

.quest-crystal {
  position: absolute;
  top: 15%;
  left: 34%;
  width: 190px;
  height: 190px;
  transform: rotate(-16deg);
  filter: drop-shadow(0 30px 32px rgba(245, 189, 59, 0.32));
  animation: quest-crystal-float 4.8s ease-in-out infinite;
}

.quest-crystal::before,
.quest-crystal::after,
.quest-crystal span {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  clip-path: polygon(50% 0, 98% 32%, 74% 100%, 26% 100%, 2% 32%);
}

.quest-crystal::before {
  background: linear-gradient(135deg, #f5bd3b, #ff7a45 56%, #ef4444);
}

.quest-crystal span {
  inset: 14px 42px 28px 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
}

.quest-crystal::after {
  inset: 8px;
  border: 3px solid rgba(255, 255, 255, 0.46);
  background: transparent;
}

.quest-board {
  position: absolute;
  right: 3%;
  bottom: 56px;
  width: min(420px, 82%);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(233, 240, 255, 0.84)),
    #ffffff;
  box-shadow: 0 28px 68px rgba(20, 33, 61, 0.18);
  animation: float-card 4s ease-in-out infinite;
}

.quest-board strong,
.quest-board span {
  display: block;
}

.quest-board strong {
  margin: 8px 0;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.08;
}

.quest-board > span:not(.rpg-kicker) {
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 900;
}

.reward-chip,
.level-chip,
.math-token {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 42px rgba(20, 33, 61, 0.14);
  backdrop-filter: blur(14px);
}

.math-token {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  color: #10213f;
  font-size: 2rem;
  font-weight: 950;
  animation: float-symbol 5.5s ease-in-out infinite;
}

.token-pi {
  left: 0;
  top: 18%;
  color: var(--primary);
  transform: rotate(10deg);
}

.token-seven {
  right: 16%;
  top: 6%;
  animation-delay: -1s;
}

.token-x {
  right: 0;
  top: 48%;
  color: var(--rose);
  animation-delay: -2.4s;
}

.token-percent {
  left: 10%;
  bottom: 16%;
  color: var(--teal);
  animation-delay: -3.2s;
}

.reward-chip,
.level-chip {
  min-width: 170px;
  padding: 14px 16px;
}

.reward-chip {
  right: 24%;
  top: 30%;
}

.level-chip {
  left: 20%;
  top: 8%;
}

.reward-chip small,
.level-chip small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
}

.reward-chip strong,
.level-chip strong {
  display: block;
  margin-top: 5px;
  color: #10213f;
  font-size: 1.1rem;
  line-height: 1.1;
}

.spark {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #f5bd3b;
  box-shadow: 0 0 28px rgba(245, 189, 59, 0.88);
  animation: particle-drift 5.8s ease-in-out infinite;
}

.spark-one { left: 28%; top: 22%; }
.spark-two { right: 33%; top: 55%; background: #18a3a6; animation-delay: -1.8s; }
.spark-three { left: 46%; bottom: 20%; background: #ef4444; animation-delay: -3.5s; }

@keyframes quest-orbit-spin {
  from { transform: rotate(-14deg); }
  to { transform: rotate(346deg); }
}

@keyframes quest-crystal-float {
  0%, 100% { transform: translateY(0) rotate(-16deg) scale(1); }
  50% { transform: translateY(-14px) rotate(-10deg) scale(1.04); }
}

.intro-banner,
.final-cta {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.55fr);
  gap: 22px;
  align-items: center;
  margin-top: 28px;
  border: 1px solid rgba(37, 94, 219, 0.15);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(16, 33, 63, 0.96), rgba(37, 94, 219, 0.9)),
    #10213f;
  color: #ffffff;
  box-shadow: 0 28px 68px rgba(20, 33, 61, 0.22);
}

.intro-banner h2,
.final-cta h2 {
  margin: 8px 0 0;
  color: #ffffff;
  font-size: clamp(1.9rem, 3.4vw, 3.3rem);
  line-height: 1.06;
}

.intro-banner p,
.final-cta p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.08rem;
  line-height: 1.6;
}

.intro-banner .eyebrow,
.final-cta .eyebrow {
  color: #f5bd3b;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(360px, 1fr);
  gap: 22px;
  align-items: start;
  padding-bottom: clamp(44px, 7vw, 76px);
}

.contact-copy {
  padding: 24px;
  border: 1px solid rgba(37, 94, 219, 0.15);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(239, 246, 255, 0.82)),
    #ffffff;
  box-shadow: 0 22px 58px rgba(20, 33, 61, 0.11);
}

.contact-copy h2 {
  margin: 8px 0 12px;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.08;
}

.contact-copy p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 750;
  line-height: 1.6;
}

.contact-form {
  display: grid;
  gap: 12px;
  padding: 24px;
  border: 1px solid rgba(37, 94, 219, 0.16);
  border-radius: 8px;
  background:
    radial-gradient(circle at 88% 10%, rgba(245, 189, 59, 0.18), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(233, 240, 255, 0.86)),
    #ffffff;
  box-shadow: 0 24px 62px rgba(20, 33, 61, 0.12);
}

.contact-form label {
  display: grid;
  gap: 7px;
  color: #10213f;
  font-weight: 900;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(37, 94, 219, 0.18);
  border-radius: 8px;
  color: #10213f;
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-weight: 700;
  outline: none;
}

.contact-form textarea {
  min-height: 132px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: rgba(37, 94, 219, 0.62);
  box-shadow: 0 0 0 4px rgba(37, 94, 219, 0.12);
}

.contact-form .button {
  justify-self: start;
}

.feature-showcase {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.feature-card {
  min-height: 300px;
  padding: 22px;
  border: 1px solid rgba(37, 94, 219, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(239, 246, 255, 0.82)),
    #ffffff;
  box-shadow: 0 22px 58px rgba(20, 33, 61, 0.11);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.feature-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 32px 74px rgba(20, 33, 61, 0.17);
}

.feature-card > span {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 8px;
  background: #e9f0ff;
  font-size: 2rem;
}

.feature-card h3 {
  margin: 18px 0 10px;
  font-size: clamp(1.18rem, 1.65vw, 1.55rem);
  line-height: 1.12;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.challenge-card > span { background: rgba(245, 189, 59, 0.22); }
.models-card > span { background: rgba(24, 163, 166, 0.16); }
.progress-card > span { background: rgba(37, 94, 219, 0.14); }
.analytics-card > span { background: rgba(239, 68, 68, 0.12); }

.marketing-world-map .world-card {
  min-height: 360px;
}

.why-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(320px, 0.65fr);
  gap: 24px;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid rgba(24, 163, 166, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(236, 253, 245, 0.72)),
    #ffffff;
  box-shadow: 0 22px 58px rgba(20, 33, 61, 0.11);
}

.why-panel h2 {
  margin: 8px 0 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.04;
}

.why-list {
  display: grid;
  gap: 12px;
}

.why-list span {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(233, 240, 255, 0.72);
  color: #10213f;
  font-weight: 850;
  line-height: 1.4;
}

.why-list span::before {
  content: "✓";
  display: grid;
  flex: 0 0 24px;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #ffffff;
  background: #18a3a6;
  font-size: 0.86rem;
  font-weight: 950;
}

.marketing-mission,
.marketing-profile,
.marketing-reward {
  min-height: 260px;
}

.final-cta {
  margin-bottom: 42px;
}

.final-cta .button {
  justify-self: end;
  min-width: 240px;
  box-shadow: 0 18px 34px rgba(245, 189, 59, 0.22);
}

@media (max-width: 1100px) {
  .feature-showcase,
  .marketing-world-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .intro-banner,
  .final-cta,
  .contact-section,
  .why-panel {
    grid-template-columns: 1fr;
  }

  .final-cta .button,
  .contact-form .button {
    justify-self: start;
  }
}

@media (max-width: 720px) {
  .marketing-hero-copy h1 {
    font-size: clamp(2.45rem, 13vw, 3.8rem);
  }

  .hero-proof-row,
  .feature-showcase,
  .marketing-world-map {
    grid-template-columns: 1fr;
  }

  .marketing-stage {
    min-height: 430px;
  }

  .mini-battle-card {
    left: 2%;
    bottom: 92px;
  }

  .marketing-player-card {
    right: 2%;
    bottom: 20px;
  }
}

.topic-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.36fr);
  gap: 24px;
  align-items: stretch;
  min-height: 360px;
  margin-bottom: 18px;
  padding: clamp(24px, 5vw, 46px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(219, 234, 254, 0.72)),
    #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.topic-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(37, 94, 219, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 94, 219, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(90deg, #000, transparent 78%);
  pointer-events: none;
}

.topic-hero > * {
  position: relative;
  z-index: 1;
}

.topic-hero h1 {
  max-width: 820px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(3rem, 8vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.topic-hero p:not(.eyebrow) {
  max-width: 740px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.58;
}

.topic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.topic-hero-panel {
  display: grid;
  align-content: end;
  gap: 12px;
  min-height: 280px;
  padding: 20px;
  border: 1px solid rgba(37, 94, 219, 0.12);
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.86), transparent 32%),
    linear-gradient(145deg, rgba(37, 94, 219, 0.16), rgba(24, 163, 166, 0.14));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
  position: relative;
}

.topic-hero-panel strong {
  color: #10213f;
  font-size: 1.35rem;
  font-weight: 950;
}

.topic-hero-panel small {
  color: var(--muted);
  font-weight: 850;
}

.floating-equation {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  color: #10213f;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 16px 34px rgba(20, 33, 61, 0.12);
  font-weight: 950;
  animation: float-card 5s ease-in-out infinite;
}

.floating-equation:nth-child(1) {
  top: 26px;
  left: 20px;
}

.floating-equation:nth-child(2) {
  top: 98px;
  right: 22px;
  animation-delay: -1.2s;
}

.floating-equation:nth-child(3) {
  top: 172px;
  left: 42px;
  animation-delay: -2.1s;
}

.algebra-topic .topic-hero-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto minmax(42px, 1fr) auto auto auto;
  align-content: stretch;
}

.algebra-topic .floating-equation {
  position: static;
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
}

.algebra-topic .floating-equation:nth-child(1) {
  grid-column: 1;
  justify-self: start;
}

.algebra-topic .floating-equation:nth-child(2) {
  grid-column: 2;
  justify-self: end;
}

.algebra-topic .floating-equation:nth-child(3) {
  grid-column: 1 / -1;
  justify-self: center;
  margin-top: 14px;
}

.algebra-topic .topic-hero-panel strong,
.algebra-topic .topic-hero-panel .progress-track,
.algebra-topic .topic-hero-panel small {
  grid-column: 1 / -1;
}

.mini-geometry-scene {
  position: absolute;
  inset: 24px 20px auto;
  height: 190px;
}

.mini-square,
.mini-circle,
.mini-triangle {
  position: absolute;
  display: block;
  filter: drop-shadow(0 16px 18px rgba(20, 33, 61, 0.14));
  animation: spin-shape 9s linear infinite;
}

.mini-square {
  width: 76px;
  height: 76px;
  left: 14px;
  top: 74px;
  border: 7px solid #2563eb;
  background: rgba(219, 234, 254, 0.7);
}

.mini-circle {
  width: 90px;
  height: 90px;
  right: 24px;
  top: 24px;
  border: 7px solid #60a5fa;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.16);
  animation-direction: reverse;
}

.mini-triangle {
  left: 96px;
  top: 40px;
  width: 0;
  height: 0;
  border-left: 46px solid transparent;
  border-right: 46px solid transparent;
  border-bottom: 82px solid rgba(245, 189, 59, 0.72);
}

.topic-lab {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.topic-wide-card {
  grid-column: 1 / -1;
}

.topic-section {
  margin-top: 18px;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.82)),
    #ffffff;
  box-shadow: var(--shadow);
}

.topic-section-title {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: clamp(1.4rem, 2.2vw, 2rem);
}

.exercise-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.exercise-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  min-height: 320px;
  padding: 16px;
  border: 1px solid rgba(37, 94, 219, 0.12);
  border-radius: 8px;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.96), transparent 34%),
    linear-gradient(145deg, rgba(219, 234, 254, 0.86), rgba(255, 255, 255, 0.72));
  box-shadow: 0 18px 36px rgba(20, 33, 61, 0.1);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.exercise-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 46px rgba(20, 33, 61, 0.16);
}

.boss-exercise {
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.96), transparent 34%),
    linear-gradient(145deg, rgba(254, 226, 226, 0.84), rgba(255, 247, 214, 0.76));
}

.difficulty {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #10213f;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 950;
}

.difficulty.easy {
  color: #065f46;
  background: #d1fae5;
}

.difficulty.medium {
  color: #1e3a8a;
  background: #dbeafe;
}

.difficulty.hard {
  color: #7c2d12;
  background: #ffedd5;
}

.difficulty.boss {
  color: #7f1d1d;
  background: #fee2e2;
}

.exercise-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.1;
}

.exercise-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.answer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.answer-row input {
  min-height: 44px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-weight: 850;
}

.task-feedback {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.task-feedback.is-correct {
  color: #065f46;
  background: #d1fae5;
}

.task-feedback.is-wrong {
  color: #7c2d12;
  background: #ffedd5;
}

.exercise-visual {
  min-height: 114px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
}

.exercise-visual svg {
  width: 100%;
  max-width: 190px;
  height: 118px;
}

.exercise-visual text {
  fill: #14213d;
  font-size: 14px;
  font-weight: 950;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 4px;
}

.home-game .world-card {
  text-decoration: none;
}

@media (max-width: 980px) {
  .topic-hero,
  .exercise-grid {
    grid-template-columns: 1fr;
  }

  .topic-hero-panel {
    min-height: 250px;
  }

  .topic-lab {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topic-shell {
    width: min(100% - 20px, 1360px);
    padding-top: 14px;
  }

  .topic-hero h1 {
    font-size: clamp(2.4rem, 14vw, 4rem);
  }

  .answer-row {
    grid-template-columns: 1fr;
  }

  .answer-row .button {
    width: 100%;
  }

  .hero-picker {
    grid-template-columns: 1fr;
  }
}

/* Keep interactive scene layout after legacy model rules in the cascade. */
.model-output { grid-template-columns: minmax(460px, 1.2fr) minmax(320px, 0.68fr); }
.model-canvas { display: flex; min-height: 560px; padding: 12px; flex-direction: column; align-items: stretch; overflow: hidden; }
.model-canvas .model-scene-svg { width: min(100%, 760px); height: 100%; min-height: 460px; }

@media (max-width: 860px) {
  .model-output { grid-template-columns: minmax(0, 1fr); }
  .model-canvas { min-height: 470px; padding: 10px; }
  .model-scene-viewport { min-height: 370px; }
  .model-canvas .model-scene-svg { min-height: 360px; }
}

/* Large multi-point coordinate plane */
.coordinate-workspace {
  position: relative;
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.coordinate-lock-trigger {
  position: absolute;
  z-index: 8;
  inset: 0;
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: transparent;
  cursor: not-allowed;
}

.coordinate-lock-trigger:focus-visible {
  outline: 3px solid rgba(245, 189, 59, 0.9);
  outline-offset: 3px;
}

.coordinate-lock-notice {
  position: absolute;
  z-index: 9;
  top: 18px;
  left: 50%;
  display: flex;
  width: min(620px, calc(100% - 28px));
  align-items: center;
  gap: 12px;
  padding: 14px 52px 14px 18px;
  border: 1px solid rgba(37, 94, 219, 0.25);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.2);
  transform: translateX(-50%);
}

.coordinate-lock-notice[hidden] { display: none; }
.coordinate-lock-notice strong { flex: 1; color: #10213f; }
.coordinate-lock-notice .button { flex: 0 0 auto; }
.coordinate-lock-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  color: #475569;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
}

.is-coordinate-locked .coordinate-actions button { opacity: 0.58; }

@media (max-width: 640px) {
  .coordinate-lock-notice { align-items: stretch; flex-direction: column; }
}

.graph-card .coordinate-plane {
  width: 100%;
  height: auto;
  max-height: 640px;
  aspect-ratio: 3 / 2;
  margin: 0;
  border: 1px solid rgba(37, 94, 219, 0.18);
  background: rgba(255, 255, 255, 0.82);
  cursor: crosshair;
  touch-action: none;
}

.coordinate-plane:focus-visible {
  outline: 3px solid rgba(245, 189, 59, 0.9);
  outline-offset: 3px;
}

.coordinate-plane-bg { fill: rgba(255, 255, 255, 0.9); }

.coordinate-grid-line {
  fill: none;
  stroke: rgba(30, 58, 138, 0.15);
  stroke-width: 1;
  pointer-events: none;
}
.coordinate-axis,
.coordinate-axis-arrow {
  fill: none;
  stroke: #14213d;
  stroke-width: 3;
  stroke-linecap: round;
}

.coordinate-axis-name {
  fill: #14213d;
  font-size: 20px;
  font-weight: 950;
}

.coordinate-tick-label {
  fill: #475569;
  font-size: 12px;
  font-weight: 850;
  text-anchor: middle;
  pointer-events: none;
}

.coordinate-y-label { text-anchor: end; }
.coordinate-guide {
  fill: none;
  stroke: #ef4444;
  stroke-width: 2;
  stroke-dasharray: 7 6;
  opacity: 0.66;
  pointer-events: none;
}

.coordinate-segment {
  cursor: pointer;
  outline: none;
}

.coordinate-segment-hit {
  stroke: transparent;
  stroke-width: 20;
}

.coordinate-segment-line {
  stroke: #7c3aed;
  stroke-width: 4;
  stroke-linecap: round;
  pointer-events: none;
  filter: drop-shadow(0 3px 4px rgba(124, 58, 237, 0.2));
}

.coordinate-segment:hover .coordinate-segment-line,
.coordinate-segment:focus .coordinate-segment-line {
  stroke: #f59e0b;
  stroke-width: 6;
}

.coordinate-segment.is-selected .coordinate-segment-line {
  stroke: #ef4444;
  stroke-width: 6;
}

.coordinate-point {
  cursor: grab;
  outline: none;
}

.coordinate-point circle {
  fill: #2563eb;
  stroke: #fff;
  stroke-width: 4;
  filter: drop-shadow(0 5px 8px rgba(37, 94, 219, 0.3));
}

.coordinate-point text {
  fill: #10213f;
  font-size: 17px;
  font-weight: 950;
  paint-order: stroke fill;
  stroke: #fff;
  stroke-width: 5px;
  stroke-linejoin: round;
  pointer-events: none;
}

.coordinate-point.is-selected circle {
  fill: #ef4444;
  stroke: #fef3c7;
  stroke-width: 5;
  filter: drop-shadow(0 7px 11px rgba(239, 68, 68, 0.4));
}

.coordinate-point.is-connect-start circle {
  fill: #f59e0b;
  stroke: #fff7cc;
  stroke-width: 6;
  filter: drop-shadow(0 7px 11px rgba(245, 158, 11, 0.45));
}

.coordinate-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.coordinate-controls .coordinate-readout { margin: 0; }
.coordinate-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.coordinate-actions button { min-height: 40px; }
.coordinate-actions button:disabled { opacity: 0.5; cursor: not-allowed; }
.coordinate-actions button.is-active {
  color: #fff;
  border-color: #7c3aed;
  background: #7c3aed;
}

.coordinate-actions [data-coordinate-expand] {
  color: #fff;
  border-color: #2563eb;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.24);
}

.coordinate-actions [data-coordinate-reset] {
  color: #fff;
  border-color: #f59e0b;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 6px 14px rgba(245, 158, 11, 0.24);
}

.coordinate-actions [data-coordinate-connect] {
  color: #fff;
  border-color: #8b5cf6;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  box-shadow: 0 6px 14px rgba(124, 58, 237, 0.24);
}

.coordinate-actions [data-coordinate-delete] {
  color: #fff;
  border-color: #ef4444;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.22);
}

.coordinate-actions [data-coordinate-delete-segment] {
  color: #fff;
  border-color: #db2777;
  background: linear-gradient(135deg, #ec4899, #be185d);
  box-shadow: 0 6px 14px rgba(219, 39, 119, 0.22);
}

.coordinate-actions [data-coordinate-clear] {
  color: #fff;
  border-color: #991b1b;
  background: linear-gradient(135deg, #b91c1c, #7f1d1d);
  box-shadow: 0 6px 14px rgba(127, 29, 29, 0.26);
}

.coordinate-actions button:not(:disabled):hover {
  filter: brightness(1.08) saturate(1.05);
}

.coordinate-point-list,
.coordinate-segment-list {
  display: flex;
  min-height: 42px;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-weight: 800;
}

.coordinate-point-list button,
.coordinate-segment-list button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(37, 94, 219, 0.2);
  border-radius: 8px;
  color: #10213f;
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.coordinate-point-list button.is-selected,
.coordinate-segment-list button.is-selected {
  color: #fff;
  border-color: #ef4444;
  background: #ef4444;
}

.coordinate-segment-list {
  padding-top: 10px;
  border-top: 1px solid rgba(37, 94, 219, 0.12);
}

.coordinate-segment-list strong { color: #10213f; }

@media (max-width: 640px) {
  .graph-card .coordinate-plane { min-height: 0; max-height: none; }
  .coordinate-controls { align-items: stretch; }
  .coordinate-controls .coordinate-readout { width: 100%; }
  .coordinate-actions { display: grid; width: 100%; grid-template-columns: 1fr 1fr; }
}

/* MathPro mobile responsive layer */
@media (max-width: 860px) {
  html,
  body {
    max-width: 100%;
  }

  body * {
    min-width: 0;
  }

  img,
  svg,
  canvas,
  video,
  iframe {
    max-width: 100%;
  }

  h1,
  h2,
  h3,
  p,
  a,
  button,
  label,
  strong,
  span,
  small {
    overflow-wrap: anywhere;
  }

  button,
  .button,
  input,
  select,
  textarea,
  summary {
    min-height: 44px;
  }

  .content-section,
  .game-shell,
  .topic-shell,
  .marketing-home > section {
    width: min(100% - 24px, 100%);
    margin-inline: auto;
  }

  .marketing-stage,
  .hero-panel,
  .hero-game-stage {
    max-width: 100%;
    overflow: hidden;
  }

  .quest-orbit,
  .flying-symbol,
  .floating-equation {
    max-width: calc(100% - 16px);
  }

  .auth-card,
  .price-card,
  .profile-card,
  .training-card,
  .coach-card,
  .archive-section,
  .model-section {
    max-width: 100%;
  }

  .auth-card input,
  .auth-card select,
  .auth-card .button,
  .compact-form input,
  .compact-form select {
    width: 100%;
  }

  .pricing-grid,
  .pricing-trust-row,
  .profile-layout,
  .profile-progress-grid,
  .game-layout,
  .game-dashboard,
  .coach-summary,
  .coach-insights,
  .archive-grid,
  .archive-section,
  .model-output {
    grid-template-columns: minmax(0, 1fr);
  }

  .price-year-pill {
    flex-direction: column;
    gap: 5px;
  }

  .price-plan-ribbon {
    max-width: calc(100% - 24px);
    white-space: normal;
  }

  .joker-shop-balance,
  .joker-pack-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .activity-calendar,
  .performance-chart,
  .table-scroll,
  .calendar-scroll {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .performance-chart svg,
  .activity-calendar > * {
    min-width: 620px;
  }

  .geometry-stage,
  .solid-stage,
  .formula-grid,
  .archive-formula-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .graph-card,
  .coordinate-workspace,
  .coordinate-plane,
  .model-canvas,
  .model-scene-viewport {
    width: 100%;
    max-width: 100%;
  }

  .coordinate-lock-notice {
    max-width: calc(100% - 20px);
  }

  .model-section,
  .model-form,
  .model-output {
    gap: 16px;
  }

  .model-scene-toolbar,
  .coordinate-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .model-scene-toolbar button,
  .coordinate-actions button {
    width: 100%;
  }

  .model-scene-viewport {
    min-height: clamp(300px, 90vw, 420px);
  }

  .model-canvas .model-scene-svg {
    min-height: 300px;
  }

  .daily-mission-answer,
  .training-round-meta,
  .answer-form,
  .answer-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .site-header .brand-logo {
    width: 62px;
    height: 42px;
  }

  .site-header .brand > span {
    display: none;
  }

  .content-section,
  .game-shell,
  .topic-shell,
  .marketing-home > section {
    width: min(100% - 16px, 100%);
  }

  .hero,
  .topic-hero,
  .models-intro,
  .model-section,
  .price-card,
  .profile-card,
  .auth-card,
  .training-card,
  .coach-card,
  .archive-section {
    padding: 18px;
  }

  h1,
  .hero h1,
  .game-hero h1,
  .topic-hero h1 {
    font-size: clamp(2rem, 11vw, 2.8rem);
    line-height: 1.02;
  }

  .hero-actions,
  .header-actions,
  .topic-actions,
  .arena-actions,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .button,
  .header-actions .button,
  .topic-actions .button,
  .arena-actions .button {
    width: 100%;
  }

  .marketing-stage {
    min-height: 340px;
  }

  .quest-orbit {
    transform: scale(0.78);
    transform-origin: center;
  }

  .pricing-grid,
  .pricing-trust-row,
  .profile-layout,
  .profile-progress-grid,
  .stats-grid,
  .reward-loot,
  .coach-topic-list,
  .geometry-stage,
  .solid-stage,
  .formula-grid,
  .archive-formula-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .activity-calendar,
  .performance-chart {
    margin-inline: -8px;
    padding-inline: 8px;
  }

  .coordinate-actions,
  .model-scene-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .coordinate-lock-notice {
    top: 10px;
    align-items: stretch;
    padding: 42px 14px 14px;
    flex-direction: column;
  }

  .coordinate-lock-notice .button {
    width: 100%;
  }

  .model-canvas {
    min-height: 370px;
    padding: 8px;
  }

  .model-scene-viewport,
  .model-canvas .model-scene-svg {
    min-height: 290px;
  }

  .game-topbar,
  .activity-head,
  .mission-progress-row,
  .xp-stat-row,
  .profile-rpg-row {
    align-items: stretch;
  }
}

/* Compact archive phone recovery */
@media (max-width: 520px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
  }

  .archive-topic .topic-hero {
    min-height: 0;
    margin-bottom: 10px;
    padding: 16px;
  }

  .archive-topic .topic-hero-panel {
    display: none;
  }

  .archive-topic .topic-hero p {
    margin-block: 8px;
  }

  .archive-topic .topic-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .archive-topic .topic-actions .button {
    min-height: 42px;
    padding: 8px;
  }

  .archive-topic .geometry-stage,
  .archive-topic .solid-stage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .archive-topic .geometry-tile,
  .archive-topic .solid-tile {
    min-height: 0;
    padding: 8px 6px;
  }

  .archive-topic .geometry-svg,
  .archive-topic .solid-svg {
    width: min(100%, 112px);
    height: 82px;
    margin-top: 0;
  }

  .archive-topic .geometry-tile strong,
  .archive-topic .solid-tile strong {
    font-size: 0.82rem;
  }

  .archive-topic .geometry-tile small,
  .archive-topic .solid-tile small {
    font-size: 0.68rem;
  }

  .archive-topic .geometry-formulas,
  .archive-topic .solid-formulas {
    gap: 3px;
    margin-top: 6px;
  }

  .archive-topic .geometry-formulas > span,
  .archive-topic .solid-formulas > span {
    padding: 4px;
    font-size: 0.68rem;
  }

  .archive-topic .coordinate-plane {
    touch-action: pan-y;
  }

  .archive-topic .coordinate-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-topic .graph-card {
    min-height: 0;
  }
}

/* ── Телефон и таблет: заглавия без пренасяне посред думата, вход/регистрация без застъпване ── */
@media (max-width: 1400px) {
  .topic-hero h1 { font-size: clamp(2.4rem, 6vw, 6.4rem); overflow-wrap: normal; }
}

@media (max-width: 520px) {
  .topic-hero h1,
  .archive-topic .topic-hero h1 { font-size: clamp(1.75rem, 8.6vw, 2.6rem); }
}

@media (max-width: 640px) {
  .auth-shell { place-items: start center; padding: 84px 16px 28px; }
  .auth-brand { top: 20px; left: 16px; }
  .auth-brand .auth-logo { height: 34px; }
  .auth-page .language-switcher-floating { position: absolute; top: 18px; right: 16px; }
  .auth-page .language-switcher-floating .language-toggle { min-height: 40px; padding: 0 10px; }
  .auth-page .language-switcher-floating [data-language-current],
  .auth-page .language-switcher-floating .language-globe { display: none; }
  .auth-card { padding: 22px 18px; }
}
