/* TL Helper — те же цвета, что у приложения TL DPS (tlmeter/gui/theme.py) */
:root {
  --bg: #0f1115;
  --stage: #0b0d10;
  --surface: #161920;
  --field: #1d212a;
  --border: #262b36;
  --border-hi: #3a4150;
  --text: #e3e6ec;
  --muted: #8b92a3;
  --gold: #e8b04b;
  --gold-ink: #1a1408;
  --direct: #4e8fe0;
  --crit: #ff7a45;
  --dot: #9a6edc;
  --bad: #f08a80;
  --hp: #d6544c;
  --good: #5eba7d;
  --display: "Unbounded", "Segoe UI", system-ui, sans-serif;
  --body: "Golos Text", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}

.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(400px, 0.8fr);
}

/* ---------- сцена: лента ударов боя ---------- */
.stage {
  background: var(--stage);
  border-right: 1px solid var(--border);
  padding: clamp(32px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  overflow: hidden;
}
.wordmark {
  font: 700 clamp(56px, 8.4vw, 128px)/0.92 var(--display);
  letter-spacing: -0.035em;
  max-width: 6ch;
}
.tagline {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 17px;
  max-width: 32ch;
}
.fight { margin: 0; }
.hits {
  display: block;
  width: 100%;
  height: clamp(160px, 26vh, 260px);
  overflow: visible;
}
.hits .base { stroke: var(--border); stroke-width: 1; }
.hits .bar { transform-box: fill-box; transform-origin: 50% 100%; }
.hits .bar.direct { fill: var(--direct); }
.hits .bar.crit { fill: var(--crit); }
.hits .bar.dot { fill: var(--dot); opacity: 0.85; }
.hits .dps {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.sw.direct { background: var(--direct); }
.sw.crit { background: var(--crit); }
.sw.dot { background: var(--dot); }
.sw.line { height: 3px; width: 16px; border-radius: 2px; background: var(--gold); }

@media (prefers-reduced-motion: no-preference) {
  .hits .bar { animation: rise 520ms cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 16ms); }
  .hits .dps { stroke-dasharray: var(--len); stroke-dashoffset: var(--len);
               animation: draw 1400ms 300ms cubic-bezier(.4,0,.2,1) forwards; }
}
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- панель формы ---------- */
.panel {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px clamp(20px, 4vw, 56px);
}
.panel-inner { width: 100%; max-width: 360px; }
.mobile-mark { display: none; }

h1 {
  font: 500 28px/1.15 var(--display);
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}
.lead { color: var(--muted); margin: 0 0 28px; max-width: 34ch; }
.lead strong, .who { color: var(--text); font-weight: 600; }

.form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.label { font-size: 13px; font-weight: 500; color: var(--muted); }
input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  font: inherit;
  transition: border-color 120ms, box-shadow 120ms;
}
input:hover { border-color: var(--border-hi); }
input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 176, 75, 0.18); }
input::placeholder { color: #5b6273; }
input.code { font-variant-numeric: tabular-nums; letter-spacing: 0.12em; text-transform: uppercase; }
input.code::placeholder { letter-spacing: 0.12em; }
.msg { font-size: 13px; color: var(--muted); min-height: 0; }
.msg:empty { display: none; }
.field.bad input { border-color: var(--hp); }
.field.bad .msg { color: var(--bad); }

.pw { position: relative; display: block; }
.pw input { padding-right: 92px; }
.reveal {
  position: absolute; right: 6px; top: 6px; bottom: 6px;
  padding: 0 10px;
  background: transparent; color: var(--muted);
  border: 0; border-radius: 6px;
  font: 500 13px var(--body); cursor: pointer;
}
.reveal:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.captcha { min-height: 78px; }
.captcha .hint { margin-top: 6px; }

button { font: inherit; cursor: pointer; }
.primary, .secondary {
  height: 48px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 15px;
  transition: background 120ms, transform 80ms;
}
.primary { background: var(--gold); color: var(--gold-ink); border: 0; }
.primary:hover { background: #f0bd5e; }
.primary:active { transform: translateY(1px); }
.primary[disabled] { opacity: 0.6; cursor: progress; }
.secondary { background: var(--field); color: var(--text); border: 1px solid var(--border); }
.secondary:hover { border-color: var(--border-hi); }
.link { background: none; border: 0; padding: 0; color: var(--gold); font-weight: 500; }
.link:hover, a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
input:focus-visible { outline: none; }

a { color: var(--gold); text-decoration: none; font-weight: 500; }
.switch { margin: 28px 0 0; color: var(--muted); }
.quiet { margin-top: 20px; }
.hint { color: var(--muted); font-size: 13px; margin: 14px 0 0; }

.alert {
  margin: -8px 0 22px;
  padding: 11px 14px;
  border-left: 3px solid var(--hp);
  background: rgba(214, 84, 76, 0.1);
  border-radius: 0 8px 8px 0;
  color: #f3c2bc;
  font-size: 14px;
}

.result .mark { width: 56px; height: 56px; margin-bottom: 22px; fill: none; stroke-width: 3;
                stroke-linecap: round; stroke-linejoin: round; }
.result.ok .mark { stroke: var(--good); }
.result.bad .mark { stroke: var(--hp); }
.result .mark circle { stroke-width: 2; opacity: 0.45; }

/* ---------- телефон ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .stage { display: none; }
  .panel { align-items: flex-start; padding: 40px 16px; background: var(--bg); }
  .mobile-mark {
    display: block;
    font: 700 22px/1 var(--display);
    letter-spacing: -0.02em;
    margin-bottom: 40px;
  }
}
