/* ============================================================
   SETKA TAXTASI — ikki tomondan markazga, o'rtada kubok.
   Chiziqlar pseudo-elementlar bilan: juftlikning ikki katakchasi "]"
   shaklida birlashadi, o'rtasidan keyingi ustun katakchasiga chiqadi.
   Ustunlarning balandligi bir xil (--n × --u), shuning uchun har
   bosqichdagi katakcha avvalgi juftlik markaziga aniq tushadi.
   ============================================================ */

.bb {
  --pw: 138px;          /* katakcha kengligi */
  --pw1: 166px;         /* chetki (1-bosqich) ustun — avatar bilan */
  --ph: 24px;           /* katakcha balandligi */
  --gap: 22px;          /* ustunlar orasi (chiziqlar shu yerda) */
  position: relative;
}

/* ── Boshqaruv paneli ───────────────────────────────────── */
.bb__bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.bb__bar-l { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.bb__legend { display: inline-flex; align-items: center; gap: 6px; }
.bb__legend i { width: 20px; height: 10px; border-radius: 99px; display: inline-block; }
.bb__legend .lg-win { background: #fff; box-shadow: 0 0 0 2px var(--bb-on), 0 0 0 3px rgba(0,0,0,.15); }
.bb__legend .lg-tbd { border: 1.5px dashed var(--muted-2); }
.bb__legend .lg-bye { border: 1.5px dotted var(--muted-2); opacity: .7; }
.bb__zoom { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bb__pct { min-width: 66px; font-variant-numeric: tabular-nums; }

/* Ommaviy sahifada taxta butun ekran kengligi va balandligida */
.board-page { padding: 0 16px; --bb-h: max(460px, calc(100vh - 128px)); }

/* ── Ko'rish maydoni (masshtab + surish) ────────────────── */
.bb__viewport {
  position: relative; overflow: hidden;
  height: var(--bb-h, min(80vh, 920px)); min-height: 380px;
  border-radius: 20px; background: var(--bb-bg-1);
  cursor: grab; touch-action: none; outline: none;
  user-select: none; -webkit-user-select: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), var(--shadow);
}
.bb__viewport:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bb-on) 60%, transparent); }
.bb__viewport.is-drag { cursor: grabbing; }
.bb__viewport.is-drag a { pointer-events: none; }

.bb__canvas {
  position: absolute; left: 0; top: 0; transform-origin: 0 0;
  padding: 18px 22px 24px; border-radius: 26px; color: #fff;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.022) 0 84px, transparent 84px 168px),
    radial-gradient(115% 85% at 50% 50%, var(--bb-bg-2), var(--bb-bg-1) 78%);
}
.bb__hint { font-size: 12px; color: var(--muted); margin-top: 8px; text-align: center; }
.bb__hint kbd {
  font: 700 11px var(--mono); padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--border); background: var(--card);
}

/* ── Sarlavha ───────────────────────────────────────────── */
.bb__title { text-align: center; margin: 0 auto 6px; max-width: 1100px; }
.bb__kicker {
  font-size: 12px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase;
  color: var(--bb-on);
}
.bb__name {
  font-size: 30px; font-weight: 900; font-style: italic; text-transform: uppercase;
  letter-spacing: -.01em; line-height: 1.05; margin-top: 3px;
  text-shadow: 0 3px 16px rgba(0,0,0,.4);
}
.bb__sub { font-size: 13px; color: rgba(255,255,255,.72); margin-top: 6px; font-weight: 600; }

/* ── Tarkib: chap tomon · markaz · o'ng tomon ───────────── */
.bb__grid {
  display: flex; align-items: stretch; justify-content: center; gap: var(--gap);
  padding-top: 44px; min-height: 470px;
}
.bb__side { display: flex; gap: var(--gap); align-self: center; }
.bb__col {
  position: relative; display: flex; flex-direction: column;
  width: var(--pw); height: calc(var(--n) * var(--u));
}
.bb__col[data-r="1"] { width: var(--pw1); }
.bb__head {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  margin-bottom: 14px; padding: 3px 13px; border-radius: 999px; white-space: nowrap;
  font-size: 12.5px; font-weight: 850; letter-spacing: .06em; color: var(--bb-on);
  background: rgba(0,0,0,.28); border: 1px solid color-mix(in srgb, var(--bb-on) 45%, transparent);
}

.bb__pair { position: relative; flex: 1; display: flex; flex-direction: column; }
.bb__slot { position: relative; flex: 1; display: flex; align-items: center; }

/* Chiziqlar — chap tomon */
.bb__slot::after {
  content: ''; position: absolute; left: 100%; width: calc(var(--gap) / 2);
  border: 0 solid var(--bb-line); pointer-events: none;
}
.bb__slot:first-child::after {
  top: calc(50% - 1px); height: calc(50% + 1px);
  border-top-width: 2px; border-right-width: 2px; border-top-right-radius: 8px;
}
.bb__slot:last-child::after {
  bottom: calc(50% - 1px); height: calc(50% + 1px);
  border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: 8px;
}
.bb__pair::after {
  content: ''; position: absolute; top: calc(50% - 1px);
  left: calc(100% + var(--gap) / 2); width: calc(var(--gap) / 2);
  border-top: 2px solid var(--bb-line); pointer-events: none;
}
/* Chiziqlar — o'ng tomon (ko'zgu) */
.bb__side--r .bb__slot::after { left: auto; right: 100%; border-right-width: 0; border-left-width: 2px; }
.bb__side--r .bb__slot:first-child::after { border-top-right-radius: 0; border-top-left-radius: 8px; }
.bb__side--r .bb__slot:last-child::after { border-bottom-right-radius: 0; border-bottom-left-radius: 8px; }
.bb__side--r .bb__pair::after { left: auto; right: calc(100% + var(--gap) / 2); }
/* G'olib yo'li */
.bb__slot.is-win::after { border-color: var(--bb-on); z-index: 1; }
.bb__pair.is-done::after { border-top-color: var(--bb-on); }

/* ── Katakcha ───────────────────────────────────────────── */
.bb__pill {
  position: relative; z-index: 2; display: flex; align-items: center; gap: 6px;
  width: 100%; height: var(--ph); padding: 0 5px 0 11px; border-radius: 999px;
  background: #fff; color: #10201A; font-size: 12.5px; font-weight: 650; line-height: 1;
  letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-decoration: none;
  box-shadow: 0 2px 7px rgba(0,0,0,.3);
  transition: transform .15s, box-shadow .15s, background .25s, color .25s;
}
a.bb__pill:hover { text-decoration: none; transform: translateY(-1px);
                   box-shadow: 0 0 0 2px #fff, 0 5px 14px rgba(0,0,0,.4); }
.bb__col[data-r="1"] .bb__pill { padding-left: 3px; }
.bb__ava {
  width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center; font-size: 8px; font-weight: 850; letter-spacing: -.02em;
  background: var(--tone-bg); color: var(--tone);
}
.bb__nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bb__sc {
  flex-shrink: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 7px;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 850;
  background: #E3EAE7; color: #2D3D37; font-variant-numeric: tabular-nums;
}
.bb__sc:empty { display: none; }

.bb__side--r .bb__pill, .bb__fslot--r .bb__pill { flex-direction: row-reverse; padding: 0 11px 0 5px; text-align: right; }
.bb__side--r .bb__col[data-r="1"] .bb__pill { padding-right: 3px; }

.is-win > .bb__pill { font-weight: 780; box-shadow: 0 0 0 2px var(--bb-on), 0 3px 12px rgba(0,0,0,.4); }
.is-win .bb__sc { background: var(--bb-on); color: #1F3306; }
.is-lose > .bb__pill { background: rgba(255,255,255,.5); color: rgba(16,32,26,.66); box-shadow: none; }
.is-lose .bb__ava { opacity: .55; }
.bb__pill.is-tbd {
  justify-content: center; background: rgba(255,255,255,.05); color: rgba(255,255,255,.5);
  border: 1.5px dashed rgba(255,255,255,.3); box-shadow: none; font-weight: 600;
}
.bb__pill.is-bye { background: rgba(0,0,0,.14); border: 1.5px dotted rgba(255,255,255,.16); box-shadow: none; }
.is-live > .bb__pill { box-shadow: 0 0 0 2px #FF6B3D, 0 0 16px rgba(255,107,61,.65);
                       animation: bbLive 1.6s ease-in-out infinite; }
@keyframes bbLive { 50% { box-shadow: 0 0 0 2px #FF6B3D, 0 0 3px rgba(255,107,61,.2); } }

/* ── Markaz: kubok, final, g'olib, 3-o'rin ──────────────── */
.bb__center {
  flex: 0 0 auto; width: calc(2 * var(--pw) + 40px);
  display: grid; grid-template-rows: 1fr auto 1fr;
}
.bb__ctop { align-self: end; display: flex; flex-direction: column; align-items: center; padding-bottom: 16px; }
.bb__cup {
  width: 92px; height: 115px;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.45)) drop-shadow(0 0 26px rgba(242,194,48,.38));
}
.bb__flabel {
  margin-top: 10px; font-size: 24px; font-weight: 900; font-style: italic;
  letter-spacing: .14em; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.4);
}
.bb__final, .bb__tpair { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.bb__fslot { width: var(--pw); position: relative; }
.bb__final .bb__pill { --ph: 30px; font-size: 13.5px; }
.bb__vs { font-size: 11px; font-weight: 850; color: rgba(255,255,255,.55); text-transform: uppercase; }
.bb__cbot { align-self: start; display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 18px; }
.bb__champ {
  text-align: center; max-width: 100%; padding: 10px 20px; border-radius: 16px;
  background: linear-gradient(135deg, #FFF3B0, #F2C230 55%, #C8911A); color: #3A2A00;
  box-shadow: 0 10px 26px rgba(0,0,0,.4);
}
.bb__champ-l { display: block; font-size: 11px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.bb__champ-n { display: block; font-size: 16px; font-weight: 850; margin-top: 3px; }
.bb__third { width: 100%; text-align: center; }
.bb__tlabel {
  font-size: 11px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase;
  color: #F0B98A; margin-bottom: 8px;
}

/* ── Qura animatsiyasi ──────────────────────────────────── */
.bb__slot.is-target > .bb__pill, .bb__fslot.is-target > .bb__pill {
  border-color: var(--bb-on); animation: bbTarget .7s ease-in-out infinite;
}
@keyframes bbTarget {
  50% { background: color-mix(in srgb, var(--bb-on) 32%, transparent);
        box-shadow: 0 0 18px color-mix(in srgb, var(--bb-on) 70%, transparent); }
}
.bb__pill.is-pop { animation: bbPop .5s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes bbPop { from { transform: scale(.55); opacity: .1; } to { transform: scale(1); opacity: 1; } }
.bb-fly {
  position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; transform-origin: center;
  height: 30px;
  display: flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 999px;
  background: #fff; color: #10201A; font: 700 14px var(--font); white-space: nowrap;
  box-shadow: 0 0 0 3px var(--bb-on), 0 12px 30px rgba(0,0,0,.45);
}

/* ── To'liq ekran ───────────────────────────────────────── */
.bb:fullscreen { background: var(--bb-bg-1); padding: 12px 16px; display: flex; flex-direction: column; }
.bb:-webkit-full-screen { background: var(--bb-bg-1); padding: 12px 16px; display: flex; flex-direction: column; }
.bb:fullscreen .bb__viewport { flex: 1; height: auto; border-radius: 12px; }
.bb:-webkit-full-screen .bb__viewport { flex: 1; height: auto; border-radius: 12px; }
.bb:fullscreen .bb__bar-l, .bb:fullscreen .bb__hint { color: rgba(255,255,255,.65); }

/* ── Jadval: kun bo'yicha guruhlash ─────────────────────── */
.mdays { display: flex; flex-direction: column; gap: 22px; }
.mday__head {
  font-size: 14px; font-weight: 750; margin: 0 0 10px; padding-bottom: 8px;
  border-bottom: 2px solid var(--border); display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.mday__head--tbd { color: var(--muted); }

/* ── Guruh jadvali ──────────────────────────────────────── */
.groups-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.gtable td.gp { width: 100%; max-width: 1px; }
.gp__in { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gp__t { min-width: 0; }
.gp__t b, .gp__t small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gtable th.g { text-align: center; }
.gtable td.g  { text-align: center; font-variant-numeric: tabular-nums; }
.gtable .pts { font-weight: 780; color: var(--brand); }
.gtable tr.qualify td { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.gtable tr.qualify .tbl__idx { color: var(--brand); font-weight: 700; }
.gtable tr.qualify td:first-child { box-shadow: inset 3px 0 0 var(--brand); }

/* ── O'yinlar ro'yxati (jadval ko'rinishi) ──────────────── */
.mlist { display: grid; gap: 8px; }
.mrow {
  display: grid; grid-template-columns: 84px 1fr auto 1fr 100px;
  align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 10px 14px; transition: .15s;
}
.mrow:hover { border-color: var(--muted-2); text-decoration: none; }
.mrow__stage { font-size: 11.5px; font-weight: 650; color: var(--muted); }
.mrow__p { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mrow__p.right { justify-content: flex-end; text-align: right; }
.mrow__p span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.mrow__p.win span.n { font-weight: 750; }
.mrow__p.lose { opacity: .6; }
.mrow__score {
  font-variant-numeric: tabular-nums; font-weight: 750; font-size: 14px;
  padding: 4px 12px; border-radius: 8px; background: var(--bg-2); white-space: nowrap;
}
.mrow__when { font-size: 12px; color: var(--muted); text-align: right; line-height: 1.3; }
.mrow__when b { display: block; font-size: 14.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.mrow__when small { display: block; font-size: 11.5px; }
.mday__n { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: none; margin-left: 6px; }

/* Navbatdagi o'yinlar (jadval sahifasi) */
.sched-info { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.upnext { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card);
          padding: 14px 16px; margin-bottom: 22px; box-shadow: var(--shadow-sm); }
.upnext__h { font-size: 13px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em;
             color: var(--muted); margin: 0 0 10px; }
@media (max-width: 760px) {
  .mrow { grid-template-columns: 1fr auto 1fr; row-gap: 6px; }
  .mrow__stage { grid-column: 1 / -1; }
  .mrow__when { grid-column: 1 / -1; text-align: left; }
  .bb__bar-l { display: none; }
  .bb__viewport { --bb-h: 70vh; }
}
