/* Layout: panel = topbar + bosqich tablari + kartalar; sahna = 1600×900 qat'iy kanvas, ekranga moslab kattalashtiriladi.
   Turnir zali kayfiyati: siyoh-ko'k fon, guruch (brass) urg'u, fil suyagi matn. Ataylab bitta qorong'i mavzu. */
:root {
  --bg: #10131b;
  --bg-2: #141925;
  --surface: #191f2d;
  --surface-2: #212839;
  --line: #2b3448;
  --line-2: #3b465f;
  --ivory: #f1ead9;
  --muted: #a0a7b9;
  --dim: #6d7590;
  --brass: #d4a84b;
  --brass-2: #f0cf7e;
  --brass-deep: #7a5c1e;
  --silver: #b9c2d3;
  --bronze: #c98b5c;
  --win: #5dc28c;
  --loss: #e0705f;
  --draw: #8fa6d0;
  --warn: #e8b14a;
  --f-display: 'Big Shoulders Display', 'Arial Narrow', 'Helvetica Neue', Impact, sans-serif;
  --f-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --r: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ivory);
  font: 15px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body.stage-open { overflow: hidden; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brass-2); }
code { font-family: var(--f-mono); font-size: .86em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.dim { color: var(--dim); }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; text-align: center; }
:focus-visible { outline: 2px solid var(--brass-2); outline-offset: 2px; }

/* ---------- tugmalar ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--ivory); font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover:not(:disabled) { border-color: var(--brass); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, var(--brass-2), var(--brass)); color: #1b1407; border-color: var(--brass); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-lg { padding: 12px 22px; font-size: 16px; }
.btn kbd { font: 600 11px var(--f-mono); padding: 2px 6px; border-radius: 4px; background: rgba(0,0,0,.18); }
.link { background: none; border: 0; color: var(--brass-2); cursor: pointer; padding: 0; font-size: 13px; }
.link.small { font-size: 12.5px; margin-top: 8px; }
.icon { width: 28px; height: 28px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.icon:hover:not(:disabled) { border-color: var(--line-2); color: var(--ivory); }
.icon:disabled { opacity: .25; cursor: default; }
.icon.del:hover { color: var(--loss); }
.chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; font-size: 13px; font-weight: 600; }
.chip.on { background: var(--brass); color: #1b1407; border-color: var(--brass); }
span.chip { cursor: default; }

/* ---------- panel ---------- */
.shell { max-width: 1320px; margin: 0 auto; padding-inline: 20px; padding-block: 18px 80px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.king {
  font-size: 44px; line-height: 1; color: var(--brass);
  background: linear-gradient(180deg, var(--brass-2), var(--brass) 55%, var(--brass-deep));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.b-name { font: 900 28px/1 var(--f-display); text-transform: uppercase; letter-spacing: .03em; }
.b-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 260px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 6px;
  display: grid; box-shadow: 0 18px 40px rgba(0,0,0,.45);
}
.menu-pop a, .menu-pop button { text-align: left; padding: 9px 12px; border-radius: 6px; background: none; border: 0; cursor: pointer; color: var(--ivory); text-decoration: none; font-size: 14px; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface); }
.menu-pop .danger { color: var(--loss); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px; background: none; border: 0;
  border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap;
}
.tab small { color: var(--dim); font-weight: 500; }
.tab-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); font: 700 11px var(--f-mono); }
.tab.is-done .tab-n { background: var(--surface-2); border-color: var(--brass-deep); color: var(--brass); }
.tab.is-active { color: var(--ivory); border-bottom-color: var(--brass); }
.tab.is-active .tab-n { background: var(--brass); border-color: var(--brass); color: #1b1407; }
.tab:disabled { opacity: .35; cursor: not-allowed; }

.scene-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 16px;
  border: 1px solid var(--brass-deep); background: color-mix(in srgb, var(--brass) 10%, var(--surface)); border-radius: var(--r);
}
.scene-banner > span:nth-child(2) { flex: 1; min-width: 200px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--loss); box-shadow: 0 0 0 0 var(--loss); animation: pulse 1.6s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--loss) 70%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }

.view { display: grid; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-h h2, .card-h h3 { margin: 0; font: 800 22px/1.1 var(--f-display); text-transform: uppercase; letter-spacing: .04em; }
.card-h h3 { font-size: 19px; }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.count { font: 600 12.5px var(--f-mono); color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); padding: 3px 8px; border-radius: 999px; }
.count.ok { color: var(--win); border-color: color-mix(in srgb, var(--win) 40%, var(--line)); }
h2 .count { font-size: 13px; vertical-align: middle; margin-left: 6px; }
.hint { color: var(--muted); margin: 0 0 12px; font-size: 14px; max-width: 80ch; }
.hint.small { font-size: 12.5px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.err { color: var(--loss); margin: 0 0 8px; font-weight: 600; }
.warn-t { color: var(--warn); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.empty-state { text-align: center; padding: 40px 10px; color: var(--muted); }
.es-k { font-size: 54px; color: var(--line-2); }

/* setup */
.setup { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.side { display: grid; gap: 16px; }
.ptable { width: 100%; border-collapse: collapse; }
.ptable th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); font-weight: 700; padding: 6px; text-align: center; }
.ptable td { padding: 4px 6px; border-top: 1px solid var(--line); text-align: center; }
.ptable .l { text-align: left; }
.in { width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; min-width: 0; }
.in:focus { border-color: var(--brass); outline: none; }
.in-num { width: 80px; text-align: center; font-family: var(--f-mono); }
.row-act { white-space: nowrap; }
.potsel { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.potsel button { width: 32px; height: 32px; border: 0; background: var(--bg-2); color: var(--muted); cursor: pointer; font: 700 13px var(--f-mono); }
.potsel button + button { border-left: 1px solid var(--line); }
.potsel button.on.p1 { background: var(--brass); color: #1b1407; }
.potsel button.on.p2 { background: var(--silver); color: #141925; }
.potsel button.on.p3 { background: var(--bronze); color: #1d120a; }
.bulk { display: grid; gap: 8px; margin-bottom: 14px; padding: 12px; background: var(--bg-2); border-radius: 8px; }
.bulk label { font-size: 13.5px; color: var(--muted); }
.bulk textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 10px; resize: vertical; }
.bulk .btn { justify-self: start; }
.fld { display: grid; gap: 5px; margin-bottom: 12px; }
.fld > span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.chk { display: flex; align-items: center; gap: 10px; margin: 8px 0; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--brass); }
.plan { margin: 14px 0 0; padding-left: 20px; display: grid; gap: 7px; color: var(--ivory); font-size: 14px; }
.plan li::marker { color: var(--brass); font-weight: 700; }
.pots-prev { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pp { background: var(--bg-2); border-radius: 8px; overflow: hidden; min-width: 0; }
.pp-h { padding: 6px 10px; font: 800 15px var(--f-display); text-transform: uppercase; letter-spacing: .05em; display: flex; justify-content: space-between; }
.pp-h span { font: 600 12px var(--f-mono); opacity: .8; }
.pp-h.p1 { background: color-mix(in srgb, var(--brass) 25%, transparent); color: var(--brass-2); }
.pp-h.p2 { background: color-mix(in srgb, var(--silver) 18%, transparent); color: var(--silver); }
.pp-h.p3 { background: color-mix(in srgb, var(--bronze) 20%, transparent); color: var(--bronze); }
.pp ul { list-style: none; margin: 0; padding: 6px 10px 10px; font-size: 13px; display: grid; gap: 2px; }
.pp li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warns { margin: 12px 0 0; padding-left: 18px; color: var(--warn); font-size: 13px; display: grid; gap: 4px; }
.go { display: grid; justify-items: stretch; }

.pot-pill { font: 700 10px var(--f-mono); padding: 1px 5px; border-radius: 4px; margin-left: 7px; vertical-align: 1px; }
.pot-pill.p1, .gb-pot.p1 { background: color-mix(in srgb, var(--brass) 30%, transparent); color: var(--brass-2); }
.pot-pill.p2, .gb-pot.p2 { background: color-mix(in srgb, var(--silver) 22%, transparent); color: var(--silver); }
.pot-pill.p3, .gb-pot.p3 { background: color-mix(in srgb, var(--bronze) 25%, transparent); color: var(--bronze); }

/* guruh doskasi (qur'a) */
.board-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gb { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; min-width: 0; transition: border-color .3s, box-shadow .3s; }
.gb.active { border-color: var(--brass); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brass) 20%, transparent), 0 10px 40px color-mix(in srgb, var(--brass) 18%, transparent); }
.gb-h { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; font: 800 16px var(--f-display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.gb-l { font: 900 30px/1 var(--f-display); color: var(--brass); }
.gb ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.gb-slot { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 9px; border-radius: 7px; background: var(--bg-2); min-width: 0; }
.gb-slot.empty { border: 1px dashed var(--line-2); background: transparent; color: var(--dim); }
.gb-slot.empty .gb-pot { background: transparent; color: var(--dim); }
.gb-slot.filled { font-weight: 700; }
.gb-slot.latest { animation: flash 1.4s ease-out; background: color-mix(in srgb, var(--brass) 14%, var(--bg-2)); }
@keyframes flash { 0% { background: var(--brass); color: #1b1407; } 100% { background: color-mix(in srgb, var(--brass) 14%, var(--bg-2)); } }
.gb-pot { font: 700 10.5px var(--f-mono); padding: 2px 5px; border-radius: 4px; flex: none; }
.gb-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.board-admin.big .gb-slot { height: 44px; font-size: 18px; }

/* guruhlar */
.progress { height: 6px; background: var(--bg-2); border-radius: 99px; overflow: hidden; margin-bottom: 12px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brass-deep), var(--brass-2)); transition: width .4s; }
.grid-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 16px; align-items: start; }
.gcard-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.gcard-h h3 { margin: 0; flex: 1; font: 800 18px var(--f-display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.g-letter { font: 900 34px/1 var(--f-display); color: var(--brass); }
.standings { width: 100%; border-collapse: collapse; font-size: 14px; }
.standings th { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--dim); font-weight: 700; padding: 5px 6px; text-align: center; }
.standings td { padding: 7px 6px; border-top: 1px solid var(--line); text-align: center; }
.standings .l { text-align: left; }
.standings .pts { font-weight: 700; color: var(--ivory); font-size: 15px; }
.standings tr.q1 td { background: color-mix(in srgb, var(--brass) 12%, transparent); }
.standings tr.q1 td:first-child { box-shadow: inset 3px 0 0 var(--brass); }
.standings tr.q2 td:first-child { box-shadow: inset 3px 0 0 var(--silver); }
.pn { font-weight: 600; }
.matches { margin-top: 12px; display: grid; gap: 6px; }
.mrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; font-size: 14px; }
.mrow.ko { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.mr-round { font: 600 11px var(--f-mono); color: var(--dim); }
.mr-p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mr-p.w { text-align: right; }
.mr-p.won { color: var(--ivory); font-weight: 700; }
.mr-p.lost { color: var(--dim); }
.pc { font-style: normal; color: var(--dim); margin: 0 5px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 7px; overflow: hidden; background: var(--bg-2); }
.seg button { border: 0; background: transparent; padding: 6px 9px; cursor: pointer; font: 600 12.5px var(--f-mono); color: var(--muted); min-width: 44px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--ivory); background: var(--surface-2); }
.seg button.on { background: var(--brass); color: #1b1407; }
.res-static { font: 700 13px var(--f-mono); padding: 5px 10px; border-radius: 6px; background: var(--bg-2); text-align: center; min-width: 64px; }
.res-static.pending { color: var(--dim); font-weight: 500; }
.tie-warn { margin-top: 10px; padding: 10px 12px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 8%, transparent); font-size: 13.5px; }
.tie-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.tag.ok { background: color-mix(in srgb, var(--win) 18%, transparent); color: var(--win); }
.tag.mid { background: color-mix(in srgb, var(--brass) 18%, transparent); color: var(--brass-2); }
.tag.out { background: color-mix(in srgb, var(--loss) 15%, transparent); color: var(--loss); }
.komatch { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-2); margin-bottom: 10px; }
.komatch.decided { border-color: color-mix(in srgb, var(--brass) 35%, var(--line)); }
.km-head { display: flex; justify-content: space-between; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); font-weight: 700; margin-bottom: 8px; }
.tb-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; font-size: 13px; color: var(--warn); }
.ko-rounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: start; }
.champ-card { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; border-color: var(--brass-deep); background: linear-gradient(120deg, color-mix(in srgb, var(--brass) 14%, var(--surface)), var(--surface)); }
.champ-card .king { font-size: 64px; }
.champ-card > div { flex: 1; min-width: 180px; }
.eyebrow { font: 700 12px var(--f-body); text-transform: uppercase; letter-spacing: .22em; color: var(--brass); }
.champ-name { font: 900 44px/1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; }
.podium-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.podium-mini b { font-family: var(--f-mono); color: var(--brass); margin-right: 8px; }

/* ---------- setka ---------- */
.bracket { --cw: 220px; --gap: 34px; display: flex; gap: var(--gap); min-height: 420px; padding: 4px 4px 70px; min-width: max-content; }
.b-round { display: flex; flex-direction: column; width: var(--cw); }
.b-title { font: 800 14px var(--f-display); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); text-align: center; height: 26px; }
.b-col { flex: 1; display: flex; flex-direction: column; }
.b-pair { flex: 1; display: flex; flex-direction: column; position: relative; }
.b-pair::after { content: ''; position: absolute; right: calc(var(--gap) / -2); top: 25%; bottom: 25%; border-right: 2px solid var(--line-2); }
.b-slot { flex: 1; display: flex; align-items: center; position: relative; padding: 6px 0; }
.b-pair .b-slot::after { content: ''; position: absolute; right: calc(var(--gap) / -2); width: calc(var(--gap) / 2); top: 50%; border-top: 2px solid var(--line-2); }
.b-round + .b-round .b-slot::before { content: ''; position: absolute; left: calc(var(--gap) / -2); width: calc(var(--gap) / 2); top: 50%; border-top: 2px solid var(--line-2); }
.b-round.final .b-slot { flex: 1; }
.b-third { position: absolute; left: 0; right: 0; top: calc(50% + 62px); }
.b-third .b-title { height: 22px; font-size: 12px; }
.b-third .mcard { border-style: dashed; }
.mcard { width: 100%; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; position: relative; z-index: 1; }
.mcard.ghost { background: transparent; border-style: dashed; color: var(--dim); }
.mcard.current { border-color: var(--brass); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brass) 25%, transparent); animation: pop .6s cubic-bezier(.2,1.4,.4,1); }
.mc-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 6px; height: 34px; padding-right: 10px; }
.mc-row + .mc-row { border-top: 1px solid var(--line); }
.mc-seed { font: 600 11px var(--f-mono); color: var(--dim); text-align: center; align-self: stretch; display: grid; place-items: center; background: var(--bg-2); }
.mc-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; min-width: 0; }
.mc-nm i { color: var(--dim); }
.mc-col { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-left: 7px; vertical-align: 1px; border: 1px solid var(--muted); }
.mc-col.w { background: var(--ivory); }
.mc-col.b { background: #000; }
.mc-sc { font: 700 14px var(--f-mono); }
.tbm { font-style: normal; font-size: 9px; margin-left: 3px; color: var(--warn); vertical-align: 3px; }
.mc-row.win { background: color-mix(in srgb, var(--brass) 14%, transparent); }
.mc-row.win .mc-nm, .mc-row.win .mc-sc { color: var(--brass-2); }
.mc-row.lose .mc-nm, .mc-row.lose .mc-sc { color: var(--dim); }
.bracket.big { --cw: 260px; --gap: 44px; min-height: 560px; }
.bracket.big .mc-row { height: 42px; font-size: 17px; }

/* ---------- katta ekran: jonli ---------- */
.dash { padding-inline: 28px; padding-block: 22px 40px; max-width: 1800px; margin: 0 auto; display: grid; gap: 20px; }
.dash-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.dash-head .king { font-size: 64px; }
.dash-head > div:nth-child(2) { flex: 1; min-width: 220px; }
.dash-head h1 { margin: 0; font: 900 clamp(32px, 4vw, 56px)/1 var(--f-display); text-transform: uppercase; letter-spacing: .03em; }
.dash-head p { margin: 4px 0 0; color: var(--muted); font-size: 17px; }
.dash-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.live { display: inline-flex; align-items: center; gap: 8px; font: 700 12px var(--f-body); text-transform: uppercase; letter-spacing: .18em; color: var(--loss); margin-right: 6px; }
.dash-block { min-width: 0; }
.dash-h { font: 800 22px var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--brass); margin: 0 0 12px; }
.dash-names { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; font-size: 20px; font-weight: 600; }
.dash-names li { background: var(--surface); border: 1px solid var(--line); padding: 12px 16px; border-radius: 8px; }
.dash-note { font: 800 28px var(--f-display); text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.dash-split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.dash-groups .standings { font-size: 16px; }
.recent ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.recent li { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 6px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 14px; }
.rc-l { grid-column: 1 / -1; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); font-weight: 700; }
.rc-p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.rc-p:first-of-type { text-align: right; }
.rc-p.won { color: var(--ivory); font-weight: 700; }
.rc-s { font: 700 13px var(--f-mono); color: var(--brass-2); }
.dash-champ { display: flex; align-items: center; gap: 20px; padding: 18px 24px; border: 1px solid var(--brass-deep); border-radius: var(--r); background: linear-gradient(120deg, color-mix(in srgb, var(--brass) 16%, var(--surface)), var(--surface)); }
.dash-champ .king { font-size: 80px; }
.dash-champ .champ-name { font-size: 60px; }
.tickets { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tickets li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 18px; }
.tickets.dash { margin-bottom: 20px; }
.t-l { font: 900 26px/1 var(--f-display); color: var(--brass); width: 26px; text-align: center; }
.t-l.s { color: var(--silver); }

/* ---------- sahna ---------- */
.stage-root { position: fixed; inset: 0; z-index: 100; overflow: hidden; background: var(--bg); }
.stage-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 38%, color-mix(in srgb, var(--brass) 13%, transparent), transparent 70%),
    repeating-conic-gradient(color-mix(in srgb, var(--ivory) 3.2%, transparent) 0 25%, transparent 0 50%) 0 0 / 120px 120px,
    linear-gradient(180deg, var(--bg-2), var(--bg));
}
.stage-canvas { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; transform-origin: 0 0; }
.stage-controls {
  position: absolute; left: 0; right: 0; bottom: 0; height: 68px; padding: 0 18px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(8px);
}
.ctl-l { display: grid; line-height: 1.2; min-width: 0; }
.ctl-l span { font: 600 12px var(--f-mono); color: var(--muted); }
.ctl-c, .ctl-r { display: flex; gap: 8px; align-items: center; }
.stage-float { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; opacity: 0; transition: opacity .3s; }
.stage-root.show-float .stage-float { opacity: 1; }

.sc { position: absolute; inset: 0; padding: 44px 56px; display: flex; flex-direction: column; gap: 26px; }
.sc-center { align-items: center; justify-content: center; text-align: center; }
.sc-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.sc-head .eyebrow { font-size: 17px; }
.sc-head h1 { margin: 6px 0 0; font: 900 76px/.92 var(--f-display); text-transform: uppercase; letter-spacing: .02em; }
.h-letter { color: var(--brass); }
.sc-progress { display: flex; align-items: baseline; gap: 8px; font-family: var(--f-display); text-transform: uppercase; }
.sc-progress b { font-size: 64px; font-weight: 900; color: var(--brass); line-height: 1; }
.sc-progress span { font-size: 24px; font-weight: 800; color: var(--muted); letter-spacing: .05em; }
.sc-note { margin: auto 0 0; color: var(--muted); font-size: 20px; }
.sc-note.big { font: 800 40px var(--f-display); text-transform: uppercase; letter-spacing: .06em; color: var(--brass-2); text-align: center; margin: 30px 0 0; animation: blink 2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .45; } }

/* qur'a sahnasi */
.draw-grid { flex: 1; display: grid; grid-template-columns: 330px 1fr 640px; gap: 32px; min-height: 0; }
.pots { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.pot { background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; transition: border-color .3s, opacity .3s; opacity: .65; }
.pot.current { opacity: 1; border-color: var(--brass); }
.pot h3 { margin: 0 0 8px; display: flex; justify-content: space-between; align-items: baseline; font: 900 22px var(--f-display); text-transform: uppercase; letter-spacing: .06em; color: var(--brass-2); }
.pot h3 small { font: 600 13px var(--f-mono); color: var(--muted); letter-spacing: 0; }
.pot ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; font-size: 15px; font-weight: 600; }
.pot li { display: flex; justify-content: space-between; gap: 4px; min-width: 0; transition: color .4s; }
.pot li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pot li.drawn { color: var(--dim); }
.pot li.drawn span { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--dim) 60%, transparent); }
.pot li b { font: 900 15px var(--f-display); color: var(--brass); }
.reveal { display: grid; place-items: center; text-align: center; min-width: 0; }
.rv { display: grid; justify-items: center; gap: 18px; width: 100%; }
.rv .eyebrow { font-size: 18px; }
.ball {
  width: 190px; height: 190px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 35% 30%, var(--ivory), color-mix(in srgb, var(--ivory) 70%, var(--brass)) 45%, var(--brass-deep) 100%);
  box-shadow: 0 30px 60px rgba(0,0,0,.5), inset -12px -16px 30px rgba(0,0,0,.25), 0 0 0 8px color-mix(in srgb, var(--brass) 22%, transparent);
}
.ball span { font: 900 92px/1 var(--f-display); color: #1b1407; }
.ball.p2 { background: radial-gradient(circle at 35% 30%, #fff, var(--silver) 50%, #59647a 100%); }
.ball.p3 { background: radial-gradient(circle at 35% 30%, #fbe7d6, var(--bronze) 50%, #6b4122 100%); }
.rv-name { font: 900 70px/.95 var(--f-display); text-transform: uppercase; letter-spacing: .01em; min-height: 134px; display: flex; align-items: center; justify-content: center; text-wrap: balance; max-width: 100%; overflow-wrap: anywhere; }
.rv-name.spinning { color: var(--muted); filter: blur(.6px); }
.rv-name.landed { color: var(--ivory); text-shadow: 0 0 40px color-mix(in srgb, var(--brass) 55%, transparent); animation: land .6s cubic-bezier(.2,1.5,.4,1); }
@keyframes land { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }
.rv-to { font: 800 34px var(--f-display); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.rv-to span { color: var(--brass); font-size: 60px; font-weight: 900; vertical-align: -6px; margin-right: 4px; }
.rv-to.pop { animation: pop .55s cubic-bezier(.2,1.5,.4,1); }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.intro { display: grid; justify-items: center; gap: 12px; }
.intro-k { font-size: 120px; line-height: 1; color: var(--brass); background: linear-gradient(180deg, var(--brass-2), var(--brass) 55%, var(--brass-deep)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.intro h2 { margin: 0; font: 900 64px/.95 var(--f-display); text-transform: uppercase; }
.intro p { margin: 6px 0 0; color: var(--muted); font-size: 20px; max-width: 30ch; }
.intro .eyebrow { font-size: 18px; }
.intro.big h2 { font-size: 96px; }
.intro.big p { max-width: none; font-size: 24px; }
.board { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.board.g7, .board.g8 { gap: 9px; }
.board.g7 .gb-slot, .board.g8 .gb-slot { height: 30px; font-size: 15px; }
.board.g7 .gb, .board.g8 .gb { padding: 8px 10px; }
.board.g7 .gb-l, .board.g8 .gb-l { font-size: 24px; }
.board .gb { background: color-mix(in srgb, var(--surface) 85%, transparent); }
.board .gb-slot { height: 38px; font-size: 17px; }
.flyer { position: absolute; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 0 9px; border-radius: 7px; background: var(--brass); color: #1b1407; font-weight: 800; font-size: 17px; transform-origin: center; white-space: nowrap; overflow: hidden; }
.flyer .gb-pot { background: rgba(0,0,0,.15); color: #1b1407; }

/* guruh yakunlari sahnasi */
.gr-grid { flex: 1; display: grid; grid-template-columns: 1fr 420px; gap: 36px; min-height: 0; }
.gr-table { display: flex; flex-direction: column; gap: 20px; }
.big-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; font-size: 26px; }
.big-table th { font: 800 15px var(--f-body); text-transform: uppercase; letter-spacing: .12em; color: var(--dim); padding: 0 14px; text-align: center; }
.big-table td { padding: 16px 14px; background: color-mix(in srgb, var(--surface) 90%, transparent); text-align: center; }
.big-table td:first-child { border-radius: 10px 0 0 10px; font-weight: 800; }
.big-table td:last-child { border-radius: 0 10px 10px 0; }
.big-table .l { text-align: left; }
.big-table .pts { font-size: 34px; font-weight: 700; color: var(--brass-2); }
.big-table .pn { font-weight: 800; font-size: 30px; }
.big-table tr.q1 td { background: color-mix(in srgb, var(--brass) 22%, var(--surface)); }
.big-table tr.q1 td:first-child { box-shadow: inset 5px 0 0 var(--brass); }
.big-table tr.q2 td:first-child { box-shadow: inset 5px 0 0 var(--silver); }
.big-table.seconds { font-size: 24px; }
.big-table.seconds .tag { font-size: 16px; padding: 5px 14px; }
.badge { display: inline-block; margin-left: 14px; font: 800 13px var(--f-body); text-transform: uppercase; letter-spacing: .1em; padding: 5px 10px; border-radius: 6px; background: var(--surface-2); color: var(--silver); vertical-align: 5px; }
.badge.gold { background: var(--brass); color: #1b1407; }
.row-in { opacity: 0; animation: rowIn .55s cubic-bezier(.2,1,.3,1) forwards; }
@keyframes rowIn { 0% { opacity: 0; transform: translateY(24px); } 100% { opacity: 1; transform: none; } }
.big-table tr.q1.row-in td { animation: none; }
.gr-results { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: 17px; }
.gr-results b { color: var(--ivory); font-weight: 600; }
.tickets-box h3 { margin: 0 0 14px; font: 900 26px var(--f-display); text-transform: uppercase; letter-spacing: .08em; color: var(--brass); }
.tickets-box .tickets li { font-size: 22px; padding: 12px 16px; }
.tickets li.wait { color: var(--dim); border-style: dashed; background: transparent; }
.tickets li.enter-late { opacity: 0; animation: rowIn .6s cubic-bezier(.2,1,.3,1) forwards; animation-delay: var(--late, 1.4s); border-color: var(--brass); }
.stats { display: flex; gap: 18px; margin: 18px 0 8px; }
.stats div { display: grid; padding: 14px 26px; border: 1px solid var(--line-2); border-radius: 12px; background: color-mix(in srgb, var(--surface) 80%, transparent); min-width: 150px; }
.stats b { font: 900 60px/1 var(--f-display); color: var(--brass-2); }
.stats span { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }

/* juftlik (VS) */
.sc-vs .vs { margin-top: auto; }
.sc-vs > :last-child { margin-bottom: auto; }
.sc-vs .sc-note:not(.big) { margin: 10px 0 auto; text-align: center; }
.vs { display: grid; grid-template-columns: 1fr 200px 1fr; align-items: center; gap: 10px; margin-top: 20px; }
.vs-side { padding: 34px 36px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line-2); display: grid; gap: 10px; min-width: 0; }
.vs-side.a { text-align: right; border-right: 5px solid var(--brass); }
.vs-side.b { text-align: left; border-left: 5px solid var(--brass); }
.vs-tag { font: 700 16px var(--f-body); text-transform: uppercase; letter-spacing: .14em; color: var(--brass); }
.vs-name { font: 900 72px/.95 var(--f-display); text-transform: uppercase; text-wrap: balance; overflow-wrap: anywhere; }
.vs-meta { color: var(--muted); font-size: 19px; }
.vs-mid { font: 900 76px var(--f-display); color: var(--brass); text-align: center; text-shadow: 0 0 40px color-mix(in srgb, var(--brass) 50%, transparent); white-space: nowrap; }
.vs-in .vs-side.a { animation: fromL .6s cubic-bezier(.2,1,.3,1) both; }
.vs-in .vs-side.b { animation: fromR .6s cubic-bezier(.2,1,.3,1) both; }
.vs-in .vs-mid { animation: pop .5s .45s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes fromL { 0% { opacity: 0; transform: translateX(-120px); } 100% { opacity: 1; transform: none; } }
@keyframes fromR { 0% { opacity: 0; transform: translateX(120px); } 100% { opacity: 1; transform: none; } }
.pair-list { display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: center; font-size: 20px; font-weight: 600; }
.pair-list span { font: 900 20px var(--f-display); color: var(--brass); margin-right: 10px; }
.pair-list i { color: var(--dim); font-style: normal; margin: 0 6px; }
.q-list { list-style: none; padding: 0; margin: 20px 0 6px; display: grid; grid-template-columns: repeat(4, 280px); gap: 12px; text-align: left; }
.q-list li { display: grid; padding: 14px 18px; border-radius: 10px; background: color-mix(in srgb, var(--surface) 90%, transparent); border: 1px solid var(--line-2); }
.q-list li span { font: 900 28px/1 var(--f-display); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-list li small { color: var(--brass); font-size: 14px; font-weight: 700; margin-top: 4px; }
.q-list li.wait { border-style: dashed; background: transparent; }
.q-list li.wait span { color: var(--muted); font-size: 20px; }

/* setka sahnasi */
.br-intro { flex: 1; display: grid; grid-template-columns: 420px 1fr; gap: 36px; min-height: 0; }
.seed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; align-content: start; }
.seed-list li { display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; padding: 8px 14px; background: color-mix(in srgb, var(--surface) 90%, transparent); border-radius: 9px; }
.seed-list b { grid-row: span 2; font: 900 32px/1 var(--f-display); color: var(--brass); align-self: center; }
.seed-list span { font-weight: 800; font-size: 20px; }
.seed-list small { color: var(--muted); font-size: 13px; }
.br-wrap { display: flex; justify-content: center; flex: 1; min-height: 0; }
.br-wrap.low { flex: 1; }
.stage-br { --cw: 250px; --gap: 48px; min-height: 0; height: 100%; padding-bottom: 40px; }
.stage-br .mc-row { height: 38px; font-size: 17px; }
.stage-br .b-title { font-size: 17px; height: 30px; }
.stage-br.compact .mc-row { height: 30px; font-size: 15px; }
.br-wrap.full .stage-br { --cw: 300px; --gap: 64px; }
.br-wrap.full .stage-br .mc-row { height: 46px; font-size: 20px; }

/* chempion */
.champ { overflow: hidden; }
.confetti { position: absolute; inset: 0; width: 1600px; height: 900px; pointer-events: none; z-index: 3; }
.champ-wrap { display: grid; justify-items: center; gap: 10px; position: relative; z-index: 2; }
.champ-k { font-size: 220px; line-height: .9; background: linear-gradient(180deg, var(--brass-2), var(--brass) 55%, var(--brass-deep)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 0 50px color-mix(in srgb, var(--brass) 45%, transparent)); }
.champ-wrap .eyebrow { font-size: 22px; }
.champ-big { font: 900 150px/.9 var(--f-display); text-transform: uppercase; letter-spacing: .01em; text-wrap: balance; max-width: 1400px; text-shadow: 0 0 60px color-mix(in srgb, var(--brass) 40%, transparent); }
.champ-wrap p { color: var(--muted); font-size: 24px; margin: 8px 0 0; }
.champ-in .champ-k { animation: pop .9s cubic-bezier(.2,1.5,.4,1) both; }
.champ-in .eyebrow { animation: rowIn .6s .5s both; }
.champ-in .champ-big { animation: land 1s .8s cubic-bezier(.2,1.4,.4,1) both; }
.champ-in p { animation: rowIn .6s 1.3s both; }
.podium { flex: 1; display: grid; grid-template-columns: repeat(3, 360px); justify-content: center; align-items: end; gap: 24px; padding-bottom: 10px; }
.pod { display: grid; justify-items: center; gap: 14px; text-align: center; }
.pod-name { font: 900 46px/.95 var(--f-display); text-transform: uppercase; text-wrap: balance; }
.pod-k { font-size: 90px; line-height: 1; color: var(--brass); }
.pod-block { width: 100%; display: grid; place-items: center; border-radius: 14px 14px 0 0; border: 1px solid var(--line-2); border-bottom: 0; }
.pod-block span { font: 900 110px var(--f-display); }
.p1 .pod-block { height: 380px; background: linear-gradient(180deg, color-mix(in srgb, var(--brass) 45%, var(--surface)), var(--surface)); }
.p1 .pod-block span { color: var(--brass-2); }
.p2 .pod-block { height: 270px; background: linear-gradient(180deg, color-mix(in srgb, var(--silver) 25%, var(--surface)), var(--surface)); }
.p2 .pod-block span { color: var(--silver); }
.p3 .pod-block { height: 200px; background: linear-gradient(180deg, color-mix(in srgb, var(--bronze) 30%, var(--surface)), var(--surface)); }
.p3 .pod-block span { color: var(--bronze); }
.podium-in .pod { animation: rowIn .7s cubic-bezier(.2,1,.3,1) both; }
.podium-in .p3 { animation-delay: .1s; }
.podium-in .p2 { animation-delay: .7s; }
.podium-in .p1 { animation-delay: 1.4s; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; max-width: min(560px, calc(100vw - 32px));
  background: var(--surface-2); border: 1px solid var(--brass-deep); color: var(--ivory); padding: 12px 18px; border-radius: 10px; box-shadow: 0 16px 40px rgba(0,0,0,.5); font-weight: 600;
}

@media (max-width: 1000px) {
  .setup, .two-col, .dash-split { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .shell { padding-inline: 16px; }
  .b-name { font-size: 22px; }
  .top-actions .btn-ghost:first-child { display: none; }
  .mrow { grid-template-columns: 1fr auto 1fr; }
  .mr-round { display: none; }
  .pots-prev { grid-template-columns: 1fr; }
  .stage-controls { height: auto; flex-wrap: wrap; padding-block: 8px; }
  .ctl-r { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .row-in, .enter-late { opacity: 1 !important; }
}
