:root {
  --bg: #070c18;
  --panel: rgba(13, 21, 39, .9);
  --panel-2: rgba(20, 31, 55, .92);
  --line: #2a3a5c;
  --line-soft: rgba(216, 180, 106, .22);
  --gold: #d8b46a;
  --gold-hi: #f4dea0;
  --gold-lo: #9c7a3c;
  --text: #e8e2d2;
  --muted: #9aa5ba;
  --blue: #5ab4e0;
  --red: #d06a5c;
  --green: #79c28a;
  --radius: 10px;
  --display: "Cormorant SC", "Cormorant Garamond", Georgia, serif;
  --body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex; flex-direction: column;
  color: var(--text);
  font: 17px/1.5 var(--body);
  /* у обоих шрифтов цифры по умолчанию старостильные и «скачут» по высоте — включаем ровные одинаковой ширины */
  font-variant-numeric: lining-nums tabular-nums;
  background: var(--bg) url(/static/game/background_menu.webp) center top / cover fixed;
}
a { color: var(--gold-hi); text-decoration: none; }
a:hover { color: #fff; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: .02em; margin: 0 0 .4em; line-height: 1.1; }
.wrap { width: min(1200px, 100% - 32px); margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }

/* ---------- шапка ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, rgba(6, 10, 20, .97), rgba(8, 13, 26, .9));
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(6px);
}
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 26px; white-space: nowrap; }
.brand b { background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand img { height: 34px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: var(--muted); padding: 8px 12px; border-radius: 6px; font-weight: 500; }
.nav a:hover, .nav a.on { color: var(--gold-hi); background: rgba(216, 180, 106, .08); }
.who { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.langs { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.langs a { padding: 7px 10px; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.langs a.on { background: rgba(216, 180, 106, .16); color: var(--gold-hi); }
.langs a:hover { color: #fff; }
.ico { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); }
.ico svg { width: 20px; height: 20px; }
.ico.twitch:hover { color: #fff; background: #9146ff; border-color: #9146ff; }
.ico.tg:hover { color: #fff; background: #229ed9; border-color: #229ed9; }

.socials { display: flex; flex-wrap: wrap; gap: 10px; }
.socials.center-row { justify-content: center; }
.soc { display: inline-flex; align-items: center; gap: 9px; height: 44px; padding: 0 18px; border-radius: 8px; color: #fff; font-weight: 700; }
.soc svg { width: 20px; height: 20px; }
.soc.twitch { background: #9146ff; }
.soc.tg { background: #229ed9; }
.soc:hover { color: #fff; filter: brightness(1.15); }
.trailer { max-width: 1000px; margin: 0 auto; }
.trailer video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); border: 1px solid var(--line-soft); box-shadow: 0 18px 50px rgba(0, 0, 0, .5); }
/* блок трансляции; не «.live» — так помечены идущие матчи */
.live-embed { display: grid; grid-template-columns: 1fr 340px; gap: 12px; }
.live-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.live-embed .player { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-soft); background: #000; }
.live-embed .chat { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-soft); }
.org { display: flex; gap: 28px; align-items: center; }
.org .qr { width: 210px; flex: none; }
.org h3 { font-size: 30px; color: var(--gold-hi); }
.burger { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 6px 10px; font-size: 18px; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 44px;
  font: 700 19px var(--display); letter-spacing: .04em; color: var(--gold-hi);
  background: url(/static/game/Button_MainMenu_Back.png) center / 100% 100% no-repeat;
  border: 0; cursor: pointer; text-shadow: 0 1px 2px #000;
}
.btn:hover { background-image: url(/static/game/Button_MainMenu_Back_Selected.png); color: #fff; }
.btn.ghost { background: none; border: 1px solid var(--line-soft); border-radius: 8px; min-height: 46px; padding: 0 22px; }
.btn.ghost:hover { border-color: var(--gold); }
.btn.sm { min-height: 36px; padding: 0 14px; font: 600 15px var(--body); letter-spacing: 0; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); }
.btn.sm:hover { border-color: var(--gold); color: var(--gold-hi); }
.btn.sm.gold { border-color: var(--gold-lo); color: var(--gold-hi); }
.btn.sm.red { color: var(--red); }
.btn.sm.green { color: var(--green); }

/* ---------- герой ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 96px 0 72px; text-align: center;
  background: #0a0f1d;
  -webkit-mask-image: linear-gradient(#000 78%, transparent);
  mask-image: linear-gradient(#000 78%, transparent);
}
.hero::before { content: ""; position: absolute; inset: 0; z-index: 1; background: radial-gradient(ellipse at center, rgba(5, 9, 18, .35), rgba(5, 9, 18, .85) 75%); }
.hero > .wrap { position: relative; z-index: 3; }
.hero .game-logo { width: 220px; opacity: .95; margin-bottom: 8px; }
.hero h1 {
  font-size: clamp(54px, 9vw, 112px); margin: 0;
  background: linear-gradient(180deg, #fff6d8, var(--gold-hi) 35%, var(--gold) 65%, var(--gold-lo));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .8));
}
.hero .sub { font-size: 20px; color: #d6d0c0; max-width: 640px; margin: 8px auto 26px; text-shadow: 0 2px 8px #000; }
.prize { margin: 0 auto 22px; display: inline-flex; flex-direction: column; align-items: center; padding: 10px 34px 12px; border-radius: 12px; border: 1px solid var(--gold-lo); background: radial-gradient(ellipse at center, rgba(216, 180, 106, .18), rgba(8, 13, 26, .8) 70%); }
.prize span { font-size: 13px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.prize b { font: 700 clamp(34px, 5vw, 48px) var(--display); color: var(--gold-hi); line-height: 1.05; text-shadow: 0 0 22px rgba(216, 180, 106, .45); }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.fact { text-align: center; padding: 18px 12px; }
.fact span { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.fact b { display: block; font: 700 34px var(--display); color: var(--text); margin-top: 4px; }
.fact small { color: var(--muted); }
.fact.gold { border-color: var(--gold-lo); }
.fact.gold b { color: var(--gold-hi); }
.chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.chip { padding: 8px 16px; border: 1px solid var(--line-soft); border-radius: 999px; background: rgba(8, 13, 26, .75); font-weight: 500; }
.chip b { color: var(--gold-hi); }
.actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }

/* ---------- разделы ---------- */
section { padding: 48px 0; }
.title { text-align: center; margin-bottom: 28px; }
.title h2 { font-size: clamp(30px, 4vw, 42px); color: var(--gold-hi); }
.title::after {
  content: "◆"; display: block; width: min(360px, 80%); height: 16px; margin: 6px auto 0;
  font-size: 11px; line-height: 16px; color: var(--gold);
  background: linear-gradient(90deg, transparent, var(--gold-lo) 35%, transparent 47%, transparent 53%, var(--gold-lo) 65%, transparent) center / 100% 1px no-repeat;
}
.title p { margin: 0; color: var(--muted); }

.panel {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 22px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .03);
}
.grid { display: grid; gap: 16px; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }

.stage { text-align: center; }
.stage .num { font: 700 46px var(--display); color: var(--gold-hi); line-height: 1; }
.stage h3 { font-size: 26px; margin-top: 8px; }

.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pl {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: linear-gradient(90deg, rgba(216, 180, 106, .08), transparent 70%), var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px;
}
.pl img { width: 36px; height: 36px; object-fit: contain; }
.pl .n { font-weight: 700; font-size: 18px; }
.pl .f { color: var(--muted); font-size: 13px; }
.pl.empty { opacity: .45; border-style: dashed; }

.emb { width: 22px; height: 22px; object-fit: contain; flex: none; }
.emb.blank { display: inline-block; border-radius: 50%; background: rgba(255, 255, 255, .06); }

/* ---------- матчи ---------- */
.match {
  width: 236px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35); position: relative;
}
.match .when { font-size: 12px; color: var(--muted); padding: 3px 10px; background: rgba(0, 0, 0, .25); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }
.match .when a { color: var(--blue); }
.row { display: flex; align-items: center; gap: 8px; padding: 0 0 0 10px; height: 36px; }
.row + .row { border-top: 1px solid rgba(255, 255, 255, .05); }
.row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.row .sc { width: 34px; height: 100%; display: grid; place-items: center; font-weight: 700; background: rgba(0, 0, 0, .25); color: var(--muted); }
.row.win .nm { color: var(--gold-hi); }
.row.win .sc { color: #1a1306; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); }
.row.lose .nm { color: var(--muted); text-decoration: line-through rgba(255, 255, 255, .25); }
.row.tbd .nm { color: #5d6880; font-style: italic; }
.match.live { border-color: var(--gold-lo); box-shadow: 0 0 0 1px rgba(216, 180, 106, .25), 0 6px 16px rgba(0, 0, 0, .35); }
.match.bye { opacity: .55; }
.match.bye .sc { visibility: hidden; }
.match.bye .row.win .nm { color: var(--text); }
.match.mine { outline: 2px solid var(--blue); }

/* ---------- сетка ---------- */
.bracket-scroll { overflow-x: auto; padding: 4px 0 16px; }
.bracket { display: flex; min-width: max-content; }
.round { display: flex; flex-direction: column; }
.round-title { text-align: center; font: 700 18px var(--display); color: var(--gold); padding: 0 18px 10px; letter-spacing: .05em; }
.round-body { display: flex; flex-direction: column; flex: 1; }
.cell { flex: 1; display: flex; align-items: center; position: relative; padding: 8px 22px; }
.round:not(:last-child) .cell::after { content: ""; position: absolute; right: 0; width: 22px; border: 0 solid var(--line); }
.round:not(:last-child) .cell:nth-child(odd)::after { top: 50%; height: 50%; border-top-width: 2px; border-right-width: 2px; }
.round:not(:last-child) .cell:nth-child(even)::after { top: 0; height: 50%; border-bottom-width: 2px; border-right-width: 2px; }
.round:not(:first-child) .cell::before { content: ""; position: absolute; left: 0; top: 50%; width: 22px; border-top: 2px solid var(--line); }
.round:last-child .cell { padding-right: 0; }
.round.to-straight .cell:nth-child(n)::after { top: 50%; height: 0; border-right-width: 0; border-bottom-width: 0; border-top-width: 2px; }
.ticket {
  display: flex; align-items: center; gap: 10px; min-width: 190px; height: 46px; padding: 0 16px;
  border: 1px dashed var(--line); border-radius: 8px; color: #5d6880; font-style: italic;
}
.ticket.won {
  font-style: normal; font-weight: 700; color: #1a1306; border: 0;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold)); box-shadow: 0 0 18px rgba(216, 180, 106, .35);
}
.ticket .emb { width: 26px; height: 26px; }
.winners { margin-bottom: 20px; }
.winners-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 860px) { .winners-row { grid-template-columns: repeat(2, 1fr); } .ticket { min-width: 0; } }

.champion { text-align: center; padding: 26px; margin-bottom: 26px; background: url(/static/game/Window_AwardMessage.webp) center / cover; border-radius: var(--radius); border: 1px solid var(--gold-lo); }
.champion .n { font: 700 46px var(--display); color: var(--gold-hi); }

.paths { display: grid; gap: 20px; }
.path h3 { color: var(--gold-hi); font-size: 24px; }
.path .bracket-scroll { padding-bottom: 6px; }

/* ---------- расписание ---------- */
.day h3 { color: var(--gold); font-size: 26px; margin: 28px 0 12px; }
.slot { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.slot:last-child { border-bottom: 0; }
.slot .t { font: 700 22px var(--display); color: var(--gold-hi); width: 70px; }
.slot .vs { flex: 1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 600; min-width: 220px; }
.slot .vs .x { color: var(--muted); font-weight: 400; }
.slot .vs .score { font: 700 20px var(--display); color: var(--gold-hi); }
.tag { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 4px; background: rgba(90, 180, 224, .12); color: var(--blue); white-space: nowrap; }
.tag.gold { background: rgba(216, 180, 106, .14); color: var(--gold-hi); }
.tag.red { background: rgba(208, 106, 92, .14); color: var(--red); }
.tag.green { background: rgba(121, 194, 138, .14); color: var(--green); }

/* ---------- формы ---------- */
.form { max-width: 560px; margin: 0 auto; }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
label.inline { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
input[type=text], input[type=password], input[type=datetime-local], input[type=url], select, textarea {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--text);
  background: rgba(4, 8, 16, .7); border: 1px solid var(--line); border-radius: 8px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--gold); margin-top: 3px; flex: none; }
textarea { min-height: 90px; resize: vertical; }
.factions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.factions label { margin: 0; font-weight: 500; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--panel-2); }
.factions input { display: none; }
.factions img { width: 46px; height: 46px; object-fit: contain; }
.factions label:has(input:checked) { border-color: var(--gold); background: rgba(216, 180, 106, .1); color: var(--gold-hi); }

.flash { margin: 18px auto 0; padding: 12px 16px; border-radius: 8px; border: 1px solid var(--gold-lo); background: rgba(216, 180, 106, .1); color: var(--gold-hi); }

.tg-login { text-align: center; }
.tg-login .spinner { width: 30px; height: 30px; margin: 18px auto 6px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* подпись автора в подвале — тихая, не спорит с остальным текстом */
footer .credit { display: inline-block; margin-top: 10px; font-size: 12px; letter-spacing: .08em; color: rgba(154, 165, 186, .55); transition: color .2s; }
footer .credit:hover { color: var(--gold-hi); }
.login-fallback { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.login-fallback .cmd { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.login-fallback code { padding: 8px 12px; border-radius: 6px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); color: var(--gold-hi); font-size: 14px; word-break: break-all; user-select: all; }

footer { padding: 36px 0 48px; color: var(--muted); font-size: 14px; text-align: center; border-top: 1px solid var(--line-soft); margin-top: auto; background: rgba(5, 8, 16, .7); }

/* ---------- админка ---------- */
.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--gold); font-weight: 600; font-size: 14px; }
.tbl-scroll { overflow-x: auto; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
.inline-form input[type=text], .inline-form select, .inline-form input[type=datetime-local], .inline-form input[type=url] { width: auto; padding: 6px 9px; font-size: 15px; }
.copy { font-size: 13px; word-break: break-all; color: var(--blue); }
.admin-match { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.admin-match .match { flex: none; }
.admin-match .ctl { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 260px; }
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi .panel { padding: 16px; text-align: center; }
.kpi b { display: block; font: 700 36px var(--display); color: var(--gold-hi); }

@media (max-width: 860px) {
  body { font-size: 16px; background-attachment: scroll; }
  .burger { display: block; margin-left: auto; }
  .top .wrap { flex-wrap: wrap; gap: 10px; }
  .nav, .who { display: none; width: 100%; }
  .top.open .nav, .top.open .who { display: flex; flex-direction: column; padding-bottom: 12px; }
  .top.open .who { flex-direction: row; }
  .g3, .g2 { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 48px; }
  .hero .game-logo { width: 160px; }
  .factions { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .live-embed { grid-template-columns: 1fr; }
  .live-embed .chat { display: none; }
  .org { flex-direction: column; text-align: center; }
  .org .socials { justify-content: center; }
  .ico { display: none; }
  .btn { padding: 0 34px; }
}

