/* Nexus Activity — тот же язык, что у карточек бота: тёмный фон, градиент фиолетовый → синий, Exo 2 + Inter. */
@font-face { font-family: "Exo 2"; font-weight: 600; font-display: swap; src: url("assets/fonts/Exo2_600SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Exo 2"; font-weight: 700; font-display: swap; src: url("assets/fonts/Exo2_700Bold.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("assets/fonts/Inter_400Regular.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("assets/fonts/Inter_600SemiBold.ttf") format("truetype"); }

:root {
  --bg: #09090f; --panel: #141420; --panel-2: #1a1a2a; --line: #343454;
  --text: #eaedff; --muted: #8b8fa8; --purple: #8b5cf6; --blue: #2f6bff;
  --green: #3cd678; --amber: #f5a623; --red: #f0556a;
  --grad: linear-gradient(100deg, var(--purple), var(--blue));
  --title: "Exo 2", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, sans-serif;
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--body);
  display: flex; flex-direction: column; overflow: hidden;
  background-image: radial-gradient(600px 400px at 12% -10%, rgba(139, 92, 246, .22), transparent 70%),
                    radial-gradient(600px 420px at 95% 0%, rgba(47, 107, 255, .16), transparent 70%);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px;
       padding-top: max(12px, env(safe-area-inset-top)); border-bottom: 1px solid #222236; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 18px var(--title); letter-spacing: .18em; }
.brand img { border-radius: 50%; }
.tabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid #222236; border-radius: 999px; padding: 4px; }
.tab { border: 0; background: none; padding: 7px 16px; border-radius: 999px; color: var(--muted); font-weight: 600; }
.tab[aria-selected="true"] { background: var(--grad); color: #fff; }

main { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; align-items: center; }
.wrap { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 14px; }

.state { margin: auto; text-align: center; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.state h2 { font: 700 22px var(--title); margin: 0; }
.state p { margin: 0; color: var(--muted); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--purple); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── карточка кандидата ── */
.deck { position: relative; width: 100%; max-width: 560px; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.card { position: relative; flex: 1; min-height: 0; overflow-y: auto; background: var(--panel); border-radius: var(--radius); padding: 20px;
        border: 1px solid transparent; background-image: linear-gradient(var(--panel), var(--panel)), var(--grad);
        background-origin: border-box; background-clip: padding-box, border-box;
        touch-action: pan-y; user-select: none; will-change: transform; }
.card.drag { transition: none; cursor: grabbing; }
.card.settle { transition: transform .25s ease, opacity .25s ease; }
.stamp { position: absolute; top: 18px; padding: 4px 12px; border-radius: 8px; font: 700 15px var(--title); letter-spacing: .08em;
         opacity: 0; pointer-events: none; border: 2px solid; }
.stamp.like { left: 18px; color: var(--green); transform: rotate(-8deg); }
.stamp.skip { right: 18px; color: var(--muted); transform: rotate(8deg); }
.head { display: flex; align-items: center; gap: 14px; }
.mono { width: 68px; height: 68px; border-radius: 50%; flex: none; display: grid; place-items: center; font: 700 30px var(--title); color: #fff;
        box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px rgba(139, 92, 246, .55); }
.who { min-width: 0; flex: 1; }
.who h2 { margin: 0; font: 700 22px/1.2 var(--title); overflow-wrap: anywhere; }
.who .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.ring { --pct: 0; width: 66px; height: 66px; border-radius: 50%; flex: none; display: grid; place-items: center;
        background: conic-gradient(var(--ring, var(--purple)) calc(var(--pct) * 1%), #262640 0); }
.ring b { width: 54px; height: 54px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font: 700 17px var(--title); }
.block { margin-top: 16px; }
.label { font: 600 11px var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.about { margin: 0; padding: 10px 12px; background: var(--panel-2); border-left: 3px solid var(--purple); border-radius: 0 10px 10px 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 11px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }
.chip.hit { border-color: transparent; background: var(--grad); color: #fff; font-weight: 600; }
.chip.soft { color: var(--muted); }
.line { color: var(--text); }
.line small, .hint { color: var(--muted); font-size: 12px; }
.reasons { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.acc { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.acc code { background: var(--panel-2); padding: 2px 8px; border-radius: 6px; user-select: all; font: 400 13px ui-monospace, Consolas, monospace; }
.link { background: none; border: 0; padding: 0; color: #9db8ff; text-decoration: underline; }

.actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; flex: none; }
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 13px 16px; font-weight: 600; min-height: 48px; }
.btn:hover { border-color: #4a4a78; }
.btn.primary { border: 0; background: var(--grad); color: #fff; }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); padding: 6px 10px; min-height: 0; font-weight: 400; font-size: 13px; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }
.under { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; flex: none; }

/* ── профиль ── */
.section { background: var(--panel); border: 1px solid #222236; border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.section h3 { margin: 0; font: 700 16px var(--title); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
textarea.input { resize: vertical; min-height: 76px; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; min-width: 0; }
.row > .fit { flex: none; }
.pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pick button { padding: 6px 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }
.pick button[aria-pressed="true"] { background: var(--grad); border-color: transparent; color: #fff; font-weight: 600; }
.bar { height: 8px; border-radius: 999px; background: #262640; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--grad); border-radius: inherit; }
.err { color: var(--red); font-size: 13px; }
.note { color: var(--muted); font-size: 12px; }
.banner { padding: 10px 12px; border-radius: 12px; background: rgba(245, 166, 35, .12); border: 1px solid rgba(245, 166, 35, .4); font-size: 13px; }
.savebar { position: sticky; bottom: -16px; margin: 0 -16px -16px; padding: 12px 16px max(12px, env(safe-area-inset-bottom));
           background: linear-gradient(transparent, var(--bg) 35%); display: flex; gap: 10px; }
.savebar .btn { flex: 1; }

/* ── выбор игры и уведомления ── */
.sheet { position: fixed; inset: 0; background: rgba(4, 4, 10, .7); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet .box { width: 100%; max-width: 560px; max-height: 80%; overflow-y: auto; background: var(--panel); border-radius: 22px 22px 0 0;
              border: 1px solid var(--line); border-bottom: 0; padding: 18px 16px max(18px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.sheet h3 { margin: 0; font: 700 18px var(--title); }
.opt { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left;
       background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; }
.opt small { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: min(92vw, 520px); z-index: 20;
         background: #20203a; border: 1px solid var(--line); border-radius: 14px; padding: 11px 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.toast.ok { border-color: rgba(60, 214, 120, .6); }
.toast.warn { border-color: rgba(245, 166, 35, .6); }

@media (min-width: 720px) { main { padding: 24px; } }
@media (prefers-reduced-motion: reduce) { .card.settle { transition: none; } .spinner { animation-duration: 2s; } }

/* ── панель поиска, фильтры, список ── */
.searchwrap { width: 100%; max-width: 560px; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.searchwrap.wide { max-width: 720px; }
.searchwrap > .state { flex: 1; justify-content: center; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex: none; }
.seg { display: flex; gap: 4px; background: var(--panel); border: 1px solid #222236; border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn.small { padding: 8px 14px; min-height: 0; border-radius: 12px; font-size: 14px; }
.btn.small.on { border-color: var(--purple); color: #cdbbff; }
.check { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--purple); }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--panel); border: 1px solid #222236;
        border-radius: 14px; padding: 10px 14px; }
.item:hover { border-color: var(--line); }
.item .mono { width: 44px; height: 44px; font-size: 20px; box-shadow: none; }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item-main b { font: 600 16px var(--body); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-main .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c3c7de; font-size: 13px; }
.badge { align-self: flex-start; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: #c3c7de; }
.score { font: 700 17px var(--title); color: var(--text); flex: none; }

/* ── телефон: вкладки внизу, под большой палец; в Discord верх окна закрыт его панелью ── */
@media (max-width: 640px) {
  body { flex-direction: column-reverse; }
  .top { border-bottom: 0; border-top: 1px solid #222236; padding: 8px 12px max(8px, env(safe-area-inset-bottom)); background: rgba(9, 9, 15, .92); }
  .brand { display: none; }
  .tabs { flex: 1; }
  .tab { flex: 1; padding: 11px 16px; }
  .toast { bottom: 84px; }
  .sheet { z-index: 30; }
}
body.dm main { padding-top: 64px; }
.actions .btn { white-space: nowrap; padding-left: 10px; padding-right: 10px; }
img.mono { object-fit: cover; padding: 0; display: block; background: var(--panel-2); }

/* ── игровые аккаунты и настройки ── */
.account { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid #222236; border-radius: 12px; background: rgba(26, 26, 42, .45); }
.account-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.account .badge.on { border-color: rgba(60, 214, 120, .5); color: #9be8ba; }
.inline { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.inline > span { flex: none; }
.inline > select { flex: 1; min-width: 0; padding: 8px 10px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid #222236; cursor: pointer; }
.section h3 + .setting { border-top: 0; padding-top: 0; }
.setting-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.setting-text b { font-weight: 600; }
.setting input { width: 20px; height: 20px; flex: none; accent-color: var(--purple); }
.tabs .tab { white-space: nowrap; }
@media (max-width: 640px) { .tab { padding-left: 8px; padding-right: 8px; } }
