/* GABL Fantasy. Цвета и шрифты — как у gabl-stats (static/stats.css), шапка — header.css (копия их league.css). Сначала телефон. */
:root {
  --bg: #ececef; --paper: #ffffff; --paper2: #f5f5f7; --fg: #141416; --mut: #6c6c74; --line: #dcdce1;
  --accent: #e5062a; --gold: #c9a24b; --win: #1d9a55; --shadow: rgba(0,0,0,.08); --hero: #23262e;
  --font: "Noto Sans", "Noto Sans Georgian", -apple-system, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e0e10; --paper: #19191c; --paper2: #212125; --fg: #f0f0f2; --mut: #9c9ca4; --line: #303036; --shadow: rgba(0,0,0,.4); --hero: #19191c; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15px; line-height: 1.4; -webkit-text-size-adjust: 100%; }
body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
a { color: inherit; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
[hidden] { display: none !important; }
.top { z-index: 30; }
main { max-width: 760px; margin: 0 auto; padding: 14px 16px 24px; min-height: 60vh; }
.loading, .empty { text-align: center; color: var(--mut); padding: 28px 8px; margin: 0; list-style: none; }
.mut { color: var(--mut); font-size: 13px; margin: 4px 0; }
.neg { color: var(--accent); }
.note { color: var(--mut); font-size: 13px; margin: 8px 2px; }
.pt { font-size: 22px; font-weight: 800; margin: 4px 0 12px; }
code { background: var(--paper2); padding: 1px 6px; border-radius: 6px; font-size: 13px; letter-spacing: .5px; word-break: break-all; }

/* вкладки: на телефоне — панель внизу */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; background: var(--paper); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: 0 -2px 10px var(--shadow); }
.tabs a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px; text-decoration: none; color: var(--mut); font-size: 10px; font-weight: 600; white-space: nowrap; letter-spacing: -.02em; }
.tabs a span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tabs svg { width: 23px; height: 23px; }
.tabs a.on { color: var(--accent); }
.tabs a.adm { flex: 0 0 auto; justify-content: center; padding: 8px 10px; }

.card { background: var(--paper); border-radius: 14px; padding: 16px; margin: 0 0 12px; box-shadow: 0 1px 3px var(--shadow); }
.card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--mut); margin-bottom: 10px; font-feature-settings: "case"; }
.card.center { text-align: center; }
.card.center #gbtn { display: flex; justify-content: center; margin: 14px 0 6px; min-height: 44px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 20px; border: 0; border-radius: 22px; background: var(--accent); color: #fff;
  font-weight: 700; text-decoration: none; white-space: nowrap; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.ghost { background: none; color: var(--fg); border: 1px solid var(--line); }
.btn.sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn.big { min-height: 50px; padding: 0 28px; font-size: 16px; }
.btn.wide { width: 100%; }
.lnk { background: none; border: 0; padding: 4px 2px; color: var(--mut); text-decoration: underline; font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row input { flex: 1; min-width: 0; }
input, select, textarea { background: var(--paper2); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; min-height: 44px; width: 100%; font-size: 16px; }
textarea { padding: 10px 12px; font-family: ui-monospace, monospace; font-size: 13px; }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; flex: none; accent-color: var(--accent); }
.form { display: flex; flex-direction: column; gap: 12px; }
.form h2 { font-size: 20px; } .form h3 { margin: 6px 0 0; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--mut); }
.form label.chk { flex-direction: row; align-items: center; gap: 10px; font-size: 15px; color: var(--fg); font-weight: 500; }

/* главная */
.hero { background: var(--hero); color: #fff; border-radius: 16px; padding: 22px 18px 18px; margin: 0 0 12px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  background-image: radial-gradient(120% 90% at 100% 0%, rgba(229,6,42,.55), transparent 60%); }
.hero h1 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: #ff5c75; font-weight: 800; }
.hero h2 { font-size: 28px; font-weight: 800; }
.hero p { margin: 0; color: #d0d0d6; max-width: 46ch; }
.hero small { color: #a8a8b0; }
.dl { display: flex; flex-direction: column; gap: 1px; background: rgba(255,255,255,.1); border-radius: 12px; padding: 10px 14px; width: 100%; }
.dl span { font-size: 12px; color: #c4c4cc; text-transform: uppercase; letter-spacing: .04em; font-feature-settings: "case"; }
.dl b { font-size: 19px; }
.dl em { font-style: normal; color: #ffb3bf; font-weight: 600; font-size: 13px; }
.pill { display: inline-block; padding: 6px 12px; border-radius: 16px; background: rgba(255,255,255,.14); color: #fff; text-decoration: none; font-size: 13px; font-weight: 600; }
.pill.live::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff3b57; margin-right: 7px; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stats3.five { grid-template-columns: repeat(5, 1fr); margin: 14px 0; }
.stats3 b { display: block; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stats3.five b { font-size: 18px; }
.stats3 span { font-size: 11.5px; color: var(--mut); }
.prizes { display: grid; gap: 12px; border-left: 4px solid var(--gold); }
.prizes span { display: block; font-size: 12px; color: var(--mut); text-transform: uppercase; letter-spacing: .04em; }
.fx { list-style: none; margin: 0; padding: 0; }
.fx li { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 4px 8px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.fx li:first-child { border-top: 0; }
.fx time { grid-column: 1 / -1; font-size: 12px; color: var(--mut); font-weight: 500; }
.fx span { display: flex; align-items: center; gap: 7px; min-width: 0; }
.fx span:nth-of-type(2) { justify-content: flex-end; flex-direction: row-reverse; }
.fx img { width: 22px; height: 22px; object-fit: contain; flex: none; }
.fx i { color: var(--mut); font-style: normal; } .fx em { font-style: normal; font-size: 11px; color: var(--mut); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; }
.how ol { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 6px; }
.how a, .morelink { font-weight: 700; color: var(--accent); text-decoration: none; font-size: 14px; }
.morelink { display: block; margin-top: 10px; }

/* моя команда */
.thead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 12px; }
.thead h1 { font-size: 22px; font-weight: 800; word-break: break-word; }
.thead small { color: var(--mut); }
.seg { display: flex; background: var(--paper2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; margin: 0 0 12px; }
.seg a { flex: 1; text-align: center; padding: 8px 6px; border-radius: 9px; text-decoration: none; font-weight: 700; font-size: 14px; color: var(--mut); }
.seg a.on { background: var(--paper); color: var(--fg); box-shadow: 0 1px 3px var(--shadow); }
.bar { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--hero); color: #fff; border-radius: 14px; padding: 12px 6px; text-align: center; position: sticky; top: 6px; z-index: 5; box-shadow: 0 4px 14px var(--shadow); }
.bar span { display: block; font-size: 11px; color: #b8b8c0; text-transform: uppercase; letter-spacing: .04em; font-feature-settings: "case"; }
.bar b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bar b.neg { color: #ff5c75; }
.sec { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--mut); margin: 16px 2px 8px; font-feature-settings: "case"; }
.sec small { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 6px; }
.slots { display: grid; gap: 7px; }
.slot { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; min-height: 62px; padding: 8px 12px 8px 8px; background: var(--paper); border: 1px solid transparent; border-radius: 14px;
  text-align: left; text-decoration: none; box-shadow: 0 1px 3px var(--shadow); }
.slot.empty { justify-content: center; color: var(--mut); background: none; border: 1.5px dashed var(--line); box-shadow: none; font-weight: 600; }
.slot .plus { font-size: 22px; line-height: 1; color: var(--accent); }
.slot.target { border-color: var(--accent); border-style: dashed; }
.slot.from { outline: 2px solid var(--accent); }
.slot.gone { opacity: .6; }
.slot.off { opacity: .5; box-shadow: none; }
.swapnote { color: var(--accent); font-weight: 600; }
.av { position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--paper2); overflow: hidden; display: grid; place-items: center; border: 1px solid var(--line); }
.av b { font-size: 14px; color: var(--mut); font-weight: 700; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.av.big { width: 68px; height: 68px; } .av.big b { font-size: 20px; }
.cv { position: absolute; left: 38px; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--fg); color: var(--paper); font-size: 11px; display: grid; place-items: center; border: 2px solid var(--paper); z-index: 1; }
.cv.c { background: var(--accent); color: #fff; }
.cv.n { background: var(--paper2); color: var(--mut); }
.nm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nm b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm small { font-size: 12px; color: var(--mut); display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm small img { width: 15px; height: 15px; object-fit: contain; flex: none; }
.nm i, .rest { font-style: normal; }
.rest { opacity: .8; }
.num, .st { flex: none; text-align: right; display: flex; flex-direction: column; min-width: 38px; }
.num b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.st b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.num small, .st small { font-size: 10.5px; color: var(--mut); }
.savebar { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); z-index: 6; display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 12px; background: var(--paper);
  border-radius: 16px; box-shadow: 0 4px 18px var(--shadow); border: 1px solid var(--line); }
.savebar span { flex: 1; font-size: 13px; font-weight: 600; color: var(--mut); }
.savebar span.neg { color: var(--accent); }
.totals { display: flex; justify-content: flex-end; align-items: baseline; gap: 14px; margin-top: 12px; padding: 12px 14px; background: var(--paper); border-radius: 14px; }
.totals b { font-size: 19px; } .totals span { color: var(--accent); font-weight: 600; }

/* списки игроков */
.filters { display: grid; gap: 8px; margin-bottom: 10px; }
.frow { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.frow select { font-size: 14px; padding: 0 8px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 10px; scrollbar-width: none; }
.filters .chips { margin: 0; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 13px; border-radius: 18px; border: 1px solid var(--line); background: var(--paper); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; color: var(--fg); }
.chip.on { background: var(--fg); color: var(--paper); border-color: var(--fg); }
.plist { list-style: none; margin: 0; padding: 0; background: var(--paper); border-radius: 14px; box-shadow: 0 1px 3px var(--shadow); overflow: hidden; }
.plist.mini { box-shadow: none; border-radius: 0; }
.prow { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); cursor: pointer; min-height: 56px; }
.prow:first-child { border-top: 0; }
.plist.mini .prow { padding-left: 0; padding-right: 0; }
.prow .tl { width: 28px; height: 28px; object-fit: contain; flex: none; }
.prow.dis { opacity: .45; cursor: default; }
.prow .st { min-width: 34px; }
.addb { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 600; line-height: 1; }
.prow.dis .addb { background: none; }
.morerow { padding: 12px; text-align: center; border-top: 1px solid var(--line); }
.pcard { display: flex; align-items: center; gap: 14px; padding-right: 34px; }
.pcard h2 { font-size: 20px; } .pcard p { margin: 4px 0 0; color: var(--mut); font-size: 13px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pcard p img { width: 18px; height: 18px; object-fit: contain; }
.menu { display: grid; margin: 14px -4px 0; }
.menu button { background: none; border: 0; border-top: 1px solid var(--line); text-align: left; padding: 15px 6px; font-size: 16px; font-weight: 600; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.tbl th { font-size: 11px; color: var(--mut); font-weight: 600; padding: 6px 4px; }
.tbl td { padding: 8px 4px; text-align: center; border-top: 1px solid var(--line); }
.tbl .l { text-align: left; } .tbl tr.off td { color: var(--mut); }
#plog { margin-bottom: 14px; overflow-x: auto; }

/* таблицы и лиги */
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { border-top: 1px solid var(--line); }
.rank li:first-child { border-top: 0; }
.rank a { display: flex; align-items: center; gap: 10px; padding: 11px 2px; text-decoration: none; }
.rank i { font-style: normal; width: 30px; text-align: center; color: var(--mut); font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.rank span { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank b { font-size: 16px; font-variant-numeric: tabular-nums; }
.rank li.me { background: color-mix(in srgb, var(--accent) 9%, transparent); margin: 0 -16px; padding: 0 16px; }
.rank em { font-style: normal; font-size: 11px; color: var(--accent); font-weight: 700; }
.lp { display: inline-flex; vertical-align: -3px; margin-left: 3px; }
.lp img { width: 17px; height: 17px; object-fit: contain; }
.lgs { list-style: none; margin: 0; padding: 0; }
.lgs li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.lgs li:first-child { border-top: 0; }
.lgs a { flex: 1 1 100%; text-decoration: none; display: flex; flex-direction: column; gap: 2px; }
.lgs a b { font-size: 16px; } .lgs a small { color: var(--mut); }
.rules h2 { font-size: 22px; margin-bottom: 6px; } .rules h3 { font-size: 15px; color: var(--fg); text-transform: none; letter-spacing: 0; margin: 18px 0 6px; }
.rules ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
pre { white-space: pre-wrap; font-size: 12px; color: var(--mut); margin: 8px 0 0; max-height: 240px; overflow: auto; }

/* окна снизу */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sh-bg { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.sh-box { position: relative; width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto; background: var(--paper); border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); animation: up .22s ease-out; }
.sh-box.full { height: 94dvh; max-height: none; background: var(--bg); }
.sh-h { font-size: 19px; margin-bottom: 12px; padding-right: 34px; }
.sh-x { position: absolute; right: 10px; top: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--paper2); font-size: 22px; line-height: 1; z-index: 2; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: calc(140px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 80; background: var(--fg); color: var(--paper); padding: 11px 18px; border-radius: 22px;
  font-weight: 600; font-size: 14px; max-width: 90vw; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.bad { background: var(--accent); color: #fff; }

.foot { text-align: center; color: var(--mut); font-size: 12.5px; padding: 18px 16px 26px; }
.foot .tb { text-decoration: none; }

/* компьютер: вкладки сверху под шапкой */
@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .tabs { position: sticky; top: 0; bottom: auto; justify-content: center; gap: 6px; border-top: 0; border-bottom: 1px solid var(--line); box-shadow: none; padding: 0 16px; }
  .tabs a { flex: 0 0 auto; flex-direction: row; gap: 8px; padding: 14px 16px; font-size: 14px; border-bottom: 3px solid transparent; }
  .tabs a.on { border-bottom-color: var(--accent); color: var(--fg); }
  .tabs svg { width: 19px; height: 19px; }
  main { padding-top: 22px; }
  .bar { top: 58px; }
  .savebar { bottom: 12px; }
  .slots { grid-template-columns: 1fr 1fr; }
  .hero { padding: 34px 30px 28px; } .hero h2 { font-size: 38px; }
  .dl { width: auto; min-width: 320px; }
  .sheet { align-items: center; } .sh-box { border-radius: 20px; } .sh-box.full { height: 86dvh; }
  .toast { bottom: 40px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }
@media (max-width: 479px) { .prow .st.f { display: none; } }
.sh-h small { display: block; font-size: 13px; font-weight: 600; color: var(--mut); margin-top: 3px; }
