/* DraftTool — тёмная тема в духе Spotify (только стиль, без бренда) */
:root {
  --bg: #000;
  --panel: #121212;
  --surface: #181818;
  --surface-2: #1f1f1f;
  --surface-3: #2a2a2a;
  --hover: #2a2a2a;
  --border: #2f2f2f;
  --text: #fff;
  --muted: #b3b3b3;
  --subtle: #6a6a6a;
  --accent: #1ed760;
  --accent-hover: #3be477;
  --danger: #f3727f;
  --team-0: #4cb3ff;
  --team-1: #ffa42b;
  --ban: #e91429;
  --radius: 8px;
  --radius-lg: 12px;
  font-family: 'Figtree', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: var(--text); }
::selection { background: var(--accent); color: #000; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border: 3px solid transparent; background-clip: padding-box; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 280px 1fr; gap: 8px; height: 100%; padding: 8px; }
.sidebar { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.side-card { background: var(--panel); border-radius: var(--radius); padding: 8px 12px; }
.side-card.grow { flex: 1; overflow: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 12px 8px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.nav-item { display: flex; align-items: center; gap: 16px; padding: 10px 8px; color: var(--muted); font-weight: 700; font-size: 15px; border-radius: 6px; cursor: pointer; transition: color .15s; }
.nav-item:hover, .nav-item.active { color: var(--text); }
.nav-item svg { width: 24px; height: 24px; flex: none; }
.lib-title { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-weight: 700; padding: 8px; }
.lib-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 6px; cursor: pointer; }
.lib-item:hover { background: var(--surface-2); }
.lib-thumb { width: 44px; height: 44px; border-radius: 4px; background: linear-gradient(135deg, #450af5, #8e8ee5); display: grid; place-items: center; font-weight: 800; flex: none; }
.lib-meta { min-width: 0; }
.lib-meta b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-meta span { color: var(--muted); font-size: 13px; }
.me-row { display: flex; align-items: center; gap: 10px; padding: 8px; }
.me-row .grow { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { background: var(--panel); border-radius: var(--radius); overflow: auto; position: relative; min-width: 0; }
.hero { padding: 72px 32px 24px; background: linear-gradient(180deg, var(--hero, #2a4b3a) 0%, rgba(18,18,18,0) 100%); }
.hero .eyebrow { font-size: 13px; font-weight: 700; }
.hero h1 { font-size: clamp(32px, 5vw, 64px); font-weight: 800; letter-spacing: -.04em; margin: 8px 0 12px; line-height: 1; }
.hero .meta { color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.content { padding: 0 32px 48px; }
.toolbar { display: flex; align-items: center; gap: 12px; padding: 16px 0 24px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.section-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 24px 0 12px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 0 20px; height: 40px; font-weight: 700; cursor: pointer; background: transparent; transition: transform .1s, background .15s, color .15s, border-color .15s; white-space: nowrap; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); transform: scale(1.03); }
.btn-white { background: #fff; color: #000; }
.btn-white:hover:not(:disabled) { transform: scale(1.03); }
.btn-outline { border: 1px solid #7c7c7c; color: var(--text); }
.btn-outline:hover:not(:disabled) { border-color: #fff; transform: scale(1.03); }
.btn-ghost { color: var(--muted); padding: 0 12px; }
.btn-ghost:hover:not(:disabled) { color: var(--text); }
.btn-danger { border: 1px solid var(--danger); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: rgba(243,114,127,.12); }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 52px; padding: 0 32px; font-size: 16px; }
.icon-btn { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { color: var(--text); background: var(--surface-3); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: 13px; font-weight: 600; border: 0; cursor: pointer; white-space: nowrap; }
.chip:hover { background: #333; }
.chip.active { background: #fff; color: #000; }
.chip.static { cursor: default; }
.chip.static:hover { background: var(--surface-3); }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; background: var(--surface-3); color: var(--muted); }
.badge.green { background: rgba(30,215,96,.15); color: var(--accent); }
.badge.blue { background: rgba(76,179,255,.15); color: var(--team-0); }
.badge.orange { background: rgba(255,164,43,.15); color: var(--team-1); }
.badge.gray { background: var(--surface-3); color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field label { font-weight: 700; font-size: 13px; }
.input, .select, .textarea { background: var(--surface-3); border: 1px solid transparent; border-radius: 6px; padding: 12px 14px; outline: none; width: 100%; transition: border-color .15s, background .15s; }
.input:hover, .select:hover, .textarea:hover { border-color: #535353; }
.input:focus, .select:focus, .textarea:focus { border-color: #fff; background: #333; }
.textarea { min-height: 180px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.search .input { padding-left: 40px; border-radius: 999px; background: var(--surface-2); height: 40px; padding-top: 0; padding-bottom: 0; }

.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; user-select: none; }
.switch .track { width: 40px; height: 22px; border-radius: 999px; background: #535353; position: relative; transition: background .15s; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch.on .track { background: var(--accent); }
.switch.on .track::after { transform: translateX(18px); }

/* ---------- cards / lists ---------- */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; transition: background .2s; cursor: pointer; position: relative; }
.card:hover { background: var(--surface-3); }
.card .cover { aspect-ratio: 1.6; border-radius: 6px; margin-bottom: 14px; display: flex; flex-direction: column; justify-content: flex-end; padding: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.5); position: relative; overflow: hidden; }
.card .cover .big { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.card .cover .small { font-size: 12px; font-weight: 700; opacity: .85; }
.card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card p { margin: 0; color: var(--muted); font-size: 13px; }
.card .play { position: absolute; right: 24px; top: calc(16px + (100% - 32px) * 0); }
.card .fab { position: absolute; right: 26px; bottom: 74px; width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #000; display: grid; place-items: center; box-shadow: 0 8px 8px rgba(0,0,0,.3); opacity: 0; transform: translateY(8px); transition: all .2s; }
.card:hover .fab { opacity: 1; transform: none; }
.empty { color: var(--muted); padding: 48px 0; text-align: center; }
.empty b { display: block; color: var(--text); font-size: 20px; margin-bottom: 8px; }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
.modal { background: #282828; border-radius: var(--radius-lg); padding: 24px; width: min(480px, 100%); box-shadow: 0 16px 48px rgba(0,0,0,.6); max-height: calc(100vh - 32px); overflow: auto; animation: pop .15s; }
.modal.wide { width: min(920px, 100%); }
.modal h2 { margin: 0 0 20px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; justify-content: space-between; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.opt-list { display: flex; flex-direction: column; gap: 4px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-radius: 6px; background: var(--surface-3); cursor: pointer; border: 1px solid transparent; }
.opt:hover { background: #333; }
.opt.selected { border-color: var(--accent); }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { transform: scale(.96); opacity: 0 } }

/* ---------- avatar / character ---------- */
.avatar { border-radius: 50%; background: #535353; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; overflow: hidden; object-fit: cover; }
.char { position: relative; border-radius: 6px; overflow: hidden; background: var(--surface-3); flex: none; }
.char img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.char .fallback { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 13px; text-align: center; padding: 2px; line-height: 1.1; }
.char.r5 { background: linear-gradient(160deg, #6b4a1f, #2a2116); }
.char.r4 { background: linear-gradient(160deg, #4b3c6b, #1f1a2b); }

/* ---------- lobby ---------- */
.lobby-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.team-card { background: var(--surface); border-radius: var(--radius-lg); padding: 20px; border-top: 3px solid var(--tc); }
.team-card h3 { margin: 0 0 16px; font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.team-card h3 .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tc); }
.slot { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--surface-2); min-height: 76px; margin-bottom: 8px; }
.slot.empty-slot { border: 1px dashed #3a3a3a; background: transparent; justify-content: space-between; color: var(--subtle); }
.slot .who { flex: 1; min-width: 0; }
.slot .who b { display: block; font-size: 15px; }
.slot .who b small { color: var(--muted); font-weight: 600; }
.slot .who .sub { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.slot .linkish { color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.slot .linkish:hover { color: var(--text); }
.ready-pill { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 700; font-size: 13px; }
.observers { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); }
.obs { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 999px; padding: 4px 12px 4px 4px; color: var(--text); font-weight: 600; font-size: 13px; }
.link-row { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 999px; padding: 4px 4px 4px 16px; color: var(--muted); font-size: 13px; max-width: 520px; }
.link-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.footer-actions { display: flex; align-items: center; gap: 12px; margin-top: 32px; flex-wrap: wrap; }

/* ---------- draft ---------- */
.draft { display: flex; flex-direction: column; gap: 16px; }
.board { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.side { background: var(--surface); border-radius: var(--radius-lg); padding: 16px; border-top: 3px solid var(--tc); position: relative; }
.side.turn { box-shadow: 0 0 0 1px var(--tc) inset, 0 0 32px -8px var(--tc); }
.side-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.side-head h3 { margin: 0; font-size: 18px; font-weight: 800; flex: 1; display: flex; align-items: center; gap: 8px; }
.side-head .players { display: flex; }
.side-head .players .avatar { border: 2px solid var(--surface); margin-left: -6px; }
.stat { text-align: right; }
.stat small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.stat b { font-size: 20px; font-variant-numeric: tabular-nums; }
.row-label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin: 10px 0 6px; }
.slots { display: flex; gap: 6px; flex-wrap: wrap; }
.slots.picks { display: grid; grid-template-columns: repeat(4, 72px); }
.pslot { width: 72px; height: 96px; border-radius: 6px; background: var(--surface-2); border: 1px dashed #333; position: relative; overflow: hidden; }
.pslot.bslot { width: 52px; height: 52px; }
.pslot.current { border: 2px solid var(--tc); animation: pulse 1.2s infinite; }
.pslot .char { width: 100%; height: 100%; border-radius: 0; }
.pslot.banned .char { filter: grayscale(1) brightness(.55); }
.pslot.banned::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top right, transparent calc(50% - 1.5px), var(--ban) calc(50% - 1.5px), var(--ban) calc(50% + 1.5px), transparent calc(50% + 1.5px)); }
.pslot .tag { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, rgba(0,0,0,.9)); font-size: 11px; font-weight: 800; padding: 10px 4px 3px; display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
@keyframes pulse { 50% { border-color: transparent } }

.timeline { display: flex; gap: 4px; flex-wrap: wrap; background: var(--surface); border-radius: var(--radius-lg); padding: 12px; align-items: center; }
.tl { height: 28px; min-width: 34px; padding: 0 6px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 800; letter-spacing: .04em; background: var(--surface-2); color: var(--subtle); border-bottom: 3px solid var(--tc); }
.tl.done { opacity: .35; }
.tl.ban { color: #ff8a95; }
.tl.pick { color: #7ef0a6; }
.tl.now { background: var(--tc); color: #000; opacity: 1; transform: scale(1.08); }

.turnbar { display: flex; align-items: center; gap: 16px; background: var(--surface); border-radius: var(--radius-lg); padding: 14px 18px; flex-wrap: wrap; }
.turnbar .what { flex: 1; min-width: 200px; }
.turnbar .what b { font-size: 18px; display: block; }
.turnbar .what span { color: var(--muted); }
.clock { font-variant-numeric: tabular-nums; font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.clock.reserve { color: var(--team-1); }
.clock.out { color: var(--danger); }
.clock small { font-size: 12px; color: var(--muted); display: block; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

.pool { background: var(--surface); border-radius: var(--radius-lg); padding: 16px; }
.pool-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.pool-tools .search { flex: 1; min-width: 200px; }
.pool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.pcard { background: var(--surface-2); border-radius: 6px; padding: 6px; cursor: pointer; border: 2px solid transparent; text-align: left; transition: background .15s, border-color .15s, transform .1s; }
.pcard:hover:not(:disabled) { background: var(--surface-3); border-color: var(--tc, #fff); }
.pcard:active:not(:disabled) { transform: scale(.96); }
.pcard:disabled { cursor: not-allowed; opacity: .3; }
.pcard .char { width: 100%; aspect-ratio: 1; }
.pcard .nm { font-size: 11px; font-weight: 700; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .cs { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; display: flex; justify-content: space-between; }
.pcard.selected { border-color: var(--accent); }

.sidechoice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.sidechoice button { height: 120px; border-radius: var(--radius-lg); border: 0; cursor: pointer; font-size: 18px; font-weight: 800; transition: transform .1s, filter .15s; }
.sidechoice button:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-2px); }
.sidechoice button:disabled { opacity: .35; cursor: not-allowed; }

.results { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.res-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; }
.res-row:hover { background: var(--surface-2); }
.res-row .char { width: 40px; height: 40px; }
.res-row .nm { flex: 1; font-weight: 600; }
.res-row .num { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- profile / roster ---------- */
.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.rcard { background: var(--surface-2); border-radius: 8px; padding: 8px; border: 2px solid transparent; }
.rcard.off { opacity: .35; }
.rcard.off:hover { opacity: .7; }
.rcard .char { width: 100%; aspect-ratio: 1; cursor: pointer; }
.rcard .nm { font-size: 12px; font-weight: 700; margin: 6px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eids { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.eids button { height: 20px; border: 0; border-radius: 3px; background: var(--surface-3); font-size: 10px; font-weight: 800; cursor: pointer; color: var(--muted); padding: 0; }
.eids button.on { background: var(--accent); color: #000; }
.eids button:hover:not(.on) { background: #3a3a3a; color: #fff; }
.note { color: var(--muted); font-size: 13px; line-height: 1.5; }
.warn { background: rgba(255,164,43,.1); border: 1px solid rgba(255,164,43,.35); color: #ffc46b; border-radius: 8px; padding: 10px 14px; font-size: 13px; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #fff; color: #000; padding: 12px 20px; border-radius: 8px; font-weight: 600; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.5); animation: pop .15s; max-width: calc(100vw - 32px); }
.toast.error { background: var(--danger); color: #000; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; background: linear-gradient(180deg, #1e3a2a 0%, #000 60%); }
.login-box { width: min(420px, 100%); background: #121212; border-radius: var(--radius-lg); padding: 40px 32px; text-align: center; }
.login-box h1 { font-size: 32px; font-weight: 800; letter-spacing: -.03em; margin: 16px 0 8px; }
.login-box p { color: var(--muted); margin: 0 0 28px; }
.discord-btn { width: 100%; background: #5865f2; color: #fff; }
.discord-btn:hover:not(:disabled) { background: #4752c4; transform: scale(1.02); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--subtle); margin: 24px 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; padding: 0; gap: 0; }
  .sidebar { flex-direction: row; overflow-x: auto; }
  .side-card.grow, .side-card.lib { display: none; }
  .side-card { border-radius: 0; display: flex; align-items: center; gap: 4px; }
  .brand { padding: 8px; font-size: 16px; }
  .nav-item { padding: 8px; }
  .nav-item span { display: none; }
  .main { border-radius: 0; }
  .hero { padding: 32px 16px 16px; }
  .content { padding: 0 16px 32px; }
  .teams, .board, .results { grid-template-columns: 1fr; }
  .sidechoice { grid-template-columns: 1fr; }
  .sidechoice button { height: 64px; }
}

/* ---------- драфт-доска (команды сверху/снизу + шкала ходов) ---------- */
.dboard { background: var(--surface); border-radius: var(--radius-lg); padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.dteam { --slot-h: 200px; }
.dteam-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dtag { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 16px; background: var(--tc); color: #000; font-weight: 800; font-size: 18px; font-style: italic; transform: skewX(-18deg); border-radius: 3px; }
.dtag > * { transform: skewX(18deg); }
.dname { font-weight: 800; font-size: 16px; }
.dplayers { display: flex; }
.dplayers .avatar { border: 2px solid var(--surface); margin-left: -6px; }
.dline { flex: 1; height: 2px; background: var(--tc); opacity: .7; border-radius: 2px; }
.dstat { display: flex; flex-direction: column; align-items: flex-end; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; min-width: 56px; }
.dstat small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.dstat.out { color: var(--danger); }
.drow { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.dslot { height: var(--slot-h); border-radius: 6px; background: var(--surface-2); flex: none; position: relative; overflow: hidden; transition: box-shadow .2s; }
.dslot.ban { width: 56px; }
.dslot.pick { width: 112px; }
.dslot .char { position: absolute; inset: 0; width: auto; height: auto; border-radius: 0; }
.dslot .char .fallback { font-size: 20px; }
.dslot.banned .char { filter: grayscale(1) brightness(.5); }
.dslot.banned::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top right, transparent calc(50% - 1.5px), var(--ban) calc(50% - 1.5px), var(--ban) calc(50% + 1.5px), transparent calc(50% + 1.5px)); }
.dslot.current { box-shadow: 0 0 0 2px var(--tc) inset, 0 0 24px -4px var(--tc); animation: slotpulse 1.4s infinite; }
@keyframes slotpulse { 50% { box-shadow: 0 0 0 2px transparent inset, 0 0 0 transparent; } }
.dname-tag { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 6px 6px; background: linear-gradient(transparent, rgba(0,0,0,.92)); font-size: 11px; line-height: 1.25; }
.dname-tag b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.dname-tag span { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }
.dline-bottom { height: 2px; background: var(--tc); opacity: .7; border-radius: 2px; margin-top: 14px; }
.dteam.turn .dline, .dteam.turn .dline-bottom { opacity: 1; box-shadow: 0 0 10px var(--tc); }

.dtimeline { display: flex; flex-wrap: wrap; gap: 6px; row-gap: 34px; padding: 34px 0 30px; align-items: center; }
.mk { position: relative; width: 48px; height: 12px; display: flex; align-items: center; justify-content: center; }
.mk-bar { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--mk); }
.mk-bar::after { content: ''; position: absolute; left: 50%; margin-left: -6px; border: 6px solid transparent; }
.mk.up .mk-bar::after { bottom: 100%; border-bottom-color: var(--mk); border-top-width: 0; }
.mk.down .mk-bar::after { top: 100%; border-top-color: var(--mk); border-bottom-width: 0; }
.mk.ban { --mk: #e5483d; }
.mk.pick { --mk: #52c43b; }
.mk.done { opacity: .28; }
.mk.now .mk-bar { box-shadow: 0 0 12px 2px var(--mk); background: color-mix(in srgb, var(--mk) 60%, #fff); }
.mk-label { position: absolute; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--mk); white-space: nowrap; }
.mk.up .mk-label { top: 16px; }
.mk.down .mk-label { bottom: 16px; }
.mk-clock { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text); }
.mk.up .mk-clock { bottom: auto; top: -30px; }
.mk.down .mk-clock { bottom: auto; top: 18px; }
.mk-clock.reserve { color: var(--team-1); }
.mk-clock.out { color: var(--danger); }
@media (max-width: 900px) {
  .dteam { --slot-h: 132px; }
  .dslot.ban { width: 40px; }
  .dslot.pick { width: 76px; }
  .dstat small { display: none; }
  .mk { width: 30px; }
}

/* пул: клик по карточке = ход */
.pcard.off { cursor: not-allowed; opacity: .3; }
.pcard:not(.off):hover { background: var(--surface-3); border-color: var(--tc, #fff); }
.pcard:not(.off):active { transform: scale(.96); }
.pool-grid.busy { pointer-events: none; opacity: .6; }
.pool-hint { margin-left: auto; font-weight: 700; font-size: 13px; padding: 0 4px; }
.pool-hint.ban { color: #ff8a95; }
.pool-hint.pick { color: var(--accent); }
.eopts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; margin-top: 6px; }
.eopts button { height: 20px; border: 0; border-radius: 3px; background: var(--surface-3); color: var(--muted); font-size: 10px; font-weight: 800; cursor: pointer; padding: 0; }
.eopts button:hover { background: var(--accent); color: #000; }

/* ---------- адаптивная доска: всё помещается на экран, шкала ходов в одну строку ---------- */
.hero.compact { padding-top: 20px; padding-bottom: 12px; }
.hero.compact h1 { font-size: clamp(22px, 3vw, 34px); margin: 4px 0 8px; }
.draft { gap: 10px; }
.dboard { padding: 12px 16px 14px; gap: 4px; }
.dteam { --slot-h: clamp(48px, 18vh, 220px); min-width: 0; }
.dteam-head { margin-bottom: 8px; min-width: 0; }
.dname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.drow { display: grid; gap: clamp(3px, .5vw, 8px); overflow: visible; padding-bottom: 0; }
.dslot.ban, .dslot.pick { width: auto; min-width: 0; }
.dline-bottom { margin-top: 10px; }

.dtimeline { display: flex; flex-wrap: nowrap; gap: clamp(2px, .4vw, 6px); padding: 30px 0 26px; }
.mk { flex: 1 1 0; min-width: 0; width: auto; }
.mk-bar::after { margin-left: clamp(-6px, -.4vw, -3px); border-width: clamp(3px, .4vw, 6px); }
.mk-label { font-size: clamp(9px, .9vw, 12px); }
.mk-clock { font-size: clamp(13px, 1.4vw, 18px); }

@media (max-width: 900px) {
  .dteam { --slot-h: clamp(44px, 13vh, 120px); }
  .dslot.ban, .dslot.pick { width: auto; }
  .dname-tag { padding: 14px 3px 3px; font-size: 9px; }
  .dname-tag b { display: none; }
  .dstat { font-size: 13px; min-width: 0; }
  .dtag { height: 24px; padding: 0 10px; font-size: 14px; }
  .dname { font-size: 14px; }
  .dplayers { display: none; }
  .mk { width: auto; }
  .dtimeline { padding: 26px 0 22px; }
}
@media (max-width: 520px) {
  .dname-tag { display: none; }
  .dslot .char .fallback { font-size: 11px; }
  .dteam-head { gap: 6px; }
  .dstat.out small, .dstat small { display: none; }
}
.draft .turnbar { padding: 10px 16px; }
.draft .turnbar .what b { font-size: 16px; }
.draft .clock { font-size: 24px; }

/* ---------- пик со световым конусом ---------- */
.dslot.pick { display: flex; flex-direction: column; }
.dchar { position: relative; flex: 1 1 74%; min-height: 0; overflow: hidden; }
.dchar .char { position: absolute; inset: 0; border-radius: 0; }
.dbadge-e { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.75); color: #fff; font-weight: 800; font-size: clamp(9px, .9vw, 13px); padding: 1px 5px; border-radius: 3px; font-variant-numeric: tabular-nums; }
.dcost { position: absolute; bottom: 3px; right: 5px; color: #ffd84d; font-weight: 800; font-size: clamp(10px, 1vw, 15px); text-shadow: 0 1px 3px #000; font-variant-numeric: tabular-nums; }
.dcname { position: absolute; left: 0; right: 30px; bottom: 0; padding: 14px 5px 3px; font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.dcone { position: relative; flex: 0 0 26%; min-height: 0; border-top: 2px solid var(--surface); overflow: hidden; background: var(--surface-3); }
.dcone .cone { position: absolute; inset: 0; }
.dcone-s { position: absolute; left: 5px; bottom: 3px; font-weight: 800; font-size: clamp(10px, 1vw, 15px); text-shadow: 0 1px 3px #000; }
.dcone.nocone { display: flex; align-items: center; justify-content: center; }
.dcone-add { font-size: 11px; font-weight: 700; color: var(--muted); }
.dslot.editable { cursor: pointer; }
.dslot.editable:hover { box-shadow: 0 0 0 2px var(--tc) inset; }
.dslot.editable:hover .dcone-add { color: var(--text); }
.cone { position: relative; overflow: hidden; background: linear-gradient(160deg, #3a3550, #1c1a26); }
.cone.r5 { background: linear-gradient(160deg, #6b4a1f, #2a2116); }
.cone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cone .fallback { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 11px; color: rgba(255,255,255,.7); }

.edit-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.edit-head b { font-size: 18px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cone-current { display: flex; align-items: center; gap: 12px; background: var(--surface-3); border-radius: 8px; padding: 8px; }
.cone-current .cone { width: 52px; height: 52px; border-radius: 6px; flex: none; }
.cone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; max-height: 42vh; overflow: auto; padding-right: 4px; }
.cone-card { background: var(--surface-3); border: 2px solid transparent; border-radius: 6px; padding: 6px; text-align: left; cursor: pointer; }
.cone-card:hover { border-color: #fff; }
.cone-card.selected { border-color: var(--accent); }
.cone-card .cone { width: 100%; aspect-ratio: 1; border-radius: 4px; }
.cone-card .nm { font-size: 11px; font-weight: 700; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cone-card .cs { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.res-row { flex-wrap: wrap; }
.res-row .res-cone { width: 40px; height: 40px; border-radius: 6px; }
.res-row .cone-nm { flex: 1 1 140px; font-size: 13px; }
@media (max-width: 900px) {
  .dcname { display: none; }
  .dcone-add { font-size: 0; }
  .dcone-add::before { content: '+'; font-size: 14px; }
}
.dslot.ban .dchar { position: absolute; inset: 0; }
/* фиксированные доли: портрет 74%, конус 26% (не зависит от содержимого) */
.dslot.pick .dchar { flex: none; height: 74%; }
.dslot.pick .dcone { flex: none; height: 26%; }
.dcname { right: 0; padding-right: 3.6em; }
.dlocked { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 12px; font-weight: 700; }
.dlock-btn { height: 26px; padding: 0 10px; font-size: 12px; }
.dcone-hidden { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--muted); }
@media (max-width: 900px) { .dlock-btn { display: none; } .dcone-hidden { font-size: 0; } }

/* ---------- портреты выше ---------- */
.dteam { --slot-h: clamp(60px, 21vh, 250px); }
@media (max-width: 900px) { .dteam { --slot-h: clamp(48px, 15vh, 140px); } }

/* ---------- этап раскладки по пачкам ---------- */
.arrange { background: var(--surface); border-radius: var(--radius-lg); padding: 14px 16px 16px; border-top: 3px solid var(--tc); }
.arrange-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.arrange-head b { font-size: 16px; }
.ahalves { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.azone { background: var(--surface-2); border-radius: 10px; padding: 10px; border: 2px dashed transparent; transition: border-color .15s, background .15s; min-width: 0; }
.azone.unassigned { margin-bottom: 12px; }
.azone.over { border-color: var(--tc); background: var(--surface-3); }
.azone-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.azone-cost { margin-left: auto; color: #ffd84d; font-weight: 800; font-variant-numeric: tabular-nums; }
.azone-cards { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; }
.azone.unassigned .azone-cards { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.acard { position: relative; display: flex; flex-direction: column; height: clamp(150px, 24vh, 240px); border-radius: 6px; overflow: hidden; background: var(--surface-3); min-width: 0; }
.acard.placeholder { background: transparent; border: 1px dashed #3a3a3a; }
.acard.editable { cursor: grab; }
.acard.editable:hover { box-shadow: 0 0 0 2px var(--tc) inset; }
.achar { position: relative; flex: none; height: 72%; overflow: hidden; }
.achar .char { position: absolute; inset: 0; border-radius: 0; }
.acard .dcone { flex: none; height: 28%; cursor: pointer; }
.amove { position: absolute; top: 4px; left: 4px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.acard:hover .amove { opacity: 1; }
.amove button { width: 22px; height: 22px; border: 0; border-radius: 4px; background: rgba(0,0,0,.75); color: #fff; font-size: 11px; font-weight: 800; cursor: pointer; padding: 0; }
.amove button.on { background: var(--accent); color: #000; }
.amove button:hover { background: #fff; color: #000; }
@media (max-width: 900px) {
  .ahalves { grid-template-columns: 1fr; }
  .amove { opacity: 1; }
  .acard { height: 130px; }
}
.draft > .arrange + .arrange { margin-top: 0; }

/* ---------- этап «Результаты» ---------- */
.cycles-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.cycles-row label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.num-input { width: 96px; padding: 8px 10px; font-variant-numeric: tabular-nums; font-weight: 700; text-align: center; }
.num-input:disabled { opacity: .7; cursor: default; }
.score-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; background: var(--surface-2); border-radius: 10px; padding: 10px 14px; }
.score-item { display: flex; flex-direction: column; gap: 2px; }
.score-item small { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.score-item b { font-size: 20px; font-variant-numeric: tabular-nums; }
.score-item.total b { color: var(--tc); font-size: 24px; }
.score-op { color: var(--subtle); font-size: 18px; font-weight: 700; }
.submit-row { display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap; }
.winner-banner { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: var(--radius-lg); background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 28%, transparent), var(--surface)); color: var(--tc); }
.winner-banner b { display: block; font-size: 24px; color: var(--text); }
.winner-banner span { color: var(--muted); font-variant-numeric: tabular-nums; }
.winner-banner > div { flex: 1; }
.arrange.winner { box-shadow: 0 0 0 1px var(--tc) inset, 0 0 32px -10px var(--tc); }
/* селектор эйдолона на пикнутом персонаже */
.eselect { appearance: none; -webkit-appearance: none; border: 1px solid var(--accent); cursor: pointer; padding-right: 14px;
  background: rgba(0,0,0,.8) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%231ed760'/%3E%3C/svg%3E") no-repeat right 4px center; font-family: inherit; z-index: 2; }
.eselect:hover { background-color: #000; }
.eselect option { background: #282828; color: #fff; }

/* ---------- модалка подтверждения ---------- */
.confirm-modal { width: min(440px, 100%); background: #1c1c1c; border-radius: 16px; padding: 28px 28px 22px; text-align: center; box-shadow: 0 24px 64px rgba(0,0,0,.7); animation: pop .18s; border: 1px solid #2c2c2c; }
.confirm-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; }
.confirm-modal.danger .confirm-icon { background: rgba(243,114,127,.14); color: var(--danger); box-shadow: 0 0 0 8px rgba(243,114,127,.06); }
.confirm-modal.primary .confirm-icon { background: rgba(30,215,96,.14); color: var(--accent); box-shadow: 0 0 0 8px rgba(30,215,96,.06); }
.confirm-modal h2 { margin: 0 0 10px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.confirm-text { color: var(--muted); line-height: 1.5; font-size: 14px; }
.confirm-text b { color: var(--text); }
.confirm-actions { display: flex; gap: 10px; justify-content: center; margin-top: 24px; }
.btn-danger-fill { background: var(--danger); color: #000; }
.btn-danger-fill:hover:not(:disabled) { background: #ff8f99; transform: scale(1.03); }
.eselect { max-width: 52px; text-overflow: ellipsis; }
.amove { top: auto; bottom: 26px; left: 4px; }
.amove { bottom: calc(28% + 24px); }

/* ---------- список лобби (вертикальный) ---------- */
.ltabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--border); margin: 8px 0 16px; }
.ltab { background: none; border: 0; padding: 14px 16px 12px; font-size: 14px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 8px; }
.ltab:hover { color: var(--text); }
.ltab.active { color: var(--accent); border-bottom-color: var(--accent); }
.ltab-count { background: var(--surface-3); color: var(--muted); border-radius: 999px; padding: 1px 8px; font-size: 11px; letter-spacing: 0; }
.ltab.active .ltab-count { background: rgba(30,215,96,.15); color: var(--accent); }
.ltabs .spacer { flex: 1; }
.ltabs .btn { margin-bottom: 6px; }
.lrows { display: flex; flex-direction: column; gap: 8px; }
.lrow { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; cursor: pointer; transition: background .15s, border-color .15s; }
.lrow:hover { background: var(--surface-2); border-color: #3a3a3a; }
.lrow-icon { width: 40px; height: 40px; display: grid; place-items: center; color: var(--muted); flex: none; }
.lrow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lrow-main b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow-main span { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lpill { padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.lpill.waiting { background: rgba(30,215,96,.15); color: var(--accent); }
.lpill.progress { background: #7fbfff; color: #0b1a2a; }
.lpill.finished { background: var(--surface-3); color: var(--muted); }
@media (max-width: 600px) {
  .lrow { flex-wrap: wrap; }
  .lrow-main { flex-basis: calc(100% - 60px); }
  .ltab { padding: 12px 8px 10px; font-size: 12px; }
}
/* на доске драфта конусов нет — портрет на всю высоту слота */
.dteam .dslot.pick .dchar { height: 100%; }

/* =====================================================================
   Balances / Cost Test / My Teams / Admin
   ===================================================================== */
.select-sm { padding: 6px 10px; width: auto; font-size: 13px; }
.warn-note { color: #ffc46b; }
.hero .eyebrow a:hover { text-decoration: underline; }

/* выбор баланса и патча */
.bp-bar { display: flex; gap: 12px; flex-wrap: wrap; }
.bp-field { display: flex; flex-direction: column; gap: 4px; min-width: 180px; }
.bp-field span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.bp-field .select { padding: 9px 12px; }
.ct-toolbar { align-items: flex-end; }
.search.sm .input { height: 38px; width: 200px; }

/* список балансов */
.bal-icon { background: var(--surface-3); border-radius: 8px; width: 44px; height: 44px; display: grid; place-items: center; color: var(--accent); }
.patch-pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.patch-pills .badge { cursor: pointer; text-transform: none; }
.patch-pills .badge:hover { color: var(--text); }

/* редактор баланса */
.bal-meta .avatar { display: inline-grid; }
.bal-toolbar { padding-bottom: 12px; }
.patch-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.latest-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }
.ptable-wrap { overflow: auto; border-radius: var(--radius); background: var(--surface); max-height: calc(100vh - 330px); min-height: 280px; margin-bottom: 80px; }
.ptable { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; }
.ptable th { position: sticky; top: 0; z-index: 2; background: #202020; font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px 6px; text-align: center; border-bottom: 1px solid var(--border); }
.ptable td { padding: 4px; border-bottom: 1px solid #222; text-align: center; }
.ptable tr:hover td { background: #1c1c1c; }
.ptable .pname { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 220px; padding-left: 12px; }
.ptable th.pname { z-index: 3; background: #202020; }
.ptable tr:hover td.pname { background: #1c1c1c; }
.pname-in { display: flex; align-items: center; gap: 10px; }
.pname-in .char { width: 36px; height: 36px; flex: none; }
.pname-in .cone { width: 30px; height: 36px; flex: none; }
.pname-in b { display: block; font-size: 13px; white-space: nowrap; }
.pname-in span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; }
.pcell { width: 64px; padding: 7px 6px; border-radius: 6px; border: 1px solid transparent; background: var(--surface-3); text-align: center; outline: none; font-variant-numeric: tabular-nums; }
.pcell:hover { border-color: #535353; }
.pcell:focus { border-color: #fff; background: #333; }
.pcell.changed { border-color: var(--accent); background: rgba(30,215,96,.1); }
.pcell.bad { border-color: var(--danger); background: rgba(243,114,127,.12); }
.pcell-ro { display: inline-block; min-width: 56px; padding: 7px 0; }
.savebar { position: fixed; left: calc(296px + 32px); right: 40px; bottom: 16px; z-index: 40; display: flex; align-items: center; gap: 12px; background: #282828; border-radius: var(--radius-lg); padding: 12px 16px; box-shadow: 0 8px 32px rgba(0,0,0,.6); transform: translateY(140%); transition: transform .2s; }
.savebar.show { transform: none; }
.savebar .spacer { flex: 1; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; padding-top: 8px; align-items: start; }
.panel { background: var(--surface); border-radius: var(--radius-lg); padding: 20px; }
.panel h3 { margin: 0 0 16px; font-size: 18px; }
.panel .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.panel .mini { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.panel .field label b { color: var(--text); }
.chip:disabled { opacity: .5; cursor: default; }
.user-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.user-list.found { margin-top: 8px; background: #202020; border-radius: 8px; padding: 4px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; }
.user-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.user-row.clickable { cursor: pointer; }
.user-row.clickable:hover { background: var(--surface-3); }
.danger-zone { border: 1px solid rgba(243,114,127,.3); }
.dz-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.dz-row > div { flex: 1; }
.dz-row b { display: block; }

/* Cost Test */
.ct-performance { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.ct-performance .field { flex: 1 1 180px; max-width: 280px; margin-bottom: 0; }
.ct-performance .input[aria-invalid="true"] { border-color: var(--danger); }
.ct-performance .field-error { color: var(--danger); font-size: 12px; }
.team-performance { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.team-row-head .team-performance .badge { margin-top: 0; }
.ct-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ct-slot { position: relative; background: var(--surface); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 290px; text-align: center; }
.ct-slot.empty-slot { border: 2px dashed #3a3a3a; background: transparent; color: var(--muted); justify-content: center; cursor: pointer; font-weight: 700; gap: 10px; }
.ct-slot.empty-slot:hover { border-color: #fff; color: var(--text); }
.ct-remove { position: absolute; top: 8px; right: 8px; }
.ct-char { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 10px; }
.ct-char .char { width: 96px; height: 96px; }
.ct-char:hover .char { outline: 2px solid #fff; }
.ct-name { font-size: 15px; margin-top: 4px; }
.ct-line { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 6px; }
.ct-line .select-sm { flex: 1; min-width: 0; }
.ct-cost { min-width: 44px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.ct-cone { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: var(--surface-3); border: 0; border-radius: 6px; padding: 4px 8px; height: 40px; cursor: pointer; text-align: left; }
.ct-cone:hover { background: #333; }
.ct-cone .cone { width: 26px; height: 32px; flex: none; }
.ct-cone .nm { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-line .ct-cone + .select-sm { flex: none; }
.ct-total { display: flex; align-items: center; gap: 16px; margin-top: 16px; background: var(--surface); border-radius: var(--radius-lg); padding: 16px 24px; flex-wrap: wrap; }
.ct-total > div:not(.op) { display: flex; flex-direction: column; }
.ct-total span { font-size: 12px; color: var(--muted); font-weight: 600; }
.ct-total b { font-size: 24px; font-variant-numeric: tabular-nums; }
.ct-total .op { color: var(--subtle); font-size: 22px; font-weight: 800; }
.ct-total .sum b { font-size: 34px; color: var(--accent); }
.picker-grid { max-height: 56vh; overflow: auto; }

/* My Teams */
.team-rows { display: flex; flex-direction: column; gap: 8px; }
.team-row { display: grid; grid-template-columns: minmax(140px, 1fr) auto 110px auto; align-items: center; gap: 20px; background: var(--surface); border-radius: var(--radius); padding: 12px 16px; }
.team-row:hover { background: #1f1f1f; }
.team-row-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.team-row-head b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-row-head .badge { align-self: flex-start; margin-top: 4px; }
.team-members { display: flex; gap: 10px; }
.tm { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 64px; }
.tm.empty-tm { height: 64px; border: 2px dashed #333; border-radius: 8px; }
.tm-pic { position: relative; width: 64px; height: 64px; }
.tm-pic .char { width: 64px; height: 64px; }
.tm-e { position: absolute; left: 2px; top: 2px; background: rgba(0,0,0,.75); font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 4px; }
.tm-cone { position: absolute; right: -6px; bottom: -6px; display: flex; align-items: flex-end; }
.tm-cone .cone { width: 24px; height: 30px; border: 2px solid var(--surface); border-radius: 4px; }
.tm-cone i { font-style: normal; font-size: 9px; font-weight: 800; background: rgba(0,0,0,.8); padding: 0 3px; border-radius: 3px; margin-left: -8px; }
.tm-cost { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.team-total { display: flex; flex-direction: column; align-items: flex-end; }
.team-total span { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.team-total b { font-size: 26px; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.1; }
.team-total small { color: var(--subtle); font-size: 11px; font-variant-numeric: tabular-nums; }
.team-actions { display: flex; align-items: center; gap: 4px; }

/* Admin */
.admin-row { cursor: default; }
.admin-row .switch { margin-left: 8px; }

@media (max-width: 1100px) {
  .ct-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-row { grid-template-columns: 1fr auto; }
  .team-members { grid-column: 1 / -1; order: 3; }
}
@media (max-width: 900px) {
  .savebar { left: 16px; right: 16px; }
}
@media (max-width: 560px) {
  .ct-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ct-slot { padding: 12px 8px; min-height: 250px; }
  .ct-char .char { width: 72px; height: 72px; }
  .team-members { gap: 6px; }
  .tm, .tm-pic, .tm-pic .char { width: 52px; }
  .tm-pic, .tm-pic .char { height: 52px; }
  .admin-row { flex-wrap: wrap; }
}
.toolbar > .select { width: auto; padding: 9px 12px; }

/* ---------- разбор драфта (этап результатов) ---------- */
.recap { background: var(--surface); border-radius: var(--radius-lg); padding: 4px 20px 20px; margin-top: 16px; }
.recap-head { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; padding: 14px 0; cursor: pointer; text-align: left; }
.recap-head b { font-size: 18px; }
.recap-head .spacer { flex: 1; }
.recap-caret { transition: transform .15s; color: var(--muted); }
.recap-caret:not(.open) { transform: rotate(-90deg); }
.recap small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.recap-story { display: flex; gap: 32px; flex-wrap: wrap; padding: 4px 0 16px; border-bottom: 1px solid var(--border); }
.recap-story b { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; }
.recap-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px 0; }
.recap-team { background: var(--surface-2); border-radius: var(--radius); padding: 14px 16px; border-top: 3px solid var(--tc); }
.recap-team-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.recap-team-head .dtag { background: var(--tc); }
.recap-bans { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.recap-bans small { margin: 0 6px 0 0; }
.recap-ban { position: relative; width: 40px; height: 40px; }
.recap-ban .char { width: 40px; height: 40px; filter: grayscale(1) brightness(.7); }
.recap-ban::after, .rm-pic.banned::after { content: ''; position: absolute; left: -2px; right: -2px; top: 50%; height: 2px; background: var(--ban); transform: rotate(-35deg); }
.recap-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px 16px; }
.recap-stats b { font-variant-numeric: tabular-nums; }
.recap-stats .bad b { color: var(--danger); }
.recap-order { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.recap-move { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 0; border-radius: 6px; background: var(--surface-2); border-left: 3px solid var(--tc); }
.rm-n { width: 26px; text-align: right; color: var(--subtle); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 12px; }
.rm-type { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--tc); width: 30px; }
.recap-move.ban .rm-type { color: var(--ban); }
.rm-pic { position: relative; width: 36px; height: 36px; flex: none; }
.rm-pic .char { width: 36px; height: 36px; }
.rm-pic.banned .char { filter: grayscale(1) brightness(.7); }
.rm-main { flex: 1; min-width: 0; }
.rm-main b, .rm-main span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-main b { font-size: 13px; }
.rm-main span { font-size: 11px; color: var(--muted); }
.rm-time { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; }
.rm-time small { display: block; font-size: 10px; text-transform: none; letter-spacing: 0; margin: 0; }
.rm-time.warn small { color: #ffc46b; }
.rm-time.bad, .rm-time.bad small { color: var(--danger); }
@media (max-width: 900px) { .recap-teams { grid-template-columns: 1fr; } .recap { padding: 4px 14px 14px; } }
.recap-board { padding-top: 16px; }
.recap-board .dboard { margin: 0; }
.dtook { position: absolute; left: 3px; top: 3px; z-index: 2; background: rgba(0,0,0,.72); color: #fff; font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.dtook.warn { color: #ffc46b; }
.dtook.bad { color: var(--danger); }
@media (max-width: 700px) { .dtook { display: none; } }

/* ---------- Patch Notes ---------- */
:root { --buff: #1ed760; --nerf: #f3727f; }
.pn-legend { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.pn-legend.buff, .pn-count.buff { color: var(--buff); background: rgba(30,215,96,.14); }
.pn-legend.nerf, .pn-count.nerf { color: var(--nerf); background: rgba(243,114,127,.14); }
.pn-patch { background: var(--surface); border-radius: var(--radius-lg); padding: 16px 20px 20px; margin-bottom: 16px; }
.pn-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pn-head h2 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.pn-head .spacer { flex: 1; }
.pn-count { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.pn-group h3 { font-size: 15px; margin: 18px 0 8px; display: flex; gap: 8px; align-items: baseline; }
.pn-wrap { max-height: none; min-height: 0; margin-bottom: 0; background: var(--surface-2); }
.pn-table .pname { background: var(--surface-2); }
.pn-table th, .pn-table th.pname { background: #242424; }
.pn-row td { border-bottom-color: #2a2a2a; }
.pn-row.buff td.pname { box-shadow: inset 3px 0 0 var(--buff); }
.pn-row.nerf td.pname { box-shadow: inset 3px 0 0 var(--nerf); }
.pn-row.mixed td.pname { box-shadow: inset 3px 0 0 #ffc46b; }
.pn-kind { font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 10px !important; }
.pn-kind.buff { color: var(--buff) !important; }
.pn-kind.nerf { color: var(--nerf) !important; }
.pn-kind.mixed { color: #ffc46b !important; }
.pn-cell { font-variant-numeric: tabular-nums; min-width: 64px; }
.pn-cell.same { color: var(--subtle); }
.pn-cell s { display: block; font-size: 11px; color: var(--subtle); }
.pn-cell b { display: block; }
.pn-cell.buff { background: rgba(30,215,96,.12); color: var(--buff); }
.pn-cell.nerf { background: rgba(243,114,127,.12); color: var(--nerf); }
@media (max-width: 560px) { .pn-patch { padding: 12px; } .pn-head h2 { font-size: 20px; } }
@media (max-width: 560px) { .ptable .pname { min-width: 140px; } .pname-in span { display: none; } .pname-in .pn-kind { display: block; } }
/* черновик патча */
.draft-tag { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #ffc46b; }
.chip.active .draft-tag { color: #9a5b00; }
.draft-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 12px; border-radius: var(--radius); background: rgba(255,164,43,.1); border: 1px solid rgba(255,164,43,.35); }
.draft-bar > div { flex: 1; min-width: 220px; }
.draft-bar b { display: block; color: #ffc46b; }
.draft-bar span { color: var(--muted); font-size: 13px; }
.ro-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--radius); background: var(--surface-2); color: var(--muted); font-size: 13px; }
.ro-bar a { color: var(--text); text-decoration: underline; }

/* ---------- ростеры на драфте ---------- */
.drost { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.drost-team { background: var(--surface-2); border-radius: var(--radius); padding: 12px; border-top: 3px solid var(--tc); min-width: 0; }
.drost-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.drost-head .dtag { background: var(--tc); }
.drost-head .note { flex-basis: 100%; }
.drost-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; max-height: 52vh; overflow: auto; padding-right: 2px; }
.drost-card { background: #1a1a1a; border-radius: 6px; padding: 5px; }
.drost-card.picked, .drost-card.banned { opacity: .4; }
.drost-card.picked:hover, .drost-card.banned:hover { opacity: .8; }
.drost-pic { position: relative; }
.drost-pic .char { width: 100%; aspect-ratio: 1; }
.drost-card.banned .char { filter: grayscale(1); }
.drost-st { position: absolute; left: 3px; top: 3px; font-size: 9px; font-weight: 800; padding: 1px 4px; border-radius: 3px; background: var(--sc); color: #000; }
.drost-st.ban { background: var(--ban); color: #fff; }
.drost-card .nm { font-size: 11px; font-weight: 700; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drost-eids { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.drost-eids span { font-size: 10px; font-weight: 800; background: var(--surface-3); border-radius: 3px; padding: 1px 4px; font-variant-numeric: tabular-nums; }
.drost-eids i { font-style: normal; font-weight: 600; color: var(--muted); margin-left: 3px; }
@media (max-width: 760px) { .drost { grid-template-columns: 1fr; } .drost-grid { max-height: none; } }
