:root {
  color-scheme: dark;
  --background: #0a0a0a;
  --surface: #131313;
  --line: #2c2c2c;
  --muted: #aaa6a3;
  --red: #e10000;
  --light: #f4f0ec;
  --heading: "Druk Text LCG", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  background: #080808;
  color: var(--light);
  font: 13px/1.45 var(--mono);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
button:disabled { cursor: default; }
button[hidden], [hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--heading); font-weight: 900; line-height: .98; text-transform: uppercase; }
h1 { font-size: 43px; letter-spacing: -.075em; }
h2 { font-size: 26px; letter-spacing: -.05em; }
h3 { font-size: 20px; letter-spacing: -.04em; }
small { font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.safe-insets { position: fixed; inset: 0; visibility: hidden; pointer-events: none; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#viewport { position: fixed; overflow: hidden; }
.scene { display: flex; width: 402px; flex-direction: column; background: var(--background); border: 1px solid #242424; transform-origin: top left; }
#screen { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; outline: 0; scrollbar-width: none; }
#screen::-webkit-scrollbar, .dates::-webkit-scrollbar { display: none; }
.content { padding: 19px 15px 22px; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 17px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.header h1 { max-width: 280px; overflow-wrap: anywhere; }
.brand { font-family: var(--heading); font-size: 17px; font-weight: 900; letter-spacing: -.09em; white-space: nowrap; }
.brand span { color: var(--red); }
.eyebrow { color: var(--red); font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); }
.meta { color: var(--muted); font-size: 11px; }
.panel { padding: 15px; border: 1px solid var(--line); background: var(--surface); }
.panel p + p, .panel h2 + p { margin-top: 8px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 20px 0 9px; }
.section-title span { flex: none; color: var(--red); }
.loading { min-height: 100%; display: grid; place-content: center; gap: 17px; text-align: center; }
.loading-logo { color: var(--light); font-size: 57px; }
.loading-track { height: 3px; overflow: hidden; background: var(--line); }
.loading-track::before { content: ""; display: block; width: 96%; height: 100%; transform-origin: left; background: var(--red); animation: load 1.4s ease-out both; }
@keyframes load { from { transform: scaleX(.08); } to { transform: scaleX(1); } }
.error-view { min-height: 100%; display: grid; place-content: center; gap: 15px; padding: 24px; text-align: center; }
.error-view h1 { font-size: 34px; }
.action { display: grid; place-items: center; width: 100%; min-height: max(46px, var(--minimum-touch-size, 44px)); border: 0; padding: 8px 11px; background: var(--red); color: #fff; text-transform: uppercase; font-family: var(--heading); font-size: 19px; font-weight: 900; letter-spacing: -.03em; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px)); }
.action-secondary { background: #242020; color: var(--light); }
.action:disabled { background: #262222; color: #aaa6a3; }
.action:focus-visible { outline-offset: -4px; outline-color: var(--light); }
.notice { margin: 8px 0; color: #f3b0aa; font-size: 12px; overflow-wrap: anywhere; }
.status-line { margin-top: 13px; }
.demo-flag { color: #d5b7a3; display: block; margin-top: 10px; }
.hero { position: relative; isolation: isolate; min-height: 226px; padding: 17px; display: grid; align-content: space-between; gap: 12px; overflow: hidden; background: radial-gradient(ellipse at 85% 86%, #661c18, transparent 57%), linear-gradient(144deg, #261311, #111010 62%); border: 1px solid #71312d; }
.hero::before { content: ""; position: absolute; pointer-events: none; z-index: -1; inset: 0; background: repeating-linear-gradient(135deg, transparent 0 25px, #fd665b0d 25px 26px); }
.hero h1 { font-size: 67px; line-height: .83; }
.hero h1 span { display: block; color: var(--red); }
.hero .eyebrow { color: #ff8d80; }
.hero .meta { color: #d5b4af; }
.hero-team { position: absolute; right: -12px; bottom: -36px; z-index: -1; font-family: var(--heading); font-size: 205px; font-weight: 900; color: #ff6b5022; transform: rotate(-13deg); line-height: 1; }
.hero img { width: 34px; height: 34px; object-fit: contain; justify-self: end; }
.home-draft { display: grid; gap: 12px; }
.summary-slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.summary-slot { min-width: 0; border: 1px solid #472420; background: linear-gradient(#241816, #120f0f); text-align: center; padding: 5px 2px; }
.summary-slot b { display: block; color: #ff8076; font-size: 10px; }
.summary-slot span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.preferences { margin-top: 10px; }
.home-summaries { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-top: 12px; }
.home-summaries button { text-align: left; }
.home-summaries strong { display: block; text-transform: uppercase; font: 900 17px/1 var(--heading); }
.home-summaries small { display: block; color: var(--muted); margin-top: 5px; }
.match-tag + .match-tag { margin-top: 3px; }
.preferences [role=status] { margin: 4px 0 0; }
.preference { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: max(46px, var(--minimum-touch-size, 44px)); padding: 4px 0; cursor: pointer; }
.preference + .preference { border-top: 1px solid var(--line); }
.preference input { appearance: none; flex: none; width: 40px; height: 24px; border: 1px solid #666; margin: 0; border-radius: 12px; background: #2b2b2b; cursor: pointer; }
.preference input::before { content: ""; display: block; width: 16px; height: 16px; margin: 3px; border-radius: 50%; background: #e9e3dd; transition: transform .12s ease; }
.preference input:checked { background: #9c302a; border-color: #e6554c; }
.preference input:checked::before { transform: translateX(16px); }
#nav { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); padding: 2px 4px; background: #100f0f; border-top: 1px solid #3d2422; }
#nav button { display: grid; place-items: center; align-content: center; gap: 1px; min-height: max(46px, var(--minimum-touch-size, 44px)); border: 0; padding: 3px 1px; background: transparent; color: #bcb0af; font-size: 10px; line-height: 1.2; }
#nav button[aria-current="page"] { color: #ff746b; background: #291715; }
.nav-icon { display: block; font-size: 19px; line-height: 1; }
.dates { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 0 0 6px; margin: 0 0 9px; }
.date, .chip { flex: 0 0 auto; min-height: max(44px, var(--minimum-touch-size, 44px)); border: 1px solid var(--line); background: #141313; color: var(--muted); font-size: 11px; text-align: center; }
.date { min-width: 66px; padding: 4px 6px; }
.date strong, .date span { display: block; white-space: nowrap; }
.date strong { font-size: 15px; color: var(--light); }
.date[aria-pressed="true"], .chip[aria-pressed="true"] { border-color: var(--red); color: var(--light); background: #311917; }
.draft-day { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin-bottom: 9px; align-items: center; }
.draft-day > p { grid-column: 1 / -1; }
.timer { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; color: #ff7970; }
.draft-status { font-size: 12px; color: var(--muted); }
.slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 9px 0; }
.slot { position: relative; min-width: 0; border: 1px solid #642d28; padding: 4px; background: linear-gradient(#291b17, #151010); text-align: left; min-height: 83px; display: grid; align-content: center; justify-items: center; gap: 2px; }
.slot[aria-pressed="true"] { border-color: var(--red); box-shadow: inset 0 0 15px #ee382f36; }
.slot strong, .slot span { display: block; width: 100%; min-width: 0; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot span { color: #fbb6ae; font-size: 10px; }
.slot strong { font-size: 12px; }
.slot .plus { color: #ff746b; font: 22px/.85 var(--heading); }
.slot .portrait { height: 30px; width: 30px; }
.slot-action { display: grid; grid-template-columns: 1fr; align-items: center; min-height: max(42px, var(--minimum-touch-size, 44px)); margin-bottom: 3px; }
.filters { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
.chip { padding: 5px 8px; }
.draft-tools { position: sticky; top: 0; z-index: 2; background: var(--background); padding: 6px 0; }
.draft-tools label { display: block; }
.draft-tools input { width: 100%; min-height: max(44px, var(--minimum-touch-size, 44px)); margin-bottom: 5px; background: #171717; color: var(--light); border: 1px solid #3f3a38; padding: 7px 10px; }
.feedback:empty { display: none; }
.club-list { display: grid; gap: 5px; }
.club-header { width: 100%; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 7px; border: 1px solid var(--line); min-height: max(47px, var(--minimum-touch-size, 44px)); background: #151515; text-align: left; padding: 6px 8px; }
.club-header > strong { overflow-wrap: anywhere; }
.club-header[aria-expanded="true"] { border-color: #6b332e; }
.team-logo, .portrait { width: 28px; height: 28px; object-fit: contain; vertical-align: middle; }
.portrait { border-radius: 50%; object-fit: cover; background: #332525; }
.placeholder { display: inline-grid; place-items: center; color: #f4b5ad; border: 1px solid #60403d; font-size: 9px; line-height: 1; text-align: center; }
.players { display: grid; gap: 3px; margin: 3px 0; }
.player-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: max(45px, var(--minimum-touch-size, 44px)); background: #181616; padding: 2px 0; }
.player-row button { border: 0; background: transparent; }
.player-info { display: flex; align-items: center; gap: 7px; width: 100%; text-align: left; padding: 4px 7px; }
.player-info span:last-child { min-width: 0; overflow-wrap: anywhere; }
.player-info small { display: block; color: var(--muted); }
.player-pick { min-width: max(64px, var(--minimum-touch-size, 44px)); color: #ff8179; font-weight: 700; }
.player-pick:disabled { color: var(--muted); }
.empty { margin-top: 9px; }
.matches-header { text-align: center; padding-bottom: 11px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.matches-header h1 { font-size: 47px; }
.matches-header p { color: var(--muted); margin-top: 6px; font-size: 10px; letter-spacing: .05em; }
.match-filters { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 9px; }
.matches { display: grid; gap: 7px; }
.match { width: 100%; border: 1px solid var(--line); background: linear-gradient(105deg, #181515, #101010); padding: 8px 10px; text-align: left; }
.match:focus-visible { border-color: transparent; }
.match.is-yandex { border-color: #b94036; background: linear-gradient(180deg, #6e2420, #261516 38%, #110f0f 100%); }
.match-meta { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 10px; }
.match-clubs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 7px; min-height: 84px; }
.match-club { display: flex; align-items: center; flex-direction: column; min-width: 0; gap: 3px; overflow-wrap: anywhere; text-align: center; font-size: 11px; font-weight: 700; }
.match-club .team-logo { flex: none; }
.match-logo { display: grid; place-items: center; width: 47px; height: 47px; border: 1px solid #55413f; border-radius: 50%; background: #171313; }
.match-center { text-align: center; white-space: nowrap; color: #ff8c83; }
.match-center strong { display: block; color: var(--light); font-family: var(--heading); font-size: 23px; }
.match-center small { display: block; font-size: 9px; }
.match-tag { display: block; border: 1px solid #743832; padding: 3px; text-align: center; font-size: 10px; color: #fbb6ae; }
.rankings { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; }
.rank-row { display: grid; grid-template-columns: 35px 1fr auto; gap: 8px; align-items: center; border: 1px solid var(--line); background: var(--surface); padding: 7px 10px; min-height: 45px; }
.rank-row.is-me { margin-top: 4px; border-color: #aa4a43; background: #291715; }
.rank-name { min-width: 0; overflow-wrap: anywhere; }
.rank-name small { display: block; color: #ff9a8e; }
.rank-place, .points { color: #ff9a8e; }
dialog { position: absolute; top: var(--dialog-center-y); left: var(--dialog-center-x); transform: translate(-50%, -50%); margin: 0; width: min(calc(var(--dialog-width, 402px) - 24px), 410px); max-width: none; max-height: calc(var(--dialog-height, 100dvh) - 16px); padding: 0; border: 1px solid #743833; background: #161413; color: var(--light); box-shadow: 0 8px 40px #000b; }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: #080606da; }
#detail-body { overflow: auto; padding: 13px; }
#detail-body > :first-child { margin-top: 0; }
#detail-body > p { margin-top: 10px; }
#detail form { padding: 0 13px 12px; }
#detail form .action + .action { margin-top: 6px; }
.orientation { padding: 18px; text-align: center; }
.position-options { display: grid; gap: 4px; margin-top: 8px; }
.profile { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 0 0 10px; border-bottom: 1px solid var(--line); }
.profile > div { min-width: 0; overflow-wrap: anywhere; }
.profile .portrait { width: 100%; height: 95px; border-radius: 0; }
.profile h2 { margin-top: 5px; }
.profile-data { margin: 0; }
.profile-data > div { display: flex; justify-content: space-between; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.profile-data dd { margin: 0; }
.match-lineups { margin-top: 10px; display: grid; gap: 3px; }
.lineup-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; }
.lineup-player { display: flex; align-items: center; gap: 4px; padding: 4px; overflow-wrap: anywhere; background: #231e1d; font-size: 10px; }
.lineup-player:nth-child(2) { flex-direction: row-reverse; text-align: right; }
.lineup-player .portrait { width: 22px; height: 22px; flex: none; }
.lineup-player .lineup-stats { margin-inline-start: auto; white-space: nowrap; color: #ff9a8e; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
