/* ============================================================
   Eduson — Калькулятор дохода
   Design system: glassmorphism, airy, motivating
   ============================================================ */

:root {
  /* type */
  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;

  /* accent gradient — Eduson brand violet */
  --acc-1: #6a4cf0;   /* violet (brand core) */
  --acc-2: #7b6cff;   /* periwinkle violet   */
  --acc-3: #9a86ff;   /* light violet        */
  --gold:  #ffd23d;   /* bright brand yellow */
  --acc-grad: linear-gradient(120deg, var(--acc-1), var(--acc-2) 55%, var(--acc-3));

  /* motion */
  --anim-mult: 1;          /* set by tweak (0 = off, 1 = normal, 1.6 = dynamic) */
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- LIGHT THEME ---------- */
.theme-light {
  --bg-base: #edeef6;
  --ink: #16172b;
  --ink-soft: #565a7e;
  --ink-faint: #9094b3;

  --blob-1: #8f7bff;
  --blob-2: #b3a6ff;
  --blob-3: #c9beff;
  --blob-4: #ffe08a;
  --blob-alpha: .5;

  --glass-bg: rgba(255, 255, 255, .52);
  --glass-bg-strong: rgba(255, 255, 255, .72);
  --glass-brd: rgba(255, 255, 255, .85);
  --glass-hi: rgba(255, 255, 255, .9);
  --glass-shadow: 0 24px 60px -20px rgba(40, 40, 110, .35),
                  0 6px 20px -12px rgba(40, 40, 110, .25);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, .9),
                 inset 0 -1px 0 rgba(120, 120, 180, .08);
  --track: rgba(110, 92, 255, .14);
  --chip-bg: rgba(255, 255, 255, .6);
}

/* ---------- DARK THEME ---------- */
.theme-dark {
  --bg-base: #070912;
  --ink: #f3f5ff;
  --ink-soft: #aab0d8;
  --ink-faint: #6f76a3;

  --blob-1: #6a4cf0;
  --blob-2: #7b6cff;
  --blob-3: #4a3bd0;
  --blob-4: #ffcf3d;
  --blob-alpha: .6;

  --glass-bg: rgba(255, 255, 255, .055);
  --glass-bg-strong: rgba(255, 255, 255, .09);
  --glass-brd: rgba(255, 255, 255, .14);
  --glass-hi: rgba(255, 255, 255, .22);
  --glass-shadow: 0 30px 70px -24px rgba(0, 0, 0, .8),
                  0 8px 28px -16px rgba(40, 30, 120, .6);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, .14),
                 inset 0 -1px 0 rgba(0, 0, 0, .25);
  --track: rgba(255, 255, 255, .1);
  --chip-bg: rgba(255, 255, 255, .06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background .6s var(--ease-out), color .4s var(--ease-out);
}

#root { min-height: 100vh; position: relative; z-index: 1; }

/* ============================================================
   BACKGROUND — mesh + floating orbs + grain
   ============================================================ */
.bg-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg-base);
  transition: background .6s var(--ease-out);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: var(--blob-alpha);
  will-change: transform;
  mix-blend-mode: normal;
}
.theme-dark .blob { filter: blur(80px); mix-blend-mode: screen; }

/* faint concentric rings (Eduson hero motif) */
.bg-rings {
  position: absolute; left: 50%; top: 46%;
  width: 1400px; height: 1400px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  will-change: transform;
}
.bg-rings span {
  position: absolute; left: 50%; top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid currentColor;
}
.theme-light .bg-rings { color: rgba(90, 80, 180, .1); }
.theme-dark .bg-rings { color: rgba(160, 150, 255, .07); }

/* ============================================================
   SPLASH SCREEN
   ============================================================ */
.splash-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-base);
  display: flex; align-items: center; justify-content: center;
  animation: splash-out 0.6s var(--ease-out) 2.8s both;
}
.splash-content { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.splash-logo {
  width: 88px; height: 88px; border-radius: 24px;
  background: var(--acc-grad);
  display: grid; place-items: center;
  color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 44px;
  box-shadow: 0 8px 22px -6px rgba(80,70,255,.65);
  animation: splash-logo-enter 1.3s var(--ease-spring) both;
}
.splash-title {
  font-family: var(--font-display); font-weight: 800; font-size: 28px; letter-spacing: -.01em;
  background: var(--acc-grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0; animation: splash-text-in 0.5s var(--ease-out) 0.38s both;
}
.splash-sub {
  font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-faint);
  opacity: 0; animation: splash-text-in 0.5s var(--ease-out) 0.56s both;
}
@keyframes splash-logo-enter {
  0%   { transform: scale(0.25) rotate(-12deg); opacity: 0; box-shadow: 0 8px 22px -6px rgba(80,70,255,.3); }
  45%  { transform: scale(1.12) rotate(0deg);  opacity: 1; box-shadow: 0 8px 22px -6px rgba(80,70,255,.5); }
  56%  { transform: scale(1.0);  box-shadow: 0 0 80px 16px rgba(106,76,240,.8), 0 0 160px 40px rgba(123,108,255,.35); }
  72%  { transform: scale(1.0);  box-shadow: 0 8px 22px -6px rgba(80,70,255,.65); }
  100% { transform: scale(1.0);  opacity: 1;  box-shadow: 0 8px 22px -6px rgba(80,70,255,.65); }
}
@keyframes splash-text-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes splash-out {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.06); pointer-events: none; }
}

/* ============================================================
   AURORA BACKGROUND FLOW
   ============================================================ */
.bg-aurora {
  position: absolute; inset: 0;
  background: linear-gradient(
    125deg,
    rgba(106,76,240,.20) 0%,
    rgba(123,108,255,.11) 22%,
    rgba(255,210,61,.08) 44%,
    rgba(154,134,255,.15) 66%,
    rgba(106,76,240,.20) 100%
  );
  background-size: 400% 400%;
  animation: aurora 18s ease infinite;
  mix-blend-mode: screen;
  pointer-events: none;
}
.theme-light .bg-aurora { mix-blend-mode: multiply; opacity: .55; }
@keyframes aurora {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(60px,-50px) scale(1.08); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-70px,40px) scale(1.12); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(50px,60px) scale(.94); } }
@keyframes drift4 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-40px,-60px) scale(1.05); } }

.bg-grain {
  position: absolute;
  inset: -50%;
  opacity: .5;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.theme-light .bg-grain { opacity: .25; }

/* a soft vignette to seat content */
.bg-vignette {
  position: absolute; inset: 0; pointer-events: none;
}
.theme-dark .bg-vignette {
  background: radial-gradient(120% 90% at 50% 0%, transparent 40%, rgba(0,0,0,.45) 100%);
}
.theme-light .bg-vignette {
  background: radial-gradient(120% 90% at 50% 0%, transparent 55%, rgba(70,70,140,.12) 100%);
}

/* ============================================================
   GLASS PRIMITIVE
   ============================================================ */
.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  border-radius: 28px;
  box-shadow: var(--glass-shadow), var(--glass-inset);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}
/* specular sheen */
.glass::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(140deg, var(--glass-hi), transparent 40%);
  opacity: .6;
  pointer-events: none;
}
.glass.strong { background: var(--glass-bg-strong); }

/* glass effect off — flat solid cards */
.no-glass .glass {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.theme-light.no-glass .glass, .no-glass .theme-light .glass { background: rgba(255,255,255,.92); }
.theme-dark.no-glass .glass, .no-glass .theme-dark .glass { background: rgba(22,24,42,.92); }

/* hoverable lift */
.lift {
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.stage {
  position: relative;
  z-index: 2;
  max-width: 1240px;
  margin: 0 auto;
  padding: 30px 32px 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px;
  background: var(--acc-grad);
  display: grid; place-items: center;
  color: #fff; font-family: var(--font-display); font-weight: 800;
  font-size: 20px;
  box-shadow: 0 8px 22px -6px rgba(80, 70, 255, .65);
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand-sub { font-size: 12.5px; color: var(--ink-faint); margin-top: 1px; }

.topbar-right { display: flex; align-items: center; gap: 14px; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--chip-bg); border: 1px solid var(--glass-brd);
  display: grid; place-items: center; cursor: pointer;
  font-size: 18px; backdrop-filter: blur(12px);
  transition: transform .3s var(--ease-spring), background .3s;
}
.theme-toggle:hover { transform: scale(1.12) rotate(12deg); }
.month-pill {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--glass-brd);
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  backdrop-filter: blur(12px);
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--acc-grad);
  display: grid; place-items: center; color: #fff;
  font-weight: 700; font-size: 15px;
  box-shadow: 0 8px 20px -8px rgba(80, 70, 255, .6);
  border: 2px solid var(--glass-hi);
}

.grid {
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  gap: 22px;
  align-items: start;
}
.col { display: flex; flex-direction: column; gap: 22px; }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .stage { padding: 22px 18px 56px; }
}

/* section eyebrow */
.eyebrow {
  font-size: 11.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-faint);
  display: flex; align-items: center; gap: 8px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--acc-2); }

/* ============================================================
   INPUT PANEL
   ============================================================ */
.panel-pad { padding: 26px 26px 28px; }
.panel-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: 21px; letter-spacing: -.01em; margin: 14px 0 4px;
}
.panel-note { font-size: 13px; color: var(--ink-soft); margin-bottom: 22px; line-height: 1.5; }

.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.field-label { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.field-val {
  font-family: var(--font-display); font-weight: 600;
  font-size: 16px; color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* custom slider */
.slider {
  position: relative; height: 30px; display: flex; align-items: center;
  cursor: pointer; touch-action: none;
}
.slider-track {
  position: absolute; left: 0; right: 0; height: 8px; border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}
.slider-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  border-radius: 999px;
  background: var(--acc-grad);
  box-shadow: 0 0 16px -2px rgba(90, 100, 255, .7);
}
.slider-thumb {
  position: absolute; width: 24px; height: 24px; border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(120,120,200,.3);
  box-shadow: 0 6px 16px -4px rgba(40,40,110,.5), inset 0 0 0 5px var(--acc-2);
  transform: translateX(-50%);
  transition: box-shadow .2s, transform .15s var(--ease-spring);
}
.slider:hover .slider-thumb { transform: translateX(-50%) scale(1.12); }
.slider:active .slider-thumb { transform: translateX(-50%) scale(1.05); }

/* tier badge */
.tier-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  font-weight: 700; font-size: 13px;
  background: var(--acc-grad); color: #fff;
  box-shadow: 0 10px 24px -8px rgba(80,70,255,.6);
}
.tier-rate { font-size: 12.5px; color: var(--ink-soft); }
.tier-rate b { color: var(--ink); font-weight: 700; }

/* ============================================================
   EARNINGS HERO
   ============================================================ */
.hero-pad { padding: 30px 32px 30px; overflow: hidden; }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }

.hero-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 7vw, 86px);
  line-height: .98;
  letter-spacing: -.03em;
  margin: 14px 0 2px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, var(--ink), var(--ink) 60%, var(--acc-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.theme-dark .hero-amount {
  background: linear-gradient(120deg, #fff, #dcd4ff 50%, var(--acc-3));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-cur { font-size: .42em; -webkit-text-fill-color: var(--ink-faint); color: var(--ink-faint); margin-left: 6px; }
.hero-label { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--acc-2); }
.theme-dark .hero-label { color: var(--acc-2); }

.hero-phrase {
  font-size: 15px; color: var(--ink-soft); margin-top: 8px; max-width: 30ch;
  line-height: 1.5;
  min-height: 44px;
}
.hero-phrase b { color: var(--ink); font-weight: 700; }

.delta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
  background: var(--chip-bg); border: 1px solid var(--glass-brd);
}
.delta.up { color: #12b76a; }
.delta.up .arr { color: #12b76a; }

/* progress ring */
.ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.ring { position: relative; width: 132px; height: 132px; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring-center {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
}
.ring-pct { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -.02em; }
.ring-cap { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }

/* breakdown chips */
.breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 26px; }
.bd-card {
  padding: 16px 18px; border-radius: 20px;
  background: var(--chip-bg); border: 1px solid var(--glass-brd);
  position: relative; overflow: hidden;
}
.bd-card .k { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }
.bd-card .k .sw { width: 10px; height: 10px; border-radius: 3px; }
.bd-card .v {
  font-family: var(--font-display); font-weight: 600; font-size: 24px;
  margin-top: 8px; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.bd-card .sub { font-size: 11.5px; color: var(--ink-faint); margin-top: 3px; }

/* ============================================================
   FORTUNE WHEEL
   ============================================================ */
.fortune-btn { cursor: pointer; background: none; border: none; padding: 0; display: grid; place-items: center; transition: transform .35s var(--ease-spring); }
.fortune-btn:hover { transform: scale(1.12); }

/* 3D Dice */
.dice-scene { perspective: 90px; width: 28px; height: 28px; display: grid; place-items: center; }
.dice-cube {
  width: 22px; height: 22px; position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-20deg) rotateY(35deg);
  transition: transform .5s var(--ease-spring);
}
.fortune-btn:hover .dice-cube { transform: rotateX(-20deg) rotateY(35deg) rotateZ(14deg) scale3d(1.08,1.08,1.08); }
.dice-face {
  position: absolute; inset: 0;
  background: #fffef8; border-radius: 3px;
  border: 1px solid rgba(0,0,0,.18);
  backface-visibility: hidden;
}
.df-front  { transform: translateZ(11px); }
.df-back   { transform: rotateY(180deg) translateZ(11px); }
.df-right  { transform: rotateY(90deg)  translateZ(11px); }
.df-left   { transform: rotateY(-90deg) translateZ(11px); }
.df-top    { transform: rotateX(90deg)  translateZ(11px); }
.df-bottom { transform: rotateX(-90deg) translateZ(11px); }
.dice-dot {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: #1a1a3e; transform: translate(-50%,-50%);
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}

.fortune-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.6); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  animation: rise .3s var(--ease-out);
}
.fortune-card {
  padding: 32px 28px 28px; border-radius: 28px;
  max-width: 380px; width: 92%; text-align: center; position: relative;
}
.fortune-title {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 4px;
}

/* Drum (slot machine) */
.drum-wrap {
  position: relative; display: inline-flex;
  justify-content: center; margin: 20px 0 16px;
}
.drum-viewport {
  width: 150px; height: 192px;
  overflow: hidden; position: relative;
  border-radius: 18px;
  background: var(--chip-bg);
  border: 2px solid var(--glass-brd);
  box-shadow: inset 0 4px 24px rgba(0,0,0,.18);
}
.drum-idle { cursor: pointer; }
.drum-idle:hover { border-color: var(--acc-2); box-shadow: inset 0 4px 24px rgba(0,0,0,.18), 0 0 30px rgba(106,76,240,.4); }
.drum-strip { display: flex; flex-direction: column; }
.drum-cell {
  width: 150px; height: 64px; flex-shrink: 0;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 36px;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.drum-fade-top, .drum-fade-bot {
  position: absolute; left: 0; right: 0; height: 64px;
  pointer-events: none; z-index: 2;
}
.drum-fade-top { top: 0;    background: linear-gradient(to bottom, var(--chip-bg) 20%, transparent); }
.drum-fade-bot { bottom: 0; background: linear-gradient(to top,   var(--chip-bg) 20%, transparent); }
.drum-selector {
  position: absolute; top: 64px; left: 0; right: 0; height: 64px;
  border-top: 2px solid var(--acc-2); border-bottom: 2px solid var(--acc-2);
  pointer-events: none; z-index: 2;
  background: rgba(123,108,255,.1);
}

/* Text areas */
.fortune-hint     { font-size: 13.5px; color: var(--ink-soft); font-weight: 600; }
.fortune-hint-dim { opacity: .5; }
.fortune-result   { margin-top: 4px; }
.fortune-phrase-num { font-size: 22px; margin-bottom: 8px; }
.fortune-phrase   {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(16px, 4.5vw, 20px); line-height: 1.35;
  color: var(--ink); margin-bottom: 18px;
}
.fortune-replay {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 24px; border-radius: 999px;
  background: var(--acc-grad); color: #fff;
  font-family: var(--font-body); font-weight: 700; font-size: 14px;
  border: none; cursor: pointer;
  box-shadow: 0 10px 24px -8px rgba(80,70,255,.6);
  transition: transform .25s var(--ease-spring), box-shadow .25s;
}
.fortune-replay:hover { transform: scale(1.05); box-shadow: 0 14px 30px -8px rgba(80,70,255,.7); }

/* ============================================================
   MOBILE TOPBAR FIX
   ============================================================ */
@media (max-width: 600px) {
  .topbar { flex-wrap: nowrap; gap: 8px; }
  .brand { min-width: 0; flex-shrink: 1; overflow: hidden; }
  .brand > div { min-width: 0; }
  .brand > div > div:first-child { font-size: 16px !important; }
  .brand-sub { display: none; }
  .topbar-right { gap: 6px; flex-shrink: 0; }
  .month-pill { padding: 6px 10px; font-size: 12px; gap: 5px; }
  .theme-toggle {
    background: transparent !important; border: none !important;
    box-shadow: none !important; backdrop-filter: none !important;
    width: 32px; height: 32px; flex-shrink: 0;
  }
  .avatar.fortune-btn {
    background: transparent !important; border: none !important;
    box-shadow: none !important;
    width: 32px; height: 32px; flex-shrink: 0;
  }
}

/* celebration shimmer overlay */
.celebrate {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  opacity: 0;
}
.celebrate.on {
  animation: shimmer calc(1.1s / var(--anim-mult, 1)) var(--ease-out);
}
@keyframes shimmer {
  0% { opacity: 0; background: radial-gradient(60% 80% at 50% 120%, rgba(255,210,61,0), transparent); }
  30% { opacity: 1; background: radial-gradient(80% 120% at 50% 110%, rgba(255,210,61,.32), rgba(123,108,255,.2) 42%, transparent 72%); }
  100% { opacity: 0; background: radial-gradient(120% 160% at 50% 100%, rgba(255,210,61,0), transparent); }
}

/* spark particles */
.spark {
  position: absolute; width: 8px; height: 8px; border-radius: 2px;
  top: 50%; left: 50%; pointer-events: none;
  will-change: transform, opacity;
}

/* ============================================================
   LEADERBOARD
   ============================================================ */
.lb-pad { padding: 24px 26px 26px; }
.lb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.lb-title { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -.01em; }
.lb-list { display: flex; flex-direction: column; gap: 9px; }
.lb-row {
  display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: 16px;
  background: transparent; border: 1px solid transparent;
  transition: background .3s, border-color .3s, transform .3s var(--ease-out);
}
.lb-row:hover { background: var(--chip-bg); }
.lb-row.me {
  background: var(--glass-bg-strong);
  border-color: var(--glass-brd);
  box-shadow: 0 12px 30px -16px rgba(80,70,255,.5);
}
.lb-rank { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--ink-faint); text-align: center; }
.lb-row.me .lb-rank { color: var(--acc-2); }
.theme-dark .lb-row.me .lb-rank { color: var(--acc-2); }
.lb-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lb-ava { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.lb-name { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-meta { font-size: 11.5px; color: var(--ink-faint); margin-top: 1px; }
.lb-amount { font-family: var(--font-display); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.lb-row.me .lb-amount { color: var(--acc-2); }
.theme-dark .lb-row.me .lb-amount { color: var(--acc-2); }
.lb-medal { font-size: 15px; }

/* footer credit */
.foot { text-align: center; margin-top: 30px; font-size: 12px; color: var(--ink-faint); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.visit-count { font-size: 11px; opacity: .7; }

/* entrance */
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise calc(.7s / var(--anim-mult, 1)) var(--ease-out) both; }

/* ============================================================
   GRADE CARDS
   ============================================================ */
.grade-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 1100px) { .grade-grid { grid-template-columns: repeat(4, 1fr); } }
.grade-card {
  position: relative;
  padding: 16px 14px 14px; border-radius: 20px;
  background: var(--chip-bg); border: 1.5px solid var(--glass-brd);
  cursor: pointer; text-align: center;
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), border-color .25s, background .25s;
}
.grade-card:hover { transform: translateY(-3px); }
.grade-card .emo { font-size: 28px; line-height: 1; filter: drop-shadow(0 6px 12px rgba(0,0,0,.15)); }
.grade-card .gn { font-weight: 700; font-size: 14.5px; margin-top: 10px; }
.grade-card .gs { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }
.grade-card.active {
  background: linear-gradient(160deg, rgba(123,108,255,.18), rgba(123,108,255,.05));
  border-color: var(--sg-color, var(--acc-2));
  box-shadow: 0 16px 36px -14px rgba(106,76,240,.45), var(--glass-inset);
}
.grade-card.active .gn { color: var(--sg-color, var(--acc-1)); }
.theme-dark .grade-card.active .gn { color: var(--sg-color, #c9beff); }
.theme-dark .grade-card .gs { color: var(--ink-soft); }
.grade-card .pip {
  position: absolute; top: 11px; right: 11px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--sg-color, var(--acc-2)); box-shadow: 0 0 10px var(--sg-color, var(--acc-2)); opacity: 0; transition: opacity .25s;
}
.grade-card.active .pip { opacity: 1; }

/* InputPanel glow when premium subgrade active */
.sg-glow {
  box-shadow: var(--glass-shadow), var(--glass-inset),
              0 0 0 1.5px var(--sg-color),
              0 0 40px -10px var(--sg-color);
}

/* Subgrade bonus row in result */
.sg-line { color: var(--sg-color, var(--ink-soft)) !important; }
.sg-amt  { color: var(--sg-color, var(--ink)) !important; font-weight: 800; }

/* info button on subgrade cards */
.sg-info-btn {
  position: absolute; top: 8px; left: 8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--chip-bg); border: 1px solid var(--glass-brd);
  color: var(--ink-faint); font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: opacity .2s;
  line-height: 1;
}
.grade-card:hover .sg-info-btn { opacity: 1; }
@media (hover: none) { .sg-info-btn { opacity: .7; } }

/* subgrade perks panel */
.sg-perks {
  padding: 16px 18px; border-radius: 20px;
  border: 1.5px solid var(--glass-brd);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  position: relative;
}
.theme-light .sg-perks { background: rgba(250,250,255,.97); box-shadow: 0 20px 50px -10px rgba(40,40,110,.3); }
.theme-dark  .sg-perks { background: rgba(10,12,32,.97);    box-shadow: 0 20px 50px -10px rgba(0,0,0,.75); }

/* Desktop: absolute dropdown */
.sg-perks-popup {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 50;
}
/* Mobile: centered modal */
.sg-mobile-backdrop { display: none; }
@media (max-width: 600px) {
  .sg-mobile-backdrop {
    display: block;
    position: fixed; inset: 0; z-index: 299;
    background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  }
  .sg-perks-popup {
    position: fixed;
    top: 50%; left: 16px; right: 16px; bottom: auto;
    transform: translateY(-50%);
    border-radius: 20px; z-index: 300;
    max-height: 80vh; overflow-y: auto;
  }
}
.sg-perks-close {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--chip-bg); border: 1px solid var(--glass-brd);
  color: var(--ink-soft); font-size: 18px; line-height: 1;
  display: grid; place-items: center; cursor: pointer; z-index: 1;
}
.sg-perks-close:hover { color: var(--ink); }
@media (max-width: 520px) { .sg-perks-grid { grid-template-columns: 1fr; } }

.sg-perks-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.sg-perks-name { font-weight: 700; font-size: 15px; }
.sg-perks-sub  { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.sg-perks-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.perk-card {
  padding: 10px 12px; border-radius: 14px;
  background: var(--chip-bg); border: 1px solid var(--glass-brd);
  display: flex; gap: 9px; align-items: flex-start;
}
.perk-icon  { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.perk-title { font-weight: 700; font-size: 12.5px; color: var(--ink); line-height: 1.3; }
.perk-desc  { font-size: 11px; color: var(--ink-soft); margin-top: 2px; line-height: 1.3; }
.perk-special {
  margin-top: 10px; padding: 10px 14px; border-radius: 12px;
  background: linear-gradient(120deg, rgba(167,139,250,.15), rgba(167,139,250,.05));
  border: 1px solid rgba(167,139,250,.3);
  font-weight: 700; font-size: 13px; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* ============================================================
   PLAN FIELD + PERIOD SPLIT
   ============================================================ */
.plan-field {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 16px 20px; border-radius: 18px;
  background: var(--chip-bg); border: 1px solid var(--glass-brd);
}
.plan-input {
  font-family: var(--font-display); font-weight: 600; font-size: 26px;
  letter-spacing: -.02em; text-align: right; color: var(--ink);
  background: none; border: none; outline: none; width: 100%;
  font-variant-numeric: tabular-nums;
}
.plan-cur { font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--ink-faint); }
.split-row { display: flex; gap: 18px; margin-top: 12px; font-size: 12.5px; color: var(--ink-soft); }
.split-row b { color: var(--ink); font-weight: 700; }

/* ============================================================
   PERIOD TABS
   ============================================================ */
.ptabs { display: flex; gap: 6px; padding: 5px; border-radius: 16px; background: var(--track); }
.ptab {
  flex: 1; padding: 11px 10px; border-radius: 12px; border: none; cursor: pointer;
  background: transparent; color: var(--ink-soft); font-family: var(--font-body);
  font-weight: 700; font-size: 13.5px; transition: all .3s var(--ease-out);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.ptab .pr { font-size: 11px; font-weight: 600; opacity: .7; }
.ptab.active {
  background: var(--glass-bg-strong); color: var(--ink);
  box-shadow: 0 8px 20px -10px rgba(80,70,255,.5);
}
.theme-light .ptab.active { background: #fff; }

/* Period tab attention pulse */
.ptab-pulse {
  border: 1.5px solid rgba(245,158,11,.55) !important;
  animation: ptab-glow 1.8s ease-in-out infinite;
}
.ptab-badge {
  position: absolute; top: 5px; right: 5px;
  width: 15px; height: 15px; border-radius: 50%;
  background: #f59e0b; color: #fff;
  font-size: 9px; font-weight: 800;
  display: grid; place-items: center;
}
@keyframes ptab-glow {
  0%,100% { box-shadow: none;                          border-color: rgba(245,158,11,.35); }
  50%     { box-shadow: 0 0 14px 3px rgba(245,158,11,.3); border-color: rgba(245,158,11,.85); }
}

/* performance bar */
.perf-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.perf-val { font-family: var(--font-display); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.perf-val.good { color: #12b76a; }
.perf-bar { height: 9px; border-radius: 999px; background: var(--track); overflow: hidden; }
.perf-fill {
  height: 100%; border-radius: 999px; background: var(--acc-grad);
  transition: width .7s var(--ease-out);
  box-shadow: 0 0 14px -1px rgba(106,76,240,.7);
}
.perf-fill.good      { background: linear-gradient(90deg, #12b76a, #34d399); box-shadow: 0 0 14px -1px rgba(18,183,106,.6); }
.perf-fill.pace-green  { background: linear-gradient(90deg, #12b76a, #34d399); box-shadow: 0 0 14px -1px rgba(18,183,106,.6); }
.perf-fill.pace-yellow { background: linear-gradient(90deg, #f59e0b, #fbbf24); box-shadow: 0 0 14px -1px rgba(245,158,11,.5); }
.perf-fill.pace-red    { background: linear-gradient(90deg, #ef4444, #f87171); box-shadow: 0 0 14px -1px rgba(239,68,68,.5); }
.perf-val.pace-green  { color: #12b76a; }
.perf-val.pace-yellow { color: #f59e0b; }
.perf-val.pace-red    { color: #ef4444; }

/* coefficient readout chip */
.coef-chip {
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  padding: 4px 12px; border-radius: 10px; background: var(--chip-bg);
  border: 1px solid var(--glass-brd); font-variant-numeric: tabular-nums;
}

/* coefficient range slider */
.coef-range {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--acc-2) var(--coef-val, 0%), var(--track) var(--coef-val, 0%));
  outline: none;
  cursor: pointer;
  margin-top: 10px;
}
.coef-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(120,120,200,.3);
  box-shadow: 0 6px 16px -4px rgba(40,40,110,.5), inset 0 0 0 5px var(--acc-2);
  cursor: pointer;
}
.coef-range::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(120,120,200,.3);
  box-shadow: 0 6px 16px -4px rgba(40,40,110,.5), inset 0 0 0 5px var(--acc-2);
  cursor: pointer;
}

/* ============================================================
   SEGMENTED CONTROL (звонки / конверсия)
   ============================================================ */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg button {
  padding: 11px 8px; border-radius: 13px; cursor: pointer;
  border: 1px solid var(--glass-brd); background: var(--chip-bg);
  font-family: var(--font-body); font-weight: 700; font-size: 12.5px;
  color: var(--ink-soft); transition: all .25s var(--ease-out);
}
.seg button:hover { transform: translateY(-2px); }
.seg button.on {
  background: linear-gradient(135deg, #12b76a, #2fb389); color: #fff; border-color: transparent;
  box-shadow: 0 10px 22px -10px rgba(18,183,106,.7);
}
.seg button.on.zero { background: rgba(220,80,80,.15); border-color: rgba(200,70,70,.45); color: var(--ink); box-shadow: 0 6px 14px -8px rgba(220,80,80,.25); }

.sub-label { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 10px; }

/* ============================================================
   MOTIVATOR
   ============================================================ */
.motiv-pad { padding: 24px 26px 24px; }
.motiv-head { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.motiv-head .bolt { color: var(--gold); font-size: 16px; }
.motiv-big { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.02em; margin: 12px 0 4px; }
.motiv-big .u { color: var(--ink-faint); font-weight: 500; font-size: .5em; }
.motiv-rows { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.motiv-r { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-soft); }
.motiv-r .ic { width: 18px; text-align: center; opacity: .8; }
.motiv-r b { color: var(--ink); font-weight: 700; margin-left: auto; font-variant-numeric: tabular-nums; }
.motiv-extra {
  margin-top: 16px; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-radius: 16px;
  background: linear-gradient(120deg, rgba(255,210,61,.18), rgba(255,210,61,.05));
  border: 1px solid rgba(255,200,40,.45);
}
.motiv-extra .lab { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.motiv-extra .amt { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: #c79400; font-variant-numeric: tabular-nums; }
.theme-dark .motiv-extra .amt { color: var(--gold); }

/* ============================================================
   RESULT BREAKDOWN
   ============================================================ */
.res-pad { padding: 24px 26px 26px; }
.res-period { padding: 16px 18px; border-radius: 18px; background: var(--chip-bg); border: 1px solid var(--glass-brd); margin-bottom: 12px; }
.res-period .ph { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.res-period .pn { font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.res-period .pd { font-size: 11.5px; color: var(--ink-faint); }
.res-line { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13.5px; color: var(--ink-soft); }
.res-line .ic { width: 18px; text-align: center; opacity: .75; }
.res-line .amt { margin-left: auto; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.res-line.tot { border-top: 1px dashed var(--glass-brd); margin-top: 6px; padding-top: 10px; }
.res-line.tot .lbl { font-weight: 700; color: var(--ink); }
.res-line.tot .amt { font-family: var(--font-display); font-weight: 600; }

.res-summary-line { display: flex; align-items: center; gap: 12px; padding: 12px 2px; font-size: 14px; color: var(--ink-soft); }
.res-summary-line .amt { margin-left: auto; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.res-summary-line.good .amt { color: #12b76a; }

.grand {
  margin-top: 6px; display: flex; align-items: center; justify-content: space-between;
  padding-top: 18px; border-top: 1px solid var(--glass-brd);
}
.grand .gl { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 19px; }
.grand .gv {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  background: var(--acc-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.grand .gv .u { -webkit-text-fill-color: var(--ink-faint); color: var(--ink-faint); font-size: .5em; margin-left: 4px; }
