/* Design system — the night scene of the bot signal cards.
   Night sky gradient, asanoha pattern, a moon in the accent of the open tab (--acc),
   hills and a torii at the bottom, sakura petals. Panels are translucent night glass,
   labels are outlined pills like the card badges. Gold only for Stars. 4px grid. */
@property --acc {
  syntax: "<color>";
  inherits: true;
  initial-value: #ff8fb1;
}
:root {
  --night-top: #090a16;
  --night-bottom: #151028;
  --panel: rgba(11, 11, 28, .8);
  --panel-solid: #0f0f22;
  --panel-2: rgba(255, 255, 255, .05);
  --panel-3: rgba(255, 255, 255, .09);
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .15);
  --text: #f4f1ea;
  --muted: #b9bbcf;
  --faint: #7e809a;
  --acc: #ff8fb1;
  --sakura: #ff9cbd;
  --sakura-ink: #22060f;
  --star: #ffb83d;
  --danger: #ff5d6c;
  --live: #ff4d5e;
  --ok: #57e3a8;
  --radius: 18px;
  --shadow: 0 14px 40px rgba(0, 0, 0, .45);
  --safe-top: var(--tg-content-safe-area-inset-top, 0px);
  --safe-bottom: max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
  color-scheme: dark;
  transition: --acc .6s ease;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; color: var(--text); background: var(--night-top); }
body {
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  min-height: 100vh;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- the scene ---------- */
.scene { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: linear-gradient(180deg, #07081a 0%, #0d0c24 45%, #1a1233 78%, #22163a 100%); }
.scene > * { position: absolute; }
.scene .glow { inset: 0;
  background:
    radial-gradient(ellipse 80% 40% at 50% 100%, color-mix(in srgb, var(--acc) 22%, transparent), transparent 70%),
    radial-gradient(ellipse 60% 35% at 15% 30%, rgba(110, 80, 200, .14), transparent 70%),
    radial-gradient(ellipse 50% 30% at 85% 12%, color-mix(in srgb, var(--acc) 14%, transparent), transparent 70%); }
.scene .pattern { inset: 0; background-image: var(--pattern); opacity: .05;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.4) 55%, transparent 80%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.4) 55%, transparent 80%); }
.scene canvas { inset: 0; width: 100%; height: 100%; }
.scene .moon {
  top: calc(64px + var(--safe-top)); right: -30px; width: 136px; height: 136px; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 36% 34%, color-mix(in srgb, var(--acc) 55%, #fff4e8) 0%, var(--acc) 58%, color-mix(in srgb, var(--acc) 70%, #3a1030) 100%);
  box-shadow: 0 0 0 24px color-mix(in srgb, var(--acc) 11%, transparent), 0 0 0 52px color-mix(in srgb, var(--acc) 6%, transparent),
    0 0 140px 50px color-mix(in srgb, var(--acc) 30%, transparent);
  animation: moon 9s ease-in-out infinite;
}
.scene .moon i { position: absolute; border-radius: 50%; background: rgba(60, 10, 40, .16); box-shadow: inset 2px 2px 4px rgba(0, 0, 0, .12); }
.scene .moon i:nth-child(1) { width: 26px; height: 26px; left: 30px; top: 58px; }
.scene .moon i:nth-child(2) { width: 14px; height: 14px; left: 70px; top: 30px; }
.scene .moon i:nth-child(3) { width: 18px; height: 18px; left: 64px; top: 92px; }
@keyframes moon { 50% { transform: scale(1.03); } }
.scene .cloud { height: 22px; border-radius: 99px; background: rgba(22, 18, 48, .78); filter: blur(1.5px); left: 0;
  animation: drift linear infinite; }
.scene .cloud::before, .scene .cloud::after { content: ""; position: absolute; border-radius: 50%; background: inherit; }
.scene .cloud::before { width: 46%; height: 190%; left: 16%; bottom: 20%; }
.scene .cloud::after { width: 34%; height: 150%; left: 52%; bottom: 25%; }
.scene .c1 { width: 130px; top: calc(150px + var(--safe-top)); animation-duration: 95s; animation-delay: -30s; }
.scene .c2 { width: 90px; top: calc(110px + var(--safe-top)); animation-duration: 130s; animation-delay: -80s; opacity: .7; }
.scene .c3 { width: 160px; top: calc(260px + var(--safe-top)); animation-duration: 160s; animation-delay: -10s; opacity: .55; }
@keyframes drift { from { transform: translateX(-220px); } to { transform: translateX(calc(100vw + 60px)); } }
.scene .land { left: 0; right: 0; bottom: 0; width: 100%; height: 34vh; }
.scene .land .r1 { fill: color-mix(in srgb, var(--acc) 12%, #17142e); }
.scene .land .r2 { fill: color-mix(in srgb, var(--acc) 9%, #0e0c20); }
.scene .land .r3 { fill: color-mix(in srgb, var(--acc) 5%, #060610); }
.scene .torii { right: 18px; bottom: calc(7vh + var(--safe-bottom) * .5); width: 92px; fill: #030308;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--acc) 25%, transparent)); }
.scene .vignette { inset: 0; background: radial-gradient(ellipse 120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, .55) 100%); }

/* ---------- shell ---------- */
#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, rgba(9, 10, 22, .96) 60%, rgba(9, 10, 22, 0));
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: .02em; text-transform: uppercase; }
.logo { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  border: 2px solid var(--acc); color: var(--acc); background: color-mix(in srgb, var(--acc) 14%, transparent); }
.logo svg { width: 18px; height: 18px; }
.access-chip {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 700; letter-spacing: .03em;
  border: 1.5px solid var(--border-strong); background: rgba(5, 5, 13, .7); color: var(--muted);
}
.access-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.access-chip.off .dot { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
main { flex: 1; padding: 0 16px calc(104px + var(--safe-bottom)); }

.nav {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-bottom)); z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  padding: 6px; border-radius: 22px;
  background: rgba(8, 8, 20, .82); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.nav button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px 6px; border-radius: 16px; color: var(--faint);
  font-size: 11px; font-weight: 700; letter-spacing: .02em; transition: color .15s, background .15s;
}
.nav button svg { width: 22px; height: 22px; }
.nav button.on { color: var(--text); background: color-mix(in srgb, var(--acc) 16%, transparent); }
.nav button.on svg { color: var(--acc); }

/* ---------- tabs ---------- */
.tabs {
  position: sticky; top: calc(52px + var(--safe-top)); z-index: 10;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px; padding: 4px 16px 14px;
  background: linear-gradient(180deg, rgba(9, 10, 22, .96) 70%, rgba(9, 10, 22, 0));
}
.tabs::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: 99px;
  background: rgba(5, 5, 13, .72); border: 2px solid rgba(255, 255, 255, .1);
  font-weight: 800; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); transition: all .2s;
}
.chip em {
  font-style: normal; font-size: 11px; font-weight: 800; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 99px; display: grid; place-items: center; background: var(--panel-3); color: var(--text);
}
.chip.on { color: var(--text); border-color: var(--c); background: color-mix(in srgb, var(--c) 18%, rgba(5, 5, 13, .8)); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 30%, transparent); }
.chip.on em { background: var(--c); color: #0b0b12; }

/* ---------- signal cards (the bot card, as a list item) ---------- */
.day { margin: 14px 2px 8px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); display: flex; align-items: center; gap: 10px; }
.day::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }
.list { display: flex; flex-direction: column; gap: 12px; }
.sig {
  position: relative; overflow: hidden;
  padding: 16px 16px 14px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid color-mix(in srgb, var(--c) 22%, rgba(255, 255, 255, .06));
  box-shadow: 0 8px 26px rgba(0, 0, 0, .3);
}
.sig.enter { animation: rise .42s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); }

/* transitions between screens and tabs */
.view-in { animation: view-in .34s cubic-bezier(.2, .8, .2, 1) both; }
.slide-l { animation: slide-l .32s cubic-bezier(.2, .8, .2, 1) both; }
.slide-r { animation: slide-r .32s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes slide-l { from { opacity: 0; transform: translateX(36px); } }
@keyframes slide-r { from { opacity: 0; transform: translateX(-36px); } }
.chip.on { animation: pop .38s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 0% { transform: scale(.94); } 60% { transform: scale(1.05); } }
.nav button.on svg { animation: hop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes hop { 0% { transform: translateY(0) scale(.9); } 45% { transform: translateY(-4px) scale(1.12); } }
.nav button { transition: color .2s, background .25s, transform .1s; }
.nav button:active { transform: scale(.94); }
.seg button { transition: background .2s, color .2s, box-shadow .2s; }
.sig::after { /* a small moon in the corner, like on the cards */
  content: ""; position: absolute; top: -36px; right: -36px; width: 96px; height: 96px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 30%, transparent) 0 34%, color-mix(in srgb, var(--c) 9%, transparent) 35% 60%, transparent 61%);
  pointer-events: none;
}
.sig.fresh { border-color: color-mix(in srgb, var(--c) 60%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent), 0 10px 30px color-mix(in srgb, var(--c) 18%, transparent); }
.sig-head { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.label {
  display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 99px;
  border: 2px solid var(--c); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.moment { font-size: 12.5px; font-weight: 800; color: var(--c); }
.new-tag { font-size: 10px; font-weight: 900; letter-spacing: .1em; padding: 2px 7px; border-radius: 6px; background: var(--c); color: #0b0b12; }
.sig-head time { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--faint); }
.match { position: relative; margin-top: 12px; font-size: 18px; font-weight: 800; line-height: 1.25; letter-spacing: -.005em; max-width: 92%; }
.match .vs { color: var(--faint); font-weight: 600; margin: 0 5px; }
.league { margin-top: 4px; font-size: 13.5px; color: var(--muted); }
.bar { width: 40px; height: 3px; margin: 12px 0 0; border-radius: 3px; background: var(--c); }
/* win rate of the open tab */
.rate { display: flex; align-items: center; gap: 14px; margin: 2px 0 6px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid color-mix(in srgb, var(--c) 28%, rgba(255, 255, 255, .06)); }
.rate-ring { flex: none; width: 58px; height: 58px; position: relative; display: grid; place-items: center; }
.rate-ring::before { /* the ring is masked on its own layer, so the percent on top stays visible */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255, 255, 255, .08) 0);
  -webkit-mask: radial-gradient(circle, transparent 0 21px, #000 22px); mask: radial-gradient(circle, transparent 0 21px, #000 22px); }
.rate-ring b { position: absolute; font-size: 14px; font-weight: 900; }
.rate { position: relative; }
.rate-ring + .rate-text { margin-left: 0; }
.rate-text { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); }
.rate-text span { display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.rate-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.rate-counts i { font-style: normal; font-weight: 800; font-size: 13px; padding: 2px 9px; border-radius: 99px; background: var(--panel-2); color: var(--text); }
.rate-counts .w { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.rate-counts .l { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }

/* result of a settled signal */
.res { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; padding: 4px 11px; border-radius: 99px;
  font-size: 12px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; border: 1.5px solid; }
.res-win, .res-half_win { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 60%, transparent); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.res-loss, .res-half_loss { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 60%, transparent); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.res-push, .res-void { color: var(--muted); border-color: var(--border-strong); }
.sig.is-win, .sig.is-half_win { box-shadow: inset 3px 0 0 var(--ok), 0 8px 26px rgba(0, 0, 0, .3); }
.sig.is-loss, .sig.is-half_loss { box-shadow: inset 3px 0 0 var(--danger), 0 8px 26px rgba(0, 0, 0, .3); }
.res-edit { width: 30px; height: 24px; margin-right: -6px; border-radius: 8px; color: var(--faint); font-weight: 900; letter-spacing: .05em; }
.res-edit:hover, .res-edit.on { color: var(--text); background: var(--panel-3); }
.res-pick-title { width: 100%; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.res-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-strong); }
.res-pick .btn.on { border-color: var(--c); color: var(--c); }

.bot-card .bot-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 16px; }
.bot-card .bot-head span { font-size: 20px; }
.bot-card { border-color: color-mix(in srgb, var(--c) 30%, rgba(255, 255, 255, .06)); }
.books { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.book { padding: 6px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 750; color: var(--muted);
  border: 1.5px solid var(--border-strong); background: rgba(5, 5, 13, .6); transition: all .15s; }
.book.on { color: var(--text); border-color: var(--c); background: color-mix(in srgb, var(--c) 20%, transparent); }
.book.on::before { content: "✓ "; color: var(--c); }
.terms { display: flex; flex-wrap: wrap; gap: 6px; max-height: 260px; overflow: auto; }
.term { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 650;
  background: var(--panel-2); border: 1px solid var(--border-strong); }
.term button { width: 22px; height: 22px; border-radius: 50%; color: var(--faint); font-size: 11px; }
.term button:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 15%, transparent); }
.err-stack { margin: 8px 0 0; padding: 10px; border-radius: 10px; background: rgba(0, 0, 0, .45); border: 1px solid var(--border);
  font: 11px/1.45 ui-monospace, Menlo, Consolas, monospace; color: var(--muted); white-space: pre-wrap; word-break: break-all;
  max-height: 260px; overflow: auto; }
.combo { display: inline-flex; margin: 10px 0 0 6px; padding: 4px 11px; border-radius: 99px; font-size: 12px; font-weight: 900;
  letter-spacing: .05em; color: #ffb35c; border: 1.5px solid rgba(255, 150, 60, .6); background: rgba(255, 120, 40, .12);
  box-shadow: 0 0 14px rgba(255, 120, 40, .25); }
.price s { margin-right: 4px; font-weight: 700; opacity: .55; }
.kpi.bad b { color: var(--danger); }
.an { padding: 4px 14px; }
.an-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; }
.an-row + .an-row { border-top: 1px solid var(--border); }
.an-key { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.an-key small { display: block; font-size: 12px; font-weight: 500; color: var(--faint); }
.an-row .badge { min-width: 54px; text-align: center; }
select.input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.row.disabled { opacity: .5; }
.total-line { margin-top: 10px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.total-line b { margin-left: 6px; font-size: 22px; letter-spacing: 0; color: var(--c); text-shadow: 0 0 16px color-mix(in srgb, var(--c) 35%, transparent); }
.picks { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; }
.pick { font-size: 16px; font-weight: 800; }
.pick::before { content: "✓ "; color: var(--c); }

.score {
  margin-top: 12px; display: flex; padding: 6px 4px; border-radius: 14px;
  background: rgba(5, 5, 14, .78); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
}
.score .cell { flex: 1; min-width: 0; padding: 3px 4px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.score .cell + .cell { border-left: 1px solid var(--border); }
.score small { font-size: 10px; font-weight: 800; letter-spacing: .08em; color: var(--faint); text-transform: uppercase; white-space: nowrap; }
.score b { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.score .total { flex: 1.2; }
.score .total b { font-size: 18px; color: var(--c); }
.score.live .total small { color: var(--live); display: flex; align-items: center; gap: 5px; }
.score.live .total small::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--live); box-shadow: 0 0 8px var(--live); animation: pulse 1.4s infinite; }
.score.void .total small { color: var(--danger); }
.score-wait { margin-top: 12px; font-size: 12.5px; color: var(--faint); display: flex; align-items: center; gap: 8px; }
.score-wait::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--c); animation: pulse 1.8s infinite; }

@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes pulse { 50% { opacity: .25; } }

.more { margin: 16px auto 0; display: flex; }
.empty { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty .big { font-size: 42px; margin-bottom: 10px; }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 18px; }

.skel { height: 150px; border-radius: var(--radius); border: 1px solid var(--border);
  background: linear-gradient(100deg, var(--panel) 30%, rgba(30, 28, 60, .8) 50%, var(--panel) 70%); background-size: 300% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- buttons, fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 18px; border-radius: 99px; font-weight: 800; font-size: 14.5px; letter-spacing: .02em;
  background: rgba(5, 5, 13, .7); border: 2px solid var(--border-strong); transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--sakura); color: var(--sakura-ink); border-color: transparent; box-shadow: 0 6px 22px rgba(255, 140, 180, .3); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.sm { height: 34px; padding: 0 13px; font-size: 12.5px; }
.btn.block { width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.input {
  height: 42px; padding: 0 13px; border-radius: 12px; width: 100%;
  background: rgba(5, 5, 13, .75); border: 1.5px solid var(--border-strong); outline: none;
}
.input:focus { border-color: var(--acc); }

/* ---------- panels ---------- */
.h1 { margin: 10px 2px 4px; font-size: 26px; font-weight: 900; letter-spacing: -.01em; }
.sub { margin: 0 2px 16px; color: var(--muted); }
.card { padding: 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.section-title { margin: 24px 2px 10px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); display: flex; align-items: center; gap: 10px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }

.status-card { position: relative; overflow: hidden; padding: 20px; border-color: color-mix(in srgb, var(--acc) 35%, transparent); }
.status-card::after { content: ""; position: absolute; top: -50px; right: -50px; width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--acc) 45%, transparent) 0 30%, color-mix(in srgb, var(--acc) 10%, transparent) 31% 58%, transparent 59%); }
.status-card .big { position: relative; font-size: 46px; font-weight: 900; letter-spacing: -.02em; line-height: 1; }
.status-card .big small { font-size: 16px; font-weight: 700; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.status-card p { position: relative; margin: 8px 0 0; color: var(--muted); }
.meter { position: relative; margin-top: 16px; height: 6px; border-radius: 6px; background: var(--panel-3); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--acc), var(--sakura)); }

.tariffs { display: grid; gap: 10px; }
.tariff {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  padding: 14px 14px 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1.5px solid var(--border);
  transition: border-color .15s, transform .1s;
}
.tariff:active { transform: scale(.99); }
.tariff.best { border-color: color-mix(in srgb, var(--star) 60%, transparent); box-shadow: 0 0 22px rgba(255, 184, 61, .12); }
.tariff .t-main { flex: 1; min-width: 0; }
.tariff .t-title { font-weight: 900; font-size: 16px; display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: .03em; }
.tariff .t-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.tag { font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; border: 1.5px solid var(--star); color: var(--star); }
.price { display: inline-flex; align-items: center; gap: 5px; height: 38px; padding: 0 14px; border-radius: 99px; background: var(--star); color: #1d1300; font-weight: 900; font-size: 15px; box-shadow: 0 4px 16px rgba(255, 184, 61, .25); }
.price svg { width: 15px; height: 15px; }

.toggle-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.toggle-row + .toggle-row { border-top: 1px solid var(--border); }
.toggle-row .t-name { flex: 1; font-weight: 700; }
.toggle-row .t-name small { display: block; margin-top: 1px; font-size: 12px; font-weight: 500; color: var(--faint); }
.sub-toggles { border-top: 1px solid var(--border); padding-left: 10px; transition: opacity .2s; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
textarea.input { height: auto; padding: 10px 13px; resize: vertical; line-height: 1.5; }
.proxy { align-items: flex-start; }
.proxy.disabled { opacity: .5; }
.row.proxy .title { white-space: normal; overflow: visible; text-overflow: clip; word-break: break-all; }
.proxy-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.proxy-actions .inline-check { margin-right: 0; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--panel-3); border: 1px solid var(--border-strong); transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked + i { background: var(--sakura); border-color: transparent; }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:disabled + i { opacity: .4; }

/* paywall */
.paywall { position: relative; min-height: 560px; }
.paywall .ghost { display: flex; flex-direction: column; gap: 12px; filter: blur(5px); opacity: .45; pointer-events: none; }
.paywall .lock-card {
  position: absolute; left: 0; right: 0; top: 20px; margin: 0 auto; max-width: 420px;
  padding: 24px 18px 18px; border-radius: 24px; text-align: center;
  background: rgba(10, 10, 26, .94); border: 1px solid color-mix(in srgb, var(--star) 35%, transparent); box-shadow: var(--shadow);
}
.lock-ico { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--star); color: var(--star); box-shadow: 0 0 0 10px rgba(255, 184, 61, .08), 0 0 30px rgba(255, 184, 61, .25); }
.lock-ico svg { width: 24px; height: 24px; }
.lock-card h2 { margin: 0 0 6px; font-size: 21px; font-weight: 900; }
.lock-card p { margin: 0 0 16px; color: var(--muted); }
.lock-card .tariffs { text-align: left; }

/* friends */
.hero-num { display: flex; align-items: baseline; gap: 10px; }
.hero-num b { font-size: 48px; font-weight: 900; line-height: 1; color: var(--sakura); text-shadow: 0 0 24px rgba(255, 156, 189, .35); }
.linkbox { display: flex; gap: 8px; margin-top: 14px; }
.linkbox .input { font-size: 13px; color: var(--muted); }
ol.steps { margin: 0; padding: 0; counter-reset: step; display: grid; gap: 14px; }
.steps li { list-style: none; display: flex; gap: 12px; align-items: center; color: var(--muted); }
.steps li::before { counter-increment: step; content: counter(step); flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 13px; border: 2px solid var(--sakura); color: var(--sakura); }
.steps b { color: var(--text); }

/* ---------- admin ---------- */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 99px; background: rgba(5, 5, 13, .75); border: 1px solid var(--border-strong); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1; white-space: nowrap; height: 34px; padding: 0 12px; border-radius: 99px; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.seg button.on { background: color-mix(in srgb, var(--acc) 22%, transparent); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--acc); }
/* admin sections: all eight visible at once, 4 x 2 */
.admin-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 12px 0 16px; padding: 6px;
  border-radius: 18px; background: rgba(5, 5, 13, .75); border: 1px solid var(--border-strong); }
.admin-tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 8px 2px 7px;
  border-radius: 12px; font-size: 11px; font-weight: 750; color: var(--muted); transition: background .2s, color .2s, box-shadow .2s; }
.admin-tabs button span { font-size: 18px; line-height: 1; }
.admin-tabs button { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-tabs button.on { color: var(--text); background: color-mix(in srgb, var(--acc) 22%, transparent); box-shadow: inset 0 0 0 1.5px var(--acc); }
.admin-tabs button:active { transform: scale(.95); }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { padding: 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--border); }
.kpi span { display: block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.kpi { min-width: 0; overflow: hidden; }
.kpi b { overflow-wrap: anywhere; display: block; margin-top: 6px; font-size: clamp(18px, 6vw, 26px); font-weight: 900; font-variant-numeric: tabular-nums; }
.kpi small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.kpi.accent b { color: var(--ok); }
.kpi.star b { color: var(--star); }
.chart-card h4 { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; display: flex; justify-content: space-between; align-items: baseline; }
.chart-card h4 small { font-weight: 800; color: var(--text); font-size: 15px; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 96px; margin-top: 12px; }
.bars i { flex: 1; min-height: 2px; border-radius: 3px 3px 1px 1px; background: var(--c); opacity: .85; box-shadow: 0 0 10px color-mix(in srgb, var(--c) 35%, transparent); }
.bars i.zero { background: var(--panel-3); box-shadow: none; }
.axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--faint); }
.hbar { display: grid; grid-template-columns: minmax(90px, 40%) 1fr auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.hbar .track { height: 8px; border-radius: 8px; background: var(--panel-3); overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 8px; background: var(--c); }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; }
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 10px; padding: 11px 0; }
.row + .row { border-top: 1px solid var(--border); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: 12.5px; color: var(--muted); }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 14px; border: 1.5px solid var(--border-strong); background: rgba(5, 5, 13, .7); color: var(--muted); }
.badge { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 99px; border: 1.5px solid var(--border-strong); color: var(--muted); white-space: nowrap; }
.badge.ok { border-color: color-mix(in srgb, var(--ok) 60%, transparent); color: var(--ok); }
.badge.bad { border-color: color-mix(in srgb, var(--danger) 60%, transparent); color: var(--danger); }
.badge.star { border-color: color-mix(in srgb, var(--star) 60%, transparent); color: var(--star); }
.user-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 12px 46px; }
.user-actions .input { width: 76px; height: 34px; }
.tariff-form { display: grid; grid-template-columns: 1fr 72px 84px; gap: 8px; align-items: end; }
.tariff-form .actions { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.inline-check { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-right: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- misc ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--panel-3); border-top-color: var(--sakura); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast {
  position: fixed; left: 50%; bottom: calc(100px + var(--safe-bottom)); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 18px; border-radius: 99px; font-weight: 700; font-size: 14px;
  background: var(--text); color: #0b0b12; box-shadow: var(--shadow); transition: all .2s; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.error-box { padding: 14px; border-radius: 14px; background: rgba(60, 10, 20, .7); border: 1px solid color-mix(in srgb, var(--danger) 50%, transparent); color: #ffb4bd; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 420px) {
  /* 4 quarters + OT + total must fit a 360px phone */
  .score .cell { padding: 3px 1px; }
  .score b { font-size: 13.5px; }
  .score .total b { font-size: 15px; }
  .score small { font-size: 9px; letter-spacing: .04em; }
}
@media (min-width: 640px) {
  main, .top { max-width: 640px; margin-left: auto; margin-right: auto; width: 100%; }
  .nav { max-width: 460px; margin: 0 auto; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
