/* AI-Creators: тёмная бирюза, стеклянные карточки, крупные заголовки капсом, светящийся акцент.
 * Тема своя и всегда тёмная — не зависит от темы Telegram. */
:root {
  --bg: #071114;
  --bg-2: #0b1d22;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #eaf6f7;
  --hint: #8ba7ac;
  --accent: #1fc8d6;
  --accent-deep: #0e8d99;
  --accent-ink: #032a2f;
  --glow: 0 0 22px rgba(31, 200, 214, 0.38);
  --danger: #ff7a7a;
  --radius: 22px;
  --radius-sm: 14px;
  --display: "Segoe UI Variable Display", "SF Pro Display", "Montserrat", "Roboto", -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }

/* Фон: бирюзовые «прожекторы» и тонкая диагональная сетка */
.backdrop {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 60% at 85% -10%, rgba(31, 200, 214, 0.28), transparent 60%),
    radial-gradient(90% 50% at -10% 30%, rgba(14, 141, 153, 0.22), transparent 60%),
    radial-gradient(80% 50% at 50% 110%, rgba(31, 200, 214, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 55%);
}
.backdrop::after {
  content: ""; position: absolute; inset: 0; opacity: 0.35;
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 22px);
  mask-image: linear-gradient(180deg, #000, transparent 70%);
}

/* ─── шапка ─────────────────────────────────────────────────────────────── */
.hero { padding: 16px 18px 6px; max-width: 760px; margin: 0 auto; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { font: 700 12px/1 var(--display); letter-spacing: 0.22em; color: var(--hint); }
.logo b { color: var(--accent); }
.mode-btn {
  border: 1px solid var(--line-strong); background: var(--glass); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; cursor: pointer; backdrop-filter: blur(12px);
}
.hero-title {
  font: 800 34px/1.02 var(--display); letter-spacing: 0.02em; text-transform: uppercase;
  margin: 14px 0 6px; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}
.hero-title .accent {
  color: var(--accent);
  background: linear-gradient(180deg, #7ff2fa, var(--accent) 60%, var(--accent-deep));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { color: var(--hint); margin: 0 0 4px; font-size: 14px; }

/* ─── каркас ────────────────────────────────────────────────────────────── */
main { padding: 10px 14px calc(118px + env(safe-area-inset-bottom)); max-width: 760px; margin: 0 auto; }
.card {
  position: relative; background: linear-gradient(160deg, var(--glass-strong), var(--glass) 45%);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px;
  margin: 0 0 12px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.card h2 {
  font: 800 12px/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--hint); margin: 0 0 12px;
}
.card h2::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px;
  background: var(--accent); border-radius: 2px; vertical-align: -1px; box-shadow: var(--glow); }
.muted { color: var(--hint); }
.center { text-align: center; }
.small { font-size: 13px; }
.empty { text-align: center; padding: 28px 12px; color: var(--hint); }
.empty .big { font-size: 34px; display: block; margin-bottom: 6px; }

/* Нижняя панель вкладок: круглые кнопки, активная — крупный белый круг на «горбе» панели */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end;
  padding: 10px max(10px, calc((100% - 560px) / 2)) calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(18, 24, 26, 0.92), rgba(8, 12, 14, 0.98));
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 26px 26px 0 0;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45);
}
.dock button {
  position: relative; border: 0; background: transparent; color: #c9d6d8; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
}
.dock .ic {
  position: relative; z-index: 1; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04) 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, width 0.2s ease, height 0.2s ease, background 0.2s ease;
}
.dock svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }
.dock .lbl { position: relative; z-index: 1; color: #6f7f83; transition: color 0.2s ease; }
.dock button[aria-selected="true"] .ic {
  width: 58px; height: 58px; transform: translateY(-14px); color: #0a1416;
  background: radial-gradient(circle at 35% 30%, #ffffff, #e6eef0 75%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5), 0 0 0 6px rgba(14, 20, 22, 0.95), 0 0 26px rgba(31, 200, 214, 0.25);
}
.dock button[aria-selected="true"]::before {  /* «горб» панели под активной кнопкой */
  content: ""; position: absolute; left: 50%; top: -32px; width: 84px; height: 84px; z-index: 0;
  transform: translateX(-50%); border-radius: 50%;
  background: linear-gradient(180deg, rgba(20, 27, 29, 1), rgba(16, 22, 24, 1) 60%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.dock button[aria-selected="true"] svg { stroke-width: 2.1; }
.dock button[aria-selected="true"] .lbl { color: #ffffff; font-weight: 700; transform: translateY(-10px); }
.dock button:focus-visible .ic { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ─── кнопки ────────────────────────────────────────────────────────────── */
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn {
  border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer;
  font: 800 13px/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase;
  background: linear-gradient(180deg, #4fe0ea, var(--accent) 55%, var(--accent-deep));
  color: var(--accent-ink); box-shadow: var(--glow);
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); box-shadow: none; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid rgba(255, 122, 122, 0.35); box-shadow: none; }
.btn.wide { width: 100%; padding: 14px 16px; border-radius: 999px; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.back { border: 0; background: none; color: var(--accent); padding: 0 0 12px; cursor: pointer; font-weight: 700; }

/* ─── карта тем ─────────────────────────────────────────────────────────── */
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.topic {
  text-align: left; cursor: pointer; border: 1px solid var(--line); border-radius: 18px; padding: 14px 12px;
  background: linear-gradient(160deg, rgba(31, 200, 214, 0.10), var(--glass) 55%); min-height: 112px;
  display: flex; flex-direction: column; gap: 6px; backdrop-filter: blur(14px);
  transition: transform 0.12s, border-color 0.12s;
}
.topic:active { transform: scale(0.98); }
.topic:hover, .topic:focus-visible { border-color: rgba(31, 200, 214, 0.55); outline: none; }
.topic .emoji { font-size: 26px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4)); }
.topic .name { font: 800 14px/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.03em; }
.topic .desc { color: var(--hint); font-size: 12px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ─── батлы: «постер» ───────────────────────────────────────────────────── */
.poster { overflow: hidden; padding: 0; }
.poster .art {
  position: relative; padding: 22px 18px 18px; min-height: 170px;
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(31, 200, 214, 0.45), transparent 55%),
    radial-gradient(60% 80% at 0% 100%, rgba(14, 141, 153, 0.35), transparent 60%),
    linear-gradient(135deg, #0f2f36, #081619);
}
.poster .art::after { content: ""; position: absolute; right: 14px; bottom: 0; width: 18px; height: 54px;
  background: var(--accent); box-shadow: var(--glow); }
.poster .art::before { content: ""; position: absolute; left: 0; top: 18px; width: 16px; height: 28px; background: var(--accent); }
.poster .kicker { font: 800 11px/1 var(--display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin-left: 8px; }
.poster h3 { font: 800 26px/1.05 var(--display); text-transform: uppercase; letter-spacing: 0.02em; margin: 10px 0 10px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--hint); }
.meta-line .pill { padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--text); }
.meta-line .pill.hot { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.poster .body { padding: 14px 18px 18px; }
.rules { white-space: pre-wrap; word-break: break-word; color: #cfe3e6; font-size: 14px; }
.rules.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.more { border: 0; background: none; color: var(--accent); padding: 6px 0 0; cursor: pointer; font-size: 13px; font-weight: 600; }
.countdown { font: 800 20px/1 var(--display); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; margin-top: 12px; }
.countdown small { display: block; font: 600 11px/1.4 var(--display); letter-spacing: 0.14em; color: var(--hint); text-transform: uppercase; }

/* ─── поиск, ссылки ─────────────────────────────────────────────────────── */
.search {
  display: flex; align-items: center; gap: 8px; padding: 0 14px; margin: 0 0 12px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--glass); backdrop-filter: blur(14px);
}
.search svg { width: 18px; height: 18px; stroke: var(--hint); fill: none; stroke-width: 2; flex: 0 0 auto; }
.search input { flex: 1; border: 0; background: transparent; padding: 12px 0; outline: none; min-width: 0; }
.search:focus-within { border-color: var(--accent); box-shadow: var(--glow); }
.link-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.link-row:last-child { border-bottom: 0; }
.link-row .fav { width: 38px; height: 38px; border-radius: 12px; flex: 0 0 auto; display: grid; place-items: center;
  font: 800 15px/1 var(--display); color: var(--accent-ink); background: linear-gradient(160deg, #6ff0f8, var(--accent-deep)); text-transform: uppercase; }
.link-row .main { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 0; cursor: pointer; }
.link-row .title { font-weight: 600; line-height: 1.3; overflow: hidden; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.link-row .sub { color: var(--hint); font-size: 12px; }
.link-row .src { border: 1px solid var(--line-strong); background: none; border-radius: 8px; color: var(--hint);
  font-size: 11px; padding: 5px 8px; cursor: pointer; white-space: nowrap; }

/* ─── вопрос ────────────────────────────────────────────────────────────── */
.ask-box textarea { min-height: 96px; }
.answer p { margin: 0 0 10px; }
.answer ul { margin: 0 0 10px; padding-left: 20px; }
.answer li { margin: 0 0 4px; }
.answer li::marker { color: var(--accent); }
.sources { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
.sources li { margin: 0 0 8px; }
.sources button { border: 0; background: none; padding: 0; color: var(--text); text-align: left; cursor: pointer; }
.sources .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; margin-right: 8px;
  background: rgba(31, 200, 214, 0.15); color: var(--accent); font-size: 12px; font-weight: 800; }
.thinking { display: flex; align-items: center; gap: 10px; color: var(--hint); }
.thinking::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong);
  border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── админка: цифры, график, списки ────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.tile { background: linear-gradient(160deg, var(--glass-strong), var(--glass)); border: 1px solid var(--line);
  border-radius: 18px; padding: 14px; backdrop-filter: blur(14px); }
.tile .value { font: 800 28px/1.05 var(--display); font-variant-numeric: tabular-nums; }
.tile:first-child .value { color: var(--accent); text-shadow: 0 0 18px rgba(31, 200, 214, 0.35); }
.tile .label { color: var(--hint); font-size: 12px; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.08em; }
.tile .delta { font-size: 12px; margin-top: 4px; color: var(--hint); }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; max-height: 260px; overflow: visible; }
.chart .bar { fill: var(--accent); }
.chart .bar-hit { fill: transparent; cursor: pointer; }
.chart .bar-hit:focus { outline: none; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--hint); font-size: 10px; }
.chart .tip { position: absolute; pointer-events: none; transform: translate(-50%, -100%);
  background: #eaf6f7; color: #06181b; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 8px;
  white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-toggle { border: 0; background: none; color: var(--accent); padding: 8px 0 0; cursor: pointer; font-size: 13px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.data td, table.data th { padding: 5px 0; border-bottom: 1px solid var(--line); text-align: left; }
table.data td:last-child, table.data th:last-child { text-align: right; }

.barlist { list-style: none; margin: 0; padding: 0; }
.barlist li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 7px 0; }
.barlist .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barlist .num { color: var(--hint); font-variant-numeric: tabular-nums; }
.barlist .track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.barlist .fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.switch { position: relative; width: 48px; height: 28px; flex: 0 0 auto; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.12); transition: background 0.15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); transition: transform 0.15s; }
.switch input:checked + span { background: var(--accent); box-shadow: var(--glow); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid #fff; outline-offset: 2px; }

.facts { list-style: none; margin: 0; padding: 0; }
.facts li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.facts li:last-child { border-bottom: 0; }
.facts span { color: var(--hint); }
.facts b { font-variant-numeric: tabular-nums; text-align: right; }

/* Формы */
label.field { display: block; margin: 0 0 12px; }
label.field > span, .field-label { display: block; font-size: 11px; color: var(--hint); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; }
input[type=text], input[type=datetime-local], select, textarea {
  width: 100%; border: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.25); border-radius: 12px;
  padding: 11px 13px; outline: none;
}
input[type=text]:focus, input[type=datetime-local]:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: var(--glow); }
select option { background: #0b1d22; }
textarea { min-height: 140px; resize: vertical; line-height: 1.45; }
.choice { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.choice label { flex: 1 1 auto; position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; text-align: center; padding: 10px; border-radius: 12px; border: 1px solid var(--line-strong);
  cursor: pointer; font-size: 13px; }
.choice input:checked + span { border-color: var(--accent); color: var(--accent); font-weight: 700; background: rgba(31, 200, 214, 0.1); }
.choice input:focus-visible + span { outline: 2px solid #fff; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; }
.chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: rgba(31, 200, 214, 0.12); color: var(--accent); }

.list-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%;
  border: 0; background: none; padding: 12px 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; }
.list-item:last-child { border-bottom: 0; }
.list-item .meta { color: var(--hint); font-size: 12px; margin-top: 2px; }
.badge { font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--hint); white-space: nowrap; }
.badge.on { color: var(--accent); border-color: rgba(31, 200, 214, 0.5); }

.entries { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 12px; }
.entry { background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 12px; }
.entry .thumb { aspect-ratio: 1; background: rgba(255, 255, 255, 0.05); display: grid; place-items: center; font-size: 28px; }
.entry img { width: 100%; height: 100%; object-fit: cover; display: block; }
.entry .cap { padding: 6px 8px; }

.preview { white-space: pre-wrap; word-break: break-word; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #eaf6f7; color: #06181b; padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
  max-width: calc(100% - 32px); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45); z-index: 20; }
.toast.error { background: var(--danger); color: #2a0606; }

@media (min-width: 560px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .topic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-title { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.cite { color: var(--accent); font-size: 10px; font-weight: 800; margin-left: 1px; }
.poster-title { font: 800 20px/1.15 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.search input[type=search] { -webkit-appearance: none; appearance: none; }
.search input::-webkit-search-cancel-button { filter: invert(1) opacity(0.6); }

/* ═══ Эффекты: свет, переливы, искры ═════════════════════════════════════════ */
:root { --violet: #9b7bff; --pink: #ff5fa2; --gold: #ffd166; }

/* Плавающие световые пятна за всем содержимым */
.orbs { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.orbs i { position: absolute; width: 280px; height: 280px; border-radius: 50%; filter: blur(70px); opacity: 0.32;
  animation: drift 22s ease-in-out infinite alternate; }
.orbs i:nth-child(1) { background: var(--accent); top: -80px; right: -60px; }
.orbs i:nth-child(2) { background: var(--violet); top: 38%; left: -120px; opacity: 0.22; animation-duration: 28s; animation-delay: -6s; }
.orbs i:nth-child(3) { background: var(--pink); bottom: -120px; right: 10%; opacity: 0.16; animation-duration: 34s; animation-delay: -12s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 60px) scale(1.15); }
  100% { transform: translate(-30px, 20px) scale(0.95); }
}

/* Переливающееся слово в заголовке */
.hero-title .accent {
  background: linear-gradient(90deg, #7ff2fa, var(--accent), var(--violet), var(--accent), #7ff2fa);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: shimmer 7s linear infinite;
}
@keyframes shimmer { to { background-position: 300% 0; } }

/* Карточки выезжают по очереди */
.rise { animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }

/* Главная кнопка мягко «дышит» светом */
.btn:not(.ghost):not(.danger) { animation: breathe 2.8s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 18px rgba(31, 200, 214, 0.30); }
  50% { box-shadow: 0 0 30px rgba(31, 200, 214, 0.60), 0 0 60px rgba(155, 123, 255, 0.18); }
}

/* Блик, пробегающий по постеру батла */
.poster::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.10), transparent);
  transform: skewX(-12deg); animation: sweep 5.5s ease-in-out infinite;
}
@keyframes sweep { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.countdown.urgent { color: var(--pink); animation: urgent 1.6s ease-in-out infinite; }
@keyframes urgent { 50% { text-shadow: 0 0 16px rgba(255, 95, 162, 0.7); } }

/* Искры */
.spark { position: fixed; z-index: 50; width: 7px; height: 7px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 10px var(--c); pointer-events: none;
  animation: spark 1.1s cubic-bezier(0.15, 0.7, 0.3, 1) both; }
.spark.star { border-radius: 1px; width: 9px; height: 9px; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
@keyframes spark {
  0% { transform: translate(0, 0) scale(0.4) rotate(0); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--dy) + 40px)) scale(1.1) rotate(200deg); opacity: 0; }
}

/* ─── вкладка «Старт» ───────────────────────────────────────────────────── */
.welcome { overflow: hidden; cursor: pointer;
  background: linear-gradient(135deg, rgba(31, 200, 214, 0.22), rgba(155, 123, 255, 0.14) 55%, rgba(255, 95, 162, 0.10)); }
.welcome .hello { font: 800 24px/1.15 var(--display); margin-bottom: 8px; position: relative; z-index: 1; }
.welcome p { margin: 0; color: #d6e8ea; position: relative; z-index: 1; }
.welcome-glow { position: absolute; width: 180px; height: 180px; right: -50px; top: -60px; border-radius: 50%;
  background: radial-gradient(circle, rgba(127, 242, 250, 0.55), transparent 65%); animation: pulse 4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.25); opacity: 0.6; } }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.step { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line);
  border-radius: 16px; padding: 12px; background: rgba(0, 0, 0, 0.18); cursor: pointer; transition: border-color 0.15s, transform 0.12s; }
div.step { cursor: default; }
button.step:hover, button.step:focus-visible { border-color: rgba(31, 200, 214, 0.55); outline: none; }
button.step:active { transform: scale(0.98); }
.step .num { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font: 800 15px/1 var(--display); color: #071114;
  background: linear-gradient(135deg, #7ff2fa, var(--accent) 50%, var(--violet)); box-shadow: 0 0 16px rgba(31, 200, 214, 0.45); }
.step .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.step .title { font-weight: 700; }
.step .emo { margin-right: 6px; }
.step .text { color: var(--hint); font-size: 13px; line-height: 1.4; }
.step .arrow { color: var(--accent); font-size: 26px; line-height: 1; }

.rules-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
.rule { display: grid; grid-template-columns: 40px 1fr; gap: 2px 10px; padding: 12px; border-radius: 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)); border: 1px solid var(--line); }
.rule .emoji { grid-row: span 2; font-size: 26px; line-height: 40px; text-align: center; }
.rule b { font: 800 14px/1.25 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.rule .text { color: #cfe3e6; font-size: 13px; line-height: 1.4; }
.rules-outro { margin: 12px 0 0; }

.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: 0; }
.faq summary { list-style: none; cursor: pointer; padding: 12px 28px 12px 0; position: relative; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 8px; font-size: 22px; color: var(--accent); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 12px; color: #cfe3e6; font-size: 14px; animation: rise 0.3s ease both; }

@media (min-width: 560px) { .rules-grid { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .orbs i, .hero-title .accent, .btn, .poster::after, .welcome-glow, .countdown.urgent { animation: none !important; }
}

/* Команда */
.who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn.ghost.on { border-color: var(--accent); color: var(--accent); background: rgba(31, 200, 214, 0.10); }

/* Библиотека промптов */
.filter-chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 12px; margin: 0 -2px; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.fchip { flex: 0 0 auto; border: 1px solid var(--line-strong); background: var(--glass); color: var(--text);
  border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 600; cursor: pointer; backdrop-filter: blur(12px); }
.fchip.on { background: linear-gradient(135deg, rgba(31, 200, 214, 0.28), rgba(155, 123, 255, 0.22)); border-color: var(--accent); color: #fff; }
.prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.muted-chip { background: rgba(255, 255, 255, 0.06); color: var(--hint); }
.prompt-text { white-space: pre-wrap; word-break: break-word; font: 14px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: #e3f3f5; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; }
.prompt-text.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.star-btn.on { border-color: var(--gold); color: var(--gold); }

/* Полезное: переключатель и каталог нейросетей */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); border-radius: 14px; }
.seg-btn { border: 0; background: transparent; color: var(--hint); border-radius: 10px; padding: 9px 6px;
  font-weight: 700; cursor: pointer; }
.seg-btn.on { background: linear-gradient(135deg, rgba(31, 200, 214, 0.30), rgba(155, 123, 255, 0.22)); color: #fff;
  box-shadow: 0 0 16px rgba(31, 200, 214, 0.25); }
.legend { margin: 0 0 12px; }
.add-tool { margin-bottom: 12px; }
.tool-name { font: 800 17px/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.tool-desc { margin: 6px 0 10px; color: #cfe3e6; font-size: 14px; }
.tool-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.tbadge { font-size: 12px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text); }
.tbadge.price-free { border-color: rgba(31, 200, 214, 0.6); color: #7ff2fa; }
.tbadge.price-paid { border-color: rgba(255, 209, 102, 0.5); color: var(--gold); }
.tbadge.ru-yes { border-color: rgba(127, 242, 250, 0.5); }
.tbadge.ru-vpn { border-color: rgba(255, 95, 162, 0.45); color: #ff9cc6; }
.tbadge.ru-unknown { color: var(--hint); }

/* Карточка участника */
.profile { background: linear-gradient(150deg, rgba(155, 123, 255, 0.18), rgba(31, 200, 214, 0.10) 60%, var(--glass)); }
.profile-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.profile-name { font: 800 20px/1.15 var(--display); }
.level { font: 800 13px/1 var(--display); padding: 8px 12px; border-radius: 999px; white-space: nowrap;
  background: linear-gradient(135deg, var(--gold), #ff9f43); color: #2a1600; box-shadow: 0 0 18px rgba(255, 209, 102, 0.35); }
.pstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.pstat { text-align: center; padding: 10px 4px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); }
.pstat b { display: block; font: 800 20px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.pstat span { font-size: 11px; color: var(--hint); }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px;
  border: 1px dashed var(--line-strong); background: transparent; cursor: pointer; opacity: 0.45; filter: grayscale(1); }
.badge-item.earned { opacity: 1; filter: none; border-style: solid; border-color: rgba(255, 209, 102, 0.55);
  background: rgba(255, 209, 102, 0.08); box-shadow: 0 0 14px rgba(255, 209, 102, 0.18); }
.badge-item .bi { font-size: 24px; line-height: 1; }
.badge-item .bt { font-size: 11px; font-weight: 700; color: var(--text); text-align: center; }

/* Топ недели */
.top-row { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; scrollbar-width: none; }
.top-row::-webkit-scrollbar { display: none; }
.top-item { position: relative; flex: 0 0 132px; scroll-snap-align: start; border: 1px solid var(--line); border-radius: 16px;
  background: rgba(0, 0, 0, 0.25); padding: 0; overflow: hidden; cursor: pointer; text-align: left; color: var(--text); }
.top-thumb { position: relative; aspect-ratio: 4 / 5; display: grid; place-items: center; font-size: 30px; background: rgba(255, 255, 255, 0.05); }
.top-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.top-thumb .play { position: absolute; inset: auto 8px 8px auto; width: 26px; height: 26px; border-radius: 50%; display: grid;
  place-items: center; font-size: 11px; background: rgba(0, 0, 0, 0.6); color: #fff; }
.medal { position: absolute; top: 6px; left: 6px; z-index: 1; font-size: 22px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5)); }
.top-meta { display: flex; justify-content: space-between; gap: 6px; padding: 8px 10px; font-size: 12px; }
.top-meta .author { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.top-meta .likes { white-space: nowrap; color: #ff9cc6; }
.top-hide { position: absolute; top: 6px; right: 6px; z-index: 2; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; background: rgba(0, 0, 0, 0.6); color: #fff; cursor: pointer; }

/* ─── галерея батла ─────────────────────────────────────────────────────── */
.no-scroll { overflow: hidden; }
.gallery { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  background: radial-gradient(120% 70% at 50% 0%, rgba(31, 200, 214, 0.18), transparent 60%), #05090b;
  animation: gIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.gallery.closing { animation: gOut 0.22s ease both; }
@keyframes gIn { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes gOut { to { opacity: 0; transform: scale(0.97); } }
.g-head { display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 16px 10px; }
.g-head > div { flex: 1; min-width: 0; }
.g-title { font: 800 18px/1.15 var(--display); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-count { font: 700 13px/1 var(--display); color: var(--hint); font-variant-numeric: tabular-nums; }
.g-close { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--glass); color: #fff; cursor: pointer; }
.g-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.g-track::-webkit-scrollbar { display: none; }
.g-slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; flex-direction: column; padding: 0 16px; min-height: 0; overflow: hidden; }
.g-media { flex: 1; min-height: 0; display: grid; place-items: center; font-size: 54px; border-radius: 22px; overflow: hidden;
  background: rgba(255, 255, 255, 0.04); transition: transform 0.08s linear; will-change: transform; }
.g-media img { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; }
.g-info { padding: 12px 2px calc(10px + env(safe-area-inset-bottom)); }
.g-num { display: flex; align-items: center; gap: 8px; font: 800 20px/1.2 var(--display); text-transform: uppercase; margin-bottom: 4px; }
.g-caption { color: #cfe3e6; font-size: 14px; margin: 4px 0; max-height: 3.2em; overflow: hidden; }
.g-vote { flex: 1 1 100%; border: 0; border-radius: 999px; padding: 15px 18px; font: 800 16px/1 var(--display); letter-spacing: 0.04em;
  cursor: pointer; color: #fff; background: linear-gradient(135deg, var(--pink), #ff7a59); box-shadow: 0 0 26px rgba(255, 95, 162, 0.45); }
.g-vote.chosen { background: linear-gradient(135deg, #2bd47d, var(--accent)); box-shadow: 0 0 26px rgba(43, 212, 125, 0.45); }
.g-vote[disabled] { background: rgba(255, 255, 255, 0.08); box-shadow: none; color: var(--hint); }
.g-vote.pulse { animation: heart 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes heart { 0% { transform: scale(1); } 30% { transform: scale(1.12); } 55% { transform: scale(0.96); } 100% { transform: scale(1); } }
.g-dots { display: flex; justify-content: center; gap: 6px; padding: 0 0 calc(8px + env(safe-area-inset-bottom)); }
.g-dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.25); transition: width 0.2s, background 0.2s; }
.g-dots i.on { width: 18px; background: var(--accent); }

/* ─── проверка новичка ──────────────────────────────────────────────────── */
.accept { display: flex; align-items: center; gap: 12px; padding: 4px 0 14px; cursor: pointer; font-weight: 600; }
.accept input { width: 22px; height: 22px; accent-color: var(--accent); flex: 0 0 auto; }
.human { position: relative; height: 54px; margin-bottom: 14px; border-radius: 999px; overflow: hidden;
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line-strong); }
.human-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; z-index: 2; cursor: grab;
  -webkit-appearance: none; appearance: none; background:
  linear-gradient(90deg, rgba(31, 200, 214, 0.45), rgba(155, 123, 255, 0.35)) 0 0 / var(--p, 0%) 100% no-repeat; }
.human-range::-webkit-slider-thumb { -webkit-appearance: none; width: 54px; height: 54px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #dfe9eb); box-shadow: 0 0 20px rgba(31, 200, 214, 0.6); }
.human-range::-moz-range-thumb { width: 54px; height: 54px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 20px rgba(31, 200, 214, 0.6); }
.human-label { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; padding-left: 62px;
  font-weight: 700; font-size: 14px; color: var(--hint); pointer-events: none; animation: hint 2.4s ease-in-out infinite; }
@keyframes hint { 50% { opacity: 0.45; } }
.human.done { border-color: #2bd47d; }
.human.done .human-label { color: #fff; animation: none; z-index: 3; padding-left: 0; }
.done-card { text-align: center; }
.big-emoji { font-size: 64px; line-height: 1; margin-bottom: 8px; animation: pop 0.6s cubic-bezier(0.2, 0.8, 0.2, 1.4) both; }
@keyframes pop { from { transform: scale(0.3) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ═══ Анимации 2.0: наклон, бегущая рамка, звёзды, переходы ═══════════════════ */

/* Наклон карточек за пальцем с бликом */
.tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); transform-style: preserve-3d; }
.tilt.tilting { transition: transform 0.06s linear; }
.tilt:not(.poster)::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.14), transparent 55%);
  opacity: 0; transition: opacity 0.3s; }
.tilt.tilting:not(.poster)::after { opacity: 1; }
.topic, .tool, .tile, .top-item, .rule, .step { position: relative; }
/* у постера ::after занят бликом-проходом — для него наклон без отдельного блика */

/* Бегущая светящаяся рамка */
@property --angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.poster::before, .welcome::before, .profile::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 3;
  background: conic-gradient(from var(--angle), transparent 0 55%, var(--accent) 70%, var(--violet) 80%, var(--pink) 88%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: angle 5s linear infinite;
}
.profile::before { animation-duration: 7s; }
@keyframes angle { to { --angle: 360deg; } }

/* Звёздная пыль */
.stars { position: fixed; inset: -50% 0 0; z-index: -1; pointer-events: none; opacity: 0.55;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff, transparent), radial-gradient(1px 1px at 72% 8%, #bff8ff, transparent),
    radial-gradient(1.5px 1.5px at 38% 42%, #fff, transparent), radial-gradient(1px 1px at 88% 36%, #d9ccff, transparent),
    radial-gradient(1px 1px at 22% 66%, #fff, transparent), radial-gradient(1.5px 1.5px at 58% 74%, #bff8ff, transparent),
    radial-gradient(1px 1px at 80% 88%, #fff, transparent), radial-gradient(1px 1px at 6% 92%, #ffd6ea, transparent);
  background-size: 360px 360px; animation: stars-drift 90s linear infinite, twinkle 6s ease-in-out infinite; }
@keyframes stars-drift { to { transform: translateY(360px); } }
@keyframes twinkle { 50% { opacity: 0.25; } }

/* Смена вкладок: сдвиг в сторону перехода */
#app[data-dir="fwd"] .rise { animation-name: rise-fwd; }
#app[data-dir="back"] .rise { animation-name: rise-back; }
@keyframes rise-fwd { from { opacity: 0; transform: translateX(26px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes rise-back { from { opacity: 0; transform: translateX(-26px) scale(0.98); } to { opacity: 1; transform: none; } }

/* Активная иконка подпрыгивает, кнопки пружинят */
.dock button[aria-selected="true"] .ic { animation: dock-pop 0.45s cubic-bezier(0.2, 0.8, 0.2, 1.5); }
@keyframes dock-pop { 0% { transform: translateY(0) scale(0.8); } 60% { transform: translateY(-18px) scale(1.06); } 100% { transform: translateY(-14px) scale(1); } }
.btn, .fchip, .seg-btn, .g-vote { transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1.6), box-shadow 0.2s; }
.btn:active, .fchip:active, .seg-btn:active { transform: scale(0.95); }

@media (prefers-reduced-motion: reduce) {
  .stars, .poster::before, .welcome::before, .profile::before, .dock button[aria-selected="true"] .ic { animation: none !important; }
  .tilt { transform: none !important; }
}
