/* ==========================================================================
   EmbeeTech — design system
   ========================================================================== */

:root {
  --bg: #0B0804;
  --bg-soft: #100C06;
  --surface: #171208;
  --surface-2: #20180B;
  --surface-3: #2B2110;
  --surface-4: #382B13;
  --line: rgba(255, 214, 128, 0.09);
  --line-strong: rgba(255, 214, 128, 0.18);
  --text: #FFF7E7;
  --text-soft: #F2E3C1;
  --muted: #C1AE87;
  --muted-2: #A08D66;
  --lime: #FFC531;
  --lime-deep: #E8A800;
  --violet: #F59E0B;
  --violet-deep: #D97706;
  --cyan: #FFE08A;
  --pink: #FFB84D;
  --coral: #FF8A3D;
  --amber: #ffd166;
  --green: #FFD166;
  --danger: #F2643C;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.28);
  --shadow-card: 0 22px 60px rgba(0, 0, 0, 0.32);
  --font-display: 'Sora', 'Segoe UI', sans-serif;
  --font-body: 'DM Sans', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', monospace;
  --font-tech: 'Orbitron', 'Sora', 'Segoe UI', sans-serif;
  --sidebar-w: 254px;
  --topbar-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1100px 700px at 12% -12%, rgba(217, 119, 6, 0.14), transparent 62%),
    radial-gradient(900px 600px at 100% 0%, rgba(255, 224, 138, 0.07), transparent 55%),
    var(--bg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 72%);
}

::selection {
  background: rgba(255, 197, 49, 0.85);
  color: #140E06;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.035em;
  line-height: 1.14;
}

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

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

button {
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

img, svg {
  display: block;
}

svg {
  flex: 0 0 auto;
}

code, pre, kbd {
  font-family: var(--font-mono);
}

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #4A3A22;
  border-radius: 999px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: #6B5630;
}

/* ==========================================================================
   Boot, utilities and primitives
   ========================================================================== */

.boot-loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg);
  transition: opacity 0.45s var(--ease), visibility 0.45s;
}

.boot-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.boot-logo .logo-mark {
  width: 78px;
  height: 82px;
  animation: bootFloat 2.4s ease-in-out infinite;
}

.boot-word {
  display: flex;
  align-items: baseline;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.06em;
  line-height: 1;
}

.boot-track {
  width: 160px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.boot-track span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--cyan), var(--lime));
  animation: bootSlide 1.15s ease-in-out infinite;
}

.boot-loader p {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

@keyframes bootFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-6px) rotate(1deg); }
}

@keyframes bootSlide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(360%); }
}

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 30px;
  background: var(--bg);
  color: var(--text);
  text-align: center;
}

.logo-mark {
  width: 43px;
  height: 46px;
  display: block;
  flex: 0 0 auto;
  position: relative;
  overflow: visible;
}

.bee-mark-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 8px rgba(255, 212, 0, 0.16));
  user-select: none;
  -webkit-user-drag: none;
}

.logo-mark.sm {
  width: 30px;
  height: 32px;
}

.logo-mark.lg {
  width: 56px;
  height: 59px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-word {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.06em;
  line-height: 1;
  white-space: nowrap;
}

.bw-em {
  color: #fff8e8;
}

.bw-bee {
  color: transparent;
  background-image: repeating-linear-gradient(125deg, #ffe000 0 6px, #0b0804 6px 10px);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 7px rgba(255, 212, 0, 0.16));
}

.bw-tech {
  position: relative;
  display: inline-block;
  margin-left: 0.13em;
  color: transparent;
  font-family: var(--font-tech);
  font-size: 0.68em;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff7e7 0%, #ffd166 50%, #e8a800 100%);
  -webkit-background-clip: text;
  background-clip: text;
  transform: translateY(-0.02em);
}

.bw-tech::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0.1em;
  bottom: -0.16em;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 197, 49, 0), #ffc531, rgba(255, 197, 49, 0));
  box-shadow: 0 0 7px rgba(255, 197, 49, 0.7);
}

.bw-tech::before {
  content: '';
  position: absolute;
  right: -0.16em;
  top: 40%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ffd400;
  box-shadow: 0 0 7px #ffd400;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 14px var(--lime);
}

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

.text-gradient {
  background: linear-gradient(100deg, var(--lime) 0%, var(--cyan) 48%, #FFD166 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hidden {
  display: none !important;
}

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

.stack {
  display: flex;
  flex-direction: column;
}

.btn {
  --btn-bg: var(--surface-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--btn-bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), background 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(105deg, #FFE082 0%, #FFC531 42%, #FFD166 100%);
  color: #1A1206;
  box-shadow: 0 10px 30px rgba(255, 197, 49, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-primary:hover {
  box-shadow: 0 14px 38px rgba(255, 197, 49, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.24);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background: rgba(242, 100, 60, 0.12);
  border-color: rgba(242, 100, 60, 0.22);
  color: #FFC0A2;
}

.btn-danger:hover {
  background: rgba(242, 100, 60, 0.18);
}

.btn-violet {
  background: linear-gradient(105deg, #D97706, #F59E0B);
  color: #fff;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.2);
}

.btn-sm {
  height: 36px;
  padding: 0 13px;
  border-radius: 10px;
  font-size: 12.5px;
}

.btn-lg {
  height: 50px;
  padding: 0 24px;
  border-radius: 14px;
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

.btn .spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
}

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

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  transition: color 0.18s, background 0.18s, border-color 0.18s, transform 0.18s;
  position: relative;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.icon-btn.sm {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pill-lime {
  background: rgba(255, 197, 49, 0.09);
  border-color: rgba(255, 197, 49, 0.2);
  color: #FFE082;
}

.pill-violet {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
  color: #FFD166;
}

.pill-cyan {
  background: rgba(255, 224, 138, 0.09);
  border-color: rgba(255, 224, 138, 0.2);
  color: #FFE08A;
}

.pill-amber {
  background: rgba(255, 209, 102, 0.09);
  border-color: rgba(255, 209, 102, 0.2);
  color: #ffe09a;
}

.pill-danger {
  background: rgba(242, 100, 60, 0.09);
  border-color: rgba(242, 100, 60, 0.2);
  color: #FFC7A8;
}

.avatar {
  aspect-ratio: 1;
  border-radius: 50% !important;
  --avatar-color: #F59E0B;
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  position: relative;
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.2), transparent 42%),
    color-mix(in srgb, var(--avatar-color) 28%, #181107);
  border: 1px solid color-mix(in srgb, var(--avatar-color) 45%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
  font-size: 20px;
  line-height: 1;
}

.avatar.sm {
  width: 32px;
  height: 32px;
  font-size: 15px;
}

.avatar.lg {
  width: 56px;
  height: 56px;
  font-size: 27px;
}

.avatar.xl {
  width: 88px;
  height: 88px;
  font-size: 42px;
  border-width: 2px;
}

.avatar .online-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #FBBF24;
  border: 2px solid var(--surface);
  box-shadow: 0 0 10px rgba(255, 197, 49, 0.7);
}

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack .avatar {
  margin-left: -9px;
  border: 2px solid var(--surface);
}

.avatar-stack .avatar:first-child {
  margin-left: 0;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(255, 197, 49, 0.1);
  border: 1px solid rgba(255, 197, 49, 0.18);
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  overflow: hidden;
}

.progress-track > span {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--track, var(--violet)), var(--track-accent, var(--cyan)));
  box-shadow: 0 0 12px color-mix(in srgb, var(--track, #F59E0B) 45%, transparent);
  transition: width 0.7s var(--ease);
}

.progress-track.thin {
  height: 4px;
}

.panel {
  background: rgba(24, 18, 8, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel-link {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  transition: color 0.18s;
}

.panel-link:hover {
  color: var(--lime);
}

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

.section-head h2 {
  font-size: 20px;
  font-weight: 700;
}

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

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  transition: color 0.18s;
}

.section-link:hover {
  color: var(--lime);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 22px;
  gap: 8px;
  color: var(--muted);
}

.empty-state .empty-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  margin-bottom: 4px;
}

.empty-state h3 {
  color: var(--text);
  font-size: 15px;
}

.empty-state p {
  max-width: 340px;
  font-size: 12.5px;
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* ==========================================================================
   Auth
   ========================================================================== */

.auth-page {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(440px, 0.88fr);
  position: relative;
  z-index: 1;
  background: var(--bg);
}

.auth-art {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding: 44px 54px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(800px 600px at 20% 20%, rgba(217, 119, 6, 0.32), transparent 62%),
    radial-gradient(600px 500px at 82% 78%, rgba(255, 224, 138, 0.16), transparent 60%),
    radial-gradient(420px 380px at 60% 8%, rgba(255, 197, 49, 0.08), transparent 60%),
    #100B05;
  border-right: 1px solid var(--line);
}

.auth-art::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at 45% 45%, #000 0%, transparent 78%);
  pointer-events: none;
}

.auth-art::after {
  content: '';
  position: absolute;
  width: 460px;
  height: 460px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  right: -170px;
  bottom: -170px;
  box-shadow: 0 0 0 70px rgba(255, 255, 255, 0.018), 0 0 0 140px rgba(255, 255, 255, 0.012);
  pointer-events: none;
}

.auth-art > * {
  position: relative;
  z-index: 2;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.auth-brand .brand-word {
  font-size: 23px;
}

.auth-art-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-copy {
  margin-top: auto;
  margin-bottom: auto;
  padding: 70px 0 80px;
  max-width: 650px;
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #FFE082;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255, 197, 49, 0.2);
  background: rgba(255, 197, 49, 0.07);
  margin-bottom: 24px;
}

.auth-kicker .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 197, 49, 0.45); }
  55% { box-shadow: 0 0 0 8px rgba(255, 197, 49, 0); }
}

.auth-copy h1 {
  font-size: clamp(42px, 4.6vw, 66px);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1.02;
}

.auth-copy h1 .line-accent {
  background: linear-gradient(100deg, #FFF0B8 0%, #FFC531 45%, #F59E0B 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.auth-copy > p {
  color: #C5B693;
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.65;
  max-width: 500px;
  margin-top: 24px;
}

.auth-features {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 30px;
}

.auth-feature {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  color: #D8C9A8;
  font-size: 11.5px;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.auth-feature svg {
  color: var(--lime);
}

.auth-proof {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 40px;
}

.auth-proof .avatar-stack .avatar {
  border-color: #140E06;
}

.auth-proof-text {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.auth-proof-text strong {
  color: var(--text);
  font-weight: 700;
}

.auth-stats {
  display: flex;
  gap: 38px;
  margin-top: 48px;
  padding-top: 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.auth-stat span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}

.auth-float {
  position: absolute;
  z-index: 3;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(26, 19, 8, 0.82);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
  pointer-events: none;
  animation: floatCard 6s ease-in-out infinite;
}

.auth-float.code-float {
  top: 16%;
  right: 5.5%;
  width: 238px;
  transform: rotate(2deg);
  padding: 14px;
}

.auth-float.code-float .float-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.auth-float.code-float .float-file {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
}

.auth-float.code-float pre {
  margin: 0;
  color: #E8DDC3;
  font-size: 10px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.auth-float.xp-float {
  right: 12%;
  bottom: 17%;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  gap: 11px;
  animation-delay: -2.5s;
}

.auth-float.xp-float .xp-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 197, 49, 0.12);
  color: var(--lime);
}

.auth-float.xp-float strong {
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
}

.auth-float.xp-float span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.auth-float.duel-float {
  top: 35%;
  right: 2.5%;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  animation-delay: -4s;
}

.auth-float.duel-float .vs {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  color: var(--coral);
  padding: 0 2px;
}

.auth-float.duel-float .duel-label {
  color: var(--muted);
  font-size: 9.5px;
}

@keyframes floatCard {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -9px; }
}

.auth-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 42px 34px;
  position: relative;
  overflow-y: auto;
  background:
    radial-gradient(600px 500px at 80% 0%, rgba(217, 119, 6, 0.08), transparent 60%),
    #0B0804;
}

.auth-card {
  width: 100%;
  max-width: 418px;
  position: relative;
  z-index: 1;
}

.auth-mobile-brand {
  display: none;
  justify-content: center;
  margin-bottom: 30px;
}

.auth-card-head h2 {
  font-size: 31px;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.auth-card-head p {
  color: var(--muted);
  margin-top: 8px;
  font-size: 13.5px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin: 28px 0 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.auth-tab {
  height: 39px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.auth-tab.is-active {
  color: var(--text);
  background: #261C0C;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 700;
}

.field label .field-hint {
  color: var(--muted-2);
  font-weight: 500;
  font-size: 10.5px;
}

.field-input {
  position: relative;
  display: flex;
  align-items: center;
}

.field-input > svg {
  position: absolute;
  left: 13px;
  color: var(--muted-2);
  pointer-events: none;
  transition: color 0.18s;
}

.field-input input,
.field-input select,
.field-input textarea {
  width: 100%;
  height: 47px;
  padding: 0 42px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 13.5px;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  appearance: none;
}

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

.field-input input:focus,
.field-input select:focus,
.field-input textarea:focus {
  outline: 0;
  border-color: rgba(255, 197, 49, 0.5);
  background: rgba(255, 197, 49, 0.025);
  box-shadow: 0 0 0 3px rgba(255, 197, 49, 0.08);
}

.field-input:focus-within > svg {
  color: var(--lime);
}

.field-input .input-action {
  position: absolute;
  right: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
}

.field-input .input-action:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.field-input.has-icon input {
  padding-left: 42px;
  padding-right: 14px;
}

.field-input .password-toggle + input {
  padding-right: 44px;
}

.form-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(242, 100, 60, 0.09);
  border: 1px solid rgba(242, 100, 60, 0.19);
  color: #FFC7A8;
  font-size: 11.5px;
  line-height: 1.5;
}

.form-error:empty {
  display: none;
}

.auth-submit {
  margin-top: 3px;
  height: 48px;
}

.auth-help-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10.5px;
}

.auth-text-link {
  color: var(--lime);
  font-size: 10.5px;
  font-weight: 800;
  padding: 0;
  text-align: left;
  transition: color 0.18s, text-shadow 0.18s;
}

.auth-text-link:hover {
  color: var(--text);
  text-shadow: 0 0 18px rgba(255, 197, 49, 0.35);
}

.recovery-info {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  margin-bottom: 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 197, 49, 0.18);
  background: rgba(255, 197, 49, 0.05);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.recovery-info svg {
  color: var(--lime);
  margin-top: 1px;
}

.recovery-sent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 197, 49, 0.22);
  background:
    radial-gradient(220px 120px at 100% 0%, rgba(255, 197, 49, 0.1), transparent 70%),
    rgba(255, 197, 49, 0.045);
}

.recovery-sent > svg {
  color: var(--lime);
  margin-top: 1px;
}

.recovery-sent strong {
  display: block;
  color: var(--text);
  font-size: 12px;
}

.recovery-sent p {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
  margin-top: 3px;
}

.recovery-info code {
  color: var(--lime);
  font-size: 10px;
  background: rgba(255, 197, 49, 0.08);
  padding: 1px 4px;
  border-radius: 4px;
}

.recovery-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 197, 49, 0.35);
  background:
    radial-gradient(200px 100px at 100% 0%, rgba(255, 197, 49, 0.1), transparent 70%),
    rgba(255, 197, 49, 0.04);
}

.recovery-code-box span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.recovery-code-box strong {
  display: block;
  margin-top: 3px;
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 25px;
  letter-spacing: 0.2em;
  line-height: 1.1;
}

.recovery-footer-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal .modal-actions {
  margin-top: 6px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 21px 0 15px;
  color: var(--muted-2);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

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

.demo-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 197, 49, 0.25);
  background: linear-gradient(120deg, rgba(255, 197, 49, 0.055), rgba(245, 158, 11, 0.05));
  transition: border-color 0.18s, background 0.18s;
}

.demo-card:hover {
  border-color: rgba(255, 197, 49, 0.5);
  background: linear-gradient(120deg, rgba(255, 197, 49, 0.08), rgba(245, 158, 11, 0.07));
}

.demo-card .demo-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 197, 49, 0.12);
  color: var(--lime);
}

.demo-card .demo-text {
  flex: 1;
  min-width: 0;
}

.demo-card strong {
  display: block;
  font-size: 11.5px;
}

.demo-card span {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  margin-top: 2px;
}

.demo-card .btn {
  flex: 0 0 auto;
}

.auth-legal {
  color: var(--muted-2);
  font-size: 10.5px;
  text-align: center;
  line-height: 1.55;
  margin-top: 22px;
}

.auth-legal a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-foot {
  margin-top: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: 10px;
}

.auth-foot .code-dots {
  font-family: var(--font-mono);
  color: var(--lime);
}

.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.password-strength span {
  height: 3px;
  flex: 1;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.2s;
}

.password-strength span.is-on {
  background: var(--lime);
}

.password-strength span.is-mid {
  background: var(--amber);
}

.password-strength span.is-weak {
  background: var(--danger);
}

/* ==========================================================================
   App shell
   ========================================================================== */

.shell {
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 20px 15px 18px;
  background: rgba(18, 13, 6, 0.94);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(22px);
}

.sidebar .brand {
  padding: 6px 9px 24px;
}

.sidebar .brand-word {
  font-size: 19px;
}

.sidebar-label {
  padding: 0 12px;
  margin: 5px 0 8px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 45px;
  padding: 0 12px;
  border-radius: 11px;
  color: #C5B693;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.18s, background 0.18s;
}

.nav-link svg {
  color: #9A8862;
  transition: color 0.18s;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.nav-link:hover svg {
  color: #E8DDC3;
}

.nav-link.is-active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(255, 197, 49, 0.105), rgba(255, 197, 49, 0.02));
}

.nav-link.is-active::before {
  content: '';
  position: absolute;
  left: -15px;
  top: 11px;
  bottom: 11px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--lime);
  box-shadow: 0 0 14px rgba(255, 197, 49, 0.5);
}

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

.nav-link .nav-badge {
  margin-left: auto;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(242, 100, 60, 0.18);
  color: #FFCBAD;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
}

.nav-link .nav-badge.lime {
  background: rgba(255, 197, 49, 0.13);
  color: var(--lime);
}

.sidebar-spacer {
  flex: 1;
  min-height: 20px;
}

.side-quest {
  position: relative;
  overflow: hidden;
  padding: 15px;
  border-radius: 16px;
  border: 1px solid rgba(255, 197, 49, 0.15);
  background:
    radial-gradient(120px 120px at 100% 0%, rgba(255, 197, 49, 0.15), transparent 70%),
    linear-gradient(145deg, rgba(255, 197, 49, 0.07), rgba(245, 158, 11, 0.07));
  margin-bottom: 14px;
}

.side-quest::after {
  content: '</>';
  position: absolute;
  right: -3px;
  bottom: -8px;
  font-family: var(--font-mono);
  font-size: 43px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.035);
  letter-spacing: -0.15em;
  pointer-events: none;
}

.side-quest .quest-top {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--lime);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.side-quest h4 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}

.side-quest p {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

.side-quest .btn {
  width: 100%;
  margin-top: 12px;
  height: 34px;
  font-size: 11px;
  position: relative;
  z-index: 1;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.18s, border-color 0.18s;
}

.sidebar-user:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

.sidebar-user-info {
  min-width: 0;
  flex: 1;
}

.sidebar-user-info strong {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-info span {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .logout-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted-2);
  flex: 0 0 auto;
}

.sidebar-user .logout-btn:hover {
  color: var(--danger);
  background: rgba(242, 100, 60, 0.08);
}

.main-shell {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  position: relative;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 11, 5, 0.78);
  backdrop-filter: blur(20px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.topbar-mobile-brand {
  display: none;
  align-items: center;
  gap: 9px;
}

.topbar-context {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
}

.topbar-context strong {
  color: var(--text);
  font-weight: 600;
}

.topbar-context .slash {
  color: var(--muted-2);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.streak-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid rgba(255, 209, 102, 0.16);
  background: rgba(255, 209, 102, 0.06);
  color: #ffe3a0;
  font-size: 11.5px;
  font-weight: 700;
}

.streak-pill .flame {
  font-size: 14px;
  filter: drop-shadow(0 0 8px rgba(255, 150, 70, 0.5));
}

.streak-pill small {
  color: rgba(255, 227, 160, 0.55);
  font-size: 9.5px;
  font-weight: 600;
}

.notif-button .unread-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  border: 2px solid #140E06;
  box-shadow: 0 0 8px rgba(255, 138, 61, 0.65);
}

.topbar-avatar {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 0;
  transition: transform 0.18s, border-color 0.18s;
}

.topbar-avatar:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 197, 49, 0.35);
}

.view {
  max-width: 1500px;
  margin: 0 auto;
  padding: 32px 34px 70px;
  position: relative;
  z-index: 1;
}

.mobile-nav {
  display: none;
}

.mobile-menu-btn {
  display: none;
}

/* ==========================================================================
   Page headings and dashboard
   ========================================================================== */

.page-enter > * {
  animation: fadeUp 0.55s var(--ease) both;
}

.page-enter > *:nth-child(2) { animation-delay: 0.04s; }
.page-enter > *:nth-child(3) { animation-delay: 0.08s; }
.page-enter > *:nth-child(4) { animation-delay: 0.12s; }

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

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.page-heading .eyebrow {
  margin-bottom: 8px;
}

.page-heading h1 {
  font-size: clamp(25px, 2.6vw, 34px);
  font-weight: 700;
  letter-spacing: -0.05em;
}

.page-heading h1 .wave {
  display: inline-block;
  animation: wave 2.4s ease-in-out infinite;
  transform-origin: 70% 70%;
}

@keyframes wave {
  0%, 50%, 100% { transform: rotate(0); }
  6% { transform: rotate(16deg); }
  12% { transform: rotate(-8deg); }
  18% { transform: rotate(14deg); }
  24% { transform: rotate(-4deg); }
  30% { transform: rotate(10deg); }
  36% { transform: rotate(0); }
}

.page-heading p {
  color: var(--muted);
  margin-top: 6px;
  font-size: 13px;
}

.page-heading-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}

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

.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.dashboard-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.continue-card {
  --track: #F59E0B;
  --track-accent: #FFE08A;
  position: relative;
  overflow: hidden;
  min-height: 247px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
  padding: 28px 30px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(480px 300px at 95% -20%, color-mix(in srgb, var(--track) 32%, transparent), transparent 70%),
    radial-gradient(400px 300px at 58% 120%, rgba(255, 224, 138, 0.08), transparent 65%),
    linear-gradient(135deg, #241A0C 0%, #1B1409 55%, #140E06 100%);
  box-shadow: var(--shadow-soft);
  isolation: isolate;
}

.continue-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(90deg, transparent 0%, #000 60%, #000 100%);
  pointer-events: none;
  z-index: -1;
}

.continue-card::after {
  content: '';
  position: absolute;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  top: -90px;
  right: -45px;
  box-shadow: 0 0 0 45px rgba(255, 255, 255, 0.018), 0 0 0 90px rgba(255, 255, 255, 0.012);
  pointer-events: none;
}

.continue-content {
  position: relative;
  z-index: 2;
  align-self: center;
  max-width: 520px;
}

.continue-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: color-mix(in srgb, var(--track-accent) 82%, white);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  margin-bottom: 13px;
}

.continue-label .line {
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.continue-card h2 {
  font-size: clamp(22px, 2.4vw, 31px);
  font-weight: 700;
  letter-spacing: -0.05em;
  max-width: 480px;
}

.continue-card .continue-desc {
  color: #C5B693;
  font-size: 12.5px;
  line-height: 1.55;
  margin-top: 9px;
  max-width: 440px;
}

.continue-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 17px 0 19px;
}

.continue-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.continue-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.continue-ring {
  --progress: 0;
  width: 172px;
  height: 172px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--track) calc(var(--progress) * 1%), rgba(255, 255, 255, 0.075) 0);
  box-shadow: 0 0 50px color-mix(in srgb, var(--track) 18%, transparent);
}

.continue-ring::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #1C1408;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.continue-ring-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.continue-ring-inner .lang-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 7px;
  font-size: 18px;
  border-radius: 17px;
}

.continue-ring-inner strong {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.04em;
}

.continue-ring-inner span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 1px;
}

.float-code {
  position: absolute;
  z-index: 3;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.28);
  font-size: 11px;
  pointer-events: none;
  user-select: none;
}

.float-code.one {
  top: 23px;
  right: 30px;
  color: color-mix(in srgb, var(--track-accent) 68%, transparent);
}

.float-code.two {
  bottom: 24px;
  right: 58px;
  color: rgba(255, 255, 255, 0.19);
}

.lang-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  color: var(--track, var(--violet));
  background: color-mix(in srgb, var(--track, #F59E0B) 14%, #181107);
  border: 1px solid color-mix(in srgb, var(--track, #F59E0B) 32%, transparent);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.06em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.lang-icon.sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 10.5px;
}

.lang-icon.lg {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  font-size: 19px;
}

.lang-icon.xl {
  width: 92px;
  height: 92px;
  border-radius: 26px;
  font-size: 28px;
}

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

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 17px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(26, 19, 9, 0.72);
  min-width: 0;
}

.stat-card::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  right: -28px;
  top: -30px;
  background: var(--stat-color, var(--violet));
  opacity: 0.06;
  filter: blur(3px);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 11px;
}

.stat-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--stat-color, var(--violet));
  background: color-mix(in srgb, var(--stat-color, #F59E0B) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--stat-color, #F59E0B) 16%, transparent);
}

.stat-card .stat-trend {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.02em;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.1;
}

.stat-label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  margin-top: 3px;
}

.mini-progress {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
}

.mini-progress .progress-track {
  flex: 1;
}

.mini-progress span {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  white-space: nowrap;
}

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

.track-card {
  --track: #F59E0B;
  --track-accent: #FFE08A;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 174px;
  padding: 16px;
  border-radius: 17px;
  border: 1px solid var(--line);
  background:
    radial-gradient(180px 120px at 110% -20%, color-mix(in srgb, var(--track) 12%, transparent), transparent 70%),
    rgba(26, 19, 9, 0.76);
  transition: transform 0.24s var(--ease), border-color 0.24s, background 0.24s, box-shadow 0.24s;
  overflow: hidden;
}

.track-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--track) 40%, transparent);
  background:
    radial-gradient(200px 140px at 110% -20%, color-mix(in srgb, var(--track) 17%, transparent), transparent 70%),
    rgba(31, 23, 10, 0.9);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.22);
}

.track-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.track-card h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.track-card .track-desc {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.track-card .track-footer {
  margin-top: auto;
  padding-top: 13px;
}

.track-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 600;
  margin-bottom: 7px;
}

.track-meta .xp {
  color: var(--track);
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.daily-tip {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--tip-color, #FFC531) 20%, transparent);
  background:
    radial-gradient(300px 180px at 96% 0%, color-mix(in srgb, var(--tip-color, #FFC531) 12%, transparent), transparent 70%),
    linear-gradient(120deg, rgba(30, 22, 11, 0.88), rgba(22, 16, 8, 0.9));
}

.daily-tip::after {
  content: '💡';
  position: absolute;
  right: 18px;
  bottom: -16px;
  font-size: 85px;
  opacity: 0.045;
  transform: rotate(-8deg);
  pointer-events: none;
}

.daily-tip-icon {
  width: 41px;
  height: 41px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: color-mix(in srgb, var(--tip-color, #FFC531) 12%, transparent);
  color: var(--tip-color, var(--lime));
  border: 1px solid color-mix(in srgb, var(--tip-color, #FFC531) 20%, transparent);
}

.daily-tip-content {
  min-width: 0;
}

.daily-tip-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--tip-color, var(--lime));
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.daily-tip h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.daily-tip p {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
  margin-top: 4px;
  max-width: 590px;
}

.leaderboard-mini {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.leader-row {
  display: grid;
  grid-template-columns: 20px 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 7px;
  border-radius: 9px;
  transition: background 0.18s;
}

.leader-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.leader-row.is-me {
  background: rgba(255, 197, 49, 0.055);
}

.leader-rank {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted-2);
  text-align: center;
}

.leader-rank.top-1 { color: #ffd166; }
.leader-rank.top-2 { color: #F3E6C8; }
.leader-rank.top-3 { color: #e3a778; }

.leader-name {
  min-width: 0;
}

.leader-name strong {
  display: block;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leader-name span {
  display: block;
  color: var(--muted-2);
  font-size: 8.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leader-xp {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.leader-xp strong {
  color: var(--text);
  font-size: 9.5px;
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.activity-item {
  display: flex;
  gap: 10px;
  padding: 9px 4px;
  position: relative;
  min-width: 0;
}

.activity-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  margin-top: 1px;
}

.activity-item[data-type='lesson'] .activity-icon {
  color: var(--cyan);
  background: rgba(255, 224, 138, 0.075);
}

.activity-item[data-type='duel'] .activity-icon {
  color: var(--coral);
  background: rgba(255, 138, 61, 0.075);
}

.activity-item[data-type='badge'] .activity-icon {
  color: var(--amber);
  background: rgba(255, 209, 102, 0.075);
}

.activity-body {
  min-width: 0;
  flex: 1;
}

.activity-body p {
  color: var(--text-soft);
  font-size: 10.5px;
  line-height: 1.45;
}

.activity-body p strong {
  color: var(--text);
  font-weight: 700;
}

.activity-time {
  display: block;
  color: var(--muted-2);
  font-size: 8.5px;
  margin-top: 2px;
}

.arena-mini {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(160px 150px at 100% 0%, rgba(255, 138, 61, 0.22), transparent 70%),
    linear-gradient(135deg, #2C1D0C, #1F1609);
}

.arena-mini::after {
  content: 'VS';
  position: absolute;
  right: 5px;
  bottom: -16px;
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 800;
  letter-spacing: -0.1em;
  color: rgba(255, 255, 255, 0.035);
  pointer-events: none;
}

.arena-mini .mini-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--coral);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.arena-mini h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
}

.arena-mini p {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
  margin-top: 5px;
  max-width: 220px;
  position: relative;
  z-index: 1;
}

.arena-mini .btn {
  margin-top: 13px;
  height: 35px;
  font-size: 11px;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Tracks page
   ========================================================================== */

.tracks-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 23px 26px;
  margin-bottom: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.09);
  background:
    radial-gradient(400px 220px at 88% 0%, rgba(245, 158, 11, 0.19), transparent 70%),
    radial-gradient(300px 200px at 65% 120%, rgba(255, 224, 138, 0.1), transparent 70%),
    linear-gradient(120deg, #23190A, #140E06);
}

.tracks-banner-copy {
  position: relative;
  z-index: 1;
}

.tracks-banner h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.tracks-banner p {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 4px;
  max-width: 500px;
}

.tracks-banner-stats {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}

.banner-stat {
  min-width: 72px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
}

.banner-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: -0.04em;
}

.banner-stat span {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 1px;
}

.tracks-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 19px;
}

.search-box {
  position: relative;
  width: 280px;
  max-width: 100%;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 40px;
  padding: 0 13px 0 37px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 12px;
  transition: border-color 0.18s, background 0.18s;
}

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

.search-box input:focus {
  outline: 0;
  border-color: rgba(255, 197, 49, 0.4);
  background: rgba(255, 197, 49, 0.02);
}

.filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  height: 35px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}

.chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.chip.is-active {
  color: #120D06;
  border-color: var(--lime);
  background: var(--lime);
}

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

.track-card-lg {
  --track: #F59E0B;
  --track-accent: #FFE08A;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 248px;
  padding: 20px;
  border-radius: 19px;
  border: 1px solid var(--line);
  background:
    radial-gradient(260px 160px at 108% -15%, color-mix(in srgb, var(--track) 13%, transparent), transparent 72%),
    rgba(26, 19, 9, 0.75);
  transition: transform 0.24s var(--ease), border-color 0.24s, box-shadow 0.24s, background 0.24s;
  overflow: hidden;
}

.track-card-lg:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--track) 38%, transparent);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  background:
    radial-gradient(280px 170px at 108% -15%, color-mix(in srgb, var(--track) 19%, transparent), transparent 72%),
    rgba(30, 22, 10, 0.92);
}

.track-card-lg .track-card-top {
  margin-bottom: 16px;
}

.track-card-lg h3 {
  font-size: 18px;
  letter-spacing: -0.035em;
}

.track-card-lg .track-tagline {
  color: var(--text-soft);
  font-size: 11.5px;
  margin-top: 3px;
}

.track-card-lg .track-desc {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  margin-top: 7px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.track-card-lg .track-footer {
  margin-top: auto;
  padding-top: 18px;
}

.track-card-lg .track-stats-line {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--muted-2);
  font-size: 9.5px;
  margin-bottom: 9px;
}

.track-card-lg .track-stats-line span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.track-card-lg .track-progress-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.track-card-lg .track-progress-line .progress-track {
  flex: 1;
}

.track-card-lg .track-progress-line span {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 8.5px;
  min-width: 29px;
  text-align: right;
}

.track-card-lg .difficulty {
  font-size: 8.5px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border: 1px solid var(--line);
}

/* ==========================================================================
   Track detail
   ========================================================================== */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  margin-bottom: 18px;
  transition: color 0.18s;
}

.back-link:hover {
  color: var(--lime);
}

.track-hero {
  --track: #F59E0B;
  --track-accent: #FFE08A;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 30px;
  border-radius: var(--radius-xl);
  border: 1px solid color-mix(in srgb, var(--track) 22%, transparent);
  background:
    radial-gradient(430px 300px at 10% 0%, color-mix(in srgb, var(--track) 25%, transparent), transparent 70%),
    radial-gradient(350px 260px at 100% 110%, rgba(255, 224, 138, 0.08), transparent 70%),
    linear-gradient(135deg, #241A0C, #171006);
  margin-bottom: 24px;
}

.track-hero::after {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  right: -80px;
  top: -100px;
  box-shadow: 0 0 0 44px rgba(255, 255, 255, 0.014), 0 0 0 88px rgba(255, 255, 255, 0.009);
  pointer-events: none;
}

.track-hero-icon {
  position: relative;
  z-index: 1;
}

.track-hero-content {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
}

.track-hero-content .eyebrow {
  margin-bottom: 8px;
}

.track-hero h1 {
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 800;
  letter-spacing: -0.055em;
}

.track-hero p {
  color: #C8B995;
  font-size: 13px;
  line-height: 1.6;
  max-width: 600px;
  margin-top: 8px;
}

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

.track-level-path {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}

.level-path-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.028);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.level-path-item strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.level-dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px rgba(255, 197, 49, 0.55);
}

.lesson-level-group[data-level='Intermediário'] .level-dot {
  background: var(--coral);
  box-shadow: 0 0 8px rgba(255, 138, 61, 0.5);
}

.lesson-level-group[data-level='Avançado'] .level-dot {
  background: var(--pink);
  box-shadow: 0 0 8px rgba(255, 184, 77, 0.5);
}

.track-hero-progress {
  width: 190px;
  flex: 0 0 auto;
  padding: 16px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(13, 9, 4, 0.32);
  position: relative;
  z-index: 1;
  backdrop-filter: blur(10px);
}

.track-hero-progress .progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.track-hero-progress .progress-head span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
}

.track-hero-progress .progress-head strong {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.04em;
}

.track-hero-progress p {
  color: var(--muted);
  font-size: 9.5px;
  margin: 8px 0 0;
}

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

.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lesson-level-group {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.lesson-level-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 7px;
  border-bottom: 1px solid var(--line);
}

.lesson-level-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lesson-level-count {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  white-space: nowrap;
}

.lesson-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 32px;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(26, 19, 9, 0.66);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.lesson-row:hover {
  transform: translateX(3px);
  background: rgba(31, 23, 10, 0.9);
  border-color: var(--line-strong);
}

.lesson-row.is-completed {
  border-color: rgba(255, 209, 102, 0.13);
}

.lesson-number {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.lesson-row.is-completed .lesson-number {
  color: #071a16;
  background: var(--green);
  border-color: var(--green);
}

.lesson-info {
  min-width: 0;
}

.lesson-info h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lesson-info p {
  color: var(--muted);
  font-size: 10.5px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lesson-row-meta {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--muted-2);
  font-size: 9px;
  white-space: nowrap;
}

.lesson-row-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lesson-row-arrow {
  color: var(--muted-2);
  display: grid;
  place-items: center;
}

.lesson-row:hover .lesson-row-arrow {
  color: var(--lime);
}

.track-side-card {
  position: sticky;
  top: calc(var(--topbar-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.track-side-panel {
  padding: 19px;
  border-radius: 17px;
  border: 1px solid var(--line);
  background: rgba(26, 19, 9, 0.7);
}

.track-side-panel h3 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  list-style: none;
}

.check-list li svg {
  color: var(--green);
  margin-top: 2px;
}

.track-tip-box {
  padding: 15px;
  border-radius: 14px;
  border: 1px solid rgba(255, 209, 102, 0.16);
  background: rgba(255, 209, 102, 0.055);
}

.track-tip-box .tip-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--amber);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.track-tip-box p {
  color: #D9C8A4;
  font-size: 10.5px;
  line-height: 1.55;
}

.track-side-cta {
  background:
    radial-gradient(200px 150px at 100% 0%, rgba(255, 197, 49, 0.13), transparent 70%),
    linear-gradient(135deg, #261B0B, #181107);
  border-color: rgba(255, 197, 49, 0.14);
}

.track-side-cta p {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
  margin-bottom: 12px;
}

/* ==========================================================================
   Code window & lesson
   ========================================================================== */

.code-window {
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #080604;
  overflow: hidden;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.25);
}

.code-head {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}

.code-dots {
  display: flex;
  gap: 5px;
}

.code-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4A3A22;
}

.code-dots span:nth-child(1) { background: #FF7A45; }
.code-dots span:nth-child(2) { background: #ffd166; }
.code-dots span:nth-child(3) { background: #FFD166; }

.code-file {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.code-file svg {
  opacity: 0.6;
}

.code-lang {
  margin-left: auto;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.code-window pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  color: #E8DDC3;
  font-size: 11.5px;
  line-height: 1.85;
  tab-size: 2;
}

.code-window code {
  font-family: var(--font-mono);
}

.tok-kw { color: #FFD166; }
.tok-str { color: #FFE082; }
.tok-num { color: #ffcb8d; }
.tok-com { color: #827253; font-style: italic; }
.tok-fn { color: #FFE08A; }
.tok-type { color: #FFB84D; }
.tok-punc { color: #A89570; }

.lesson-page {
  max-width: 1220px;
  margin: 0 auto;
}

.lesson-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 16px;
}

.lesson-topline .back-link {
  margin: 0;
}

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

.lesson-main {
  display: flex;
  flex-direction: column;
  gap: 17px;
  min-width: 0;
}

.lesson-header {
  position: relative;
  overflow: hidden;
  padding: 27px 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(300px 180px at 100% 0%, color-mix(in srgb, var(--track, #F59E0B) 15%, transparent), transparent 70%),
    rgba(26, 19, 9, 0.75);
}

.lesson-header h1 {
  font-size: clamp(25px, 3vw, 35px);
  font-weight: 800;
  letter-spacing: -0.055em;
  margin-top: 9px;
}

.lesson-header .lesson-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

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

.lesson-section {
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(24, 18, 8, 0.72);
}

.lesson-section h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.lesson-section > p {
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.65;
}

.lesson-section .code-window {
  margin-top: 16px;
}

.key-points {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 13px;
}

.key-point {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.55;
}

.key-point .num {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 6px;
  background: rgba(255, 197, 49, 0.08);
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  margin-top: 1px;
}

.lesson-tip {
  display: flex;
  gap: 12px;
  padding: 16px 17px;
  border-radius: 14px;
  border: 1px solid rgba(255, 209, 102, 0.17);
  background: rgba(255, 209, 102, 0.055);
}

.lesson-tip .tip-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: rgba(255, 209, 102, 0.12);
  color: var(--amber);
}

.lesson-tip strong {
  display: block;
  color: var(--amber);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.lesson-tip p {
  color: #cabf9f;
  font-size: 11.5px;
  line-height: 1.55;
}

.lesson-tip code {
  color: #f6df9e;
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 4px;
  border-radius: 4px;
}

.lesson-side {
  position: sticky;
  top: calc(var(--topbar-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lesson-progress-card {
  padding: 19px;
  border-radius: 17px;
  border: 1px solid var(--line);
  background: rgba(26, 19, 9, 0.75);
}

.lesson-progress-card h3 {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 13px;
}

.lesson-steps {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.lesson-step {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 10.5px;
}

.lesson-step .step-dot {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--muted-2);
}

.lesson-step.is-active {
  color: var(--text);
}

.lesson-step.is-active .step-dot {
  background: rgba(255, 197, 49, 0.12);
  border-color: rgba(255, 197, 49, 0.35);
  color: var(--lime);
}

.lesson-step.is-done .step-dot {
  background: var(--green);
  border-color: var(--green);
  color: #2A1D04;
}

.reward-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 17px;
  border: 1px solid rgba(255, 197, 49, 0.16);
  background:
    radial-gradient(150px 120px at 100% 0%, rgba(255, 197, 49, 0.14), transparent 70%),
    rgba(26, 19, 9, 0.75);
}

.reward-card .reward-icon {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 197, 49, 0.12);
  color: var(--lime);
  margin-bottom: 10px;
}

.reward-card h3 {
  font-size: 13px;
  font-weight: 700;
}

.reward-card p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  margin-top: 3px;
}

.reward-card strong {
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 11px;
}

.quiz-card {
  padding: 23px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(245, 158, 11, 0.18);
  background:
    radial-gradient(300px 200px at 100% 0%, rgba(245, 158, 11, 0.08), transparent 70%),
    rgba(24, 18, 8, 0.8);
}

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

.quiz-head-left {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--violet);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.quiz-progress-text {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.quiz-segments {
  display: flex;
  gap: 5px;
  margin-bottom: 20px;
}

.quiz-segments span {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.3s;
}

.quiz-segments span.is-done {
  background: var(--lime);
}

.quiz-segments span.is-current {
  background: var(--violet);
}

.quiz-question h3 {
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.025em;
}

.quiz-question .code-window {
  margin-top: 13px;
}

.quiz-question .code-window pre {
  padding: 13px 16px;
  font-size: 10.5px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 17px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 49px;
  padding: 9px 13px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
  text-align: left;
  font-size: 12px;
  line-height: 1.45;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}

.option:not(:disabled):hover {
  transform: translateX(3px);
  border-color: rgba(255, 197, 49, 0.3);
  background: rgba(255, 197, 49, 0.035);
}

.option-letter {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.option.is-selected {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.08);
}

.option.is-correct {
  border-color: rgba(255, 209, 102, 0.55);
  background: rgba(255, 209, 102, 0.075);
  color: #FFF0C2;
}

.option.is-correct .option-letter {
  background: var(--green);
  border-color: var(--green);
  color: #2A1D04;
}

.option.is-wrong {
  border-color: rgba(242, 100, 60, 0.5);
  background: rgba(242, 100, 60, 0.07);
  color: #FFD8C2;
}

.option.is-wrong .option-letter {
  background: var(--danger);
  border-color: var(--danger);
  color: #2B0F05;
}

.option .option-state {
  margin-left: auto;
}

.option .option-state.ok { color: var(--green); }
.option .option-state.no { color: var(--danger); }

.answer-feedback {
  display: flex;
  gap: 12px;
  padding: 14px;
  margin-top: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  animation: fadeUp 0.35s var(--ease) both;
}

.answer-feedback.ok {
  border-color: rgba(255, 209, 102, 0.22);
  background: rgba(255, 209, 102, 0.055);
}

.answer-feedback.no {
  border-color: rgba(242, 100, 60, 0.2);
  background: rgba(242, 100, 60, 0.05);
}

.answer-feedback .feedback-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
}

.answer-feedback.ok .feedback-icon {
  background: rgba(255, 209, 102, 0.12);
  color: var(--green);
}

.answer-feedback.no .feedback-icon {
  background: rgba(242, 100, 60, 0.12);
  color: var(--danger);
}

.answer-feedback strong {
  display: block;
  font-size: 11.5px;
  margin-bottom: 2px;
}

.answer-feedback p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.quiz-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 16px;
}

.quiz-complete {
  text-align: center;
  padding: 22px 12px 8px;
  animation: fadeUp 0.45s var(--ease) both;
}

.quiz-complete .complete-graphic {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.28), transparent 40%),
    linear-gradient(135deg, rgba(255, 197, 49, 0.28), rgba(255, 224, 138, 0.16));
  border: 1px solid rgba(255, 197, 49, 0.3);
  color: var(--lime);
  font-size: 33px;
  box-shadow: 0 0 50px rgba(255, 197, 49, 0.14);
}

.quiz-complete h3 {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.quiz-complete p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 7px;
}

.quiz-score {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin-top: 14px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 11px;
}

.quiz-score strong {
  color: var(--lime);
  font-family: var(--font-mono);
}

.quiz-complete-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.lesson-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
}

/* ==========================================================================
   Arena
   ========================================================================== */

.arena-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding: 30px;
  margin-bottom: 22px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 138, 61, 0.18);
  background:
    radial-gradient(420px 280px at 88% 5%, rgba(255, 138, 61, 0.2), transparent 70%),
    radial-gradient(350px 260px at 55% 120%, rgba(245, 158, 11, 0.16), transparent 70%),
    linear-gradient(135deg, #2A1E0C, #171006);
}

.arena-hero::after {
  content: 'VS';
  position: absolute;
  right: 28%;
  top: 50%;
  transform: translateY(-50%) rotate(-6deg);
  font-family: var(--font-display);
  font-size: 170px;
  font-weight: 800;
  letter-spacing: -0.13em;
  color: rgba(255, 255, 255, 0.025);
  pointer-events: none;
}

.arena-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
}

.arena-hero-copy .eyebrow {
  color: #FFC0A2;
  margin-bottom: 9px;
}

.arena-hero h1 {
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 800;
  letter-spacing: -0.06em;
}

.arena-hero p {
  color: #C9BB9E;
  font-size: 13px;
  line-height: 1.6;
  max-width: 550px;
  margin-top: 8px;
}

.arena-hero-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

.arena-hero-visual {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.arena-avatar-duel {
  display: flex;
  align-items: center;
}

.arena-avatar-duel .avatar {
  width: 64px;
  height: 64px;
  font-size: 30px;
  border: 3px solid #241A0D;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.arena-avatar-duel .vs-badge {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #140E06;
  border: 1px solid rgba(255, 138, 61, 0.35);
  color: var(--coral);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  margin: 0 -7px;
  z-index: 2;
}

.active-match-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  margin-bottom: 20px;
  border-radius: 13px;
  border: 1px solid rgba(255, 197, 49, 0.22);
  background: linear-gradient(100deg, rgba(255, 197, 49, 0.08), rgba(255, 224, 138, 0.04));
}

.active-match-banner .live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  animation: livePulse 1.6s infinite;
  flex: 0 0 auto;
}

@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 197, 49, 0.5); }
  50% { box-shadow: 0 0 0 7px rgba(255, 197, 49, 0); }
}

.active-match-banner .banner-copy {
  flex: 1;
  min-width: 0;
}

.active-match-banner strong {
  display: block;
  font-size: 11.5px;
}

.active-match-banner span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 1px;
}

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

.arena-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.arena-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.arena-section {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(24, 18, 8, 0.72);
  padding: 20px;
}

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

.arena-section-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.arena-section-head .count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(242, 100, 60, 0.15);
  color: #FFC7A8;
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.challenge-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.challenge-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.022);
}

.challenge-card.incoming {
  border-color: rgba(255, 138, 61, 0.2);
  background: linear-gradient(100deg, rgba(255, 138, 61, 0.055), rgba(255, 255, 255, 0.018));
}

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

.challenge-card strong {
  display: block;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.challenge-card p {
  color: var(--muted);
  font-size: 9.5px;
  margin-top: 2px;
}

.challenge-card .challenge-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.challenge-card .challenge-actions .btn {
  height: 31px;
  padding: 0 10px;
  font-size: 10px;
  border-radius: 8px;
}

.rivals-search {
  margin-left: auto;
  width: 190px;
}

.rival-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.rival-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.18s, border-color 0.18s;
}

.rival-row:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
}

.rival-info {
  min-width: 0;
}

.rival-info strong {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rival-info strong .bot-tag {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 3px;
}

.rival-info span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rival-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  white-space: nowrap;
}

.rival-stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.presence-status {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
}

.presence-status.is-online { color: #9bdb83; }
.presence-status.is-online::before { content: '●'; margin-right: 5px; font-size: 8px; }
.trainer-panel p { margin: 0 0 16px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.trainer-panel .btn { width: 100%; }
.rank-user-copy .presence-status { display: block; margin-top: 3px; }
.friend-action { display: inline-flex; margin-top: 6px; }
.avatar[data-action="view-profile"] { cursor: pointer; }
.avatar[data-action="view-profile"]:focus-visible { outline: 2px solid #ffc531; outline-offset: 4px; }
.profile-name-link { color: inherit; text-decoration: none; }
.profile-name-link:hover { color: #ffc531; text-decoration: underline; }
.public-profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 16px; margin: 22px 0; }
.public-profile-stats .panel { display: flex; flex-direction: column; gap: 9px; }
.public-profile-stats strong { font-size: 26px; color: #ffc531; }
.public-profile-stats span { color: var(--muted); font-size: 12px; }
.public-profile-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.google-login-section { margin: 18px 0; }
.google-login-button { display: flex; justify-content: center; min-height: 42px; }
.google-setup-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.google-setup-card { width: min(100%, 480px); }
.google-setup-card h1 { margin: 26px 0 12px; font-size: 30px; }
.google-setup-card p { color: var(--muted); line-height: 1.6; }
.google-setup-card label { display: block; margin: 24px 0 10px; }
.google-setup-card input { width: 100%; }
.google-setup-card .btn-ghost { margin-top: 16px; }
.delete-account-warning { color: var(--muted); font-size: 13px; line-height: 1.7; margin-bottom: 22px; }
.btn-danger { background: #b83232; border-color: #df5555; color: white; }
.btn-danger:hover:not(:disabled) { background: #d23f3f; }
.friends-page > .panel, #friends-content > .panel { margin-bottom: 20px; }
.friend-row { display: flex; align-items: center; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.friend-row:last-child { border-bottom: 0; }
.friend-copy { display: flex; flex: 1; flex-direction: column; gap: 5px; min-width: 110px; }
.friend-copy > span { color: var(--muted); font-size: 12px; }
.friend-copy > .is-online { color: #9bdb83; }
.friend-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.friends-empty { color: var(--muted); font-size: 12px; line-height: 1.6; }
.friend-search-form label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.friend-search-form > div { display: flex; gap: 10px; flex-wrap: wrap; }
.friend-input { flex: 1; min-width: 140px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: 10px; padding: 12px 14px; font: inherit; }

.arena-empty {
  padding: 20px;
  border-radius: 12px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  text-align: center;
  font-size: 10.5px;
}

.how-to-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
  counter-reset: how;
}

.how-to-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  counter-increment: how;
}

.how-to-item::before {
  content: counter(how);
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 7px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.16);
  color: #FFD166;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
}

.how-to-item strong {
  display: block;
  font-size: 10.5px;
  margin-bottom: 1px;
}

.how-to-item p {
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.45;
}

.arena-stat-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.arena-stat-item {
  padding: 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.arena-stat-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: -0.04em;
}

.arena-stat-item span {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  margin-top: 1px;
}

.arena-history {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.arena-history-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 10px;
}

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

.arena-history-row .result-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
  flex: 0 0 auto;
}

.arena-history-row .result-dot.win { background: var(--green); }
.arena-history-row .result-dot.loss { background: var(--danger); }

.arena-history-row .history-copy {
  min-width: 0;
  flex: 1;
}

.arena-history-row strong {
  display: block;
  font-size: 9.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arena-history-row span {
  color: var(--muted-2);
  font-size: 8px;
}

/* Modal & language picker */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(5, 6, 12, 0.72);
  backdrop-filter: blur(7px);
  animation: fadeIn 0.2s ease both;
}

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

.modal {
  width: min(100%, 540px);
  max-height: min(86vh, 800px);
  overflow-y: auto;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background:
    radial-gradient(300px 200px at 100% 0%, rgba(245, 158, 11, 0.1), transparent 70%),
    #1B1308;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
  animation: modalIn 0.28s var(--ease) both;
}

.modal.modal-sm {
  width: min(100%, 420px);
}

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

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 0;
}

.modal-head h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

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

.modal-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 20px 22px 22px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.challenge-opponent {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  margin-bottom: 18px;
}

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

.challenge-opponent strong {
  display: block;
  font-size: 12.5px;
}

.challenge-opponent span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 1px;
}

.field-label {
  display: block;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
}

.language-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 3px;
}

.language-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 9px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.language-option .lang-icon {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  font-size: 8.5px;
}

.language-option:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.language-option.is-selected {
  color: var(--text);
  border-color: rgba(255, 197, 49, 0.4);
  background: rgba(255, 197, 49, 0.055);
}

.language-option.mixed-option {
  grid-column: 1 / -1;
  border-color: rgba(245, 158, 11, 0.18);
  background: rgba(245, 158, 11, 0.045);
}

.language-option.mixed-option .lang-icon {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.2);
  color: #FFD166;
}

/* ==========================================================================
   Duel
   ========================================================================== */

.duel-page {
  max-width: 1180px;
  margin: 0 auto;
  min-height: calc(100vh - var(--topbar-h) - 104px);
  display: flex;
  flex-direction: column;
}

.duel-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.duel-topbar-left {
  display: flex;
  align-items: center;
  gap: 11px;
}

.duel-lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--track, #F59E0B) 30%, transparent);
  background: color-mix(in srgb, var(--track, #F59E0B) 9%, transparent);
  color: color-mix(in srgb, var(--track, #F59E0B) 82%, white);
  font-size: 10px;
  font-weight: 700;
}

.duel-lang-badge .lang-icon {
  width: 23px;
  height: 23px;
  border-radius: 6px;
  font-size: 7.5px;
}

.duel-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.duel-status .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  animation: livePulse 1.6s infinite;
}

.duel-scoreboard {
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.duel-player {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(24, 18, 8, 0.75);
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.duel-player.is-me {
  border-color: rgba(255, 197, 49, 0.22);
  background:
    radial-gradient(180px 100px at 0% 0%, rgba(255, 197, 49, 0.07), transparent 70%),
    rgba(24, 18, 8, 0.8);
}

.duel-player.is-opponent {
  flex-direction: row-reverse;
  text-align: right;
  border-color: rgba(255, 138, 61, 0.13);
}

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

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

.duel-player-copy span {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
  margin-top: 1px;
}

.duel-player-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}

.duel-player.is-opponent .duel-player-progress {
  flex-direction: row-reverse;
}

.duel-player-progress .dots {
  display: flex;
  gap: 3px;
}

.duel-player-progress .dots span {
  width: 15px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
}

.duel-player.is-me .dots span.is-done { background: var(--lime); }
.duel-player.is-opponent .dots span.is-done { background: var(--coral); }

.duel-player-progress small {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7.5px;
  white-space: nowrap;
}

.duel-vs {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 138, 61, 0.22);
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.12), transparent 45%),
    #20160A;
  color: var(--coral);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.06em;
  box-shadow: 0 0 30px rgba(255, 138, 61, 0.08);
}

.duel-stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.09);
  background:
    radial-gradient(500px 250px at 50% -20%, rgba(245, 158, 11, 0.12), transparent 70%),
    rgba(22, 16, 8, 0.85);
  padding: 22px;
  overflow: hidden;
  min-height: 410px;
}

.duel-stage-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  color: var(--muted-2);
  font-size: 9px;
}

.duel-stage-footer span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.duel-stage-footer svg {
  color: var(--violet);
}

.duel-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, #000, transparent 55%);
  pointer-events: none;
}

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

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

.duel-question-count {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
}

.duel-question-count strong {
  color: var(--text);
  font-size: 11px;
}

.duel-timer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.duel-timer .timer-ring {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--timer-color, var(--lime)) calc(var(--timer-progress, 100) * 1%), rgba(255, 255, 255, 0.08) 0);
  position: relative;
}

.duel-timer .timer-ring::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #140E06;
}

.duel-timer .timer-ring span {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
}

.duel-timer .timer-label {
  color: var(--muted-2);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.duel-question {
  padding: 9px 4px 0;
}

.duel-question .question-kicker {
  color: var(--violet);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.duel-question h2 {
  font-size: clamp(21px, 2.6vw, 29px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.035em;
  max-width: 850px;
}

.duel-question .code-window {
  margin-top: 16px;
  max-width: 800px;
}

.duel-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 20px;
}

.duel-options .option {
  min-height: 56px;
}

.duel-feedback {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  margin-top: 16px;
  animation: fadeUp 0.3s var(--ease) both;
}

.duel-feedback.ok {
  border-color: rgba(255, 209, 102, 0.23);
  background: rgba(255, 209, 102, 0.055);
}

.duel-feedback.no {
  border-color: rgba(242, 100, 60, 0.22);
  background: rgba(242, 100, 60, 0.05);
}

.duel-feedback strong {
  display: block;
  font-size: 11.5px;
}

.duel-feedback p {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
  margin-top: 2px;
}

.duel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 17px;
}

.waiting-stage {
  text-align: center;
  align-items: center;
  justify-content: center;
  padding: 52px 20px 44px;
}

.waiting-avatars {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.waiting-avatars .avatar {
  border: 3px solid #140E06;
  margin: 0 -8px;
  animation: waitBounce 2s ease-in-out infinite;
}

.waiting-avatars .avatar:nth-child(2) {
  animation-delay: -0.5s;
}

.waiting-avatars .waiting-vs {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin: 0 7px;
  border-radius: 50%;
  background: #140E06;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--coral);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 800;
  z-index: 2;
}

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

.waiting-stage h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.waiting-stage p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 7px;
}

.waiting-progress {
  width: min(100%, 330px);
  margin: 20px auto 0;
}

.waiting-progress-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
  margin-bottom: 7px;
}

.waiting-progress-head strong {
  color: var(--text);
  font-family: var(--font-mono);
}

.waiting-tip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 22px;
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 9.5px;
}

/* Duel result */
.duel-result {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(600px 350px at 50% -10%, var(--result-glow, rgba(255, 197, 49, 0.18)), transparent 70%),
    linear-gradient(150deg, #1D1509, #130E07);
  padding: 44px 36px 34px;
  text-align: center;
}

.duel-result::before {
  content: '';
  position: absolute;
  width: 460px;
  height: 460px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  left: 50%;
  top: -280px;
  transform: translateX(-50%);
  box-shadow: 0 0 0 80px rgba(255, 255, 255, 0.014), 0 0 0 160px rgba(255, 255, 255, 0.01);
}

.result-badge {
  position: relative;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  margin: 0 auto 19px;
  border-radius: 50%;
  font-size: 42px;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.3), transparent 45%),
    var(--result-bg, linear-gradient(135deg, rgba(255, 197, 49, 0.25), rgba(255, 224, 138, 0.12)));
  border: 1px solid var(--result-border, rgba(255, 197, 49, 0.3));
  box-shadow: 0 0 70px var(--result-shadow, rgba(255, 197, 49, 0.16));
}

.result-kicker {
  color: var(--result-color, var(--lime));
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.duel-result h1 {
  font-size: clamp(32px, 4.4vw, 50px);
  font-weight: 800;
  letter-spacing: -0.065em;
  margin-top: 8px;
}

.duel-result > p {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 8px;
}

.result-vs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 15px;
  max-width: 570px;
  margin: 28px auto 0;
}

.result-player {
  padding: 15px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.result-player.is-winner {
  border-color: rgba(255, 197, 49, 0.24);
  background: rgba(255, 197, 49, 0.045);
}

.result-player .avatar {
  margin: 0 auto 8px;
}

.result-player strong {
  display: block;
  font-size: 11.5px;
}

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

.result-player .result-score {
  display: block;
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.result-player .result-detail {
  display: block;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  margin-top: 1px;
}

.result-xp {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 21px;
  padding: 8px 13px;
  border-radius: 9px;
  border: 1px solid rgba(255, 197, 49, 0.2);
  background: rgba(255, 197, 49, 0.07);
  color: #FFE082;
  font-size: 10.5px;
  font-weight: 700;
}

.result-xp strong {
  font-family: var(--font-mono);
  font-size: 11px;
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 25px;
}

.result-question-review {
  max-width: 650px;
  margin: 28px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.result-question-review h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 9px;
}

.review-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 4px;
  color: var(--muted);
  font-size: 10px;
  text-align: left;
}

.review-row .review-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  flex: 0 0 auto;
}

.review-row .review-icon.ok {
  background: rgba(255, 209, 102, 0.1);
  color: var(--green);
}

.review-row .review-icon.no {
  background: rgba(242, 100, 60, 0.1);
  color: var(--danger);
}

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 13px;
  border-radius: 2px;
  animation: confettiFall var(--duration, 2.8s) linear forwards;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}

@keyframes confettiFall {
  0% { opacity: 1; transform: translate3d(0, -20px, 0) rotate(0deg); }
  100% { opacity: 0; transform: translate3d(var(--drift, 30px), 105vh, 0) rotate(var(--spin, 540deg)); }
}

/* ==========================================================================
   Ranking
   ========================================================================== */

.ranking-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.period-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.period-tab {
  height: 32px;
  padding: 0 13px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  transition: background 0.18s, color 0.18s;
}

.period-tab.is-active {
  background: var(--surface-3);
  color: var(--text);
}

.podium {
  display: grid;
  grid-template-columns: 1fr 1.14fr 1fr;
  align-items: end;
  gap: 13px;
  max-width: 820px;
  margin: 6px auto 26px;
}

.podium-card {
  --podium-color: #ffd166;
  position: relative;
  text-align: center;
  padding: 23px 16px 20px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--podium-color) 22%, transparent);
  background:
    radial-gradient(200px 140px at 50% 0%, color-mix(in srgb, var(--podium-color) 14%, transparent), transparent 70%),
    linear-gradient(160deg, #241A0C, #171006);
  overflow: hidden;
}

.podium-card.place-1 {
  padding-top: 34px;
  min-height: 245px;
}

.podium-card.place-2 {
  min-height: 215px;
}

.podium-card.place-3 {
  min-height: 198px;
}

.podium-card .crown {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%) rotate(-5deg);
  font-size: 23px;
  filter: drop-shadow(0 4px 10px rgba(255, 209, 102, 0.3));
}

.podium-place {
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--podium-color);
  opacity: 0.72;
}

.podium-card .avatar {
  width: 62px;
  height: 62px;
  margin: 0 auto 11px;
  font-size: 29px;
  border-width: 2px;
}

.podium-card.place-1 .avatar {
  width: 76px;
  height: 76px;
  font-size: 36px;
}

.podium-card h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.podium-card .podium-user {
  color: var(--muted);
  font-size: 9px;
  margin-top: 1px;
}

.podium-xp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 5px 9px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--podium-color) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--podium-color) 17%, transparent);
  color: var(--podium-color);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
}

.podium-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 8.5px;
}

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

.ranking-table-panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(24, 18, 8, 0.72);
  overflow: hidden;
}

.rank-table-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 85px 65px 95px;
  gap: 10px;
  padding: 13px 17px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.rank-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 85px 65px 95px;
  gap: 10px;
  align-items: center;
  padding: 11px 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.18s;
}

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

.rank-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.rank-row.is-me {
  background: rgba(255, 197, 49, 0.05);
  box-shadow: inset 3px 0 0 var(--lime);
}

.rank-row .rank-position {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}

.rank-row .rank-position.medal {
  color: var(--amber);
}

.rank-user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.rank-user-copy {
  min-width: 0;
}

.rank-user-copy strong {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-user-copy span {
  display: block;
  color: var(--muted-2);
  font-size: 8.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-cell {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.rank-cell strong {
  color: var(--text);
  font-size: 9.5px;
}

.rank-xp {
  text-align: right;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
}

.rank-xp span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 400;
  display: block;
}

.rank-side {
  display: flex;
  flex-direction: column;
  gap: 15px;
  position: sticky;
  top: calc(var(--topbar-h) + 20px);
}

.rank-me-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 17px;
  border: 1px solid rgba(255, 197, 49, 0.17);
  background:
    radial-gradient(200px 150px at 100% 0%, rgba(255, 197, 49, 0.12), transparent 70%),
    rgba(26, 19, 9, 0.8);
}

.rank-me-card .my-rank-label {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.rank-me-card .my-rank-number {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.07em;
  line-height: 1;
  margin: 6px 0 8px;
}

.rank-me-card .my-rank-number span {
  color: var(--muted);
  font-size: 15px;
}

.rank-me-card p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.rank-me-card .btn {
  width: 100%;
  margin-top: 12px;
  height: 36px;
  font-size: 11px;
}

.xp-guide {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.xp-guide-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
}

.xp-guide-item .guide-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 197, 49, 0.07);
  color: var(--lime);
  flex: 0 0 auto;
}

.xp-guide-item p {
  flex: 1;
  color: var(--muted);
  font-size: 9.5px;
}

.xp-guide-item strong {
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 8.5px;
  white-space: nowrap;
}

/* ==========================================================================
   Profile
   ========================================================================== */

.profile-hero {
  --profile-color: #F59E0B;
  position: relative;
  border-radius: var(--radius-xl);
  border: 1px solid color-mix(in srgb, var(--profile-color) 22%, transparent);
  background:
    radial-gradient(500px 260px at 18% 0%, color-mix(in srgb, var(--profile-color) 26%, transparent), transparent 70%),
    radial-gradient(400px 250px at 90% 110%, rgba(255, 224, 138, 0.07), transparent 70%),
    linear-gradient(135deg, #241A0C, #171006);
  overflow: hidden;
  margin-bottom: 20px;
}

.profile-banner {
  height: 154px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(280px 180px at 22% 0%, color-mix(in srgb, var(--profile-color) 28%, transparent), transparent 70%),
    repeating-linear-gradient(115deg, transparent 0 26px, rgba(255, 255, 255, 0.025) 26px 27px);
}

.profile-banner::after {
  content: '</>';
  position: absolute;
  right: 42px;
  bottom: -42px;
  font-family: var(--font-mono);
  font-size: 170px;
  font-weight: 700;
  letter-spacing: -0.18em;
  color: rgba(255, 255, 255, 0.022);
  pointer-events: none;
}

.profile-banner-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(90deg, #000, transparent 80%);
}

.profile-body {
  position: relative;
  padding: 0 26px 24px;
}

.profile-avatar-wrap {
  position: relative;
  margin-top: -48px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.profile-avatar-frame {
  aspect-ratio: 1;
  border-radius: 50% !important;
  position: relative;
  display: inline-flex;
  padding: 5px;
  border-radius: 50%;
  background: linear-gradient(135deg, color-mix(in srgb, var(--profile-color) 60%, white), transparent 80%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}

.profile-avatar-frame .avatar {
  width: 104px;
  height: 104px;
  font-size: 52px;
  border-width: 3px;
  border-color: #1B1409;
}

.profile-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
}

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

.profile-name-row h1 {
  font-size: clamp(24px, 3vw, 31px);
  font-weight: 800;
  letter-spacing: -0.05em;
}

.profile-handle {
  color: var(--muted);
  font-size: 11px;
  margin-top: 1px;
}

.profile-bio {
  color: var(--text-soft);
  font-size: 12px;
  max-width: 600px;
  margin-top: 9px;
  line-height: 1.55;
}

.profile-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
}

.profile-meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

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

.profile-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.profile-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.profile-stat {
  padding: 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(26, 19, 9, 0.68);
}

.profile-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: -0.05em;
}

.profile-stat span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 2px;
}

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

.badge-card {
  position: relative;
  padding: 13px 11px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.023);
  text-align: center;
  transition: border-color 0.18s, background 0.18s;
}

.badge-card.earned {
  border-color: rgba(255, 209, 102, 0.16);
  background: linear-gradient(150deg, rgba(255, 209, 102, 0.065), rgba(255, 255, 255, 0.02));
}

.badge-card.locked {
  opacity: 0.45;
}

.badge-card .badge-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  margin: 0 auto 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 18px;
}

.badge-card.earned .badge-icon {
  background: rgba(255, 209, 102, 0.1);
  border: 1px solid rgba(255, 209, 102, 0.14);
}

.badge-card strong {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-card span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.language-progress-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.language-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.language-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.language-progress-head strong {
  font-size: 10.5px;
  font-weight: 700;
}

.language-progress-head span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

.duel-history-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.duel-history-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.duel-history-item:last-child {
  border-bottom: 0;
}

.duel-history-item .history-icon {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.duel-history-item.win .history-icon {
  background: rgba(255, 209, 102, 0.09);
  color: var(--green);
}

.duel-history-item.loss .history-icon {
  background: rgba(242, 100, 60, 0.08);
  color: var(--danger);
}

.duel-history-item .history-copy {
  flex: 1;
  min-width: 0;
}

.duel-history-item strong {
  display: block;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.duel-history-item span {
  display: block;
  color: var(--muted-2);
  font-size: 8px;
  margin-top: 1px;
}

.duel-history-item .history-result {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

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

.avatar-option {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 18px;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}

.avatar-option:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.avatar-option.is-selected {
  border-color: var(--lime);
  background: rgba(255, 197, 49, 0.08);
}

.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.color-option {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 2px solid transparent;
  position: relative;
  transition: transform 0.18s;
}

.color-option:hover {
  transform: scale(1.08);
}

.color-option.is-selected {
  border-color: var(--text);
  box-shadow: 0 0 0 2px #1B1308;
}

.modal .field-input textarea {
  height: 82px;
  padding-top: 12px;
  resize: vertical;
  min-height: 70px;
  max-height: 140px;
  line-height: 1.5;
}

/* ==========================================================================
   Notifications
   ========================================================================== */

.notification-panel {
  position: fixed;
  top: calc(var(--topbar-h) + 8px);
  right: 26px;
  width: 365px;
  max-height: min(560px, calc(100vh - 100px));
  z-index: 80;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: rgba(28, 21, 10, 0.98);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  animation: notifIn 0.22s var(--ease) both;
}

@keyframes notifIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.notif-head h3 {
  font-size: 13px;
  font-weight: 700;
}

.notif-head .notif-count {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  margin-left: 5px;
}

.notif-mark-all {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.notif-mark-all:hover {
  color: var(--lime);
}

.notif-list {
  overflow-y: auto;
  padding: 5px;
}

.notif-item {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  text-align: left;
  transition: background 0.18s;
}

.notif-item:hover {
  background: rgba(255, 255, 255, 0.045);
}

.notif-item.is-unread {
  background: rgba(255, 197, 49, 0.035);
}

.notif-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  flex: 0 0 auto;
  background: rgba(245, 158, 11, 0.1);
  color: #FFD166;
}

.notif-item[data-type='challenge'] .notif-icon {
  background: rgba(255, 138, 61, 0.1);
  color: #FFC0A2;
}

.notif-item[data-type='duel'] .notif-icon {
  background: rgba(255, 209, 102, 0.09);
  color: var(--amber);
}

.notif-item[data-type='lesson'] .notif-icon {
  background: rgba(255, 209, 102, 0.09);
  color: var(--green);
}

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

.notif-copy strong {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
}

.notif-copy p {
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.45;
  margin-top: 2px;
}

.notif-copy span {
  display: block;
  color: var(--muted-2);
  font-size: 8px;
  margin-top: 3px;
}

.notif-item .unread-pin {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
  align-self: center;
  flex: 0 0 auto;
}

/* ==========================================================================
   Toasts
   ========================================================================== */

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(30, 22, 11, 0.98);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  pointer-events: auto;
  animation: toastIn 0.3s var(--ease) both;
}

.toast.is-leaving {
  animation: toastOut 0.22s ease forwards;
}

.toast-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(255, 197, 49, 0.09);
  color: var(--lime);
}

.toast[data-type='error'] .toast-icon {
  background: rgba(242, 100, 60, 0.1);
  color: var(--danger);
}

.toast[data-type='challenge'] .toast-icon {
  background: rgba(255, 138, 61, 0.1);
  color: var(--coral);
}

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

.toast-copy strong {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
}

.toast-copy p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  margin-top: 2px;
}

.toast-action {
  color: var(--lime);
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
  align-self: center;
  pointer-events: auto;
}

.toast-close {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--muted-2);
  flex: 0 0 auto;
}

.toast-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

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

@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(0.97); }
}

/* ==========================================================================
   Loading and small helpers
   ========================================================================== */

.page-loading {
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: var(--muted);
  font-size: 11px;
}

.page-loading .loading-ring {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--lime);
  animation: spin 0.8s linear infinite;
}

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

.inline-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.inline-note svg {
  margin-top: 1px;
  color: var(--muted-2);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1280px) {
  :root { --sidebar-w: 232px; }
  .view { padding-left: 26px; padding-right: 26px; }
  .topbar { padding-left: 26px; padding-right: 26px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) 310px; }
  .track-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .track-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .continue-card { grid-template-columns: minmax(0, 1fr) 220px; }
  .continue-ring { width: 150px; height: 150px; }
  .continue-ring-inner .lang-icon { width: 50px; height: 50px; }
  .auth-art { padding: 38px 42px; }
  .auth-float.code-float { right: 3%; }
}

@media (max-width: 1080px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .arena-mini { grid-column: 1 / -1; }
  .dashboard-side .panel:last-child { grid-column: auto; }
  .track-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .arena-grid,
  .ranking-layout,
  .profile-grid { grid-template-columns: 1fr; }
  .arena-side,
  .rank-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .rank-side .rank-me-card { grid-column: 1 / -1; }
  .profile-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .track-layout { grid-template-columns: 1fr; }
  .track-side-card { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .track-side-cta { grid-column: 1 / -1; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-side { position: static; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .lesson-side .reward-card { display: block; }
  .auth-page { grid-template-columns: minmax(0, 1fr) minmax(400px, 0.9fr); }
  .auth-float { display: none; }
  .auth-copy h1 { font-size: clamp(38px, 4.4vw, 54px); }
  .auth-art { padding: 36px 38px; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; --topbar-h: 66px; }
  .sidebar { display: none; }
  .main-shell { margin-left: 0; padding-bottom: 77px; }
  .topbar { padding: 0 18px; }
  .topbar-mobile-brand { display: flex; }
  .topbar-context { display: none; }
  .view { padding: 24px 18px 40px; }
  .topbar-mobile-brand .brand-word { font-size: 17px; }
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 70;
    height: 61px;
    padding: 6px;
    border-radius: 18px;
    border: 1px solid var(--line-strong);
    background: rgba(24, 18, 9, 0.95);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(22px);
  }
  .mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 700;
    transition: color 0.18s, background 0.18s;
  }
  .mobile-nav-link.is-active {
    color: var(--text);
    background: rgba(255, 197, 49, 0.08);
  }
  .mobile-nav-link.is-active svg {
    color: var(--lime);
  }
  .mobile-nav-link.arena-nav {
    position: relative;
  }
  .mobile-nav-link.arena-nav .arena-nav-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    margin-top: -21px;
    border-radius: 12px;
    border: 1px solid rgba(255, 138, 61, 0.28);
    background: linear-gradient(145deg, #2D1F0D, #21170A);
    color: var(--coral);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  }
  .mobile-nav-link.arena-nav span.label {
    margin-top: -1px;
  }
  .streak-pill small { display: none; }
  .streak-pill { padding: 0 10px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 15px; }
  .page-heading-actions { width: 100%; }
  .page-heading-actions .btn { flex: 1; }
  .tracks-banner { flex-direction: column; align-items: flex-start; }
  .tracks-banner-stats { width: 100%; }
  .banner-stat { flex: 1; }
  .page-heading h1 { font-size: 27px; }
  .podium { max-width: 100%; }
  .notification-panel { right: 14px; width: min(365px, calc(100vw - 28px)); }
  .auth-page { display: block; min-height: 100vh; }
  .auth-art { display: none; }
  .auth-panel { min-height: 100vh; min-height: 100svh; padding: 34px 22px; justify-content: flex-start; padding-top: 38px; }
  .auth-mobile-brand { display: flex; }
  .auth-card-head h2 { font-size: 27px; }
  .auth-foot { margin-top: 26px; }
}

@media (max-width: 720px) {
  .dashboard-side { display: flex; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid .stat-card:first-child { grid-column: 1 / -1; }
  .track-strip { grid-template-columns: 1fr 1fr; }
  .continue-card { grid-template-columns: 1fr; padding: 23px; }
  .continue-visual { display: none; }
  .float-code.one, .float-code.two { display: none; }
  .track-side-card,
  .lesson-side,
  .arena-side,
  .rank-side,
  .profile-side { display: flex; }
  .track-side-card { grid-template-columns: none; }
  .lesson-side .reward-card { display: block; }
  .tracks-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .search-box { width: 100%; }
  .track-grid { grid-template-columns: 1fr 1fr; }
  .track-card-lg { min-height: 230px; padding: 17px; }
  .track-hero { flex-direction: column; align-items: flex-start; padding: 23px; gap: 18px; }
  .track-hero-progress { width: 100%; }
  .track-hero-icon .lang-icon { width: 68px; height: 68px; font-size: 21px; }
  .lesson-row { grid-template-columns: 38px minmax(0, 1fr) 26px; gap: 10px; padding: 13px; }
  .lesson-row-meta { display: none; }
  .lesson-row-arrow { grid-column: 3; }
  .lesson-section, .quiz-card { padding: 18px; }
  .duel-options { grid-template-columns: 1fr; }
  .duel-scoreboard { grid-template-columns: 1fr 44px 1fr; gap: 6px; }
  .duel-player { padding: 9px; gap: 8px; border-radius: 11px; }
  .duel-player .avatar { width: 35px; height: 35px; font-size: 17px; }
  .duel-vs { width: 40px; height: 40px; font-size: 10px; }
  .duel-player-copy strong { font-size: 9.5px; }
  .duel-player-copy span { font-size: 7.5px; }
  .duel-player-progress .dots span { width: 9px; }
  .duel-stage { padding: 16px; }
  .duel-question h2 { font-size: 21px; }
  .duel-stage-footer { flex-direction: column; align-items: flex-start; gap: 5px; font-size: 8.5px; }
  .duel-player.is-opponent .duel-player-copy { text-align: right; }
  .arena-hero { flex-direction: column; align-items: flex-start; padding: 23px; }
  .arena-hero-visual { display: none; }
  .arena-hero::after { font-size: 110px; right: 0; }
  .rivals-search { width: 145px; }
  .rival-row { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 8px; }
  .rival-stats { display: none; }
  .challenge-card { flex-wrap: wrap; }
  .challenge-card .challenge-actions { width: 100%; padding-left: 44px; }
  .podium { gap: 7px; }
  .podium-card { padding: 18px 8px 15px; border-radius: 15px; }
  .podium-card.place-1 { min-height: 220px; padding-top: 30px; }
  .podium-card.place-2 { min-height: 198px; }
  .podium-card.place-3 { min-height: 185px; }
  .podium-card h3 { font-size: 11px; }
  .podium-card .avatar { width: 49px; height: 49px; font-size: 23px; }
  .podium-card.place-1 .avatar { width: 58px; height: 58px; font-size: 28px; }
  .podium-xp { font-size: 8px; padding: 4px 6px; }
  .rank-table-head,
  .rank-row { grid-template-columns: 30px minmax(0, 1fr) 52px 70px; }
  .rank-table-head span:nth-child(4),
  .rank-row .rank-cell.wins { display: none; }
  .rank-xp { text-align: right; }
  .profile-avatar-wrap { flex-direction: column; align-items: flex-start; gap: 13px; }
  .profile-avatar-frame .avatar { width: 82px; height: 82px; font-size: 40px; }
  .profile-header-actions { padding-bottom: 0; width: 100%; }
  .profile-header-actions .btn { flex: 1; }
  .profile-stat-grid { grid-template-columns: 1fr 1fr; }
  .badge-grid { grid-template-columns: repeat(3, 1fr); }
  .lesson-layout { gap: 16px; }
  .lesson-header { padding: 22px; }
  .quiz-question h3 { font-size: 17px; }
  .modal-backdrop { padding: 12px; align-items: end; }
  .modal { max-height: 90vh; border-radius: 20px; }
  .language-picker { max-height: 220px; }
  .notification-panel { top: 72px; }
  .result-vs { gap: 7px; }
  .result-player { padding: 10px 7px; }
  .result-player .avatar { width: 38px; height: 38px; font-size: 18px; }
  .duel-result { padding: 34px 17px 26px; }
  .duel-result h1 { font-size: 35px; }
  .duel-result .result-vs { max-width: 100%; }
}

@media (max-width: 520px) {
  .view { padding: 20px 14px 32px; }
  .topbar { padding: 0 14px; }
  .topbar-actions { gap: 6px; }
  .streak-pill { height: 35px; font-size: 10.5px; }
  .icon-btn { width: 38px; height: 38px; }
  .topbar-avatar { width: 38px; height: 38px; }
  .mobile-nav { left: 7px; right: 7px; bottom: 7px; }
  .page-heading h1 { font-size: 24px; }
  .page-heading p { font-size: 12px; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 21px; }
  .track-strip { grid-template-columns: 1fr; }
  .track-grid { grid-template-columns: 1fr; }
  .track-card-lg { min-height: 210px; }
  .continue-card { padding: 20px; }
  .continue-card h2 { font-size: 23px; }
  .continue-actions .btn { flex: 1; }
  .tracks-banner { padding: 19px; }
  .tracks-banner-stats { gap: 5px; }
  .banner-stat { min-width: 0; padding: 8px; }
  .banner-stat strong { font-size: 14px; }
  .daily-tip { padding: 15px; gap: 11px; }
  .daily-tip-icon { width: 34px; height: 34px; }
  .daily-tip p { font-size: 10.5px; }
  .auth-panel { padding: 26px 17px; }
  .auth-card { max-width: 100%; }
  .auth-tabs { margin: 23px 0 19px; }
  .demo-card { flex-wrap: wrap; }
  .demo-card .btn { width: 100%; margin-top: 3px; }
  .auth-stats { gap: 22px; }
  .auth-stat strong { font-size: 21px; }
  .profile-body { padding: 0 17px 18px; }
  .profile-banner { height: 120px; }
  .profile-name-row h1 { font-size: 23px; }
  .profile-stat { padding: 11px; }
  .profile-stat strong { font-size: 18px; }
  .badge-grid { grid-template-columns: 1fr 1fr; }
  .lesson-topline { flex-wrap: wrap; }
  .lesson-header { padding: 18px; }
  .lesson-section { padding: 15px; }
  .quiz-card { padding: 15px; }
  .option { font-size: 11px; padding: 8px 10px; }
  .option-letter { width: 22px; height: 22px; }
  .quiz-actions .btn { flex: 1; }
  .duel-topbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .duel-player { flex-direction: column; align-items: flex-start; text-align: left; gap: 6px; }
  .duel-player.is-opponent { flex-direction: column; align-items: flex-end; text-align: right; }
  .duel-player .duel-player-copy { width: 100%; }
  .duel-player-progress { width: 100%; }
  .duel-options { gap: 6px; }
  .duel-actions .btn { flex: 1; }
  .challenge-card .challenge-actions { padding-left: 0; }
  .language-picker { grid-template-columns: 1fr; max-height: 195px; }
  .language-option.mixed-option { grid-column: auto; }
  .modal-head { padding: 18px 17px 0; }
  .modal-body { padding: 16px 17px 18px; }
  .modal-actions .btn { flex: 1; }
  .rank-table-head,
  .rank-row { grid-template-columns: 25px minmax(0, 1fr) 58px; padding-left: 12px; padding-right: 12px; }
  .rank-table-head span:nth-child(3),
  .rank-row .rank-cell.level-col { display: none; }
  .rank-user-copy span { display: none; }
  .rank-side { display: flex; }
  .profile-side { display: flex; }
  .avatar-picker { grid-template-columns: repeat(7, 1fr); }
  .result-actions .btn { flex: 1; }
  .duel-result .result-vs { grid-template-columns: 1fr 34px 1fr; gap: 4px; }
  .result-player .result-score { font-size: 18px; }
  .toast-root { right: 10px; left: 10px; bottom: 82px; max-width: none; }
  .notification-panel { right: 8px; width: calc(100vw - 16px); }
}

/* ==========================================================================
   Movimento e interações
   ========================================================================== */

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0);
  background: radial-gradient(circle, rgba(255, 197, 49, 0.09) 0%, rgba(245, 158, 11, 0.035) 35%, transparent 68%);
  transition: opacity 0.45s ease;
  will-change: transform;
}

.cursor-glow.is-active {
  opacity: 1;
}

.ambient-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-particle {
  position: absolute;
  width: var(--particle-size, 5px);
  height: var(--particle-size, 5px);
  border-radius: 2px;
  background: var(--lime);
  opacity: 0.15;
  transform: rotate(45deg);
  animation: ambientDrift var(--particle-duration, 18s) linear infinite;
  animation-delay: var(--particle-delay, 0s);
}

@keyframes ambientDrift {
  0% { transform: translate3d(0, 10vh, 0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.18; }
  85% { opacity: 0.12; }
  100% { transform: translate3d(var(--particle-drift, 80px), -110vh, 0) rotate(540deg); opacity: 0; }
}

.btn {
  position: relative;
  overflow: hidden;
}

.btn-ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.32);
  transform: translate(-50%, -50%) scale(0);
  animation: buttonRipple 0.62s ease-out forwards;
}

@keyframes buttonRipple {
  to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

.scroll-reveal {
  opacity: 0;
  translate: 0 16px;
  transition: opacity 0.58s var(--ease), translate 0.58s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

.scroll-reveal.is-visible {
  opacity: 1;
  translate: 0 0;
}

.progress-track > span {
  transform-origin: left center;
  animation: barGrow 0.9s var(--ease) both;
}

@keyframes barGrow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.answer-feedback.ok {
  animation: feedbackPop 0.36s var(--ease) both;
}

.answer-feedback.no {
  animation: feedbackShake 0.4s ease both;
}

.option.is-correct {
  animation: optionCorrect 0.4s var(--ease);
}

.option.is-wrong {
  animation: optionWrong 0.34s ease;
}

@keyframes feedbackPop {
  0% { opacity: 0; transform: translateY(7px) scale(0.985); }
  60% { transform: scale(1.01); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes feedbackShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

@keyframes optionCorrect {
  0% { transform: scale(1); }
  45% { transform: scale(1.012); }
  100% { transform: scale(1); }
}

@keyframes optionWrong {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-3px); }
  60% { transform: translateX(3px); }
}

.duel-timer .timer-ring.is-low {
  animation: timerPulse 0.8s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 100, 60, 0); }
  50% { box-shadow: 0 0 0 7px rgba(242, 100, 60, 0.16); }
}

.track-card::after,
.track-card-lg::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(260px circle at var(--shine-x, 50%) var(--shine-y, 0%), rgba(255, 255, 255, 0.08), transparent 45%);
  transition: opacity 0.25s ease;
}

.track-card:hover::after,
.track-card-lg:hover::after {
  opacity: 1;
}

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

  .cursor-glow,
  .ambient-particles {
    display: none;
  }

  .scroll-reveal {
    opacity: 1;
    translate: none;
  }
}
.avatar { position: relative; }
.avatar-photo { display:block; width:100%; height:100%; object-fit:cover; border-radius:50%; }
[data-action="view-profile"] { cursor:pointer; }
[data-action="view-profile"]:focus-visible { outline:2px solid var(--primary, #FFC531); outline-offset:3px; }
.rival-row[data-action]:hover, .friend-row[data-action]:hover, .rank-row[data-action]:hover, .leader-row[data-action]:hover, .challenge-card[data-action]:hover { background:rgba(255,197,49,.055); }
.profile-photo-editor { display:flex; gap:16px; align-items:center; flex-wrap:wrap; margin:10px 0; }
.profile-photo-editor input[type="file"] { max-width:100%; font:inherit; font-size:12px; }
.profile-photo-editor > div { min-width:0; flex:1 1 180px; }
#edit-profile-form { color-scheme: dark; }
#edit-profile-form .field { gap: 10px; }
#edit-profile-form .field-hint { color:var(--muted); font-size:11px; line-height:1.6; }
#edit-profile-form .avatar-picker { grid-template-columns:repeat(auto-fit, minmax(42px, 1fr)); gap:8px; }
#edit-profile-form .avatar-option { aspect-ratio:auto; height:44px; font-size:20px; }
#edit-profile-form .color-picker { display:grid; grid-template-columns:repeat(12, minmax(0, 1fr)); gap:9px; padding:3px; }
#edit-profile-form .color-option { width:100%; max-width:30px; height:auto; aspect-ratio:1; justify-self:center; }
#edit-profile-form .color-option:focus-visible, #custom-profile-color:focus-visible { outline:2px solid var(--lime); outline-offset:4px; }
.custom-color-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:10px 12px; border:1px solid var(--line); border-radius:11px; background:rgba(255,255,255,.025); }
.custom-color-control { display:flex; align-items:center; gap:10px; }
#profile-color-value { color:var(--text-soft); font:11px var(--font-mono); }
#custom-profile-color { display:block; width:32px; height:32px; padding:3px; border-radius:8px; border:1px solid var(--line-strong); background:var(--surface-2); cursor:pointer; }
#custom-profile-color::-webkit-color-swatch-wrapper { padding:0; }
#custom-profile-color::-webkit-color-swatch { border:0; border-radius:4px; }
#custom-profile-color::-moz-color-swatch { border:0; border-radius:4px; }
#edit-profile-form input[type="file"] { color:var(--muted); font-size:11px; }
#edit-profile-form input[type="file"]::file-selector-button { padding:8px 11px; margin-right:9px; border:1px solid var(--line-strong); border-radius:8px; background:var(--surface-3); color:var(--text-soft); font:600 11px var(--font-body); cursor:pointer; }
#edit-profile-form input[type="file"]::file-selector-button:hover { border-color:var(--lime); }
#edit-favorite { color-scheme:dark; background-color:#211a10; color:var(--text); cursor:pointer; }
#edit-favorite option { color:#FFF7E7; background:#211a10; font-size:13px; }
#edit-favorite option:checked { color:#FFC531; background:#382b13; }
@supports (appearance:base-select) {
  #edit-favorite, #edit-favorite::picker(select) { appearance:base-select; }
  #edit-favorite { display:flex; align-items:center; padding-right:14px; }
  #edit-favorite::picker-icon { color:var(--muted); transition:rotate .18s; }
  #edit-favorite:open::picker-icon { rotate:180deg; }
  #edit-favorite::picker(select) { margin-top:6px; padding:6px; border:1px solid var(--line-strong); border-radius:12px; background:#211a10; color:var(--text); box-shadow:0 12px 32px rgba(0,0,0,.4); max-height:280px; overflow-y:auto; scrollbar-color:#6b542f #211a10; }
  #edit-favorite option { min-height:38px; padding:9px 12px; gap:10px; border-radius:7px; cursor:pointer; }
  #edit-favorite option:hover, #edit-favorite option:focus { outline:0; color:#FFF7E7; background:#332818; }
  #edit-favorite option:checked { background:#3a2c12; color:#FFD66B; font-weight:600; }
  #edit-favorite option::checkmark { color:#FFD66B; }
}
@media (max-width:480px) {
  #edit-profile-form .color-picker { grid-template-columns:repeat(8,minmax(0,1fr)); gap:10px; }
  #edit-profile-form .avatar-picker { grid-template-columns:repeat(7,minmax(0,1fr)); gap:5px; }
  #edit-profile-form .avatar-option { height:38px; }
}

