/* Стиль «табло eFootball»: темно-синій, кислотно-жовтий, рожеві акценти, скошені форми й шеврони.
   Розкладка: шапка з вкладками → герой ліги → сітка карток груп; усе спершу під телефон. */
:root {
  --night: #05053a;
  --navy: #0a0a66;
  --navy-2: #15158c;
  --navy-3: #1d1db0;
  --line: #2a2ab8;
  --yellow: #e8e800;
  --ink: #0a0a66;
  --pink: #ff1493;
  --cyan: #1fc8ff;
  --blue: #1463ff;
  --text: #ffffff;
  --muted: #aeb0e6;
  --ok: #35e6a4;
  --gold-a: #fff06a;
  --gold-b: #f2b100;
  --silver-a: #ffffff;
  --silver-b: #9eb0c6;
  --font-display: "Exo 2", "Arial Black", Impact, sans-serif;
  --font-body: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --cut: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--night);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
}
a { color: var(--yellow); }
h1, h2, h3 { font-family: var(--font-display); font-style: italic; font-weight: 800; margin: 0; letter-spacing: .01em; text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Фон із шевронами ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(700px 480px at 105% -5%, rgba(255, 20, 147, .28), transparent 60%),
    radial-gradient(800px 600px at -10% 105%, rgba(31, 200, 255, .16), transparent 60%),
    linear-gradient(165deg, #0b0b70 0%, var(--night) 55%, #03032a 100%); }
.chev { position: absolute; display: block; background: var(--yellow); clip-path: polygon(0 0, 42% 0, 100% 50%, 42% 100%, 0 100%, 58% 50%); }
.c1 { width: 380px; height: 480px; right: -150px; top: 140px; opacity: .09; }
.c2 { width: 260px; height: 330px; right: 90px; top: 215px; opacity: .05; }
.c3 { width: 340px; height: 430px; left: -190px; bottom: -60px; opacity: .12; background: var(--pink); transform: scaleX(-1); }
.c4 { width: 140px; height: 180px; left: 38%; top: -70px; opacity: .05; }
.stripe { position: absolute; left: -20%; right: -20%; top: 62%; height: 110px; background: var(--yellow); opacity: .035; transform: rotate(-9deg); }

/* ---------- Шапка ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(10, 10, 102, .96); backdrop-filter: blur(8px); box-shadow: 0 4px 0 var(--yellow), 0 7px 0 var(--pink); }
.top-inner { max-width: 1080px; margin: 0 auto; padding: 10px 16px 4px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-text { font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: clamp(15px, 4.4vw, 21px); line-height: 1.05; text-transform: uppercase; letter-spacing: .02em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.who { flex: none; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; font-weight: 700; font-size: 14px; color: var(--ink); background: var(--yellow); padding: 7px 16px; clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.who.on { background: linear-gradient(90deg, var(--blue), var(--cyan)); color: #fff; }
.tabs { max-width: 1080px; margin: 0 auto; display: flex; gap: 2px; padding: 6px 12px 10px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 7px 16px; color: var(--muted); text-decoration: none; font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 15px; text-transform: uppercase; white-space: nowrap; clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%); }
.tab:hover { color: var(--text); background: var(--navy-2); }
.tab.active { color: var(--ink); background: var(--yellow); }
.tab-gold.active { background: linear-gradient(100deg, var(--gold-a), var(--gold-b)); }
.tab-silver.active { background: linear-gradient(100deg, var(--silver-a), var(--silver-b)); }

/* ---------- Розкладка ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 26px 16px 90px; display: flex; flex-direction: column; gap: 22px; }
.loading, .empty { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 470px), 1fr)); gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.note { color: var(--muted); font-size: 14px; margin: 0; }
.note.warn { color: var(--yellow); }
.note.bad { color: var(--pink); }
.sec-title { font-size: 22px; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.sec-title::before { content: ""; width: 14px; height: 18px; background: var(--yellow); clip-path: polygon(0 0, 45% 0, 100% 50%, 45% 100%, 0 100%, 55% 50%); }
.sec-title.pink::before { background: var(--pink); }

/* Панель */
.panel { background: var(--navy); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%); }
.panel-head { margin: -18px -18px 0; padding: 10px 18px; background: var(--yellow); color: var(--ink); display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.panel-head h2, .panel-head h3 { font-size: 20px; text-transform: uppercase; }
.panel-head .meta { font-size: 13px; font-weight: 700; white-space: nowrap; }
.panel-head.gold { background: linear-gradient(100deg, var(--gold-a), var(--gold-b)); }
.panel-head.silver { background: linear-gradient(100deg, var(--silver-a), var(--silver-b)); }
.panel-head.pink { background: var(--pink); color: #fff; }

/* ---------- Герой ліги ---------- */
.hero { display: flex; flex-direction: column; gap: 14px; }
.hero-band { position: relative; overflow: hidden; padding: 18px 22px 16px; color: var(--ink);
  clip-path: polygon(0 0, 100% 0, calc(100% - 26px) 100%, 0 100%); }
.hero.gold .hero-band { background: linear-gradient(100deg, var(--gold-a) 0%, var(--yellow) 45%, var(--gold-b) 100%); }
.hero.silver .hero-band { background: linear-gradient(100deg, #fff 0%, #dfe7f0 50%, var(--silver-b) 100%); }
.hero-band::after { content: ""; position: absolute; right: 40px; top: -20px; bottom: -20px; width: 150px; background: var(--ink); opacity: .12;
  clip-path: polygon(0 0, 42% 0, 100% 50%, 42% 100%, 0 100%, 58% 50%); }
.hero-band::before { content: ""; position: absolute; right: 150px; top: 18%; bottom: 18%; width: 60px; background: var(--pink); opacity: .95;
  clip-path: polygon(0 0, 42% 0, 100% 50%, 42% 100%, 0 100%, 58% 50%); }
@media (max-width: 560px) {
  .hero-band::before { right: 30px; width: 40px; }
  .hero-band::after { right: -70px; }
}
.hero-kicker { position: relative; display: block; font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.hero h1 { position: relative; font-size: clamp(40px, 11vw, 76px); line-height: .95; font-weight: 900; text-transform: uppercase; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.tile { background: var(--navy); padding: 10px 14px; border-left: 4px solid var(--yellow); min-width: 0; }
.tile b { display: block; font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 26px; line-height: 1.1; color: var(--yellow); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tile.pink { border-left-color: var(--pink); }
.tile.pink b { color: #fff; }

/* ---------- Таблиця групи (як статистика матчу) ---------- */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table.stand { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }
.stand th { color: var(--yellow); font-weight: 700; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; text-align: center; padding: 4px 4px 8px; }
.stand td { text-align: center; padding: 9px 4px; border-top: 1px solid rgba(232, 232, 0, .28); font-weight: 600; }
.stand .l { text-align: left; }
.stand td.pos { width: 34px; padding-left: 0; }
.pos-badge { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 24px; font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 14px; background: var(--navy-2); clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
tr.p1 .pos-badge { background: var(--yellow); color: var(--ink); }
tr.p2 .pos-badge, tr.p3 .pos-badge { background: var(--navy-3); }
.stand td.nick { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.stand tr.me td.nick { color: var(--yellow); }
.stand tr.me td.nick::before { content: "▸ "; color: var(--pink); }
.stand td.pts { font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 18px; color: var(--yellow); }
.stand td.dim { color: var(--muted); font-weight: 500; }
.gd-pos { color: var(--ok) !important; }
.gd-neg { color: var(--pink) !important; }

details.more > summary { cursor: pointer; list-style: none; font-weight: 700; color: var(--yellow); font-size: 14px; text-transform: uppercase; letter-spacing: .05em; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: " ›"; }
details.more[open] > summary::after { content: " ⌄"; }
details.more > .matches { margin-top: 12px; }

/* ---------- Табло матчу ---------- */
.matches { display: flex; flex-direction: column; gap: 10px; }
.mcard { display: flex; flex-direction: column; background: var(--navy); }
.board { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto minmax(0, 1fr); align-items: center; gap: 6px; padding: 8px 10px; background: linear-gradient(180deg, #0d0d78, var(--navy)); }
.bn { font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.bn.l { text-align: right; }
.bn.win { color: var(--yellow); }
.bn.draw { color: #fff; }
.bs { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: var(--yellow); color: var(--ink); font-family: var(--font-display); font-weight: 900; font-size: 24px; font-variant-numeric: tabular-nums; }
.bx { width: 22px; height: 38px; display: flex; align-items: center; justify-content: center; background: var(--navy-2); color: var(--yellow); font-family: var(--font-display); font-weight: 900; }
.mstrip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 4px 10px; background: var(--yellow); color: var(--ink); font-size: 12px; font-weight: 700; }
.mstrip .grow { flex: 1; }
.mcard.disputed .mstrip { background: var(--pink); color: #fff; }
.mbody { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.mbody:empty { display: none; }
.reason { font-size: 14px; color: #ffb3d9; margin: 0; }
.st { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; background: var(--ink); color: var(--yellow); text-transform: uppercase; font-size: 11px; letter-spacing: .05em; }
.st::before { content: ""; width: 6px; height: 6px; background: currentColor; transform: rotate(45deg); }
.st.confirmed { color: var(--ok); }
.st.disputed { background: #fff; color: var(--pink); }

/* ---------- Кнопки ---------- */
.btn { appearance: none; cursor: pointer; border: 0; background: var(--navy-2); color: var(--text); padding: 10px 18px; font-weight: 700; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); transition: filter .15s, background .15s; }
.btn:hover { background: var(--navy-3); }
.btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px #fff; }
.btn.primary { background: var(--yellow); color: var(--ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.cta { background: linear-gradient(90deg, var(--blue), var(--cyan)); color: #fff; font-family: var(--font-display); font-style: italic; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: 12px 26px; }
.btn.cta::after { content: "›"; font-size: 22px; line-height: 0; margin-left: 4px; }
.btn.cta:hover { filter: brightness(1.1); }
.btn.danger { background: rgba(255, 20, 147, .16); color: #ff5cb1; }
.btn.danger:hover { background: rgba(255, 20, 147, .3); }
.btn.solid-pink { background: var(--pink); color: #fff; }
.btn.small { padding: 6px 13px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }

/* ---------- Форми ---------- */
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; min-width: 0; }
input[type="text"], input[type="password"], input[type="number"], select, textarea {
  background: var(--night); border: 2px solid var(--line); border-radius: 0; padding: 10px 12px; color: var(--text); font-size: 16px; width: 100%; min-width: 0; text-transform: none; letter-spacing: 0; font-weight: 500; }
input:focus, select:focus, textarea:focus { border-color: var(--yellow); outline: none; }
textarea { min-height: 92px; resize: vertical; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }

/* Вхід */
.auth { max-width: 440px; width: 100%; margin: 10px auto 0; }
.auth .big { font-size: 30px; text-transform: uppercase; }

/* ---------- Картка гравця ---------- */
.pcard { position: relative; overflow: hidden; color: var(--ink); padding: 18px 20px 20px; display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; align-items: center;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%); }
.pcard.gold { background: linear-gradient(125deg, var(--gold-a) 0%, var(--yellow) 40%, var(--gold-b) 100%); }
.pcard.silver { background: linear-gradient(125deg, #ffffff 0%, #e3eaf2 45%, var(--silver-b) 100%); }
.pcard.none { background: linear-gradient(125deg, var(--navy-3), var(--navy)); color: #fff; }
.pcard::after { content: ""; position: absolute; right: -30px; top: -10px; bottom: -10px; width: 170px; background: var(--ink); opacity: .1;
  clip-path: polygon(0 0, 42% 0, 100% 50%, 42% 100%, 0 100%, 58% 50%); }
.pc-rank { grid-row: span 2; text-align: center; font-family: var(--font-display); font-style: italic; font-weight: 900; line-height: .9; }
.pc-rank b { display: block; font-size: 64px; }
.pc-rank span { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.pc-league { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.pc-nick { font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: clamp(26px, 7vw, 40px); line-height: 1.05; overflow-wrap: anywhere; position: relative; }
.pc-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; position: relative; z-index: 1; }
.pc-stats div { background: var(--ink); color: #fff; padding: 6px 8px; text-align: center; }
.pc-stats b { display: block; font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 20px; color: var(--yellow); }
.pc-stats span { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; font-weight: 700; padding: 3px 10px; background: var(--navy-2); clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
.chip.gold { background: var(--yellow); color: var(--ink); }
.chip.pink { background: var(--pink); color: #fff; }

/* ---------- Завантаження ---------- */
.drop { position: relative; border: 2px dashed var(--yellow); padding: 26px 16px; text-align: center; color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 10px; background: rgba(5, 5, 58, .6); }
.drop:hover, .drop.over { background: rgba(232, 232, 0, .08); color: var(--text); }
.drop-icon { width: 56px; height: 44px; display: flex; gap: 2px; }
.drop-icon i { flex: 1; background: var(--yellow); clip-path: polygon(0 0, 42% 0, 100% 50%, 42% 100%, 0 100%, 58% 50%); }
.drop-icon i:last-child { background: var(--pink); }
.drop strong { color: var(--text); font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 19px; text-transform: uppercase; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.preview { width: 100%; display: block; border: 2px solid var(--line); }
.versus { display: grid; grid-template-columns: minmax(0, 1fr) 62px 14px 62px minmax(0, 1fr); gap: 8px; align-items: end; background: var(--night); padding: 12px; }
.versus .colon { font-family: var(--font-display); font-weight: 900; font-size: 24px; text-align: center; padding-bottom: 8px; color: var(--yellow); }
.versus input[type="number"] { text-align: center; font-family: var(--font-display); font-weight: 900; font-size: 26px; padding: 6px 2px; background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.versus input[type="number"]:focus { border-color: #fff; }
.auto { box-shadow: 0 0 0 3px var(--ok); }
@media (max-width: 560px) {
  .versus { grid-template-columns: 1fr 14px 1fr; }
  .versus .side-a { grid-column: 1 / -1; order: 1; }
  .versus .score-a { order: 2; }
  .versus .colon { order: 3; }
  .versus .score-b { order: 4; }
  .versus .side-b { grid-column: 1 / -1; order: 5; }
}
.progress { height: 8px; background: var(--night); overflow: hidden; }
.progress > div { height: 100%; width: 0; background: repeating-linear-gradient(115deg, var(--yellow) 0 12px, #c9c900 12px 24px); transition: width .25s; }

/* ---------- Фільтри ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Адмінка ---------- */
.aplayer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 9px 0; border-top: 1px solid rgba(232, 232, 0, .2); }
.aplayer:first-child { border-top: 0; }
.aplayer .name { font-weight: 700; overflow-wrap: anywhere; }
.aplayer .acts { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.aplayer select { width: auto; max-width: 100%; padding: 5px 8px; font-size: 13px; border-width: 1px; }
.badge { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 1px 7px; background: var(--navy-3); color: var(--muted); }
.badge.owner { background: var(--pink); color: #fff; }
.badge.admin { background: var(--yellow); color: var(--ink); }

/* ---------- Модалка й тости ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(3, 3, 30, .8); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: var(--navy); border-top: 5px solid var(--yellow); box-shadow: 0 5px 0 var(--pink) inset; padding: 20px 18px 18px; width: 100%; max-width: 470px; max-height: calc(100% - 32px); overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-box h3 { font-size: 22px; text-transform: uppercase; }
.modal-box.wide { max-width: 920px; }
.modal-box img { max-width: 100%; display: block; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(24px); background: var(--yellow); color: var(--ink); padding: 11px 24px; font-weight: 800; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); z-index: 60;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--pink); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
