/* Deutsch-Trainer 7.0 — приложение. Два вида, переключаются кнопкой ◐ (html[data-theme]):
   neo    — «Neo-Berlin»: ночной город будущего, стекло, неон (жёлтый — табло вызова, бирюзовый — ИИ);
   bright — светлый и яркий: белые карточки, насыщенные синий, фиолетовый и жёлтый.
   Шрифты свои (DSGVO). Крупный текст и контраст — для всех, в том числе для старых телефонов. */

@font-face { font-family: "Golos"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("fonts/golos-text-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Golos"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("fonts/golos-text-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Golos"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("fonts/golos-text-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Golos"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("fonts/golos-text-cyrillic-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: "Vazirmatn"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/vazirmatn-arabic-wght-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }

/* ---------- темы ---------- */
:root, [data-theme="neo"] {
  color-scheme: dark;
  --bg: #070B1A;
  --bg-glow-1: rgba(62, 240, 255, 0.16);
  --bg-glow-2: rgba(255, 79, 216, 0.13);
  --grid: rgba(120, 150, 255, 0.06);
  --sheet: rgba(255, 255, 255, 0.055);
  --sheet-strong: #111A3A;
  --sheet-hover: rgba(255, 255, 255, 0.09);
  --line: rgba(140, 170, 255, 0.20);
  --ink: #EEF2FF;
  --ink-soft: #C3CCEB;
  --muted: #8F9AC0;
  --signal: #FFD23F;
  --signal-ink: #1A1300;
  --signal-soft: rgba(255, 210, 63, 0.14);
  --cyan: #3EF0FF;
  --violet: #7C7BFF;
  --magenta: #FF4FD8;
  --glow: 0 0 0 1px rgba(62, 240, 255, 0.35), 0 0 24px -4px rgba(62, 240, 255, 0.45);
  --role: rgba(62, 240, 255, 0.09);
  --role-line: rgba(62, 240, 255, 0.35);
  --me-bg: linear-gradient(135deg, #3EF0FF 0%, #7C7BFF 100%);
  --me-ink: #050A1C;
  --bar: rgba(7, 11, 26, 0.78);
  --ok: #3EE89B;
  --error: #FF5C7A;
  --shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.9);
  --blur: blur(14px);
}
[data-theme="bright"] {
  color-scheme: light;
  --bg: #F3F5FF;
  --bg-glow-1: rgba(43, 91, 255, 0.10);
  --bg-glow-2: rgba(255, 196, 0, 0.16);
  --grid: rgba(43, 91, 255, 0.045);
  --sheet: #FFFFFF;
  --sheet-strong: #FFFFFF;
  --sheet-hover: #F7F8FF;
  --line: #DDE2F4;
  --ink: #131A3A;
  --ink-soft: #33406B;
  --muted: #5B6488;
  --signal: #FFC400;
  --signal-ink: #1A1300;
  --signal-soft: #FFF3C4;
  --cyan: #0096C7;
  --violet: #5B3DF5;
  --magenta: #E0339F;
  --glow: 0 0 0 2px rgba(43, 91, 255, 0.25);
  --role: #EAF6FF;
  --role-line: #B9DDF5;
  --me-bg: linear-gradient(135deg, #2B5BFF 0%, #7B4DFF 100%);
  --me-ink: #FFFFFF;
  --bar: rgba(255, 255, 255, 0.86);
  --ok: #12A266;
  --error: #D5284B;
  --shadow: 0 14px 36px -22px rgba(27, 40, 110, 0.45);
  --blur: blur(10px);
}
:root {
  --font: "Golos", "Vazirmatn", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; color: var(--ink); font: 400 1.0625rem/1.5 var(--font); overscroll-behavior-y: none;
  background:
    radial-gradient(60vmax 40vmax at 10% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(50vmax 40vmax at 110% 10%, var(--bg-glow-2), transparent 60%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--bg);
  background-attachment: fixed;
}
[dir="rtl"] body { line-height: 1.75; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

.boot { height: 100vh; display: grid; place-items: center; }
.brand-mark { background: var(--signal); color: var(--signal-ink); padding: 3px 8px; border-radius: 6px; font-weight: 850; font-size: 0.9rem; letter-spacing: 0.04em; box-shadow: 0 0 18px -4px var(--signal); }
.boot .brand-mark { font-size: 1.4rem; padding: 8px 14px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }

/* ---------- голографическая сфера ИИ ---------- */
.orb { --s: 56px; width: var(--s); height: var(--s); flex: none; border-radius: 50%; position: relative; isolation: isolate;
  background: radial-gradient(circle at 34% 28%, #ffffff 0 5%, var(--cyan) 20%, var(--violet) 52%, var(--magenta) 82%);
  box-shadow: 0 0 calc(var(--s) * 0.45) -2px color-mix(in srgb, var(--cyan) 70%, transparent), inset 0 0 calc(var(--s) * 0.25) rgba(255,255,255,0.35);
  animation: orb-breathe 4.5s ease-in-out infinite; }
.orb::before { content: ""; position: absolute; inset: -14%; border-radius: 50%; z-index: -1;
  background: conic-gradient(from 0deg, transparent 0 20%, var(--cyan) 30%, transparent 42% 60%, var(--magenta) 72%, transparent 84%);
  filter: blur(3px); opacity: 0.75; animation: spin 7s linear infinite; }
.orb::after { content: ""; position: absolute; inset: 18%; border-radius: 50%;
  background: radial-gradient(circle at 60% 65%, rgba(255,255,255,0.55), transparent 55%); mix-blend-mode: screen; animation: spin 11s linear infinite reverse; }
.orb.small { --s: 34px; }
.orb.big { --s: 168px; }
.orb.huge { --s: 220px; }
body.speaking .orb { animation: orb-talk 0.42s ease-in-out infinite alternate; }
body.speaking .orb::before { animation-duration: 1.6s; opacity: 1; }
body.listening .orb { animation: orb-listen 1s ease-in-out infinite; filter: hue-rotate(160deg) saturate(1.3); }
@keyframes orb-breathe { 50% { transform: scale(1.045); } }
@keyframes orb-talk { from { transform: scale(0.97); } to { transform: scale(1.1); } }
@keyframes orb-listen { 50% { transform: scale(1.06); box-shadow: 0 0 calc(var(--s) * 0.8) 0 var(--signal); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- каркас ---------- */
.shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; max-width: 780px; margin: 0 auto; }
.bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--bar); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.bar h1 { font-size: 1.04rem; font-weight: 750; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: transparent; border: 0; color: inherit; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; font-size: 1.15rem; flex: none; }
.icon-btn:hover { background: var(--sheet-hover); }
.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 4px 10px; font-weight: 800; font-size: 0.9rem; border: 1px solid var(--line); background: var(--sheet); cursor: pointer; white-space: nowrap; }
.chip.hot { border-color: color-mix(in srgb, var(--signal) 60%, transparent); box-shadow: 0 0 16px -6px var(--signal); }
.chip.cold { opacity: 0.6; }
.view { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pad { padding: 16px 14px 28px; }
.tabs { display: flex; background: var(--bar); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabs button { flex: 1; background: none; border: 0; padding: 8px 2px 9px; font-size: 0.76rem; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; position: relative; }
.tabs button span { font-size: 1.25rem; line-height: 1; filter: grayscale(0.6); }
.tabs button[aria-current="page"] { color: var(--ink); font-weight: 750; }
.tabs button[aria-current="page"] span { filter: none; }
.tabs button[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 28%; right: 28%; height: 3px; border-radius: 0 0 4px 4px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }

/* ---------- кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--sheet); color: var(--ink); font-weight: 680;
  cursor: pointer; text-decoration: none; text-align: center; line-height: 1.25; transition: transform 0.08s, border-color 0.15s, background 0.15s;
}
.btn:hover { border-color: color-mix(in srgb, var(--cyan) 60%, var(--line)); background: var(--sheet-hover); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); box-shadow: 0 8px 24px -12px var(--signal); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.dark, .btn.glow { background: var(--me-bg); border-color: transparent; color: var(--me-ink); }
.btn.danger { background: var(--error); border-color: var(--error); color: #fff; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }
label.field { display: block; margin: 0 0 14px; font-weight: 650; }
label.field span { display: block; margin-bottom: 6px; }
input[type=email], input[type=text], input[inputmode=numeric], textarea, select {
  width: 100%; border: 1px solid var(--line); background: var(--sheet-strong); border-radius: 14px; padding: 12px 14px; font-size: 1.05rem;
}
select option { background: var(--sheet-strong); color: var(--ink); }
input:focus, textarea:focus, select:focus { border-color: var(--cyan); outline: none; box-shadow: var(--glow); }
.code-input { font-size: 1.8rem !important; letter-spacing: 0.4em; text-align: center; font-weight: 800; direction: ltr; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; margin: 6px 0 16px; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--cyan); }
.err { color: var(--error); font-weight: 650; margin: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.hint { display: block; color: var(--muted); font-weight: 400; font-size: 0.86rem; margin-top: 4px; }

/* ---------- вход ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px 18px calc(24px + var(--safe-b)); max-width: 480px; margin: 0 auto; }
.ticket { background: var(--sheet); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--line); border-radius: 22px; padding: 22px 20px; box-shadow: var(--shadow); position: relative; }
.ticket::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; border-radius: 22px 22px 0 0; background: linear-gradient(90deg, var(--cyan), var(--violet), var(--magenta), var(--signal)); }
.login .login-top { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.login h1 { font-size: clamp(1.6rem, 7vw, 2.2rem); font-weight: 850; line-height: 1.1; margin: 16px 0 8px; letter-spacing: -0.02em; }
[dir="rtl"] .login h1 { letter-spacing: 0; line-height: 1.4; }
.login .lead { color: var(--ink-soft); margin: 0 0 22px; }
.langs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 18px; justify-content: center; }
.langs button { background: none; border: 0; padding: 5px 10px; border-radius: 999px; color: var(--muted); cursor: pointer; font-size: 0.92rem; }
.langs button[aria-current="true"] { background: var(--sheet); color: var(--ink); font-weight: 700; box-shadow: inset 0 0 0 1px var(--line); }
.theme-row { display: flex; justify-content: center; margin-top: 10px; }

/* ---------- город (главный экран) ---------- */
.hello { font-size: 1.4rem; font-weight: 850; margin: 2px 0 12px; line-height: 1.2; }
.note { background: var(--signal-soft); border: 1px solid color-mix(in srgb, var(--signal) 40%, transparent); border-radius: 14px; padding: 10px 14px; margin: 0 0 14px; font-size: 0.95rem; }
.glass { background: var(--sheet); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.player { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; padding: 14px; margin-bottom: 14px; }
.player .who { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.player .lvl { font-weight: 850; font-size: 1.1rem; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.player .lvl small { font-weight: 600; color: var(--muted); font-size: 0.85rem; }
.xpbar { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 10%, transparent); overflow: hidden; }
.xpbar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--violet), var(--magenta)); box-shadow: 0 0 12px var(--cyan); transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.player .stats { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.levelbar { display: flex; gap: 6px; flex-wrap: wrap; }
.levelbar button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 4px 12px; font-weight: 750; cursor: pointer; font-size: 0.9rem; }
.levelbar button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.mission, .callcard, .story { display: flex; align-items: center; gap: 14px; padding: 14px; margin-bottom: 12px; width: 100%; text-align: start; cursor: pointer; color: inherit; font: inherit; }
.mission { border-color: color-mix(in srgb, var(--signal) 55%, var(--line)); }
.mission .ic, .callcard .ic, .story .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.6rem; flex: none; background: var(--signal-soft); }
.callcard .ic { background: color-mix(in srgb, var(--ok) 18%, transparent); animation: ring 2.4s ease-in-out infinite; }
.story .ic { background: color-mix(in srgb, var(--violet) 18%, transparent); }
.mission .txt, .callcard .txt, .story .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mission .txt b, .callcard .txt b, .story .txt b { font-size: 1.02rem; }
.mission .txt small, .callcard .txt small, .story .txt small { color: var(--muted); }
.kicker { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 800; color: var(--cyan); }
[dir="rtl"] .kicker { letter-spacing: 0; text-transform: none; font-size: 0.85rem; }
.pill-xp { background: var(--signal); color: var(--signal-ink); font-weight: 850; font-size: 0.82rem; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.pill-ok { background: var(--ok); color: #03140c; font-weight: 850; font-size: 0.82rem; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
@keyframes ring { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(-12deg); } 80% { transform: rotate(12deg); } 85% { transform: rotate(-8deg); } 90% { transform: rotate(8deg); } }
.progress { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 10%, transparent); overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; background: var(--violet); border-radius: inherit; }

.section h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 22px 0 10px; font-weight: 800; }
[dir="rtl"] .section h2 { letter-spacing: 0; text-transform: none; font-size: 0.95rem; }
.section .sub { color: var(--muted); font-size: 0.9rem; margin: -4px 0 10px; }

.city { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .city { grid-template-columns: repeat(3, 1fr); } }
.district { position: relative; overflow: hidden; border-radius: 18px; padding: 14px 12px 12px; min-height: 112px; cursor: pointer; text-align: start; color: inherit; font: inherit;
  border: 1px solid var(--line); background: var(--sheet); display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.district::before { content: ""; position: absolute; inset: auto -10% -40% -10%; height: 70%; background: radial-gradient(closest-side, var(--d-glow, transparent), transparent); opacity: 0.9; pointer-events: none; }
.district::after { content: ""; position: absolute; inset: auto 0 0 0; height: 26px; pointer-events: none; opacity: 0.1;
  background: linear-gradient(currentColor 0 0) 6% 100% / 9% 60% no-repeat, linear-gradient(currentColor 0 0) 20% 100% / 7% 90% no-repeat,
    linear-gradient(currentColor 0 0) 32% 100% / 12% 45% no-repeat, linear-gradient(currentColor 0 0) 50% 100% / 6% 100% no-repeat,
    linear-gradient(currentColor 0 0) 62% 100% / 11% 70% no-repeat, linear-gradient(currentColor 0 0) 79% 100% / 8% 50% no-repeat, linear-gradient(currentColor 0 0) 92% 100% / 9% 80% no-repeat; }
.district .d-ic { font-size: 1.7rem; line-height: 1; position: relative; }
.district b { position: relative; font-size: 1rem; line-height: 1.25; }
.district .d-count { position: relative; font-size: 0.82rem; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.district .d-count .progress { flex: 1; margin: 0; }
.district.lit { --d-glow: color-mix(in srgb, var(--cyan) 45%, transparent); border-color: color-mix(in srgb, var(--cyan) 45%, var(--line)); }
.district.full { --d-glow: color-mix(in srgb, var(--signal) 55%, transparent); border-color: color-mix(in srgb, var(--signal) 70%, var(--line)); box-shadow: 0 0 24px -10px var(--signal); }
.district[aria-expanded="true"] { outline: 2px solid var(--cyan); outline-offset: 1px; }
.dsheet { grid-column: 1 / -1; padding: 6px 0 4px; display: grid; gap: 8px; animation: rise 0.25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.card {
  background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px 12px; text-align: start; color: inherit; font: inherit;
  cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-height: 72px; position: relative; transition: border-color 0.15s, background 0.15s;
}
.card:hover { border-color: color-mix(in srgb, var(--cyan) 60%, var(--line)); background: var(--sheet-hover); }
.card b { font-weight: 720; line-height: 1.3; padding-inline-end: 64px; }
.card small { color: var(--muted); }
.card .free { position: absolute; top: 10px; inset-inline-end: 10px; background: var(--ok); color: #03140c; border-radius: 999px; font-size: 0.72rem; padding: 2px 8px; font-weight: 800; }
.card .stars { position: absolute; top: 10px; inset-inline-end: 10px; font-size: 0.86rem; letter-spacing: 1px; color: var(--signal); }
.card .stars .off { color: color-mix(in srgb, var(--ink) 25%, transparent); }
.card .free + .stars { top: 32px; }
.card .call-ic { font-size: 0.9rem; }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tools .card { min-height: 0; padding: 12px; font-weight: 650; }
.tools .card b { padding: 0; }

/* ---------- прогресс ---------- */
.bigstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.bigstats div { padding: 12px 8px; text-align: center; border-radius: 16px; border: 1px solid var(--line); background: var(--sheet); }
.bigstats b { display: block; font-size: 1.5rem; font-weight: 850; }
.bigstats small { color: var(--muted); font-size: 0.8rem; line-height: 1.2; display: block; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.badge-t { border: 1px solid var(--line); background: var(--sheet); border-radius: 16px; padding: 12px 6px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.badge-t .b-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--signal) 60%, transparent), color-mix(in srgb, var(--violet) 35%, transparent)); box-shadow: 0 0 18px -6px var(--signal); }
.badge-t small { font-size: 0.78rem; line-height: 1.25; font-weight: 650; }
.badge-t.locked { opacity: 0.55; }
.badge-t.locked .b-ic { filter: grayscale(1) brightness(0.8); background: color-mix(in srgb, var(--ink) 8%, transparent); box-shadow: none; }
.league { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.league li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--sheet); }
.league li .rk { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 850; font-size: 0.9rem; background: color-mix(in srgb, var(--ink) 9%, transparent); flex: none; }
.league li:nth-child(1) .rk { background: var(--signal); color: var(--signal-ink); }
.league li:nth-child(2) .rk { background: #C9D3E6; color: #111; }
.league li:nth-child(3) .rk { background: #E2A574; color: #111; }
.league li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.league li.me { border-color: var(--cyan); box-shadow: var(--glow); }
.storyline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; position: relative; }
.storyline li { display: flex; gap: 12px; align-items: center; padding: 8px 0; position: relative; }
.storyline li::before { content: ""; position: absolute; inset-inline-start: 13px; top: 0; bottom: 0; width: 2px; background: var(--line); z-index: -1; }
.storyline li:first-child::before { top: 50%; } .storyline li:last-child::before { bottom: 50%; }
.storyline .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; font-weight: 850; flex: none; border: 2px solid var(--line); background: var(--bg); }
.storyline li.done .dot { background: var(--ok); border-color: var(--ok); color: #03140c; }
.storyline li.next .dot { border-color: var(--signal); box-shadow: 0 0 14px -2px var(--signal); color: var(--signal); }
.storyline button { background: none; border: 0; padding: 0; text-align: start; cursor: pointer; font: inherit; color: inherit; }

/* ---------- сцена разговора: собеседник и его настроение ---------- */
.stage { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bar); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); position: sticky; top: 0; z-index: 4; }
.stage .st-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.stage .st-name { font-weight: 800; font-size: 0.98rem; display: flex; gap: 8px; align-items: center; }
.stage .st-name small { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
.mood { display: flex; align-items: center; gap: 8px; position: relative; }
.mood .face { font-size: 1.3rem; line-height: 1; transition: transform 0.3s; }
.mood .face.pop { animation: pop 0.5s ease-out; }
.mood .meter { flex: 1; height: 8px; border-radius: 999px; overflow: hidden; background: linear-gradient(90deg, var(--error), #FFB13F 40%, var(--ok)); opacity: 0.9; position: relative; }
.mood .meter i { position: absolute; inset-block: 0; inset-inline-end: 0; background: color-mix(in srgb, var(--bg) 82%, transparent); transition: width 0.8s cubic-bezier(.2,.8,.2,1); }
.mood .delta { position: absolute; inset-inline-end: 0; top: -16px; font-weight: 850; font-size: 0.85rem; animation: float-up 1.4s ease-out forwards; pointer-events: none; }
.mood .delta.up { color: var(--ok); } .mood .delta.down { color: var(--error); }
@keyframes float-up { from { opacity: 0; transform: translateY(6px); } 20% { opacity: 1; } to { opacity: 0; transform: translateY(-14px); } }
@keyframes pop { 40% { transform: scale(1.45); } }

/* ---------- переписка ---------- */
.thread { padding: 14px 12px 18px; display: flex; flex-direction: column; gap: 10px; }
.empty { text-align: center; color: var(--muted); margin: 14vh 20px 0; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.msg { max-width: 92%; display: flex; flex-direction: column; gap: 8px; animation: rise 0.22s ease-out; }
.bubble { border-radius: 18px; padding: 10px 13px; background: var(--sheet); border: 1px solid var(--line); overflow-wrap: anywhere; }
.bubble .ln { min-height: 0.6em; }
.bubble .ln:empty { height: 0.6em; }
.msg.bot { align-self: flex-start; }
.msg.role { align-self: flex-start; }
.msg.role .bubble { background: var(--role); border-color: var(--role-line); border-start-start-radius: 5px; box-shadow: 0 0 22px -14px var(--cyan); }
.msg.coach .bubble { background: var(--signal-soft); border-color: color-mix(in srgb, var(--signal) 40%, transparent); }
.msg.coach { align-self: flex-start; }
.msg.me { align-self: flex-end; }
.msg.me .bubble { background: var(--me-bg); color: var(--me-ink); border-color: transparent; border-start-end-radius: 5px; }
.msg.review { max-width: 100%; align-self: stretch; }
.msg.review .bubble { border-top: 4px solid var(--signal); }
.msg.notice .bubble { border-inline-start: 4px solid var(--signal); }
.msg .time { font-size: 0.75rem; color: var(--muted); }
.bubble code { background: color-mix(in srgb, var(--ink) 10%, transparent); padding: 1px 6px; border-radius: 6px; font-family: inherit; font-weight: 650; cursor: copy; }
.bubble s { opacity: 0.7; }
.bubble bdi[lang="de"] { unicode-bidi: isolate; }
.bubble img, .bubble video { max-width: 100%; border-radius: 12px; display: block; margin: 4px 0; }
.btns { display: flex; flex-direction: column; gap: 6px; }
.btns .row { display: flex; gap: 6px; flex-wrap: wrap; }
.btns .row > * { flex: 1 1 auto; }
.btns .btn { min-height: 40px; padding: 8px 12px; font-size: 0.95rem; border-radius: 12px; }
.play { display: inline-flex; align-items: center; gap: 8px; background: color-mix(in srgb, var(--ink) 10%, transparent); color: inherit; border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px 5px 6px; cursor: pointer; font-weight: 680; font-size: 0.92rem; margin-bottom: 6px; }
.play .ic { width: 26px; height: 26px; border-radius: 50%; background: var(--signal); color: var(--signal-ink); display: grid; place-items: center; font-size: 0.75rem; }
.play.on .ic { animation: pulse 1s infinite; }
.typing { align-self: flex-start; background: var(--sheet); border: 1px solid var(--line); border-radius: 18px; padding: 12px 16px; display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); animation: dot 1.2s infinite; box-shadow: 0 0 8px var(--cyan); }
.typing i:nth-child(2) { animation-delay: 0.15s; } .typing i:nth-child(3) { animation-delay: 0.3s; }
.typing .slow { flex-basis: 100%; margin-top: 6px; font-size: 13px; color: var(--muted); }
@keyframes dot { 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.cmd { color: var(--cyan); font-weight: 700; text-decoration: underline; cursor: pointer; }

/* ---------- поле ввода ---------- */
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 8px 10px calc(8px + var(--safe-b)); background: var(--bar); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-top: 1px solid var(--line); }
.composer textarea { resize: none; max-height: 140px; min-height: 46px; border-radius: 22px; padding: 11px 16px; line-height: 1.35; }
.round { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; font-size: 1.2rem; cursor: pointer; background: var(--me-bg); color: var(--me-ink); }
.round.mic { background: var(--signal); color: var(--signal-ink); box-shadow: 0 0 20px -6px var(--signal); }
.round.rec { background: var(--error); color: #fff; animation: pulse 1s infinite; }
.round:disabled { opacity: 0.4; cursor: default; }
.recbar { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 6px; font-weight: 650; }
.recbar .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--error); animation: pulse 1s infinite; }
.recbar button { margin-inline-start: auto; }

/* ---------- режим «Звонок» ---------- */
.callscreen { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; color: #fff;
  background: radial-gradient(80vmax 60vmax at 50% 20%, #1B2A6B 0%, #0A0F2A 55%, #04060F 100%); padding: max(20px, env(safe-area-inset-top)) 18px calc(18px + var(--safe-b)); overflow-y: auto; }
[data-theme="bright"] .callscreen { background: radial-gradient(80vmax 60vmax at 50% 20%, #3C6BFF 0%, #2436A8 60%, #141D5C 100%); }
.callscreen .c-top { text-align: center; margin-top: 4vh; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.callscreen .c-state { font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.75; font-weight: 700; }
[dir="rtl"] .callscreen .c-state { letter-spacing: 0; }
.callscreen .c-name { font-size: 1.8rem; font-weight: 850; line-height: 1.15; }
.callscreen .c-title { opacity: 0.8; }
.callscreen .c-timer { font-variant-numeric: tabular-nums; font-weight: 700; opacity: 0.9; }
.callscreen .c-orb { margin: 5vh 0 3vh; display: grid; place-items: center; position: relative; }
.callscreen .c-orb::before, .callscreen .c-orb::after { content: ""; position: absolute; width: 168px; height: 168px; border-radius: 50%; border: 2px solid rgba(62,240,255,0.5); animation: wave 2.4s ease-out infinite; }
.callscreen .c-orb::after { animation-delay: 1.2s; }
.callscreen.live .c-orb::before, .callscreen.live .c-orb::after { animation: none; opacity: 0; }
body.speaking .callscreen.live .c-orb::before { animation: wave 1.2s ease-out infinite; opacity: 1; }
@keyframes wave { from { transform: scale(0.9); opacity: 0.9; } to { transform: scale(1.7); opacity: 0; } }
.callscreen .c-mood { width: min(320px, 90%); margin-bottom: 10px; }
.callscreen .c-mood .meter i { background: rgba(10, 15, 42, 0.82); }
.callscreen .c-sub { width: min(560px, 100%); min-height: 3.2em; text-align: center; font-size: 1.12rem; line-height: 1.45; padding: 10px 14px; border-radius: 16px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); }
.callscreen .c-sub.blur > span { filter: blur(7px); user-select: none; }
.callscreen .c-said { font-size: 0.92rem; opacity: 0.8; margin-top: 8px; text-align: center; min-height: 1.4em; }
.callscreen .c-help { width: min(560px, 100%); margin-top: 10px; background: rgba(255, 210, 63, 0.14); border: 1px solid rgba(255,210,63,0.45); border-radius: 14px; padding: 10px 12px; font-size: 0.95rem; }
.callscreen .c-controls { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(560px, 100%); }
.callscreen .c-row { display: flex; gap: 22px; align-items: center; justify-content: center; width: 100%; }
.callscreen .c-row.composer { background: none; border: 0; backdrop-filter: none; padding: 0; }
.callscreen .c-btn { width: 66px; height: 66px; border-radius: 50%; border: 0; display: grid; place-items: center; font-size: 1.6rem; cursor: pointer; color: #fff; background: rgba(255,255,255,0.14); flex: none; }
.callscreen .c-btn small { display: block; }
.callscreen .c-btn.mic { width: 84px; height: 84px; font-size: 2rem; background: #FFD23F; color: #1a1300; box-shadow: 0 0 40px -8px #FFD23F; }
.callscreen .c-btn.end { background: #FF3B5C; }
.callscreen .c-btn.ok { background: #22C55E; animation: ring 1.6s ease-in-out infinite; }
.callscreen .c-lbl { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 0.8rem; opacity: 0.9; }
.callscreen .c-text { display: flex; gap: 8px; width: 100%; }
.callscreen .c-text input { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.25); }
.callscreen .c-text input::placeholder { color: rgba(255,255,255,0.6); }
.callscreen .linkish { background: none; border: 0; color: #fff; opacity: 0.85; text-decoration: underline; cursor: pointer; font-size: 0.92rem; }
.callscreen .recbar { color: #fff; }

/* ---------- экран итога ---------- */
.result { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 18px; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: fade 0.25s ease-out; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
.result .r-card { width: min(440px, 100%); padding: 22px 20px 18px; text-align: center; position: relative; overflow: hidden; background: var(--sheet-strong); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow), 0 0 60px -20px var(--cyan); animation: zoom 0.4s cubic-bezier(.2,1.4,.4,1); }
@keyframes zoom { from { transform: scale(0.85); opacity: 0; } }
.result .r-ic { font-size: 3rem; line-height: 1; }
.result .r-kicker { margin-top: 8px; }
.result .r-outcome { font-size: 1.35rem; font-weight: 850; line-height: 1.25; margin: 6px 0 2px; }
.result .r-title { color: var(--muted); font-size: 0.92rem; margin: 0 0 12px; }
.result .r-stars { display: flex; justify-content: center; gap: 10px; font-size: 2.4rem; margin: 6px 0 4px; }
.result .r-stars span { opacity: 0; transform: scale(0.3); animation: star-in 0.45s cubic-bezier(.2,1.6,.4,1) forwards; color: var(--signal); text-shadow: 0 0 18px var(--signal); }
.result .r-stars span.off { color: color-mix(in srgb, var(--ink) 22%, transparent); text-shadow: none; }
.result .r-stars span:nth-child(2) { animation-delay: 0.25s; } .result .r-stars span:nth-child(3) { animation-delay: 0.5s; }
@keyframes star-in { to { opacity: 1; transform: scale(1); } }
.result .r-why { font-size: 0.78rem; color: var(--muted); margin: 0 0 12px; }
.result .r-xp { font-size: 2rem; font-weight: 900; background: linear-gradient(90deg, var(--cyan), var(--violet), var(--magenta)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.result .r-parts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0 12px; }
.result .r-parts span { font-size: 0.8rem; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; color: var(--ink-soft); }
.result .r-lvl { text-align: start; margin: 6px 0 12px; }
.result .r-lvl .row { display: flex; justify-content: space-between; font-size: 0.86rem; font-weight: 700; margin-bottom: 6px; }
.result .r-up { background: var(--signal); color: var(--signal-ink); border-radius: 14px; padding: 8px 12px; font-weight: 850; margin: 0 0 10px; animation: pop 0.6s 0.6s both; }
.result .r-line { margin: 4px 0; font-weight: 700; }
.result .r-badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.result .r-badges .badge-t { width: 110px; animation: zoom 0.5s 0.8s both; }
.result .btn { margin-top: 12px; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; opacity: 0.9; animation: fall 2.2s ease-in forwards; }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--rot)); opacity: 0.2; } }

/* ---------- аккаунт ---------- */
.panel { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 14px; }
.panel h2 { font-size: 1.05rem; margin: 0 0 10px; }
.panel .btns { margin-top: 12px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.switch:first-of-type { border-top: 0; }
.switch input { width: 46px; height: 26px; accent-color: var(--cyan); flex: none; }
.links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.95rem; }
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-pick { border: 2px solid var(--line); border-radius: 16px; padding: 10px; cursor: pointer; background: transparent; color: inherit; font: inherit; font-weight: 700; display: flex; flex-direction: column; gap: 8px; align-items: stretch; text-align: center; }
.theme-pick[aria-pressed="true"] { border-color: var(--cyan); box-shadow: var(--glow); }
.theme-pick .sw { height: 54px; border-radius: 10px; position: relative; overflow: hidden; }
.theme-pick .sw.neo { background: radial-gradient(circle at 30% 40%, #3EF0FF 0 10%, transparent 11%), radial-gradient(circle at 70% 60%, #FF4FD8 0 8%, transparent 9%), linear-gradient(135deg, #070B1A, #18215A); }
.theme-pick .sw.bright { background: radial-gradient(circle at 30% 40%, #2B5BFF 0 10%, transparent 11%), radial-gradient(circle at 70% 60%, #FFC400 0 8%, transparent 9%), linear-gradient(135deg, #FFFFFF, #E4E9FF); border: 1px solid #DDE2F4; }

/* ---------- всплывающее ---------- */
.toast { position: fixed; left: 50%; bottom: calc(86px + var(--safe-b)); transform: translateX(-50%); background: var(--sheet-strong); color: var(--ink); border: 1px solid var(--line); padding: 10px 16px; border-radius: 14px; z-index: 60; max-width: 90vw; box-shadow: var(--shadow), var(--glow); font-weight: 650; text-align: center; }

@media (min-width: 780px) {
  .shell { border-inline: 1px solid var(--line); }
  .msg { max-width: 80%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .result .r-stars span { opacity: 1; transform: none; } }

/* ---------- 6.0: экран подписки, тихие кнопки ---------- */
.btn.quiet { background: none; border-color: transparent; box-shadow: none; color: var(--muted); font-size: 0.86rem; padding: 6px 8px; min-height: 0; text-decoration: underline; text-underline-offset: 3px; }
.buy .buy-title { font-size: 1.05rem; margin: 4px 0 12px; }
.buy .plans { display: grid; gap: 10px; margin-bottom: 16px; }
.buy .plan { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: start; padding: 14px 16px;
  border-radius: 16px; border: 2px solid var(--line); background: var(--sheet); color: inherit; font: inherit; cursor: pointer; min-height: 64px; }
.buy .plan.on { border-color: var(--cyan); box-shadow: var(--glow); }
.buy .plan:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.buy .plan-main { display: flex; flex-direction: column; gap: 2px; }
.buy .plan-main small, .buy .plan-price small { color: var(--muted); font-size: 0.84rem; }
.buy .plan-price { display: flex; flex-direction: column; align-items: flex-end; text-align: end; white-space: nowrap; }
.buy .plan-price b { font-size: 1.15rem; }
.buy .badge { align-self: flex-start; background: var(--signal); color: var(--signal-ink); border-radius: 999px; padding: 1px 8px; font-size: 0.78rem; font-weight: 800; }
.buy .buy-points { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; font-size: 0.94rem; }
.btn.big { min-height: 56px; font-size: 1.08rem; }

/* звонок: ничего не сжимается, сфера меньше, когда разговор идёт */
.callscreen > *, .callscreen .c-controls > * { flex-shrink: 0; }
.callscreen.live .c-orb { margin: 2.5vh 0 2vh; }
.callscreen.live .orb.big { --s: 128px; }
.callscreen.live .c-orb::before, .callscreen.live .c-orb::after { width: 128px; height: 128px; }
.callscreen .c-help code, .callscreen .c-help bdi { font-family: inherit; }
@media (max-height: 700px) { .callscreen .c-top { margin-top: 1vh; } .callscreen .c-name { font-size: 1.4rem; } }
