:root {
  --ink: #0a0c10;
  --panel: #13161d;
  --panel-2: #1b1f28;
  --line: #2b303b;
  --text: #eef0f3;
  --dim: #8f97a6;
  --team-a: #35dba6;
  --team-b: #ff5f4e;
  --signal: #ffc83d;
  --ban: #d9364a;
  --display: 'Sofia Sans Extra Condensed', 'Arial Narrow', Impact, sans-serif;
  --body: 'Sofia Sans', 'Segoe UI', Arial, sans-serif;
  --gutter: clamp(16px, 3vw, 32px);
}

* { box-sizing: border-box; }
html { background: var(--ink); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  font: 400 16px/1.45 var(--body);
  /* Официальный арт Dota 2 (Valve), затемнён под текст, по краям виньетка. */
  background:
    linear-gradient(90deg, rgb(6 7 10 / .92) 0%, rgb(6 7 10 / .78) 42%, rgb(6 7 10 / .55) 72%, rgb(6 7 10 / .66) 100%),
    radial-gradient(ellipse 80% 80% at 50% 50%, transparent 45%, rgb(4 5 8 / .9) 100%),
    url(bg.jpg) center / cover no-repeat fixed,
    var(--ink);
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

.t0 { --team: var(--team-a); }
.t1 { --team: var(--team-b); }

.boot { padding: 40vh 24px 0; text-align: center; color: var(--dim); }

/* ---- Верхняя панель ---- */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: #07080b;
}
.brand { font: 800 24px/1 var(--display); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.brand span { color: var(--dim); }
.brand b { color: var(--signal); }
.bar-left { display: flex; align-items: center; gap: clamp(14px, 2.6vw, 34px); min-width: 0; }
.bar-right { display: flex; align-items: center; gap: 12px; flex: none; }
.bar-nav { display: flex; align-items: center; gap: clamp(10px, 2vw, 22px); }
.sync { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); }
.sync.on { background: var(--team-a); }

.link { background: none; border: 0; padding: 4px 0; font-weight: 600; font-size: 15px; color: var(--text); }
.link:hover { color: var(--signal); }
.link.dim { color: var(--dim); }
.link.strong { color: var(--signal); text-decoration: underline; text-underline-offset: 3px; }

.page { padding: clamp(16px, 3vw, 32px) var(--gutter) 56px; max-width: 1440px; margin: 0 auto; }

.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.hint { color: var(--dim); font-size: 14px; margin-top: 10px; }
.sub { color: var(--dim); margin-bottom: 18px; }
.waiting { color: var(--signal); font-weight: 600; margin-top: 20px; }

/* ---- Кнопки и поля ---- */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--panel-2);
  padding: 12px 20px; border-radius: 4px;
  font: 800 20px/1 var(--display); letter-spacing: .03em; text-transform: uppercase;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn:hover:not(:disabled) { border-color: var(--dim); }
.btn:disabled { opacity: .4; }
.btn.primary { background: var(--signal); color: #15120a; border-color: var(--signal); }
.btn.primary:hover:not(:disabled) { background: #ffd666; border-color: #ffd666; }
.btn.danger { background: var(--ban); border-color: var(--ban); color: #fff; }
.btn.danger:hover:not(:disabled) { background: #ec4a5e; border-color: #ec4a5e; }
.btn.ghost { background: transparent; color: var(--dim); }
.btn.big { padding: 16px 30px; font-size: 26px; }
.btn.small { padding: 8px 12px; font-size: 16px; }

.field { display: block; }
.field span { display: block; font-size: 13px; font-weight: 600; color: var(--dim); margin-bottom: 6px; }
input {
  width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  padding: 13px 14px; outline: none;
}
input:focus { border-color: var(--signal); }
input::placeholder { color: #5b6270; }
.x { background: none; border: 0; color: var(--dim); font-size: 22px; line-height: 1; padding: 0 2px; }
.x:hover { color: var(--text); }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.controls.center { justify-content: center; }
.controls.end { justify-content: flex-end; }
.inline { display: flex; gap: 8px; }
.inline input { width: 160px; padding: 10px 12px; }

/* ---- Главная ---- */
.home {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(24px, 5vw, 72px); align-items: center;
  min-height: calc(100dvh - 180px);
}
.title {
  font: 900 clamp(60px, 9.2vw, 146px)/.9 var(--display);
  text-transform: uppercase; letter-spacing: -.005em; margin: 14px 0 18px; white-space: nowrap;
}
.title span { display: block; font-size: .42em; color: var(--dim); line-height: 1; }
.title b { color: var(--signal); }
.lead { font-size: 19px; max-width: 30em; color: #c6cbd4; }
.entry {
  display: grid; grid-template-columns: 1fr 150px auto; gap: 10px; align-items: end;
  margin-top: 30px; max-width: 560px;
}
.entry .btn { height: 49px; }
.code { text-transform: uppercase; letter-spacing: .1em; }
.entry-or { grid-column: 1 / -1; color: var(--dim); }

.demo-board { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.demo-tile { position: relative; aspect-ratio: 16/9; background: var(--panel); overflow: hidden; border-radius: 2px; }
.demo-tile img { width: 100%; height: 100%; object-fit: cover; opacity: .82; }
.demo-tile.banned img { filter: grayscale(1) brightness(.4); opacity: 1; }
.demo-tile.banned::after, .hero.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));
}
.demo-tile.pick-a img, .demo-tile.pick-b img { opacity: 1; }
.demo-tile.pick-a::after, .demo-tile.pick-b::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 2px var(--team-a); }
.demo-tile.pick-b::after { box-shadow: inset 0 0 0 2px var(--team-b); }

/* ---- Ближайшая игра ---- */
.home-side { display: grid; gap: 14px; min-width: 0; width: min(100%, 470px); justify-self: end; }
.game-card { padding: 16px 18px 12px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--signal); border-radius: 4px; }
.game-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.game-date { font: 900 clamp(36px, 3.6vw, 46px)/1 var(--display); text-transform: uppercase; margin-top: 2px; }
.game-when { color: var(--dim); font-weight: 600; }
.game-when::first-letter { text-transform: uppercase; }
.game-count { font: 900 34px/1 var(--display); color: var(--dim); white-space: nowrap; }
.game-count.full { color: var(--team-a); }
.game-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: column; grid-template-rows: repeat(5, auto); gap: 4px 8px; margin: 12px 0; }
.game-slot { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 10px; background: var(--panel-2); border: 1px solid transparent; border-radius: 3px; }
.game-slot i { flex: none; width: 16px; font-style: normal; font-size: 13px; font-weight: 700; color: var(--dim); }
.game-slot span { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-slot.mine { border-color: var(--signal); }
.game-slot.empty { background: transparent; border: 1px dashed var(--line); }
.game-slot.empty span { font-weight: 400; color: #535a68; }
.game-join { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.game-join input { padding: 11px 12px; }
.game-action { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.game-status { font: 800 22px/1.1 var(--display); text-transform: uppercase; color: var(--team-a); }
.game-full { margin-bottom: 8px; }
.game-admin { display: block; margin: 8px 0 0 auto; font-size: 13px; font-weight: 400; }
.admin-form .field { margin-bottom: 4px; }
.admin-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input[type='date'], input[type='time'] { color-scheme: dark; }

/* ---- Этапы ---- */
.rail { display: flex; gap: 4px; margin-bottom: 26px; }
.rail li {
  flex: 1; padding-top: 7px; border-top: 3px solid var(--line);
  font-size: 13px; font-weight: 600; color: #626a78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rail li.done { border-color: #596273; color: var(--dim); }
.rail li.now { border-color: var(--signal); color: var(--text); }
.rail.compact { margin-bottom: 12px; }

.stage { max-width: 1040px; margin: 0 auto; }
.stage.center { text-align: center; }
.stage-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.room-code { font: 900 clamp(64px, 11vw, 112px)/.95 var(--display); letter-spacing: .06em; color: var(--signal); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.stage.center .section-title { justify-content: center; }
h2 { font: 800 clamp(34px, 5vw, 48px)/1 var(--display); text-transform: uppercase; letter-spacing: .01em; }
h3 { font: 800 28px/1.05 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.count { font: 800 26px/1 var(--display); color: var(--dim); }
.turn-tag { font: 800 24px/1 var(--display); text-transform: uppercase; color: var(--team); }

.slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.slot {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px;
  padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; text-align: left;
}
.slot-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot em { font-style: normal; font-size: 13px; color: var(--dim); }
.slot.mine { border-color: var(--signal); }
.slot.empty { color: #6f7786; border-style: dashed; background: rgb(10 12 16 / .72); }
.slot.pickable:hover:not(:disabled) { border-color: var(--signal); }
.slot.pickable:disabled { color: inherit; opacity: 1; }
.slot.chosen { border-color: var(--team, var(--signal)); box-shadow: inset 0 0 0 1px var(--team, var(--signal)); }
.slot.chosen em { color: var(--team); }

.squads { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 14px; }
.squad, .squad-pool, .lineup, .team, .result-form { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 16px; }
.squad, .team, .lineup { border-top: 3px solid var(--team); }
.squad.active { background: color-mix(in srgb, var(--team) 9%, var(--panel)); }
.squad li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); font-weight: 600; overflow-wrap: anywhere; }
.squad li em { font-style: normal; color: var(--dim); font-size: 13px; font-weight: 400; }
.squad h3 { margin-bottom: 8px; }
.squad-pool ul { display: grid; gap: 6px; margin-top: 10px; }
.squad-pool { background: none; }

/* ---- Монетка ---- */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: clamp(14px, 4vw, 48px); margin: 26px 0; }
.vs-name { font: 800 clamp(30px, 5vw, 54px)/1 var(--display); text-transform: uppercase; color: var(--dim); overflow-wrap: anywhere; transition: color .25s; }
.vs-name.t0 { text-align: right; }
.vs-name.t1 { text-align: left; }
.vs-name.won { color: var(--team); }
.coin { position: relative; width: clamp(120px, 20vw, 190px); aspect-ratio: 1; transform-style: preserve-3d; transition: transform .3s; }
.coin .face {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%;
  font: 900 clamp(64px, 11vw, 104px)/1 var(--display); color: #0d1014; backface-visibility: hidden;
  box-shadow: inset 0 0 0 7px rgb(0 0 0 / .22);
}
.coin .a { background: var(--team-a); }
.coin .b { background: var(--team-b); transform: rotateY(180deg); }
.coin.side-1 { transform: rotateY(180deg); }
.coin.spin { animation: flip 1.9s cubic-bezier(.22, .7, .3, 1) both; }
@keyframes flip { to { transform: rotateY(2520deg); } }
.verdict { font-size: 21px; margin: 6px 0 12px; }
.verdict strong { color: var(--team, var(--text)); }

/* ---- Драфт ---- */
.turnbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 10px 18px; border-radius: 4px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--team) 24%, var(--panel)), var(--panel) 80%);
  border-left: 5px solid var(--team);
}
.turnbar h2 { font-size: clamp(30px, 4.4vw, 50px); overflow-wrap: anywhere; }
.verb { color: var(--team); }
.turnbar.is-ban .verb { color: #ff8a97; }
.timer { text-align: right; flex: none; }
.timer small { display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.timer strong { display: block; font: 900 clamp(46px, 6vw, 68px)/.95 var(--display); font-variant-numeric: tabular-nums; }
.timer.urgent strong { color: var(--team-b); }
.timer.reserve-mode:not(.urgent) strong { color: var(--signal); }

.turn-next { margin-top: 3px; font-size: 14px; font-weight: 600; color: var(--dim); }

.tl {
  display: grid; position: relative; gap: 3px 3px; margin: 8px 0 12px;
  grid-template-columns: 112px repeat(var(--steps), minmax(0, 1fr));
  grid-template-rows: 18px 34px 34px;
}
.tl-phase {
  grid-row: 1; align-self: end; padding-bottom: 2px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #5d6573;
  border-bottom: 2px solid #2b303b;
}
.tl-phase.current { color: var(--signal); border-color: var(--signal); }
.tl-lane { grid-column: 1 / -1; background: color-mix(in srgb, var(--team) 9%, transparent); border-radius: 3px; }
.tl-team {
  grid-column: 1; z-index: 1; display: flex; align-items: center; min-width: 0; padding: 0 8px;
  border-left: 3px solid var(--team); border-radius: 3px 0 0 3px;
  font: 800 18px/1 var(--display); text-transform: uppercase; color: var(--team);
}
.tl-nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-num { display: none; }
.tl-step {
  position: relative; z-index: 1; display: grid; place-items: center; overflow: hidden; border-radius: 3px;
  margin: 2px 0; font-size: 12px; font-weight: 700;
}
.tl-step i { font-style: normal; }
.tl-sign { display: none; }
.tl-step.is-ban { border: 1px dashed #a7606a; color: #e08a95; background: rgb(217 54 74 / .08); }
.tl-step.is-pick { background: color-mix(in srgb, var(--team) 26%, var(--panel)); color: var(--text); }
.tl-step img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tl-step.is-ban.done { border-style: solid; border-color: #4b3137; }
.tl-step.is-ban.done img { filter: grayscale(1) brightness(.55); }
.tl-step.is-ban.done::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top right, transparent calc(50% - 1px), var(--ban) calc(50% - 1px), var(--ban) calc(50% + 1px), transparent calc(50% + 1px));
}
.tl-step.is-pick.done { box-shadow: inset 0 0 0 2px var(--team); }
.tl-skip { color: #6b7280; }
.tl-step.now { background: var(--signal); border: 0; color: #15120a; animation: tl-pulse 1.1s ease-in-out infinite alternate; }
@keyframes tl-pulse { to { box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 40%, transparent); } }

.arena { display: grid; grid-template-columns: 210px minmax(0, 1fr) 210px; gap: 12px; align-items: start; }
.team { padding: 12px; }
.team.active { background: color-mix(in srgb, var(--team) 10%, var(--panel)); }
.team-head h3 { font-size: 27px; }
.reserve { font-size: 13px; color: var(--dim); }
.reserve b { font-variant-numeric: tabular-nums; color: var(--text); }
.picks { display: grid; gap: 4px; margin: 10px 0; }
.pick-slot, .ban-slot { position: relative; background: var(--ink); overflow: hidden; border-radius: 2px; }
.pick-slot { aspect-ratio: 16/6.2; }
.pick-slot img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.pick-slot span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 6px 2px; font-size: 12px; font-weight: 700;
  background: linear-gradient(transparent, rgb(0 0 0 / .85));
}
.pick-slot.now, .ban-slot.now { box-shadow: inset 0 0 0 2px var(--signal); animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { to { background: color-mix(in srgb, var(--signal) 28%, var(--ink)); } }
.bans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.ban-slot { aspect-ratio: 16/9; }
.ban-slot img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) brightness(.6); }
.ban-slot.skipped { background: repeating-linear-gradient(135deg, #1b1f28 0 3px, #101319 3px 6px); }
.roster { margin-top: 10px; font-size: 13px; color: var(--dim); }
.roster li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.board-wrap { min-width: 0; }
.board { display: grid; gap: 7px; }
.attr h4 { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 3px; }
.attr-str h4 { color: #ff8a7a; } .attr-agi h4 { color: #72e3a0; } .attr-int h4 { color: #7cc0ff; } .attr-all h4 { color: #d7b8ff; }
.row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.hero {
  position: relative; padding: 0; background: var(--panel); border: 0; border-radius: 2px; overflow: hidden;
  transition: transform .1s; text-align: left;
}
.hero img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.hero span {
  display: block; padding: 2px 4px; font-size: 12px; font-weight: 600; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--text); }
.hero.selected, .hero.selected:hover:not(:disabled) { box-shadow: 0 0 0 3px var(--signal); z-index: 1; }
.hero.banned img { filter: grayscale(1) brightness(.33); }
.hero.banned span { color: #5d6573; }
.hero.banned::after { bottom: 20px; }
.hero.picked { box-shadow: inset 0 -3px 0 var(--team); }
.hero.picked img { filter: brightness(.45); }
.hero.picked span { color: var(--team); }

.dock {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  min-height: 76px; margin-top: 10px; padding: 10px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
}
.dock p { color: var(--dim); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.dock b { display: block; font: 800 34px/1 var(--display); text-transform: uppercase; color: var(--text); }
.dock small { display: block; font-size: 13px; font-weight: 400; }
.dock .btn { flex: none; }

/* ---- Анимация пика и бана ---- */
.reveal { position: fixed; inset: 0; z-index: 15; display: grid; place-items: center; pointer-events: none; }
.reveal-card {
  --accent: var(--team);
  width: min(400px, calc(100vw - 48px)); padding: 12px 12px 14px; text-align: center;
  background: rgb(10 12 16 / .94); border: 2px solid var(--accent); border-radius: 6px;
  box-shadow: 0 0 0 1px rgb(0 0 0 / .6), 0 24px 70px rgb(0 0 0 / .75), 0 0 60px color-mix(in srgb, var(--accent) 45%, transparent);
  animation: reveal-card 1.3s cubic-bezier(.2, .9, .3, 1) both;
}
.is-ban .reveal-card { --accent: var(--ban); }
.reveal-art { position: relative; overflow: hidden; border-radius: 3px; }
.reveal-art img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.is-ban .reveal-art img { animation: reveal-fade 1.3s both; }
.reveal-slash {
  position: absolute; inset: 0; display: none;
  background: linear-gradient(to top right, transparent calc(50% - 4px), var(--ban) calc(50% - 4px), var(--ban) calc(50% + 4px), transparent calc(50% + 4px));
}
.is-ban .reveal-slash { display: block; animation: reveal-slash 1.3s ease-out both; }
.is-pick .reveal-art::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / .55) 50%, transparent 65%);
  animation: reveal-sweep 1.3s ease-out both;
}
.reveal-word { margin-top: 8px; font: 900 62px/.95 var(--display); text-transform: uppercase; letter-spacing: .03em; color: var(--accent); }
.is-ban .reveal-word { color: #ff8a97; }
.reveal-hero { font: 800 28px/1.05 var(--display); text-transform: uppercase; }
.reveal-who { margin-top: 2px; font-size: 14px; font-weight: 600; color: var(--dim); }
@keyframes reveal-card {
  0% { opacity: 0; transform: scale(1.4); }
  13% { opacity: 1; transform: scale(1); }
  82% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(.95); }
}
@keyframes reveal-fade { 0%, 22% { filter: none; } 42%, 100% { filter: grayscale(1) brightness(.5); } }
@keyframes reveal-slash { 0%, 20% { clip-path: inset(0 100% 0 0); } 38%, 100% { clip-path: inset(0); } }
@keyframes reveal-sweep { 0%, 12% { transform: translateX(-100%); } 50%, 100% { transform: translateX(100%); } }

/* ---- Прогноз ---- */
.predict { margin-bottom: 14px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.predict h3 { font-size: 24px; margin-bottom: 8px; }
.predict-sides { display: flex; justify-content: space-between; gap: 16px; }
.predict-side { display: flex; align-items: baseline; gap: 10px; min-width: 0; color: var(--team); }
.predict-side strong { font: 900 clamp(44px, 7vw, 62px)/.95 var(--display); font-variant-numeric: tabular-nums; }
.predict-name { font: 800 clamp(20px, 3vw, 28px)/1 var(--display); text-transform: uppercase; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.predict-bar { display: flex; gap: 3px; height: 10px; margin-top: 8px; }
.predict-bar span { display: block; background: var(--team); border-radius: 2px; transition: width .5s ease-out; }
.predict-best { display: flex; justify-content: space-between; gap: 16px; margin-top: 8px; font-size: 13px; color: var(--dim); }
.predict-best span:last-child { text-align: right; }
.predict .hint { margin-top: 6px; font-size: 13px; }

/* ---- Итог ---- */
.lineups { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lineup.winner { background: color-mix(in srgb, var(--team) 12%, var(--panel)); }
.final-picks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin: 12px 0 8px; }
.final-picks img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.final-picks figcaption { font-size: 12px; font-weight: 600; margin-top: 3px; line-height: 1.2; }
.final-bans { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
.final-bans img { width: 100%; aspect-ratio: 16/9; object-fit: cover; filter: grayscale(1) brightness(.55); }
.result-form { margin-top: 14px; }
.result-form h3 { font-size: 24px; margin: 4px 0 10px; }
.result-form h3:not(:first-child) { margin-top: 18px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice.mvp { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* ---- Окна ---- */
.overlay {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px;
  background: rgb(4 5 8 / .78);
}
.dialog {
  width: min(640px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 20px 22px;
}
.dialog.small { width: min(420px, 100%); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.confirm-title { font-size: 34px; margin-bottom: 10px; }
.confirm-nick { font: 900 44px/1.05 var(--display); color: var(--signal); overflow-wrap: anywhere; margin-bottom: 10px; }
.confirm-text { font-size: 18px; }
.rules { display: grid; grid-template-columns: 90px 1fr; gap: 10px 14px; }
.rules dt { font-weight: 700; color: var(--signal); }
.place-1 { --medal: var(--signal); }
.place-2 { --medal: #c9d1dc; }
.place-3 { --medal: #d99a62; }
.prizes { margin: 18px 0 16px; }
.prizes h3 { font-size: 24px; margin-bottom: 8px; }
.dialog-head + .prizes { margin-top: 0; }
.prizes ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.prize {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 10px 12px; text-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--medal) 14%, var(--panel-2)), var(--panel-2) 62%);
  border-top: 3px solid var(--medal); border-radius: 3px;
}
.prize-icon { width: 76px; height: 76px; object-fit: cover; border-radius: 12px; background: #0f1219; box-shadow: 0 0 0 1px color-mix(in srgb, var(--medal) 55%, transparent), 0 6px 20px rgb(0 0 0 / .45); }
.prize-text { min-width: 0; }
.prize strong { display: block; font: 900 26px/1 var(--display); color: var(--medal); text-transform: uppercase; }
.prize-title { display: block; margin-top: 5px; font-size: 15px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.prize-note { display: block; margin-top: 2px; font-size: 13px; color: var(--dim); }
.row-name { display: inline-flex; align-items: center; gap: 8px; }
.prize-mini { width: 22px; height: 22px; flex: none; object-fit: cover; border-radius: 5px; }
.scores tr.vacant .prize-mini { opacity: .75; }
.score-input { width: 66px; padding: 6px 8px; }
.score-actions { white-space: nowrap; }
.score-actions .x { margin-left: 6px; }
.score-add { display: flex; gap: 6px; margin-top: 12px; }
.score-add input[name='nick'] { flex: 1; min-width: 0; padding: 6px 8px; }
.admin-add { margin-top: 16px; }
.admin-add input { flex: 1; width: auto; }
.table-wrap { overflow-x: auto; }
.scores td:first-child { font-weight: 700; color: var(--dim); }
.scores tr[class^='place-'] td:first-child { color: var(--medal); font: 900 22px/1 var(--display); }
.scores tr.vacant td { color: #5d6573; }
.scores tr.vacant .n { font-weight: 400; }
.scores { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.scores th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); padding: 6px 10px 6px 0; }
.scores td { padding: 9px 10px 9px 0; border-top: 1px solid var(--line); }
.scores .n { font-weight: 600; overflow-wrap: anywhere; }
.scores .pts { font: 800 24px/1 var(--display); color: var(--signal); }
.toast {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 30;
  display: flex; gap: 16px; align-items: center; width: min(560px, calc(100% - 32px));
  padding: 12px 16px; background: #2a1518; border: 1px solid var(--ban); border-radius: 4px;
}
.toast span { flex: 1; }

/* ---- Планшет ---- */
@media (max-width: 1080px) {
  .arena { grid-template-columns: 1fr 1fr; }
  .board-wrap { grid-column: 1 / -1; grid-row: 1; }
  .picks, .bans { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .pick-slot { aspect-ratio: 16/10; }
  .pick-slot span { display: none; }
  .roster { display: none; }
  .home { grid-template-columns: 1fr; min-height: 0; }
  .title { font-size: min(18vw, 146px); }
  .home-side { width: 100%; justify-self: stretch; }
}

/* ---- Телефон ---- */
@media (max-width: 680px) {
  .brand { font-size: 21px; }
  .prizes ol { grid-template-columns: 1fr; gap: 6px; }
  .prize { flex-direction: row; gap: 12px; padding: 8px 10px; text-align: left; border-top: 0; border-left: 3px solid var(--medal); background: linear-gradient(90deg, color-mix(in srgb, var(--medal) 14%, var(--panel-2)), var(--panel-2) 62%); }
  .prize-icon { width: 54px; height: 54px; border-radius: 9px; }
  .prize strong { font-size: 20px; }
  .prize-title { margin-top: 2px; }
  .prize-mini { display: none; }
  .scores th, .scores td { padding-right: 7px; }
  .scores th { letter-spacing: 0; font-size: 11px; }
  .scores .n { overflow-wrap: break-word; }
  .entry { grid-template-columns: 1fr 1fr; }
  .entry .btn { grid-column: 1 / -1; }
  .slots { grid-template-columns: 1fr; }
  .squads, .lineups { grid-template-columns: 1fr; }
  .squad-pool { order: -1; }
  .choice.mvp { grid-template-columns: 1fr 1fr; }
  .rail li { font-size: 0; }
  .rail { margin-bottom: 14px; }
  .inline { flex: 1 1 100%; }
  .inline input { flex: 1; width: auto; }

  .in-room:has(.draft) { padding-bottom: 96px; }
  .turnbar { position: sticky; top: 0; z-index: 5; padding: 6px 12px; background: color-mix(in srgb, var(--team) 26%, var(--panel)); }
  .tl { grid-template-columns: 18px repeat(var(--steps), minmax(0, 1fr)); grid-template-rows: 15px 24px 24px; gap: 2px; margin: 6px 0 8px; }
  .tl-phase { font-size: 10px; letter-spacing: .03em; }
  .tl-team { justify-content: center; padding: 0; border-left-width: 2px; font-size: 14px; }
  .tl-nick, .tl-word { display: none; }
  .tl-num, .tl-sign { display: block; }
  .tl-step { margin: 1px 0; font-size: 13px; line-height: 1; }
  .turn-next { font-size: 12px; margin-top: 1px; }
  .team { padding: 8px; }
  .team-head h3 { font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .team-head .eyebrow { display: none; }
  .picks { margin: 6px 0; gap: 2px; }
  .bans { gap: 2px; }

  /* Четыре колонки атрибутов по семь героев: тайлы остаются читаемыми. */
  .board { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .attr h4 { font-size: 10px; letter-spacing: .02em; }
  .row { grid-template-columns: 1fr; }
  .hero span { font-size: 11px; }

  .dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; margin: 0; border-radius: 0;
    border-width: 1px 0 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    min-height: 0;
  }
  .dock b { font-size: 26px; }
  .dock .btn.big { padding: 13px 20px; font-size: 22px; }
}

/* ---- Самые узкие телефоны: шапка в одну строку ---- */
@media (max-width: 420px) {
  .bar { gap: 10px; }
  .sync { display: none; }
}

/* ---- Невысокие экраны ноутбуков: доска целиком без прокрутки ---- */
@media (min-width: 1081px) {
  .rail.compact { display: none; }
}
@media (min-width: 1081px) and (max-height: 820px) {
  .in-room:has(.draft) { padding-top: 10px; }
  .turnbar { padding: 3px 18px; }
  .turnbar h2 { font-size: 34px; }
  .timer strong { font-size: 44px; }
  .tl { margin: 5px 0 8px; grid-template-rows: 16px 28px 28px; }
  .turn-next { display: none; }
  .board { gap: 4px; }
  .dock { min-height: 58px; margin-top: 6px; padding: 5px 12px; }
  .dock b { font-size: 26px; }
  .dock .btn.big { padding: 9px 24px; font-size: 22px; }
}

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