:root {
  color-scheme: dark;
  --bg: #050506;
  --surface: rgba(13, 14, 16, 0.78);
  --surface-strong: rgba(23, 24, 27, 0.82);
  --surface-soft: rgba(255, 255, 255, 0.055);
  --glass-line: rgba(255, 255, 255, 0.16);
  --glass-glow: rgba(255, 255, 255, 0.28);
  --text: #f7f7f2;
  --muted: rgba(247, 247, 242, 0.62);
  --dim: rgba(247, 247, 242, 0.42);
  --ink: #050506;
  --white: #f7f7f2;
  --accent-a: #5ee7ff;
  --accent-b: #8b5cf6;
  --accent-c: #ff6bc8;
  --accent-d: #ffb454;
  --accent-e: #42f59a;
  --glow-a: rgba(94, 231, 255, 0.26);
  --glow-b: rgba(139, 92, 246, 0.24);
  --glow-c: rgba(255, 107, 200, 0.18);
  --shadow-strong: rgba(0, 0, 0, 0.5);
  --bad: #ad4d4d;
  --good: #f7f7f2;
  --radius-lg: 30px;
  --radius-md: 22px;
  --radius-sm: 16px;
}

body.theme-light {
  color-scheme: light;
  --bg: #eef5ff;
  --surface: rgba(248, 252, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --surface-soft: rgba(8, 18, 34, 0.055);
  --glass-line: rgba(44, 86, 132, 0.26);
  --glass-glow: rgba(95, 150, 255, 0.24);
  --text: #101827;
  --muted: rgba(16, 24, 39, 0.66);
  --dim: rgba(16, 24, 39, 0.45);
  --ink: #050506;
  --white: #ffffff;
  --glow-a: rgba(31, 170, 255, 0.28);
  --glow-b: rgba(139, 92, 246, 0.2);
  --glow-c: rgba(255, 107, 200, 0.16);
  --shadow-strong: rgba(57, 86, 128, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
}

body {
  color: var(--text);
  background: var(--bg);
  font-family: "Manrope", sans-serif;
  transition: color 0.22s ease, background 0.22s ease;
}

.boot-splash {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--text);
  background:
    radial-gradient(520px 220px at 50% 48%, rgba(94, 231, 255, 0.18), transparent 68%),
    radial-gradient(460px 260px at 58% 46%, rgba(139, 92, 246, 0.17), transparent 72%),
    var(--bg);
  transition: opacity 0.42s ease, transform 0.42s ease, visibility 0.42s ease;
}

.boot-splash.hidden-splash {
  animation: splashOut 0.42s ease forwards;
}

.boot-beam {
  position: relative;
  width: min(560px, 74vw);
  height: 34px;
  border-radius: 999px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.98) 0%, rgba(94, 231, 255, 0.92) 22%, rgba(139, 92, 246, 0.66) 48%, transparent 76%),
    linear-gradient(90deg, transparent, var(--accent-a), var(--accent-b), transparent);
  box-shadow:
    0 0 28px rgba(94, 231, 255, 0.7),
    0 0 64px rgba(139, 92, 246, 0.45),
    0 0 110px rgba(255, 107, 200, 0.24);
  transform-origin: center;
  animation: beamPulse 1.35s ease-in-out infinite alternate;
}

.boot-beam::before {
  content: "";
  position: absolute;
  inset: -70% auto -70% -24%;
  width: 34%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), rgba(94, 231, 255, 0.5), transparent);
  filter: blur(3px);
  transform: translateX(-120%) skewX(-18deg);
  animation: beamTravel 1.05s cubic-bezier(0.45, 0, 0.2, 1) infinite;
}

.boot-title {
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: clamp(22px, 5vw, 42px);
  letter-spacing: -0.04em;
}

.boot-caption {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.action-loader {
  position: fixed;
  inset: 0;
  z-index: 115;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #f7f7f2;
  background:
    radial-gradient(420px 220px at 50% 48%, rgba(94, 231, 255, 0.2), transparent 70%),
    radial-gradient(520px 260px at 58% 46%, rgba(139, 92, 246, 0.18), transparent 72%),
    rgba(3, 3, 5, 0.76);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.action-loader.leaving {
  animation: splashOut 0.34s ease forwards;
}

.action-loader-card {
  position: relative;
  width: min(620px, calc(100vw - 32px));
  min-height: 240px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025)),
    rgba(8, 9, 14, 0.78);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 90px rgba(94, 231, 255, 0.17),
    0 30px 90px rgba(0, 0, 0, 0.5);
  animation: loaderCardIn 0.36s ease both;
}

.action-loader-card::before {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent, rgba(94, 231, 255, 0.28), rgba(255, 255, 255, 0.34), rgba(139, 92, 246, 0.22), transparent);
  filter: blur(18px);
  animation: beamPulse 1.18s ease-in-out infinite alternate;
}

.action-loader-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 18% 48%, rgba(255, 107, 200, 0.2) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 38%, rgba(94, 231, 255, 0.2) 0 1px, transparent 2px),
    radial-gradient(circle at 48% 72%, rgba(255, 180, 84, 0.18) 0 1px, transparent 2px);
  animation: particleFlicker 1.8s ease-in-out infinite alternate;
}

.action-loader-card > * {
  position: relative;
  z-index: 1;
}

.action-beam {
  width: min(460px, 72vw);
  height: 32px;
}

button,
input {
  font-family: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

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

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes auraDrift {
  0% {
    transform: translate3d(-2%, -1%, 0) scale(1);
    opacity: 0.42;
  }
  100% {
    transform: translate3d(2%, 1%, 0) scale(1.04);
    opacity: 0.72;
  }
}

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

@keyframes glowSweep {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

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

@keyframes beamPulse {
  0% {
    opacity: 0.45;
    transform: translateX(-6%) scaleX(0.72);
    filter: blur(0);
  }
  50% {
    opacity: 1;
    transform: translateX(3%) scaleX(1.08);
    filter: blur(0.4px);
  }
  100% {
    opacity: 0.62;
    transform: translateX(6%) scaleX(0.86);
    filter: blur(0);
  }
}

@keyframes beamTravel {
  0% {
    opacity: 0;
    transform: translateX(-120%) skewX(-18deg);
  }
  18% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translateX(420%) skewX(-18deg);
  }
}

@keyframes loaderCardIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes sphereAura {
  0%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.72;
  }
  50% {
    transform: translateY(-3px) scale(1.035);
    opacity: 1;
  }
}

@keyframes particleFlicker {
  0%, 100% {
    opacity: 0.52;
  }
  50% {
    opacity: 0.95;
  }
}

@keyframes pulseRing {
  0%, 100% {
    box-shadow: 0 0 0 rgba(94, 231, 255, 0), 0 0 34px rgba(255, 255, 255, 0.16);
  }
  50% {
    box-shadow: 0 0 28px var(--glow-a), 0 0 58px var(--glow-b);
  }
}

@keyframes splashOut {
  to {
    opacity: 0;
    transform: scale(1.015);
    visibility: hidden;
  }
}

.pixel-backdrop,
.orb {
  position: fixed;
  pointer-events: none;
}

.pixel-backdrop {
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    radial-gradient(780px 420px at 50% -8%, var(--glow-a), transparent 72%),
    radial-gradient(520px 300px at 84% 18%, var(--glow-b), transparent 70%),
    radial-gradient(520px 280px at 10% 74%, var(--glow-c), transparent 72%);
  background-size: 34px 34px, 34px 34px, auto, auto;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.82) 48%, rgba(0, 0, 0, 0.2) 100%);
  animation: glowSweep 14s ease-in-out infinite alternate;
}

.orb {
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.24;
  background: radial-gradient(circle, var(--accent-a), transparent 68%);
  animation: softFloat 8s ease-in-out infinite;
}

.orb-a {
  top: -160px;
  right: -120px;
}

.orb-b {
  left: -180px;
  bottom: -180px;
  background: radial-gradient(circle, var(--accent-c), transparent 68%);
  animation-delay: -3s;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) calc(112px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.glass {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(420px 180px at 16% 0%, var(--glow-a), transparent 68%),
    radial-gradient(320px 160px at 100% 100%, var(--glow-b), transparent 66%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035) 38%, rgba(255, 255, 255, 0.07)),
    linear-gradient(145deg, var(--surface-strong), var(--surface));
  box-shadow:
    0 24px 70px var(--shadow-strong),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.18), transparent 28%, transparent 72%, rgba(255, 255, 255, 0.08));
  opacity: 0.55;
}

.glass::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 42%;
  pointer-events: none;
  background:
    radial-gradient(220px 70px at 18% 100%, var(--glow-a), transparent 72%),
    radial-gradient(240px 78px at 82% 100%, var(--glow-c), transparent 74%);
  opacity: 0.62;
  animation: auraDrift 9s ease-in-out infinite alternate;
}

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

body.theme-light .pixel-backdrop {
  background:
    linear-gradient(rgba(16, 24, 39, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 24, 39, 0.045) 1px, transparent 1px),
    radial-gradient(780px 420px at 50% -8%, var(--glow-a), transparent 72%),
    radial-gradient(520px 300px at 84% 18%, var(--glow-b), transparent 70%),
    radial-gradient(520px 280px at 10% 74%, var(--glow-c), transparent 72%);
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
}

body.theme-light .glass {
  background:
    radial-gradient(420px 180px at 16% 0%, rgba(31, 170, 255, 0.18), transparent 68%),
    radial-gradient(320px 160px at 100% 100%, rgba(139, 92, 246, 0.13), transparent 66%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 255, 0.7) 46%, rgba(235, 244, 255, 0.82)),
    linear-gradient(145deg, var(--surface-strong), var(--surface));
  border-color: rgba(44, 86, 132, 0.32);
  box-shadow:
    0 0 0 1px rgba(54, 104, 152, 0.1),
    0 24px 70px rgba(57, 86, 128, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.72) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(16, 24, 39, 0.06);
}

body.theme-light .glass::before {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.86), transparent 30%, transparent 70%, rgba(45, 90, 145, 0.12));
  opacity: 0.92;
}

body.theme-light .glass::after {
  opacity: 0.36;
}

.topbar,
.view,
.footer-panel,
.modal-card {
  isolation: isolate;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border-radius: 28px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pixel-mark {
  display: grid;
  grid-template-columns: repeat(3, 8px);
  grid-template-rows: repeat(3, 8px);
  gap: 3px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 28px rgba(255, 255, 255, 0.12);
}

.pixel-mark span {
  width: 8px;
  height: 8px;
  background: var(--white);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.72);
}

.pixel-mark span:nth-child(1) { grid-column: 1; grid-row: 1; }
.pixel-mark span:nth-child(2) { grid-column: 2; grid-row: 1; }
.pixel-mark span:nth-child(3) { grid-column: 3; grid-row: 1; }
.pixel-mark span:nth-child(4) { grid-column: 1; grid-row: 2; }
.pixel-mark span:nth-child(5) { grid-column: 2; grid-row: 3; }
.pixel-mark span:nth-child(6) { grid-column: 3; grid-row: 2; }

.eyebrow,
.mono {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--dim);
  text-transform: uppercase;
}

h1,
h2 {
  font-family: "Unbounded", "Manrope", sans-serif;
}

h1 {
  margin-top: 3px;
  font-size: 18px;
  line-height: 1.1;
  white-space: nowrap;
}

h2 {
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1.06;
}

h3 {
  font-size: 16px;
}

.subtitle,
.muted,
small {
  color: var(--muted);
  line-height: 1.45;
}

.subtitle {
  max-width: 560px;
  margin-top: 14px;
  font-size: 16px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.exam-switch,
.pill-row,
.hero-actions,
.answer-row,
.draw-toolbar,
.width-row,
.chips,
.formula-row {
  display: flex;
  gap: 8px;
}

.exam-switch {
  padding: 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.tab-btn,
.icon-tab,
.theme-toggle,
.profile-avatar-btn,
.pill-btn,
.tool-btn,
.ghost-btn,
.cta-btn,
.footer-btn,
.formula-btn,
.primary-action,
.secondary-action,
.mode-card,
.battle-card,
.option-btn,
.chip {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  font-size: 13px;
  font-weight: 800;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.tab-btn:hover,
.icon-tab:hover,
.theme-toggle:hover,
.profile-avatar-btn:hover,
.pill-btn:hover,
.ghost-btn:hover,
.footer-btn:hover,
.mode-card:hover,
.battle-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.28);
}

.tab-btn.active,
.icon-tab.active,
.theme-toggle.active,
.profile-avatar-btn.active,
.pill-btn.active,
.tool-btn.active,
.footer-btn.active,
.cta-btn,
.primary-action {
  color: var(--ink);
  background: var(--white);
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 34px rgba(255, 255, 255, 0.16);
}

.theme-toggle {
  min-width: 46px;
  min-height: 42px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  align-items: center;
  padding: 5px;
  overflow: hidden;
}

.profile-avatar-btn {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 18px;
  overflow: visible;
  background:
    radial-gradient(circle at 35% 18%, rgba(255, 255, 255, 0.62), transparent 36%),
    linear-gradient(135deg, rgba(94, 231, 255, 0.22), rgba(139, 92, 246, 0.18)),
    rgba(255, 255, 255, 0.075);
}

.profile-avatar-btn > span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 14px;
  color: #f7f7f2;
  background: transparent;
  box-shadow: none;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 19px;
  line-height: 1;
  font-weight: 900;
}

.profile-avatar-btn small {
  position: absolute;
  right: -4px;
  bottom: -4px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.72);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 900;
}

.theme-toggle span {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 999px;
  font-size: 14px;
  transition: transform 0.22s ease, opacity 0.22s ease, background 0.22s ease;
}

.theme-toggle .theme-moon {
  background: rgba(255, 255, 255, 0.12);
}

.theme-toggle .theme-sun {
  opacity: 0.45;
  transform: scale(0.82);
}

.theme-toggle.active .theme-sun {
  opacity: 1;
  transform: scale(1);
  background: rgba(255, 180, 84, 0.22);
}

.theme-toggle.active .theme-moon {
  opacity: 0.45;
  transform: scale(0.82);
  background: transparent;
}

body.theme-light .tab-btn,
body.theme-light .icon-tab,
body.theme-light .theme-toggle,
body.theme-light .profile-avatar-btn,
body.theme-light .pill-btn,
body.theme-light .tool-btn,
body.theme-light .ghost-btn,
body.theme-light .footer-btn,
body.theme-light .formula-btn,
body.theme-light .secondary-action,
body.theme-light .battle-card,
body.theme-light .option-btn,
body.theme-light .chip {
  border-color: rgba(44, 86, 132, 0.22);
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    0 10px 28px rgba(57, 86, 128, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

body.theme-light .tab-btn.active,
body.theme-light .icon-tab.active,
body.theme-light .theme-toggle.active,
body.theme-light .profile-avatar-btn.active,
body.theme-light .pill-btn.active,
body.theme-light .tool-btn.active,
body.theme-light .footer-btn.active,
body.theme-light .cta-btn,
body.theme-light .primary-action {
  color: #ffffff;
  background: #101827;
  border-color: rgba(16, 24, 39, 0.86);
  box-shadow: 0 14px 38px rgba(31, 74, 135, 0.18);
}

body.theme-light .primary-action small {
  color: rgba(255, 255, 255, 0.66);
}

body.theme-light .exam-switch,
body.theme-light .footer-panel,
body.theme-light .pixel-mark,
body.theme-light .liquid-card,
body.theme-light .mini-metrics div,
body.theme-light .stat-tile,
body.theme-light .stat-box,
body.theme-light .list-row,
body.theme-light .result-item,
body.theme-light .ladder-row,
body.theme-light .league-rule-card,
body.theme-light .task-row,
body.theme-light .battle-status,
body.theme-light .live-result-wait,
body.theme-light .arena-result-hero,
body.theme-light .arena-score-card,
body.theme-light .achievement-card,
body.theme-light .friend-row,
body.theme-light .friend-request-column,
body.theme-light .friend-search-card,
body.theme-light .friend-search-results,
body.theme-light .friend-list-head,
body.theme-light .profile-identity-card,
body.theme-light .profile-identity-form input,
body.theme-light .friend-search-row input,
body.theme-light .economy-status-card,
body.theme-light .subscription-card,
body.theme-light .shop-card,
body.theme-light .shop-rules,
body.theme-light .weak-card,
body.theme-light .weak-row,
body.theme-light .analytics-card,
body.theme-light .question-card,
body.theme-light .answer-card,
body.theme-light .notes-preview,
body.theme-light .result-summary,
body.theme-light .empty-state,
body.theme-light .arena-history-row,
body.theme-light .friend-profile-grid div,
body.theme-light .activity-chart {
  border-color: rgba(44, 86, 132, 0.28);
  background-color: rgba(255, 255, 255, 0.78);
  box-shadow:
    0 12px 32px rgba(57, 86, 128, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

body.theme-light .mode-card,
body.theme-light .battle-card,
body.theme-light .shop-card,
body.theme-light .weak-card {
  border-color: rgba(44, 86, 132, 0.24);
}

body.theme-light .mode-card:hover,
body.theme-light .battle-card:hover,
body.theme-light .shop-card:hover {
  border-color: rgba(31, 122, 190, 0.42);
}

body.theme-light .footer-panel {
  background:
    radial-gradient(220px 90px at 10% 0%, rgba(31, 170, 255, 0.18), transparent 74%),
    radial-gradient(240px 90px at 92% 100%, rgba(139, 92, 246, 0.14), transparent 76%),
    rgba(255, 255, 255, 0.86);
  border-color: rgba(44, 86, 132, 0.28);
}

body.theme-light .empty-state {
  border-color: rgba(44, 86, 132, 0.3);
  color: rgba(16, 24, 39, 0.68);
}

body.theme-light .empty-state::before {
  background: #101827;
  box-shadow: 0 0 16px rgba(31, 170, 255, 0.34);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.view {
  display: none;
  margin-top: 14px;
  gap: 14px;
  min-width: 0;
}

.view.active {
  display: grid;
  animation: viewIn 0.34s ease both;
}

.hero-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
  padding: 18px;
  min-height: 310px;
  overflow: hidden;
}

.hero-stage::before {
  background:
    linear-gradient(90deg, transparent 0%, rgba(94, 231, 255, 0.22) 24%, rgba(255, 255, 255, 0.34) 50%, rgba(255, 107, 200, 0.2) 76%, transparent 100%);
  height: 2px;
  inset: 0 10% auto 10%;
  opacity: 0.9;
  animation: beamPulse 2.8s ease-in-out infinite alternate;
}

.hero-stage::after {
  height: 62%;
  background:
    radial-gradient(420px 120px at 28% 92%, var(--glow-a), transparent 72%),
    radial-gradient(460px 120px at 72% 92%, var(--glow-c), transparent 74%);
}

.hero-copy,
.player-card,
.section-head,
.setup-flow,
.start-dock,
.battle-grid,
.league-ladder,
.profile-layout,
.solver-progress-row,
.answer-title,
.list,
.stats-summary,
.stats-subjects,
.stats-recent,
.result-details {
  position: relative;
  z-index: 1;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 270px;
}

.hero-actions {
  margin-top: 26px;
  flex-wrap: wrap;
}

.primary-action,
.secondary-action {
  min-height: 62px;
  border-radius: 22px;
  padding: 14px 18px;
  text-align: left;
}

.primary-action {
  animation: pulseRing 4.8s ease-in-out infinite;
}

.primary-action span,
.primary-action small,
.mode-card strong,
.mode-card small,
.battle-card strong,
.battle-card small {
  display: block;
}

.primary-action span {
  font-size: 15px;
}

.primary-action small {
  color: rgba(5, 5, 6, 0.62);
  margin-top: 4px;
}

.secondary-action {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.liquid-card {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 26px;
  background:
    radial-gradient(180px 120px at 28% 0%, var(--glow-a), transparent 72%),
    radial-gradient(180px 110px at 90% 100%, var(--glow-c), transparent 74%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 18px 48px rgba(0, 0, 0, 0.26);
}

.player-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 16px;
  animation: softFloat 7s ease-in-out infinite;
}

.card-topline,
.section-head,
.notes-head,
.answer-title,
.modal-head,
.row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-pill,
.timer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.ok {
  color: var(--ink);
  background: var(--white);
}

.status-pill.bad,
.timer-badge.danger,
.ghost-btn.danger {
  color: #fff;
  background: var(--bad);
}

.timer-badge.warn {
  color: var(--ink);
  background: #d9d6c8;
}

.level-orb {
  position: relative;
  align-self: center;
  justify-self: center;
  width: min(190px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 180, 84, 0.42), transparent 32%),
    radial-gradient(circle at 50% 78%, rgba(247, 247, 242, 0.34), transparent 38%),
    radial-gradient(circle at 38% 34%, rgba(255, 255, 255, 0.42), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02)),
    rgba(5, 5, 6, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 0 34px rgba(255, 180, 84, 0.14),
    0 0 68px rgba(94, 231, 255, 0.16),
    inset 0 0 42px rgba(255, 255, 255, 0.08),
    inset 0 -42px 54px rgba(0, 0, 0, 0.44);
  animation: sphereAura 4.2s ease-in-out infinite;
}

.level-orb::before {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background-image:
    radial-gradient(circle at 48% 9%, rgba(255, 213, 130, 0.95) 0 1.5px, transparent 2.6px),
    radial-gradient(circle at 58% 13%, rgba(255, 164, 86, 0.9) 0 1.4px, transparent 2.5px),
    radial-gradient(circle at 40% 17%, rgba(255, 235, 170, 0.9) 0 1.2px, transparent 2.4px),
    radial-gradient(circle at 68% 25%, rgba(255, 207, 98, 0.85) 0 1.2px, transparent 2.5px),
    radial-gradient(circle at 28% 30%, rgba(255, 164, 86, 0.8) 0 1.2px, transparent 2.4px),
    radial-gradient(circle at 46% 38%, rgba(255, 255, 255, 0.72) 0 1.2px, transparent 2.4px),
    radial-gradient(circle at 62% 45%, rgba(94, 231, 255, 0.7) 0 1.1px, transparent 2.3px),
    radial-gradient(circle at 35% 56%, rgba(255, 255, 255, 0.82) 0 1.4px, transparent 2.5px),
    radial-gradient(circle at 70% 62%, rgba(255, 255, 255, 0.7) 0 1.3px, transparent 2.5px),
    radial-gradient(circle at 50% 72%, rgba(247, 247, 242, 0.86) 0 1.5px, transparent 2.7px),
    radial-gradient(circle at 36% 78%, rgba(247, 247, 242, 0.72) 0 1.2px, transparent 2.4px),
    radial-gradient(circle at 64% 82%, rgba(247, 247, 242, 0.78) 0 1.2px, transparent 2.5px);
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
  opacity: 0.9;
  animation: sphereSpin 16s linear infinite;
}

.level-orb::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 22%, rgba(255, 255, 255, 0.42), transparent 16%),
    linear-gradient(180deg, transparent 0 42%, rgba(0, 0, 0, 0.32) 58%, rgba(0, 0, 0, 0.76) 100%),
    radial-gradient(circle at 50% 110%, rgba(247, 247, 242, 0.32), transparent 44%);
  pointer-events: none;
}

.level-orb span {
  position: relative;
  z-index: 1;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: rgba(247, 247, 242, 0.72);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-shadow: 0 0 12px rgba(94, 231, 255, 0.32);
}

.level-orb b {
  position: relative;
  z-index: 1;
  color: #f7f7f2;
  font-family: "Unbounded", sans-serif;
  font-size: 46px;
  line-height: 1;
  text-shadow:
    0 0 18px rgba(255, 255, 255, 0.18),
    0 0 32px rgba(94, 231, 255, 0.22);
}

.mini-metrics,
.game-stats,
.quick-grid,
.battle-grid {
  display: grid;
  gap: 10px;
}

.mini-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-metrics div,
.stat-tile,
.stat-box,
.list-row,
.result-item,
.ladder-row {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.065);
  padding: 12px;
}

.mini-metrics span,
.stat-tile span,
.stat-label,
.league-score span {
  display: block;
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
}

.mini-metrics b,
.stat-tile b,
.stat-val,
.league-score b {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

.quick-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.mode-card {
  --card-accent: var(--accent-a);
  --card-glow: rgba(94, 231, 255, 0.26);
  --card-glow-soft: rgba(94, 231, 255, 0.16);
  min-height: 138px;
  border-radius: 26px;
  padding: 18px;
  text-align: left;
  background:
    radial-gradient(180px 90px at 16% 0%, var(--card-glow), transparent 74%),
    radial-gradient(240px 80px at 100% 100%, var(--card-glow-soft), transparent 76%),
    linear-gradient(145deg, var(--surface-strong), var(--surface));
  animation: cardRise 0.34s ease both;
}

.mode-card:nth-child(2) {
  --card-accent: var(--accent-b);
  --card-glow: rgba(139, 92, 246, 0.3);
  --card-glow-soft: rgba(139, 92, 246, 0.17);
  animation-delay: 0.04s;
}

.mode-card:nth-child(3) {
  --card-accent: var(--accent-c);
  --card-glow: rgba(255, 107, 200, 0.26);
  --card-glow-soft: rgba(255, 107, 200, 0.15);
  animation-delay: 0.08s;
}

.mode-card:nth-child(4) {
  --card-accent: var(--accent-d);
  --card-glow: rgba(255, 180, 84, 0.26);
  --card-glow-soft: rgba(255, 180, 84, 0.15);
  animation-delay: 0.12s;
}

.mode-icon {
  display: inline-flex;
  margin-bottom: 18px;
  font-family: "IBM Plex Mono", monospace;
  color: var(--card-accent);
  text-shadow: 0 0 18px var(--card-glow);
}

.mode-card strong,
.battle-card strong {
  font-size: 17px;
}

.mode-card small,
.battle-card small {
  margin-top: 8px;
}

.progress-panel,
.sessions-panel,
.config-panel,
.arena-screen,
.boss-panel,
.league-panel,
.shop-panel,
.weak-panel,
.profile-panel,
.friends-panel,
.stats-panel,
.solver-head-panel,
.nav-panel,
.question-panel,
.notes-panel,
.answer-panel,
.result-panel {
  padding: 16px;
}

.compact-panel {
  border-radius: var(--radius-md);
}

.fold-panel {
  min-width: 0;
}

.fold-panel > summary {
  list-style: none;
}

.fold-panel > summary::-webkit-details-marker {
  display: none;
}

.fold-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.fold-summary h2,
.fold-summary h3 {
  margin-top: 2px;
}

.fold-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11px;
  font-weight: 900;
}

.fold-panel[open] .fold-chevron {
  color: var(--ink);
  background: var(--white);
}

.fold-panel[open] .fold-chevron::before {
  content: "Скрыть";
}

.fold-panel[open] .fold-chevron {
  font-size: 0;
}

.fold-panel[open] .fold-chevron::before {
  font-size: 11px;
}

.fold-panel:not([open]) {
  padding-bottom: 16px;
}

.activity-chart {
  position: relative;
  z-index: 1;
  min-height: 92px;
  margin-top: 14px;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
}

.activity-bar {
  flex: 1 1 0;
  min-width: 8px;
  max-width: 40px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(to top, var(--accent-b), var(--accent-a), var(--white));
  box-shadow: 0 0 22px var(--glow-a);
  transform-origin: bottom;
  animation: cardRise 0.32s ease both;
}

.list {
  margin-top: 12px;
  gap: 8px;
}

.list-row {
  color: var(--text);
}

.empty-state {
  position: relative;
  z-index: 1;
  min-height: 76px;
  display: grid;
  align-items: center;
  margin-top: 12px;
  padding: 16px 16px 16px 44px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  color: var(--muted);
  background:
    radial-gradient(140px 80px at 8% 0%, var(--glow-a), transparent 74%),
    rgba(255, 255, 255, 0.045);
  font-size: 13px;
  font-weight: 700;
}

.empty-state::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--white);
  box-shadow: 0 0 18px var(--glow-a);
  transform: translateY(-50%) rotate(45deg);
}

.setup-flow {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.selector-block {
  min-width: 0;
}

.selector-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pill-row {
  flex-wrap: wrap;
}

.pill-btn {
  max-width: 100%;
  border-radius: 16px;
}

.task-pills .pill-btn {
  min-width: 54px;
}

.muted {
  margin-top: 8px;
  font-size: 13px;
}

.start-dock {
  position: sticky;
  bottom: calc(82px + env(safe-area-inset-bottom));
  z-index: 3;
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
}

.start-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.cta-btn.big {
  min-height: 54px;
  min-width: 150px;
  border-radius: 18px;
}

.battle-grid {
  margin-top: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.battle-config {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.battle-card {
  --card-accent: var(--accent-a);
  --card-glow: rgba(94, 231, 255, 0.24);
  min-height: 170px;
  border-radius: 28px;
  padding: 18px;
  text-align: left;
  background:
    radial-gradient(190px 110px at 18% 0%, var(--card-glow), transparent 74%),
    rgba(255, 255, 255, 0.07);
  animation: cardRise 0.34s ease both;
}

.battle-card:nth-child(2) {
  --card-accent: var(--accent-b);
  --card-glow: rgba(139, 92, 246, 0.24);
  animation-delay: 0.04s;
}

.battle-card:nth-child(3) {
  --card-accent: var(--accent-c);
  --card-glow: rgba(255, 107, 200, 0.22);
  animation-delay: 0.08s;
}

.battle-card:nth-child(4) {
  --card-accent: var(--accent-d);
  --card-glow: rgba(255, 180, 84, 0.22);
  animation-delay: 0.12s;
}

.battle-card.active {
  border-color: rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2), 0 20px 54px rgba(255, 255, 255, 0.08);
}

.primary-battle {
  color: var(--ink);
  background:
    radial-gradient(200px 110px at 24% 0%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.48) 48%, rgba(255, 255, 255, 0.16)),
    var(--white);
}

.primary-battle small,
.primary-battle .mono {
  color: rgba(5, 5, 6, 0.58);
}

.battle-options {
  padding: 16px;
}

.battle-start {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.friend-invite,
.live-match {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background:
    radial-gradient(180px 110px at 20% 0%, rgba(255, 255, 255, 0.14), transparent 72%),
    rgba(255, 255, 255, 0.055);
}

.friend-invite input {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.friend-actions,
.live-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.live-match {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  background:
    radial-gradient(180px 110px at 18% 0%, rgba(255, 255, 255, 0.22), transparent 72%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));
}

.score-note {
  margin-top: 6px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.45;
}

.battle-status {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.battle-status div {
  border-radius: 16px;
  padding: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.battle-status span {
  display: block;
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
}

.battle-status b {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.live-result-wait {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(160px 90px at 20% 0%, rgba(255, 255, 255, 0.18), transparent 72%),
    rgba(255, 255, 255, 0.055);
}

.live-result-wait span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.result-stack {
  display: grid;
  gap: 12px;
}

.arena-result-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr);
  gap: 14px;
  align-items: stretch;
  padding: 16px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(240px 160px at 18% 0%, rgba(255, 255, 255, 0.22), transparent 72%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  animation: resultRise 420ms ease both;
}

.arena-result-hero.win {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 52px rgba(255, 255, 255, 0.14);
}

.arena-result-hero.lose {
  border-color: rgba(173, 77, 77, 0.62);
}

.arena-result-copy {
  display: grid;
  align-content: center;
  gap: 8px;
}

.arena-result-copy h3 {
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: clamp(26px, 5vw, 54px);
  line-height: 1;
}

.arena-versus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.arena-versus div,
.result-reward-grid div {
  min-width: 0;
  border-radius: 20px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.06);
}

.arena-versus strong {
  font-family: "IBM Plex Mono", monospace;
  color: var(--dim);
}

.arena-versus span,
.arena-versus small,
.result-reward-grid span {
  display: block;
  color: var(--dim);
  font-size: 11px;
  font-weight: 900;
}

.arena-versus b {
  display: block;
  margin-top: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(28px, 6vw, 52px);
  line-height: 1;
}

.arena-versus small {
  margin-top: 8px;
}

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

.result-reward-grid b {
  display: block;
  margin-top: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 24px;
}

.result-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@keyframes resultRise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.arena-score-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.arena-score-grid div {
  border-radius: 16px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.055);
}

.arena-score-grid span,
.arena-history-score span,
.arena-history-row small {
  display: block;
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
}

.arena-score-grid b {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.arena-history {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  padding: 16px;
}

.arena-history-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.arena-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background:
    radial-gradient(160px 90px at 16% 0%, rgba(255, 255, 255, 0.14), transparent 72%),
    rgba(255, 255, 255, 0.055);
}

.arena-history-row.win {
  border-color: rgba(255, 255, 255, 0.34);
}

.arena-history-row.lose {
  border-color: rgba(173, 77, 77, 0.55);
}

.arena-history-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.arena-history-main b,
.arena-history-main small {
  min-width: 0;
}

.arena-history-main small,
.arena-history-score span {
  margin-top: 5px;
}

.arena-history-score {
  min-width: 104px;
  text-align: right;
}

.arena-history-score b {
  display: block;
  margin-top: 5px;
  font-family: "IBM Plex Mono", monospace;
}

.outcome-pill {
  white-space: nowrap;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--ink);
  background: var(--white);
  font-size: 11px;
  font-weight: 900;
}

.outcome-pill.lose {
  color: var(--text);
  background: rgba(173, 77, 77, 0.72);
}

.outcome-pill.draw,
.outcome-pill.pending {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
}

.boss-grid {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.boss-card {
  padding: 16px;
  min-height: 132px;
}

.boss-card span,
.boss-card small {
  display: block;
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
}

.boss-card b {
  display: block;
  margin-top: 12px;
  color: var(--text);
  font-size: clamp(26px, 5vw, 42px);
  line-height: 1;
}

.boss-card small {
  margin-top: 12px;
  line-height: 1.4;
}

.boss-status,
.boss-recent {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.league-score {
  min-width: 118px;
  padding: 14px;
  text-align: center;
}

.league-rules-grid {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.league-rule-card {
  min-height: 104px;
  padding: 14px;
  border-radius: 22px;
}

.league-rule-card span,
.league-rule-card small {
  display: block;
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
}

.league-rule-card b {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: clamp(20px, 4vw, 30px);
  line-height: 1;
}

.league-rule-card small {
  margin-top: 10px;
  line-height: 1.35;
}

.league-subject-head {
  margin-top: 18px;
}

.economy-status-grid {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.economy-status-card {
  min-height: 106px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 22px;
  background:
    radial-gradient(140px 90px at 18% 0%, rgba(94, 231, 255, 0.14), transparent 74%),
    rgba(255, 255, 255, 0.06);
}

.economy-status-card.attention {
  background:
    radial-gradient(140px 90px at 18% 0%, rgba(255, 180, 84, 0.18), transparent 74%),
    rgba(255, 255, 255, 0.06);
}

.economy-status-card.full {
  background:
    radial-gradient(140px 90px at 18% 0%, rgba(66, 245, 154, 0.16), transparent 74%),
    rgba(255, 255, 255, 0.06);
}

.economy-status-card span,
.economy-status-card small {
  display: block;
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
}

.economy-status-card b {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: clamp(22px, 5vw, 34px);
  line-height: 1;
}

.economy-status-card small {
  margin-top: 10px;
  line-height: 1.35;
}

.subscription-head {
  margin-top: 14px;
}

.subscription-grid {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.subscription-card {
  min-height: 248px;
  display: grid;
  gap: 12px;
  align-content: space-between;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 26px;
  background:
    radial-gradient(180px 120px at 14% 0%, rgba(94, 231, 255, 0.18), transparent 74%),
    radial-gradient(210px 110px at 100% 100%, rgba(139, 92, 246, 0.14), transparent 76%),
    rgba(255, 255, 255, 0.06);
  animation: cardRise 0.34s ease both;
}

.subscription-card:nth-child(2) {
  background:
    radial-gradient(210px 120px at 14% 0%, rgba(255, 107, 200, 0.2), transparent 74%),
    radial-gradient(230px 120px at 100% 100%, rgba(94, 231, 255, 0.18), transparent 76%),
    rgba(255, 255, 255, 0.065);
}

.subscription-card.active {
  border-color: rgba(94, 231, 255, 0.38);
}

.subscription-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.subscription-card-top span,
.subscription-card p,
.subscription-features span {
  color: var(--dim);
  font-size: 12px;
  font-weight: 800;
}

.subscription-card-top b {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
}

.subscription-card h3 {
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: 22px;
  line-height: 1.08;
}

.subscription-card p {
  line-height: 1.45;
}

.subscription-features {
  display: grid;
  gap: 7px;
}

.subscription-features span {
  position: relative;
  padding-left: 18px;
}

.subscription-features span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.52em;
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--white);
  box-shadow: 0 0 14px var(--glow-a);
  transform: translateY(-50%) rotate(45deg);
}

.subscription-card .cta-btn {
  width: 100%;
}

.league-ladder {
  margin-top: 18px;
  display: grid;
  gap: 9px;
}

.ladder-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
}

.ladder-row.active {
  color: var(--ink);
  background: var(--white);
}

.ladder-row span,
.ladder-row small,
.ladder-row b {
  min-width: 0;
}

.ladder-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ladder-row small {
  color: var(--dim);
}

.ladder-row.active small {
  color: rgba(5, 5, 6, 0.58);
}

.weak-summary {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.weak-card {
  min-height: 92px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 20px;
  padding: 14px;
  background:
    radial-gradient(120px 80px at 18% 0%, rgba(255, 255, 255, 0.18), transparent 72%),
    rgba(255, 255, 255, 0.06);
}

.weak-card span,
.weak-card small {
  display: block;
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
}

.weak-card b {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  line-height: 1;
}

.weak-card small {
  margin-top: 6px;
}

.weak-list {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.weak-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 22px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.weak-row b,
.weak-row small {
  display: block;
  min-width: 0;
}

.weak-row small {
  margin-top: 6px;
  color: var(--muted);
}

.weak-bar {
  height: 8px;
  margin-top: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.weak-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(173, 77, 77, 0.92));
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.14);
}

.shop-wallet {
  min-width: 150px;
  padding: 16px;
  text-align: right;
}

.shop-wallet span,
.wallet-card span,
.shop-card-top span,
.shop-card p,
.shop-status,
.rule-row p {
  color: var(--dim);
  font-size: 12px;
  font-weight: 800;
}

.shop-wallet b {
  display: block;
  margin-top: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 30px;
}

.wallet-grid,
.shop-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

.wallet-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.wallet-card,
.shop-card {
  padding: 16px;
}

.wallet-card b {
  display: block;
  margin-top: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 24px;
}

.wallet-card small,
.shop-card p {
  display: block;
  margin-top: 8px;
  line-height: 1.45;
}

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

.shop-card {
  --card-accent: var(--accent-a);
  --card-glow: rgba(94, 231, 255, 0.24);
  --card-glow-soft: rgba(94, 231, 255, 0.14);
  min-height: 210px;
  display: grid;
  gap: 12px;
  align-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(150px 110px at 20% 0%, var(--card-glow), transparent 74%),
    radial-gradient(170px 90px at 100% 100%, var(--card-glow-soft), transparent 76%),
    rgba(255, 255, 255, 0.055);
  animation: cardRise 0.34s ease both;
}

.shop-card:nth-child(2) {
  --card-accent: var(--accent-b);
  --card-glow: rgba(139, 92, 246, 0.25);
  --card-glow-soft: rgba(139, 92, 246, 0.15);
  animation-delay: 0.04s;
}

.shop-card:nth-child(3) {
  --card-accent: var(--accent-c);
  --card-glow: rgba(255, 107, 200, 0.23);
  --card-glow-soft: rgba(255, 107, 200, 0.14);
  animation-delay: 0.08s;
}

.shop-card:nth-child(4) {
  --card-accent: var(--accent-d);
  --card-glow: rgba(255, 180, 84, 0.24);
  --card-glow-soft: rgba(255, 180, 84, 0.14);
  animation-delay: 0.12s;
}

.shop-card.disabled {
  opacity: 0.6;
}

.shop-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.shop-card-top b {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
}

.shop-card h3 {
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: 18px;
  line-height: 1.12;
}

.shop-card .cta-btn {
  width: 100%;
}

.shop-card .cta-btn:disabled {
  cursor: not-allowed;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.08);
}

.shop-status {
  position: relative;
  z-index: 1;
  min-height: 20px;
  margin-top: 12px;
}

.shop-rules {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.rule-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.rule-row span {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 2px;
  background: var(--white);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.58);
}

.achievement-panel {
  padding: 16px;
}

.friends-panel {
  padding: 16px;
}

.profile-identity-card {
  margin-top: 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  overflow: visible;
}

.profile-avatar-large,
.friend-avatar {
  display: grid;
  place-items: center;
  color: #f7f7f2;
  background:
    radial-gradient(circle at 36% 18%, rgba(255, 255, 255, 0.48), transparent 40%),
    linear-gradient(135deg, var(--accent-a), var(--accent-b) 58%, var(--accent-c));
  box-shadow: 0 0 34px var(--glow-a), inset 0 1px 0 rgba(255, 255, 255, 0.42);
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  line-height: 1;
  font-weight: 900;
}

.profile-avatar-large[data-avatar="pixel"],
.friend-avatar[data-avatar="pixel"] {
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.48), transparent 40%),
    linear-gradient(135deg, #ffb454, #ff6bc8 58%, #8b5cf6);
}

.profile-avatar-large[data-avatar="orbit"],
.friend-avatar[data-avatar="orbit"] {
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.48), transparent 40%),
    linear-gradient(135deg, #42f59a, #5ee7ff 58%, #8b5cf6);
}

.profile-avatar-large[data-avatar="sigma"],
.friend-avatar[data-avatar="sigma"] {
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.48), transparent 40%),
    linear-gradient(135deg, #f7f7f2, #5ee7ff 54%, #050506);
}

.profile-avatar-large[data-avatar="delta"],
.friend-avatar[data-avatar="delta"] {
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.48), transparent 40%),
    linear-gradient(135deg, #8b5cf6, #5ee7ff 54%, #42f59a);
}

.profile-avatar-large[data-avatar="pulse"],
.friend-avatar[data-avatar="pulse"] {
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.48), transparent 40%),
    linear-gradient(135deg, #ffb454, #f7f7f2 48%, #5ee7ff);
}

.profile-avatar-large[data-avatar="quark"],
.friend-avatar[data-avatar="quark"] {
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.48), transparent 40%),
    linear-gradient(135deg, #050506, #8b5cf6 58%, #ff6bc8);
}

.profile-avatar-large[data-avatar="comet"],
.friend-avatar[data-avatar="comet"] {
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.48), transparent 40%),
    linear-gradient(135deg, #5ee7ff, #f7f7f2 46%, #ffb454);
}

.profile-avatar-large > span,
.friend-avatar > span,
.avatar-option > span {
  background: transparent !important;
  box-shadow: none !important;
}

.profile-avatar-large {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 32px;
  font-size: 44px;
  overflow: hidden;
}

.profile-avatar-large::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  pointer-events: none;
}

.profile-identity-form {
  display: grid;
  gap: 12px;
}

.profile-identity-form label {
  display: grid;
  gap: 7px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-identity-form input,
.friend-search-row input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  padding: 0 14px;
  font-size: 15px;
  font-weight: 800;
  outline: none;
}

.profile-identity-form input:focus,
.friend-search-row input:focus {
  border-color: rgba(94, 231, 255, 0.52);
  box-shadow: 0 0 0 4px rgba(94, 231, 255, 0.08);
}

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

.avatar-option {
  min-width: 0;
  min-height: 58px;
  border-radius: 18px;
  padding: 8px 6px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.avatar-option.active {
  border-color: rgba(94, 231, 255, 0.58);
  box-shadow: 0 0 28px rgba(94, 231, 255, 0.16);
}

.avatar-option span,
.avatar-option small {
  display: block;
}

.avatar-option span {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
}

.avatar-option small {
  display: none;
}

.profile-save-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.goal-strip {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.goal-card,
.achievement-card {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 22px;
  padding: 14px;
  background:
    radial-gradient(140px 90px at 20% 0%, rgba(255, 255, 255, 0.16), transparent 72%),
    rgba(255, 255, 255, 0.055);
}

.goal-card.complete,
.achievement-card.complete {
  border-color: rgba(255, 255, 255, 0.46);
  background:
    radial-gradient(160px 100px at 24% 0%, rgba(255, 255, 255, 0.28), transparent 72%),
    rgba(255, 255, 255, 0.085);
  box-shadow: 0 0 34px rgba(255, 255, 255, 0.08);
}

.goal-card span,
.goal-card small,
.achievement-card span,
.achievement-card small,
.achievement-card p {
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
}

.goal-card b {
  display: block;
  margin-top: 7px;
  font-size: 16px;
}

.goal-card small {
  display: block;
  margin-top: 6px;
  line-height: 1.4;
}

.achievement-grid {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.achievement-card {
  min-height: 168px;
  display: grid;
  align-content: space-between;
  gap: 8px;
}

.achievement-card.epic {
  border-color: rgba(255, 255, 255, 0.24);
}

.achievement-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.achievement-top b {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
}

.achievement-card h3 {
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: 17px;
  line-height: 1.12;
}

.achievement-card p {
  line-height: 1.4;
}

.friend-connect,
.friend-request-column,
.friend-search-card,
.friend-search-results,
.friend-list-head,
.friend-row {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background:
    radial-gradient(160px 100px at 18% 0%, rgba(255, 255, 255, 0.16), transparent 72%),
    rgba(255, 255, 255, 0.055);
}

.friend-connect {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 22px;
}

.friend-requests-panel {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.friend-request-column {
  min-width: 0;
  padding: 12px;
  border-radius: 24px;
}

.friend-request-column .friend-list-head {
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.friend-request-column .friend-list {
  margin-top: 10px;
}

.friend-search-card {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

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

.friend-search-results {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 22px;
}

.friend-list-head {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 20px;
}

.friend-list {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.friend-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 20px;
}

.request-row {
  grid-template-columns: auto minmax(0, 1fr);
}

.request-row .friend-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.friend-leaderboard .ladder-row {
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.friend-leaderboard .ladder-row:hover {
  transform: translateY(-1px);
  border-color: rgba(94, 231, 255, 0.34);
  background:
    radial-gradient(140px 80px at 12% 0%, rgba(94, 231, 255, 0.16), transparent 74%),
    rgba(255, 255, 255, 0.075);
}

.friend-leaderboard .ladder-row.active {
  cursor: default;
}

.friend-leaderboard .ladder-row.active:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.13);
  background: var(--white);
}

.friend-ladder-main {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.friend-ladder-main b,
.friend-ladder-main small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-avatar.mini {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 17px;
  box-shadow: 0 0 18px var(--glow-a), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.friend-avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  font-size: 21px;
}

.friend-avatar.large {
  width: 88px;
  height: 88px;
  border-radius: 28px;
  font-size: 42px;
}

.friend-main b,
.friend-main small,
.friend-score b,
.friend-score small {
  display: block;
}

.friend-main small,
.friend-score small {
  margin-top: 5px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
}

.friend-score {
  text-align: right;
}

.friend-score b {
  font-family: "IBM Plex Mono", monospace;
}

.compact-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.friend-profile-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.friend-profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

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

.friend-profile-grid div {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.friend-profile-grid span,
.friend-profile-grid b {
  display: block;
}

.friend-profile-grid span {
  color: var(--dim);
  font-size: 11px;
  font-weight: 900;
}

.friend-profile-grid b {
  margin-top: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 18px;
}

.profile-layout {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.profile-orb {
  width: 200px;
}

.profile-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.level-progress {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  padding: 14px;
}

.level-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.level-progress-top b {
  color: var(--text);
}

.level-bar,
.bar-line {
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.level-bar {
  height: 10px;
  margin-top: 12px;
}

.level-bar span,
.bar-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-a), var(--accent-b), var(--accent-c));
  background-size: 180% 100%;
  box-shadow: 0 0 22px var(--glow-a);
  transition: width 0.35s ease;
  animation: glowSweep 4.5s ease-in-out infinite alternate;
}

.solver-progress-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto auto;
  gap: 9px;
  align-items: center;
}

.progress-label,
.task-label {
  font-weight: 900;
}

.task-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-nav {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  gap: 8px;
}

.nav-btn {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  font-weight: 900;
  cursor: pointer;
}

.nav-btn.active {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

.nav-btn.answered {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.nav-btn.correct {
  color: var(--ink);
  background: var(--white);
}

.nav-btn.wrong {
  color: #fff;
  background: var(--bad);
}

.question-media {
  margin-top: 14px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #fff;
}

.question-media img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #fff;
}

.question-text {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  color: var(--text);
  line-height: 1.62;
  white-space: pre-wrap;
  font-size: 15px;
}

.options-list {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.option-btn {
  border-radius: 18px;
  text-align: left;
  line-height: 1.45;
}

.option-btn.active {
  color: var(--ink);
  background: var(--white);
}

.notes-preview,
#scratchCanvas {
  width: 100%;
  max-width: 100%;
  border-radius: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  background: #f7f7f2;
  touch-action: none;
}

.notes-preview {
  margin-top: 12px;
}

.sticky-answer {
  position: sticky;
  bottom: calc(82px + env(safe-area-inset-bottom));
  z-index: 5;
}

.chips,
.formula-row {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chip,
.formula-btn {
  white-space: nowrap;
  border-radius: 999px;
  padding: 9px 12px;
}

.answer-row {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
}

input:focus {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.feedback {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  padding: 12px;
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.result-summary,
.result-details,
.stats-summary,
.stats-subjects,
.stats-recent {
  margin-top: 12px;
}

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

.insight-grid,
.analytics-layout {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.insight-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.analytics-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.insight-card,
.analytics-row,
.task-row {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  padding: 12px;
}

.insight-card span,
.insight-card small,
.analytics-row small,
.task-row small {
  display: block;
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
}

.insight-card b {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.insight-card small {
  margin-top: 6px;
  line-height: 1.35;
}

.stats-subjects,
.stats-recent,
.result-details,
.task-performance {
  display: grid;
  gap: 8px;
}

.analytics-row,
.task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.task-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.analytics-row b,
.task-row b {
  display: block;
  min-width: 0;
}

.bar-line {
  height: 7px;
  margin-top: 10px;
}

.metric-tag {
  display: grid;
  place-items: center;
  min-width: 48px;
  height: 48px;
  border-radius: 16px;
  color: var(--ink);
  background: var(--white);
  font-weight: 900;
}

.footer-panel {
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 45;
  width: min(1016px, calc(100% - 24px));
  margin: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border-radius: 24px;
  border-color: rgba(255, 255, 255, 0.2);
  background:
    radial-gradient(220px 90px at 10% 0%, var(--glow-a), transparent 74%),
    radial-gradient(240px 90px at 92% 100%, var(--glow-c), transparent 76%),
    rgba(18, 19, 24, 0.72);
  transform: translateX(-50%);
}

.footer-btn {
  position: relative;
  min-width: 0;
  border-radius: 18px;
  padding: 12px 8px;
  overflow: hidden;
}

.footer-btn span {
  position: relative;
  z-index: 1;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer-btn.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 24px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.38;
  transform: translateX(-50%);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-card {
  width: min(900px, 100%);
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 16px;
  animation: viewIn 0.22s ease both;
}

.modal-body {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  line-height: 1.58;
  white-space: pre-wrap;
}

.notes-modal {
  padding: 8px;
}

.notes-card {
  width: min(1200px, 100%);
  height: calc(100vh - 16px);
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
}

.draw-toolbar {
  position: relative;
  z-index: 1;
  align-items: center;
  flex-wrap: wrap;
}

.width-row {
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 90;
  width: min(680px, calc(100vw - 24px));
  border-radius: 18px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(18, 18, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font-size: 13px;
}

.toast.bad {
  background: rgba(111, 42, 42, 0.94);
}

.hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .boot-splash {
    display: none;
  }

  .view,
  .daily-card,
  .mode-card,
  .battle-card,
  .arena-result-card,
  .action-loader-card {
    animation-duration: 0.12s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.12s !important;
  }
}

@media (max-width: 860px) {
  .hero-stage,
  .setup-flow,
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-identity-card {
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: start;
  }

  .profile-avatar-large {
    width: 92px;
    height: 92px;
    border-radius: 26px;
    font-size: 38px;
  }

  .hero-copy {
    min-height: auto;
  }

  .quick-grid,
  .battle-grid,
  .boss-grid,
  .wallet-grid,
  .shop-grid,
  .goal-strip,
  .subscription-grid,
  .stats-summary,
  .weak-summary,
  .insight-grid,
  .analytics-layout,
  .profile-metrics {
    grid-template-columns: 1fr;
  }

  .player-card {
    min-height: 360px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) calc(104px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 24px;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto auto;
  }

  .exam-switch {
    min-width: 0;
  }

  .exam-switch .tab-btn {
    flex: 1 1 0;
    min-width: 0;
  }

  .icon-tab {
    padding-left: 10px;
    padding-right: 10px;
  }

  h2 {
    font-size: 28px;
  }

  .page-profile .big-head h2 {
    font-size: clamp(28px, 7.8vw, 36px);
    line-height: 1.02;
    letter-spacing: -0.045em;
  }

  .profile-panel .section-head {
    gap: 12px;
  }

  .profile-panel .status-pill {
    padding: 10px 14px;
    font-size: 13px;
  }

  .hero-stage,
  .progress-panel,
  .sessions-panel,
  .config-panel,
  .arena-screen,
  .boss-panel,
  .league-panel,
  .shop-panel,
  .weak-panel,
  .profile-panel,
  .friends-panel,
  .stats-panel,
  .solver-head-panel,
  .nav-panel,
  .question-panel,
  .notes-panel,
  .answer-panel,
  .result-panel {
    padding: 14px;
    border-radius: 24px;
  }

  .hero-actions {
    display: grid;
  }

  .start-dock {
    position: static;
    grid-template-columns: 1fr;
  }

  .cta-btn.big {
    width: 100%;
  }

  .section-head,
  .big-head,
  .card-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .solver-progress-row {
    grid-template-columns: auto auto 1fr auto;
    grid-template-areas:
      "prev progress timer next"
      "title title title title"
      "finish finish finish finish";
  }

  .nav-prev { grid-area: prev; }
  .progress-label { grid-area: progress; }
  .task-label { grid-area: title; white-space: normal; }
  #solverTimer { grid-area: timer; }
  .nav-next { grid-area: next; }
  .finish-btn { grid-area: finish; }

  .answer-row {
    grid-template-columns: 1fr;
  }

  .battle-start,
  .battle-status,
  .live-result-wait,
  .arena-result-hero,
  .arena-versus,
  .result-reward-grid,
  .arena-score-grid,
  .achievement-grid,
  .league-rules-grid,
  .economy-status-grid,
  .arena-history-row,
  .arena-history-main,
  .weak-row,
  .analytics-row,
  .friend-connect,
  .friend-requests-panel,
  .friend-request-column,
  .friend-search-card,
  .friend-search-row,
  .friend-list-head,
  .friend-row,
  .friend-profile-hero,
  .friend-profile-grid,
  .wallet-grid,
  .shop-grid,
  .task-row {
    grid-template-columns: 1fr;
  }

  .friend-score {
    text-align: left;
  }

  .profile-identity-card {
    gap: 12px;
    padding: 12px;
    border-radius: 24px;
  }

  .profile-avatar-large {
    width: 74px;
    height: 74px;
    border-radius: 22px;
    font-size: 32px;
  }

  .profile-avatar-large::after {
    inset: 7px;
    border-radius: 17px;
  }

  .profile-identity-form {
    gap: 9px;
  }

  .profile-identity-form label {
    gap: 5px;
    font-size: 10px;
  }

  .profile-identity-form input {
    min-height: 44px;
    border-radius: 16px;
    padding: 0 12px;
    font-size: 14px;
  }

  .avatar-picker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .avatar-option {
    min-height: 50px;
    border-radius: 16px;
    padding: 6px 4px;
  }

  .avatar-option span {
    font-size: 24px;
  }

  .avatar-option small {
    display: none;
  }

  .profile-save-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding-bottom: 14px;
  }

  .profile-save-row .muted {
    display: none;
  }

  .profile-save-row .cta-btn {
    width: 100%;
    min-height: 50px;
    justify-content: center;
  }

  .arena-history-score {
    text-align: left;
  }

  .friend-actions,
  .friend-profile-actions,
  .live-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .live-match {
    grid-template-columns: 1fr;
  }

  .sticky-answer {
    position: static;
  }

  .footer-panel {
    gap: 6px;
    padding: 7px;
    width: min(1016px, calc(100% - 20px));
  }

  .footer-btn {
    font-size: 12px;
    padding: 11px 4px;
  }

  .level-orb,
  .profile-orb {
    width: min(180px, 68vw);
  }
}

@media (max-width: 380px) {
  .top-actions {
    grid-template-columns: 1fr auto auto;
  }

  .question-nav {
    grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
    gap: 6px;
  }

  .nav-btn {
    min-height: 38px;
    border-radius: 12px;
  }
}
