/* Guruhlararo jamoaviy turnir: setka, uchrashuv kartochkalari, joylashtirish va tarkib muharrirlari.
   Ranglar — Farzin tokenlari (--fz-*), shuning uchun yorug‘ va qorong‘i mavzuda o‘zi moslashadi. */

.tb-scroll { overflow-x: auto; padding: 6px 2px 14px; -webkit-overflow-scrolling: touch; }
.tb { display: flex; align-items: stretch; min-width: max-content; }
.tb-col { display: flex; flex-direction: column; width: 232px; flex: none; }
.tb-col__head { text-align: center; font: 700 .72rem var(--fz-sans); letter-spacing: .08em; text-transform: uppercase;
  color: var(--fz-muted); padding: 0 28px 10px 0; }
.tb-col__body { flex: 1; display: flex; flex-direction: column; justify-content: space-around; }
.tb-pair { flex: 1; display: flex; flex-direction: column; justify-content: space-around; position: relative; padding-right: 28px; }
.tb-pair::after { content: ""; position: absolute; right: 13px; top: 25%; bottom: 25%; border-right: 2px solid var(--fz-line-strong, var(--fz-faint)); }
.tb-pair::before { content: ""; position: absolute; right: 0; width: 15px; top: 50%; border-top: 2px solid var(--fz-line-strong, var(--fz-faint)); }
.tb-pair--single::after { display: none; }
.tb-pair--single .tb-m::after { width: 28px; right: -28px; }
.tb-pair--single::before { display: none; }

.tb-m { position: relative; margin: 7px 0; background: var(--fz-surface); border: 1px solid var(--fz-line); border-radius: 14px;
  box-shadow: var(--fz-shadow); overflow: hidden; }
.tb-m::after { content: ""; position: absolute; right: -15px; width: 15px; top: 50%; border-top: 2px solid var(--fz-line-strong, var(--fz-faint)); }
.tb-m--live { border-color: color-mix(in srgb, var(--fz-b) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fz-b) 14%, transparent), var(--fz-shadow); }
.tb-m--finished { }
.tb-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; min-height: 36px; }
.tb-row + .tb-row { border-top: 1px solid var(--fz-line); }
.tb-row.is-win { background: color-mix(in srgb, var(--fz-gold) 14%, transparent); }
.tb-row.is-win .tb-team { color: var(--fz-text); }
.tb-row.is-lose { opacity: .5; }
.tb-team { all: unset; cursor: pointer; flex: 1; min-width: 0; font: 700 .95rem var(--fz-display); letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 6px; }
.tb-team:hover { color: var(--fz-a); }
.tb-team:focus-visible { outline: 2px solid var(--fz-a); outline-offset: 2px; }
.tb-tbd { flex: 1; min-width: 0; color: var(--fz-faint); font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-score { font: 800 .95rem var(--fz-mono); min-width: 2.2em; text-align: right; }
.tb-row.is-win .tb-score { color: var(--fz-gold); }
.tb-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 5px 10px; font-size: .72rem; font-weight: 700;
  color: var(--fz-muted); background: color-mix(in srgb, var(--fz-text) 3%, transparent); border-top: 1px solid var(--fz-line); text-decoration: none; }
a.tb-foot:hover { color: var(--fz-a); }
.tb-live-dot { display: inline-flex; align-items: center; gap: 5px; color: var(--fz-b); }
.tb-live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: tb-pulse 1.6s infinite; }
@keyframes tb-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .tb-live-dot::before { animation: none; } }

.tb-champ { display: flex; flex-direction: column; justify-content: center; align-items: center; width: 190px; flex: none; gap: 10px; text-align: center; padding-top: 26px; }
.tb-champ__cup { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem;
  background: var(--fz-grad); color: #fff; box-shadow: var(--fz-shadow-lg); }
.tb-champ b { font: 800 1.3rem var(--fz-display); letter-spacing: -.03em; }
.tb-champ small { color: var(--fz-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; }

.tb-play { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 22px; }
.tb-play .tb-m { margin: 0; }
.tb-play .tb-m::after { display: none; }
.tb-to { font-size: .72rem; color: var(--fz-muted); font-weight: 700; }

.tb-podium { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.tb-podium > div { padding: 16px; border-radius: 16px; background: var(--fz-surface); border: 1px solid var(--fz-line); display: flex; gap: 12px; align-items: center; }
.tb-podium i { font-size: 1.4rem; }
.tb-podium .r1 i { color: var(--fz-gold); } .tb-podium .r2 i { color: var(--fz-silver); } .tb-podium .r3 i { color: var(--fz-bronze); }
.tb-podium b { font: 800 1.1rem var(--fz-display); display: block; }
.tb-podium small { color: var(--fz-muted); font-weight: 700; }

/* Jamoa tarkibi oynasi */
.tb-roster { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tb-roster li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: color-mix(in srgb, var(--fz-text) 4%, transparent); }
.tb-roster .n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font: 800 .8rem var(--fz-mono); background: var(--fz-grad-soft); color: var(--fz-a); flex: none; }
.tb-roster .nm { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-roster .rt { font: 700 .8rem var(--fz-mono); color: var(--fz-muted); }
.tb-roster li.is-reserve { opacity: .75; }
.tb-roster li.is-reserve .n { background: transparent; border: 1px dashed var(--fz-faint); color: var(--fz-muted); }

/* Uchrashuv sahifasi */
.tm-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; padding: 22px; }
.tm-head .side { display: grid; gap: 4px; }
.tm-head .side:last-child { text-align: right; }
.tm-head .side b { font: 800 clamp(1.4rem, 4vw, 2.2rem) var(--fz-display); letter-spacing: -.04em; }
.tm-head .side.is-win b { color: var(--fz-gold); }
.tm-head .sc { font: 800 clamp(1.6rem, 5vw, 2.6rem) var(--fz-mono); text-align: center; white-space: nowrap; }
.tm-head .sc small { display: block; font: 700 .72rem var(--fz-sans); color: var(--fz-muted); letter-spacing: .06em; text-transform: uppercase; }
.tm-boards { display: grid; gap: 10px; }
.tm-board { display: grid; grid-template-columns: 34px 1fr auto 1fr; gap: 12px; align-items: center; padding: 12px 14px; }
.tm-board .no { font: 800 .9rem var(--fz-mono); color: var(--fz-muted); }
.tm-board .pl { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tm-board .pl:last-child { justify-content: flex-end; text-align: right; }
.tm-board .pl span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.tm-board .res { text-align: center; display: grid; gap: 4px; justify-items: center; }
.tm-board .res b { font: 800 1rem var(--fz-mono); }
.tm-dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--fz-faint); flex: none; }
.tm-dot--w { background: #fff; } .tm-dot--b { background: #222; }
.tm-arb { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 10px; border-top: 1px dashed var(--fz-line); }
.tm-arb form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
.tm-arb .fz-select, .tm-arb .fz-input { height: 36px; padding-top: 0; padding-bottom: 0; font-size: .85rem; width: auto; max-width: 190px; }
.tm-hist { grid-column: 1 / -1; font-size: .8rem; color: var(--fz-muted); display: grid; gap: 2px; }
.tm-arm { border-color: color-mix(in srgb, var(--fz-b) 45%, transparent); }
@media (max-width: 640px) {
  .tm-board { grid-template-columns: 26px 1fr; }
  .tm-board .res { grid-column: 2; justify-items: start; }
  .tm-board .pl:last-child { justify-content: flex-start; text-align: left; grid-column: 2; }
  .tm-head { grid-template-columns: 1fr; text-align: center; }
  .tm-head .side:last-child { text-align: center; }
}

/* Joylashtirish (sudrab qo‘yish) */
.tp { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .tp { grid-template-columns: 1fr; } }
.tp-pool { position: sticky; top: calc(var(--fz-header) + 12px); min-height: 120px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.tp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tp-pair { border: 1px solid var(--fz-line); border-radius: 16px; padding: 10px; display: grid; gap: 8px; background: var(--fz-surface); }
.tp-pair > small { font-weight: 800; color: var(--fz-muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.tp-spot { min-height: 46px; border: 2px dashed var(--fz-line); border-radius: 12px; padding: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; position: relative; transition: border-color .15s, background .15s; }
.tp-spot::before { content: attr(data-label); font: 800 .7rem var(--fz-mono); color: var(--fz-faint); margin-right: 2px; }
.tp-spot.is-over, .tp-pool.is-over { border-color: var(--fz-a); background: var(--fz-grad-soft); }
.tp-spot.is-play { border-style: solid; border-color: color-mix(in srgb, var(--fz-info) 50%, transparent); }
.tp-spot.is-play::after { content: "saralash"; position: absolute; right: 8px; top: -9px; font-size: .62rem; font-weight: 800; padding: 0 6px; border-radius: 99px; background: var(--fz-info); color: #fff; }
.tp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; background: var(--fz-grad-soft); border: 1px solid color-mix(in srgb, var(--fz-a) 35%, transparent);
  font: 700 .9rem var(--fz-display); cursor: grab; user-select: none; touch-action: none; }
.tp-chip.is-picked { outline: 2px solid var(--fz-a); outline-offset: 2px; }
.tp-chip.is-dragging { opacity: .4; }
.tp-chip small { font: 700 .7rem var(--fz-sans); color: var(--fz-muted); }

/* Tarkib muharriri */
.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; min-height: 40px; }
.tr-list li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: color-mix(in srgb, var(--fz-text) 4%, transparent); cursor: grab; }
.tr-list li .n { font: 800 .75rem var(--fz-mono); width: 22px; color: var(--fz-a); }
.tr-list li.is-reserve .n { color: var(--fz-muted); }
.tr-list li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tr-list li button { all: unset; cursor: pointer; color: var(--fz-muted); padding: 0 4px; }
.tr-list li button:hover { color: var(--fz-bad); }
.tr-list li.is-dragging { opacity: .4; }
.tr-pool { max-height: 220px; overflow: auto; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; border-top: 1px dashed var(--fz-line); }
.tr-pool button { font-size: .8rem; }
.tg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.tg-grid label { display: flex; gap: 6px; align-items: center; padding: 8px 10px; border: 1px solid var(--fz-line); border-radius: 10px; font-weight: 700; cursor: pointer; }
.tg-grid input:checked + span { color: var(--fz-a); }

/* Jamoa kaliti bilan qo‘shilish */
.tj__row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0; }
.tj__row b { display: block; font: 800 1.05rem var(--fz-display); letter-spacing: -.02em; }
.tj__icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--fz-grad); color: #fff; font-size: 1.1rem; flex: none; }
.tj__code { width: 150px; text-align: center; font: 800 1.15rem var(--fz-mono); letter-spacing: .2em; text-transform: uppercase; }
.tk { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 10px; border-radius: 12px; background: var(--fz-grad-soft); }
.tk code { font: 800 1.1rem var(--fz-mono); letter-spacing: .15em; flex: 1; }

/* Joylashtirish yo‘riqnomasi va hisoblagich */
.tp-guide { margin-bottom: 14px; display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; align-items: start; }
@media (max-width: 760px) { .tp-guide { grid-template-columns: 1fr; } }
.tp-guide__text ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: .88rem; color: var(--fz-muted); }
.tp-tag { font-size: .68rem; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: var(--fz-info); color: #fff; }
.tp-stats { display: flex; gap: 8px; }
.tp-stats > div { min-width: 86px; padding: 8px 10px; border: 1px solid var(--fz-line); border-radius: 12px; text-align: center; display: grid; }
.tp-stats b { font: 800 1.3rem var(--fz-mono); }
.tp-stats small { font-size: .7rem; color: var(--fz-muted); }
.tp-stats > div.is-ok { border-color: color-mix(in srgb, var(--fz-ok, #16a34a) 55%, transparent); }
.tp-stats > div.is-warn { border-color: color-mix(in srgb, var(--fz-warn, #f59e0b) 65%, transparent); }
.tp-guide__status { grid-column: 1 / -1; margin: 0; font-size: .86rem; font-weight: 700; }
.tp-guide__status.is-ok { color: var(--fz-ok, #16a34a); }
.tp-guide__status.is-warn { color: var(--fz-warn, #b45309); }
