/* Ustozona-Games — yagona Poyga sahnasi.
 *
 * Piyoda va mashina faqat ko'rinish: jamoa navbati, hisob, test va
 * telemetriya bitta dvigatelda ishlaydi. Har to'g'ri javob +10 ball.
 */
/* Poyganing o'zi oltin/sariq brendlangan edi — saytning umumiy
   rang tizimida bunday urg'u rangi yo'q — poygada jamoa ko'ki ishlatiladi.
   O'zgaruvchi NOMLARI saqlab qolindi (butun faylda ishlatiladi), lekin
   QIYMATLARI endi --ll-* tokenlariga ishora qiladi — shu bitta joy
   o'zgarsa, sahifaning hamma joyidagi "oltin" birdek havorangga aylanadi. */
:root {
  /* Poyganing urg'u rangi — JAMOA KO'KI. Umumiy `--ll-acc` iliq
     neytralga (#6E6558) o'tgach butun o'yin xira jigarrang bo'lib
     qolgandi: sinf doskasidagi o'yin uchun bu o'lik ko'rinadi.
     `--ll-team1` esa allaqachon o'yin ichida ishlatiladi (1-mashina,
     1-panel), shuning uchun begona rang emas. */
  --race-gold: var(--ll-team1);
  --race-gold-strong: #1D4ED8;
  --race-gold-soft: var(--ll-team1-soft);
  --race-cream: var(--ll-surface);
  --race-line: var(--ll-line);
  --race-blue: #3b8fd8;
  --race-green: #68ad3f;
  --race-orange: #ef8a32;
  --race-purple: #8b67d2;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ll-bg);
}

body.race-page {
  margin: 0;
  min-height: 100vh;
  color: var(--ll-ink);
  background: var(--ll-bg-grad);
  background-attachment: fixed;
  font-family: var(--ll-font);
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.race-shell {
  width: min(1500px, calc(100% - 20px));
  margin: 10px auto;
  padding: 16px;
  border: 1px solid var(--ll-line);
  border-radius: 30px;
  background: var(--ll-surface);
  box-shadow: var(--ll-sh-lg);
  backdrop-filter: blur(18px);
}

.race-header {
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr);
  align-items: center;
  gap: 14px;
  padding: 0 8px 9px;
}

.race-brand,
.race-back {
  color: var(--ll-ink);
  text-decoration: none;
}

.race-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.45px;
}

.race-brand img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: contain;
}

.race-title {
  text-align: center;
  line-height: 1;
}

/* Ixcham sarlavha — endi shoxsimon bezaksiz, kichikroq */
.race-title h1 {
  margin: 0;
  font-size: clamp(17px, 1.6vw, 22px);
  font-weight: 700;
  letter-spacing: -.5px;
}

.race-subtitle {
  display: block;
  width: max-content;
  margin: 3px auto 0;
  padding: 3px 13px 4px;
  border: 1px solid #BFDBFE;
  border-radius: 999px;
  color: #1D4ED8;
  background: var(--ll-team1-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.race-subtitle:empty {
  display: none;
}

.race-header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.icon-btn,
.race-back {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--ll-line);
  border-radius: 13px;
  color: var(--ll-ink2);
  background: var(--ll-surface);
  box-shadow: var(--ll-sh-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.icon-btn svg,
.race-back svg,
.coach-heading svg,
.team-symbol svg,
.action-button svg,
.mode-card svg,
.setup-kicker svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover,
.race-back:hover {
  border-color: #BFDBFE;
  background: var(--ll-team1-soft);
}

.setup-screen {
  max-width: 1030px;
  margin: 8px auto 18px;
  padding: clamp(20px, 4vw, 38px);
  border: 1px solid var(--ll-line);
  border-radius: 25px;
  background: var(--ll-surface);
  box-shadow: var(--ll-sh);
  overflow: hidden;
  position: relative;
}

/* Fon rasmi olib tashlangach, bu overlay endi kerak emas. */

.setup-content {
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════════
   QADAM-BAQADAM SOZLASH (wizard) — bitta qarashda hammasi ko'rinib,
   qo'rqitib yubormasin uchun. 4 qadam: format → ishtirokchilar →
   sharoit → mavzu. Har safar FAQAT bittasi ochiq; tugallanganlari
   bitta qatorli xulosa bilan yig'ilib qoladi, bosilsa qayta ochiladi.
   Bu FAQAT ko'rinish qatlami — pastidagi maydonlar/ID'lar o'zgarmadi,
   race-competition.js ularni xuddi avvalgidek o'qiydi. ═══════════════════════ */
.wiz-track {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 4px 0 20px;
}

.wiz-track li {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--ll-line);
  color: transparent;
  overflow: hidden;
  transition: background .25s ease;
}

.wiz-track li[data-done] { background: var(--ll-team1); }

.wiz-step {
  border: 1px solid var(--ll-line);
  border-radius: 17px;
  background: var(--ll-surface);
  margin-bottom: 12px;
  overflow: hidden;
  animation: wizIn .35s ease both;
}

@keyframes wizIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.wiz-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 18px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.wiz-num {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #1D4ED8;
  background: var(--ll-team1-soft);
  font-weight: 700;
  font-size: 13px;
  transition: background .2s, color .2s;
}

.wiz-step[data-wiz-done] .wiz-num {
  background: var(--ll-team1);
  color: #fff;
}

.wiz-head-text { flex: 1; min-width: 0; }
.wiz-head-text b { display: block; color: var(--ll-ink); font-size: 14.5px; }
.wiz-head-text small { display: block; margin-top: 2px; color: var(--ll-ink3); font-size: 11.5px; }

.wiz-chev {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--ll-ink3);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(90deg);
  transition: transform .2s ease;
}

.wiz-step[data-wiz-open] .wiz-chev { transform: rotate(-90deg); }

/* max-height collapse — .wiz-body ko'p bolali (format, kartalar,
   "Davom etish" tugmasi hammasi bevosita ichida), shuning uchun
   grid-template-rows:0fr/1fr trikidan ko'ra oddiy max-height
   ishonchliroq: ko'p bolali konteynerda ham bir xilda ishlaydi. */
.wiz-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
  display: grid;
  gap: 14px;
  padding: 0 18px;
}

.wiz-step[data-wiz-open] .wiz-body {
  max-height: 2600px;   /* Olimpiada paneli eng uzuni — shunga sig'adi */
  padding-top: 2px;
  padding-bottom: 18px;
}

.wiz-next {
  justify-self: start;
  border: 0;
  border-radius: 12px;
  padding: 11px 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  background: var(--ll-team1);
  font-family: inherit;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
}

.wiz-next svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wiz-next:active { transform: scale(.98); }



.setup-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #1D4ED8;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.setup-screen h2 {
  margin: 10px 0 5px;
  font-size: clamp(24px, 4vw, 37px);
  line-height: 1.15;
  letter-spacing: -.8px;
}

.setup-lead {
  max-width: 690px;
  margin: 0 0 23px;
  color: var(--ll-ink2);
  font-size: 15px;
  line-height: 1.65;
}

.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.setup-card {
  padding: 16px;
  border: 1px solid var(--ll-line);
  border-radius: 17px;
  background: var(--ll-surface);
}

.setup-card.full {
  grid-column: 1 / -1;
}

/* Format bilan yonma-yon turadigan ixcham karta — ichki bo'sh joy
   kamaytirilgan, sarlavha (h3) esa umuman yo'q, label o'rniga ishlaydi. */
.setup-card.compact {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.setup-card.compact .setup-field { gap: 3px; }
.setup-card.compact .field-hint { margin-top: 4px; }

/* Sinf avtomatik tanlangach karta ko'zga yorqinroq tashlansin — ustoz
   "tanlanmagan" deb qo'lda urinib o'tirmasin, allaqachon tayyorligini
   darrov ko'rsin. */
.setup-card.class-picked {
  border-color: #BFDBFE;
  background: var(--ll-team1-soft);
}

.setup-card.class-picked h3,
.setup-card.class-picked .setup-field label {
  color: #1D4ED8;
}

.setup-card h3 {
  margin: 0 0 11px;
  color: var(--ll-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .25px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.segmented button {
  min-height: 43px;
  border: 1.5px solid var(--ll-line);
  border-radius: 12px;
  color: var(--ll-ink2);
  background: var(--ll-surface);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.segmented button[aria-pressed="true"] {
  border-color: var(--ll-team1);
  color: #1D4ED8;
  background: var(--ll-team1-soft);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}

.field-hint {
  margin: 8px 2px 11px;
  color: var(--ll-ink3);
  font-size: 10.5px;
  line-height: 1.45;
}

.variant-rule {
  margin: 10px 0;
  padding: 9px 11px;
  border-left: 4px solid var(--ll-team1);
  border-radius: 8px 11px 11px 8px;
  color: #1D4ED8;
  background: var(--ll-team1-soft);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
}

.setup-field {
  display: grid;
  gap: 7px;
}

.setup-field + .setup-field {
  margin-top: 11px;
}

.setup-field label {
  color: var(--ll-ink3);
  font-size: 11px;
  font-weight: 600;
}

.setup-field select,
.team-name-input {
  width: 100%;
  min-height: 43px;
  padding: 9px 11px;
  border: 1.5px solid var(--ll-line);
  border-radius: 12px;
  color: var(--ll-ink);
  background: var(--ll-surface);
  outline: none;
}

.setup-field select:focus,
.team-name-input:focus {
  border-color: var(--ll-team1);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}

.mode-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.mode-card {
  min-height: 93px;
  display: grid;
  grid-template-columns: 37px 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1.5px solid var(--ll-line);
  border-radius: 14px;
  color: var(--ll-ink2);
  background: var(--ll-surface);
  text-align: left;
  cursor: pointer;
}

.mode-card > span:first-child {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #1D4ED8;
  background: var(--ll-team1-soft);
}

.mode-card b,
.mode-card small {
  display: block;
}

.mode-card b {
  color: var(--ll-ink);
  font-size: 13px;
}

.mode-card small {
  margin-top: 3px;
  font-size: 10.5px;
  line-height: 1.4;
}

.mode-card[aria-pressed="true"] {
  border-color: var(--ll-team1);
  background: var(--ll-team1-soft);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}

.team-name-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.team-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-color {
  width: 12px;
  height: 31px;
  flex: 0 0 12px;
  border-radius: 999px;
  background: var(--team-color);
}

.quiz-source {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--ll-line);
  border-radius: 12px;
  color: var(--ll-ink2);
  background: var(--ll-surface2);
  font-size: 12px;
  font-weight: 600;
}

.quiz-source .source-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--ll-team1);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .18);
}

.setup-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.primary-button,
.secondary-button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  border: 0;
  color: #fff;
  background: var(--ll-team1);
  box-shadow: 0 8px 20px rgba(37, 99, 235, .3);
}

/* Ikonka chiziqli chizilishi kerak. `fill: none` berilmagani uchun
   "Poygani boshlash" tugmasidagi ▶ belgisi to'ldirilgan QORA DOIRA
   bo'lib chiqardi — sozlash ekranidagi eng ko'zga tashlanadigan
   tugma edi. */
.primary-button svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.secondary-button {
  border: 1px solid var(--ll-line);
  color: var(--ll-ink2);
  background: var(--ll-surface);
  text-decoration: none;
}

.primary-button:active,
.secondary-button:active {
  transform: scale(.98);
}

/* ═══ Format + Sinf — yonma-yon, ixcham ═══
   Faqat 2 format (1×1, Olimpiada) va bitta "Sinf" tanlovi qoldi —
   ikkalasi ham qisqa, shuning uchun bitta qatorga sig'adi va sahifada
   bo'sh joy qolmaydi. */
.setup-top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 10px;
  margin: 0 0 14px;
}

.competition-format {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 5px;
  border: 1px solid var(--ll-line);
  border-radius: 16px;
  background: var(--ll-surface2);
}

.competition-format button {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  color: var(--ll-ink2);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.competition-format button > span {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--ll-team1-soft);
  color: #1D4ED8;
}

.competition-format button > span svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.competition-format button b {
  color: var(--ll-ink);
  font-size: 12.5px;
}

.competition-format button[aria-pressed="true"] {
  border-color: var(--ll-team1);
  color: #1D4ED8;
  background: var(--ll-team1-soft);
  box-shadow: 0 7px 18px rgba(3, 105, 161, .12);
}

.competition-format button[aria-pressed="true"] > span {
  background: var(--ll-surface);
  box-shadow: 0 4px 12px rgba(3, 105, 161, .14);
}

.answer-method-field {
  margin-top: 12px;
}

.answer-method-field .segmented,
.segmented.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.segmented.compact button {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 11.5px;
}

.roster-panel,
.tournament-panel {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--ll-line);
  border-radius: 20px;
  background: var(--ll-surface2);
}

.panel-heading-row,
.tournament-toolbar,
.bracket-heading,
.match-length-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-heading-row h3,
.tournament-toolbar h3,
.panel-heading-row h4,
.bracket-heading h4 {
  margin: 3px 0 0;
  color: var(--ll-ink);
  font-size: 17px;
}

.eyebrow {
  color: #1D4ED8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.assignment-summary {
  margin: 12px 0 9px;
  padding: 9px 12px;
  border-radius: 11px;
  color: #1D4ED8;
  background: var(--ll-team1-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.student-assignment-grid,
.participant-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 330px;
  overflow: auto;
  padding: 2px;
}

.student-assignment-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 125px;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid #ebe4d0;
  border-radius: 11px;
  background: #fff;
}

.student-assignment-row > span {
  overflow: hidden;
  color: var(--ll-ink2);
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-assignment-row select {
  min-width: 0;
  height: 34px;
  border: 1px solid #ded6bd;
  border-radius: 9px;
  background: #fffdf8;
  font-size: 10.5px;
}

.inline-action {
  min-height: 40px;
  margin-top: 10px;
  padding: 8px 14px;
  font-size: 11px;
}

.duel-pickers {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px minmax(0, 1fr);
  align-items: end;
  gap: 14px;
  margin: 18px 0;
}

.duel-pickers label {
  display: grid;
  gap: 7px;
  color: var(--ll-ink3);
  font-size: 11px;
  font-weight: 600;
}

.duel-pickers select {
  width: 100%;
  min-height: 50px;
  padding: 10px 12px;
  border: 1.5px solid #dfd4b4;
  border-radius: 13px;
  color: var(--ll-ink);
  background: #fff;
  font-weight: 600;
}

.duel-versus {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #8d1439;
  box-shadow: 0 8px 18px rgba(104, 0, 34, .2);
  font-size: 13px;
  font-weight: 950;
}

.fair-chip,
.bracket-legend {
  padding: 7px 10px;
  border: 1px solid var(--ll-line);
  border-radius: 999px;
  color: #1D4ED8;
  background: var(--ll-team1-soft);
  font-size: 10.5px;
  font-weight: 600;
}

.match-length-row {
  padding-top: 13px;
  border-top: 1px solid #eee5cd;
  color: var(--ll-ink2);
  font-size: 12px;
  font-weight: 600;
}

.match-length-input {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
}

.match-length-input input[type="number"] {
  width: 64px;
  min-height: 38px;
  padding: 6px 8px;
  border: 1.5px solid var(--ll-line);
  border-radius: 10px;
  color: var(--ll-ink);
  background: var(--ll-surface);
  text-align: center;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  outline: none;
}

.match-length-input input[type="number"]:focus {
  border-color: var(--ll-team1);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}

.tournament-toolbar-actions {
  display: flex;
  gap: 8px;
}

.tournament-toolbar-actions .secondary-button {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 10.5px;
}

.tournament-match-length {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 13px;
  padding: 11px 13px;
  border: 1px solid var(--ll-line);
  border-radius: 13px;
  background: var(--ll-team1-soft);
}

.tournament-match-length > span b,
.tournament-match-length > span small {
  display: block;
}

.tournament-match-length > span b {
  color: #5e4814;
  font-size: 11.5px;
}

.tournament-match-length > span small {
  margin-top: 2px;
  color: #8a7542;
  font-size: 9.5px;
}


.tournament-setup-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
  gap: 16px;
  margin-top: 15px;
}

.tournament-setup-columns > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid #eee5cd;
  border-radius: 15px;
  background: #fffdf8;
}

.tournament-setup-columns h4,
.test-plan-card h4 {
  margin: 0;
  color: var(--ll-ink);
  font-size: 13px;
}

.participant-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 280px;
}

.participant-check {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid #ece4d0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.participant-check input {
  width: 17px;
  height: 17px;
  accent-color: #9d1842;
}

.participant-check span {
  overflow: hidden;
  color: var(--ll-ink2);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seed-list {
  display: grid;
  gap: 6px;
  max-height: 280px;
  margin-top: 10px;
  overflow: auto;
}

.seed-slot {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 37px;
  padding: 5px 8px;
  border: 1px solid #e7dfc8;
  border-radius: 10px;
  color: var(--ll-ink2);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.seed-slot > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #765700;
  background: #fff3bd;
  font-size: 10px;
  font-weight: 700;
}

.seed-slot b {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seed-slot.selected {
  border-color: #a61b48;
  box-shadow: 0 0 0 3px rgba(166, 27, 72, .12);
}

.test-plan-card {
  margin-top: 16px;
  padding: 15px;
  border: 1px solid #e9dfc2;
  border-radius: 16px;
  background: #fffdf7;
}

.stage-test-plan {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.stage-test-row {
  display: grid;
  grid-template-columns: minmax(130px, .65fr) minmax(180px, 1.35fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid #ece3cd;
  border-radius: 12px;
  background: #fff;
}

.stage-name b,
.stage-name small,
.chosen-test b,
.chosen-test small {
  display: block;
}

.stage-name b,
.chosen-test b {
  overflow: hidden;
  color: var(--ll-ink);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-name small,
.chosen-test small {
  margin-top: 3px;
  color: var(--ll-ink3);
  font-size: 9.5px;
}

.stage-test-button {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid #d5c58e;
  border-radius: 10px;
  color: #664d0a;
  background: #fff7d3;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}

.stage-test-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.capacity-warning {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #f2c977;
  border-radius: 11px;
  color: #704508;
  background: #fff7df;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.5;
}

.bracket-heading {
  margin: 18px 2px 9px;
}

.bracket-heading p {
  margin: 4px 0 0;
  color: var(--ll-ink3);
  font-size: 10.5px;
}

.bracket-legend {
  color: #fff2c7;
  border-color: rgba(255, 223, 137, .28);
  background: #791033;
}

.bracket-legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: #ffd15b;
}

.tournament-bracket {
  min-height: 310px;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 112px minmax(360px, 1fr);
  align-items: stretch;
  gap: 12px;
  overflow-x: auto;
  padding: 18px;
  border-radius: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 202, 74, .12), transparent 24%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.022) 0 1px, transparent 1px 14px),
    linear-gradient(145deg, #8d0635, #5f0023);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 12px 28px rgba(80, 0, 29, .18);
}

.bracket-side {
  min-width: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(82px, 1fr);
  gap: 9px;
}

.bracket-center {
  min-width: 112px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.bracket-trophy {
  display: grid;
  justify-items: center;
  gap: 2px;
  color: #ffe4a0;
  text-align: center;
}

.bracket-trophy span {
  font-size: 43px;
  filter: drop-shadow(0 7px 10px rgba(31, 0, 12, .35));
}

.bracket-trophy small {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.bracket-round {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.bracket-round h5 {
  margin: 0 0 10px;
  color: #ffe5a2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
  text-transform: uppercase;
}

.bracket-matches {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 10px;
}

.bracket-match {
  position: relative;
  padding: 5px;
  border: 1px solid rgba(255, 225, 151, .2);
  border-radius: 11px;
  background: rgba(44, 0, 18, .34);
}

.bracket-match::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  width: 23px;
  border-top: 1px solid rgba(255, 208, 96, .42);
}

.bracket-round.final .bracket-match::after {
  display: none;
}

.bracket-round.right .bracket-match::after {
  right: 100%;
  left: auto;
}

.bracket-match.current {
  border-color: #ffd15b;
  box-shadow: 0 0 0 3px rgba(255, 209, 91, .16);
}

.match-number {
  display: block;
  padding: 1px 4px 4px;
  color: rgba(255, 239, 200, .68);
  font-size: 8px;
  font-weight: 600;
}

.bracket-player {
  min-height: 27px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 5px 7px;
  border-radius: 7px;
  color: rgba(255, 255, 255, .8);
  background: rgba(255, 255, 255, .07);
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bracket-player + .bracket-player {
  margin-top: 3px;
}

.bracket-player.winner {
  color: #4a2f00;
  background: #ffd15b;
  font-weight: 700;
}

.bracket-champion {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 16px;
  border: 1px solid rgba(255, 221, 132, .38);
  border-radius: 15px;
  background: rgba(34, 0, 14, .42);
  text-align: center;
}

.bracket-champion small { color: #ffe4a0; font-size: 9px; text-transform: uppercase; }
.bracket-champion b { overflow-wrap: anywhere; font-size: 11px; }

.bracket-empty {
  min-width: 100%;
  display: grid;
  place-items: center;
  color: rgba(255, 242, 210, .78);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.test-library-dialog {
  width: min(680px, calc(100% - 24px));
  max-height: 86vh;
  padding: 0;
  border: 0;
  border-radius: 21px;
  background: #fffdf8;
  box-shadow: 0 30px 90px rgba(31, 20, 0, .3);
}

.test-library-dialog::backdrop {
  background: rgba(35, 24, 5, .58);
  backdrop-filter: blur(5px);
}

.test-library-shell { padding: 18px; }

.dialog-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 11px;
  color: var(--ll-ink2);
  background: #f2eddf;
  font-size: 22px;
  cursor: pointer;
}

.test-library-search {
  width: 100%;
  min-height: 45px;
  margin: 15px 0 10px;
  padding: 10px 13px;
  border: 1.5px solid var(--ll-line);
  border-radius: 12px;
  outline: none;
}

.test-library-search:focus {
  border-color: var(--ll-team1);
  box-shadow: 0 0 0 3px rgba(217, 165, 20, .14);
}

.test-library-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 55vh;
  overflow: auto;
}

.test-library-item {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px;
  border: 1px solid #e9e1ce;
  border-radius: 12px;
  color: var(--ll-ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.test-library-item span { min-width: 0; }
.test-library-item b,
.test-library-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.test-library-item b { font-size: 11.5px; }
.test-library-item small { margin-top: 4px; color: var(--ll-ink3); font-size: 9.5px; }
.test-library-item strong { color: #745700; font-size: 10px; }

.qr-race-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  margin-top: 12px;
  padding: 11px;
  border: 1px solid var(--ll-line);
  border-radius: 13px;
  background: var(--ll-team1-soft);
}

.qr-race-control > div { min-width: 0; }
.qr-race-control b,
.qr-race-control span { display: block; }
.qr-race-control b { color: #5e4610; font-size: 11px; }
.qr-race-control span { margin-top: 2px; color: #88713c; font-size: 9px; }
.qr-race-control a { align-self: center; color: #765500; font-size: 10px; font-weight: 700; }
.qr-race-control > #qrScanCount { grid-column: 1 / -1; margin: 0; font-weight: 600; }
.qr-race-control.connected { border-color: #9bc77e; background: #f3fde9; }

#rosterStatus.is-error { color: #a61b48; font-weight: 600; }

@media (max-width: 900px) {
  .student-assignment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tournament-setup-columns { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .setup-top-row { grid-template-columns: 1fr; }
  .competition-format button { min-height: 46px; }
  .setup-grid { grid-template-columns: 1fr; }
  .panel-heading-row,
  .tournament-toolbar,
  .bracket-heading,
  .match-length-row { align-items: stretch; flex-direction: column; }
  .student-assignment-grid,
  .participant-grid { grid-template-columns: 1fr; }
  .duel-pickers { grid-template-columns: 1fr; }
  .duel-versus { margin: -4px auto; }
  .match-length-row .segmented { width: 100%; }
  .tournament-toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .tournament-match-length { align-items: stretch; flex-direction: column; }
  .tournament-match-length .segmented { width: 100%; }
  .stage-test-row { grid-template-columns: 1fr auto; }
  .stage-test-row .chosen-test { grid-column: 1 / -1; grid-row: 2; }
  .test-library-list { grid-template-columns: 1fr; }
  .tournament-bracket { min-height: 270px; padding: 13px; }
  .tournament-bracket { grid-template-columns: 380px 105px 380px; }
  .bracket-side { grid-auto-columns: minmax(86px, 1fr); }
}

/* O'qituvchi boshqaruv paneli (.coach-panel) olib tashlandi — Jamoaviy
   (navbat bilan) format bilan birga kerak bo'lmay qoldi. Endi bitta
   ustun: sahna, keyin savol/duo kartalari. */
.play-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.race-card,
.question-card,
.duo-cards {
  border: 1px solid rgba(218, 198, 140, .72);
  border-radius: 22px;
  background: rgba(255, 255, 255, .91);
  box-shadow: 0 10px 26px rgba(67, 51, 16, .08);
}

/* ═══ 1×1 / Olimpiada match — ikkala ishtirokchi BIR VAQTDA javob beradi ═══
   Navbat yo'q: har biri o'z panelidan, o'z savoliga, xohlagan tezlikda
   bosadi — arqon tortishning 2-jamoa rejimidagi yondashuv bilan bir xil,
   lekin natija poyga yo'lakchasiga (ustidagi #lanes) yoziladi. */
/* Panellar ekranning IKKI CHETIGA suriladi, o'rtada katta bo'sh joy
   qoladi — smartboard oldida turgan ikki o'quvchi bir-biriga
   yaqinlashib qolmasin, yetarli masofada tursin. */
.duo-cards {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.duo-card {
  flex: 0 1 420px;
  min-width: 0;
  padding: 14px;
  border-radius: 16px;
  background: var(--ll-surface);
  box-shadow: var(--ll-sh-sm);
}

/* Ism + ball — bal shu yerda, sahna ustida hisoblanadi (mashina ustida
   emas). Ixcham: bitta qatorda, ball urg'u rangida ajralib turadi. */
.duo-card-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--ll-ink3);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.duo-card-name .duo-score {
  padding: 1px 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
}

#duoCardA .duo-card-name { color: var(--ll-team1); }
#duoCardB .duo-card-name { color: var(--ll-team2); }
#duoCardA .duo-score { background: var(--ll-team1); }
#duoCardB .duo-score { background: var(--ll-team2); }

.duo-question {
  min-height: 46px;
  margin: 0 0 10px;
  padding: 12px 13px;
  border-radius: 13px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

#duoCardA .duo-question { background: linear-gradient(135deg, #3B82F6, var(--ll-team1)); }
#duoCardB .duo-question { background: linear-gradient(135deg, #EF4444, var(--ll-team2)); }

.duo-answers {
  display: grid;
  gap: 8px;
}

.duo-answer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border: 1.5px solid var(--ll-line);
  border-radius: 12px;
  color: var(--ll-ink);
  background: var(--ll-surface);
  font-family: inherit;
  font-weight: 700;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: transform .1s, border-color .12s;
}

.duo-answer:active { transform: scale(.97); }
.duo-answer b { flex-shrink: 0; }
#duoCardA .duo-answer b { color: var(--ll-team1); }
#duoCardB .duo-answer b { color: var(--ll-team2); }

.duo-answer.good { background: var(--ll-ok-soft); border-color: var(--ll-ok); }
.duo-answer.bad { background: var(--ll-err-soft); border-color: var(--ll-err); animation: optShakeRace .3s; }

@keyframes optShakeRace {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@media (max-width: 720px) {
  .duo-cards { flex-direction: column; }
  .duo-card { flex-basis: auto; }
}

.race-card {
  padding: 8px;
  overflow: hidden;
}

/* Sahna VERTIKAL uzun — smartboardda o'quvchilar yon-yonma turib
   bosganda yo'laklar orasida yetarli masofa bo'lsin, bir-biriga
   tiqilib qolmasin. 16:9 (kenglashgan) o'rniga ekran balandligining
   katta qismini oladigan nisbatga o'tildi. */
.race-scene {
  position: relative;
  width: 100%;
  aspect-ratio: auto;
  height: min(78vh, 860px);
  min-height: 460px;
  overflow: hidden;
  border-radius: 17px;
  background:
    linear-gradient(rgba(255, 255, 255, .03), rgba(255, 255, 255, .03)),
    url("assets/piyoda-poyga/race-track.webp") center / cover no-repeat;
}

.lane {
  --lane-top: 31.5%;
  --team-color: var(--race-blue);
  position: absolute;
  top: var(--lane-top);
  left: 0;
  right: 7.5%;
  height: 15%;
}

.lane[data-team="1"] {
  --lane-top: 31.5%;
  --team-color: var(--ll-team1);
}

.lane[data-team="2"] {
  --lane-top: 45.5%;
  --team-color: var(--ll-team2);
}

/* Mashina rasm fayli hamon YASHIL (car-green.webp — yangi qizil asset
   yo'q), shuning uchun CSS filtr bilan qizilga siljitiladi. Qiymatlar
   brauzerda o'lchab tanlangan: `hue-rotate` CSS'da haqiqiy HSL burilishi
   emas, matritsa yaqinlashuvi — shuning uchun "yashil→qizil" uchun
   nazariy -120deg emas, -105deg to'g'ri keladi (-135deg pushti berardi). */
.lane[data-team="2"] .racer {
  filter: hue-rotate(-105deg) saturate(2) brightness(.95)
    drop-shadow(0 8px 5px rgba(28, 26, 18, .24));
}

.lane[data-team="3"] {
  --lane-top: 61.7%;
  --team-color: var(--race-orange);
}

.lane[data-team="4"] {
  --lane-top: 81.7%;
  --team-color: var(--race-purple);
}

.race-scene[data-team-count="2"] .lane[data-team="1"] {
  --lane-top: 42%;
}

.race-scene[data-team-count="2"] .lane[data-team="2"] {
  --lane-top: 69%;
}

.race-scene[data-team-count="3"] .lane[data-team="1"] {
  --lane-top: 36%;
}

.race-scene[data-team-count="3"] .lane[data-team="2"] {
  --lane-top: 56%;
}

.race-scene[data-team-count="3"] .lane[data-team="3"] {
  --lane-top: 77%;
}

/* Ism — kichik, mashinaning TEPASIDA. Racer bilan bir xil --track-x'ga
   ulanadi, shuning uchun mashina bilan birga siljiydi. Ball bu yerda
   YO'Q — duo panel sarlavhasida, sahna ustida ko'rsatiladi. */
.lane-label {
  --track-x: 3%;
  --mobile-track-x: 6%;
  position: absolute;
  left: var(--track-x);
  top: 18%;
  z-index: 4;
  max-width: 140px;
  padding: 3px 11px;
  border-radius: 999px;
  color: #fff;
  background: color-mix(in srgb, var(--team-color), #082032 8%);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .16);
  transform: translateX(-8%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 600;
  transition: left .62s cubic-bezier(.2, .8, .3, 1.12);
}

.racer {
  --progress: 0%;
  --track-x: 3%;
  --mobile-track-x: 6%;
  position: absolute;
  left: var(--track-x);
  top: 58%;
  z-index: 3;
  width: clamp(64px, 7.4vw, 112px);
  height: clamp(64px, 7.4vw, 112px);
  object-fit: contain;
  transform: translate(-35%, -50%);
  filter: drop-shadow(0 8px 5px rgba(28, 26, 18, .24));
  transition: left .62s cubic-bezier(.2, .8, .3, 1.12), transform .3s ease;
  will-change: left, transform;
}

/* To'g'ri javob — oldinga yengil siltanish (surge). Xato — orqaga
   qisqa tisarilish (recoil). Ikkalasi ham FAQAT transform bilan —
   vertikal "sakrash" yo'q, chigirtkaga o'xshamaydi. Haqiqiy siljish
   `left` transitiondan keladi (yuqorida), bu esa shunga ustiga
   qo'shiladigan qisqa "zarba" hissi. */
.racer.correct-bump {
  animation: racer-surge .45s cubic-bezier(.2, .8, .3, 1.1);
}

@keyframes racer-surge {
  0% { transform: translate(-35%, -50%) scale(1); }
  35% { transform: translate(-28%, -50%) scale(1.08) rotate(2deg); }
  100% { transform: translate(-35%, -50%) scale(1); }
}

.racer.wrong-bump {
  animation: racer-recoil .5s cubic-bezier(.3, .1, .3, 1);
}

@keyframes racer-recoil {
  0% { transform: translate(-35%, -50%) scale(1); }
  30% { transform: translate(-42%, -50%) scale(.96) rotate(-2deg); }
  100% { transform: translate(-35%, -50%) scale(1); }
}

.scene-status {
  position: absolute;
  top: 10px;
  right: 10px;
  /* Pauza qoplamasidan (z-index: 30) YUQORIDA — aks holda pauzadan
     chiqish tugmasiga yetib bo'lmaydi. */
  z-index: 31;
  display: flex;
  align-items: center;
  gap: 7px;
}

.scene-chip {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 999px;
  color: #624a12;
  background: rgba(255, 252, 238, .88);
  box-shadow: 0 3px 10px rgba(63, 44, 6, .1);
  backdrop-filter: blur(6px);
  font-size: 10px;
  font-weight: 700;
}

.scene-chip.edge {
  display: none;
}

.race-page.edge-mode .scene-chip.edge {
  display: block;
}

.race-page.edge-mode .race-scene {
  background-image:
    linear-gradient(rgba(255, 255, 255, .09), rgba(255, 255, 255, .09)),
    url("assets/piyoda-poyga/race-track.webp");
}

.team-board {
  display: grid;
  gap: 7px;
}

.team-row {
  --team-color: var(--race-blue);
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 63px;
  padding: 8px 10px;
  border: 1.5px solid #e9e5d8;
  border-radius: 13px;
  color: var(--ll-ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}

.team-row:hover {
  transform: translateY(-1px);
}

.team-row[aria-disabled="true"] {
  cursor: default;
}

.team-row[aria-disabled="true"]:hover {
  transform: none;
}

.team-row[aria-pressed="true"] {
  border-color: var(--team-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--team-color), transparent 84%);
}

.team-row.answered {
  background: #fbfcf8;
}

.team-row.correct {
  border-color: var(--ll-ok);
}

.team-row.wrong {
  border-color: var(--ll-err);
}

.team-avatar {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--team-color);
}

.team-avatar svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.team-info {
  min-width: 0;
}

.team-info b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.team-progress {
  height: 7px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #ecebe7;
}

.team-progress > span {
  display: block;
  width: var(--progress);
  height: 100%;
  border-radius: inherit;
  background: var(--team-color);
  transition: width .5s ease;
}

.team-score {
  min-width: 31px;
  color: #1d2130;
  font-size: 20px;
  font-weight: 950;
  text-align: right;
}

/* Sahna ustidagi ixcham vaqt ko'rsatkichi va pauza tugmasi — o'qituvchi
   boshqaruv paneli (Jamoaviy format bilan) olib tashlangach, shu ikkitasi
   kerakli qolgan yagona narsa edi. Alohida oyna emas, .scene-status
   qatoridagi kichik chip/tugma. */
.scene-timer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--ll-ink2);
  background: rgba(255, 255, 255, .75);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 600;
}

.scene-timer svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.scene-pause {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--ll-ink2);
  background: rgba(255, 255, 255, .75);
  cursor: pointer;
}

.scene-pause svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  stroke: none;
}

.action-button {
  min-height: 49px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.action-button.primary {
  color: #3f2f00;
  background: linear-gradient(135deg, #ffd34f, #f3b51b);
  box-shadow: 0 8px 19px rgba(210, 150, 0, .23);
}

.action-button.secondary {
  border: 1px solid #e3dbc1;
  color: #67552c;
  background: #fff;
}

.question-card {
  min-height: 218px;
  padding: 17px 21px 19px;
}

.question-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.question-count {
  color: #876000;
  font-size: 13px;
  font-weight: 700;
}

.answering-team {
  max-width: 60%;
  overflow: hidden;
  padding: 5px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--active-team, var(--race-blue));
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
}

.question-text {
  min-height: 61px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 2px 10px 13px;
  color: #171b28;
  font-size: clamp(23px, 3.1vw, 42px);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.answer-button {
  min-height: 72px;
  display: grid;
  grid-template-columns: 29px 1fr;
  align-items: center;
  gap: 7px;
  padding: 10px;
  border: 1.5px solid #ded9c9;
  border-radius: 13px;
  color: #181b25;
  background: #fff;
  cursor: pointer;
  transition: transform .1s, border-color .15s, background .15s;
}

.answer-button:hover {
  border-color: #ddb634;
  background: #fffdf5;
}

.answer-button:active {
  transform: scale(.98);
}

.answer-letter {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #6b4e00;
  background: var(--race-gold-soft);
  font-size: 12px;
  font-weight: 950;
}

.answer-text {
  overflow-wrap: anywhere;
  font-size: clamp(13px, 1.25vw, 18px);
  font-weight: 600;
  line-height: 1.25;
}

.answer-button.good {
  border-color: var(--ll-ok);
  color: #14532d;
  background: var(--ll-ok-soft);
}

.answer-button.good .answer-letter {
  color: #fff;
  background: var(--ll-ok);
}

.answer-button.bad {
  border-color: var(--ll-err);
  color: #7f1d1d;
  background: var(--ll-err-soft);
}

.answer-button.bad .answer-letter {
  color: #fff;
  background: var(--ll-err);
}

.pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  background: rgba(255, 252, 240, .77);
  backdrop-filter: blur(8px);
  /* Qoplama FAQAT ko'rinish uchun. Bosishni ushlab qolmasligi shart:
     pauza tugmasi endi sahna ICHIDA (.scene-status) va qoplama uni
     bosib turardi — o'yinni davom ettirib bo'lmay qolgandi. */
  pointer-events: none;
}

.pause-overlay > div {
  padding: 18px 26px;
  border: 1px solid #dfd3af;
  border-radius: 17px;
  color: #5e4714;
  background: #fffdf6;
  box-shadow: 0 14px 34px rgba(62, 44, 9, .14);
  font-size: 20px;
  font-weight: 700;
}

.race-page.is-paused .pause-overlay {
  display: grid;
}

.race-result {
  width: min(530px, calc(100% - 24px));
  padding: 0;
  border: 0;
  border-radius: 24px;
  color: var(--ll-ink);
  background: #fffdf7;
  box-shadow: 0 30px 90px rgba(35, 27, 8, .3);
}

.race-result::backdrop {
  background: rgba(30, 25, 12, .52);
  backdrop-filter: blur(5px);
}

.result-body {
  padding: 29px;
  text-align: center;
}

.result-cup {
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 50%;
  color: #926700;
  background: linear-gradient(145deg, #fff6bc, #ffd54f);
  box-shadow: 0 13px 28px rgba(209, 153, 0, .25);
}

.result-cup svg {
  width: 43px;
  height: 43px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.race-result h2 {
  margin: 0;
  font-size: 27px;
  letter-spacing: -.5px;
}

.race-result p {
  margin: 8px 0 19px;
  color: var(--ll-ink2);
  line-height: 1.55;
}

.result-ranking {
  display: grid;
  gap: 7px;
  margin-bottom: 19px;
}

.result-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid #e8e1ca;
  border-radius: 12px;
  background: #fff;
  text-align: left;
}

.result-place {
  color: #866000;
  font-weight: 950;
}

.result-row b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-row span:last-child {
  color: var(--ll-ink2);
  font-size: 13px;
  font-weight: 600;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.race-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 800;
  max-width: min(520px, calc(100% - 24px));
  padding: 11px 17px;
  border-radius: 12px;
  color: #fff;
  background: #262313;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .2s, transform .2s;
  font-size: 13px;
  font-weight: 600;
}

.race-toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1100px) {
  .play-screen {
    grid-template-columns: minmax(0, 1fr) 288px;
  }

  .lane-label {
    min-width: 122px;
  }

  .answer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 850px) {
  .race-shell {
    width: min(100% - 10px, 760px);
    margin: 5px auto;
    padding: 10px;
    border-radius: 21px;
  }

  .race-header {
    grid-template-columns: 1fr auto;
    min-height: 63px;
    padding-bottom: 9px;
  }

  .race-title {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .race-brand,
  .race-header-actions {
    grid-row: 2;
  }

  .race-brand {
    font-size: 17px;
  }

  .race-brand img {
    width: 34px;
    height: 34px;
  }

  .race-title h1 {
    font-size: 27px;
  }

  .race-title h1::before,
  .race-title h1::after {
    display: none;
  }

  .race-subtitle {
    min-width: 170px;
    padding: 5px 15px;
    font-size: 13px;
  }

  .race-scene {
    min-height: 280px;
  }
}

@media (max-width: 620px) {
  .race-shell {
    background: rgba(255, 255, 255, .88);
  }

  .race-header-actions .label {
    display: none;
  }

  .icon-btn,
  .race-back {
    width: 40px;
    padding: 8px;
  }

  .setup-screen {
    padding: 18px 13px;
    border-radius: 18px;
  }

  .setup-grid {
    grid-template-columns: 1fr;
  }

  .setup-card.full {
    grid-column: auto;
  }

  .mode-options,
  .team-name-grid {
    grid-template-columns: 1fr;
  }

  .setup-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .race-card {
    padding: 5px;
    border-radius: 17px;
  }

  .race-scene {
    aspect-ratio: auto;
    min-height: 340px;
    background-position: 52% center;
  }

  .lane {
    right: 4%;
    height: 15%;
  }

  .lane[data-team="1"] { --lane-top: 31.5%; }
  .lane[data-team="2"] { --lane-top: 45.5%; }
  .lane[data-team="3"] { --lane-top: 61.7%; }
  .lane[data-team="4"] { --lane-top: 81.7%; }

  .lane-label {
    left: var(--mobile-track-x);
    max-width: 100px;
    padding: 2px 8px;
    font-size: 10px;
  }

  .racer {
    left: var(--mobile-track-x);
    width: 71px;
    height: 71px;
  }

  .scene-chip:not(.edge) {
    display: none;
  }

  .question-card {
    padding: 14px 10px;
    border-radius: 17px;
  }

  .question-text {
    min-height: 68px;
    font-size: 24px;
  }

  .answer-grid {
    gap: 7px;
  }

  .answer-button {
    min-height: 65px;
    grid-template-columns: 27px 1fr;
    padding: 8px;
  }

  .answer-text {
    font-size: 13px;
  }

  .team-board {
    grid-template-columns: 1fr;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   SINF (smartboard) QATLAMI — arqon bilan bir xil tajriba.
   Umumiy qismi style.css + eg-classroom.js da; bu yerda faqat
   poyga qobig'iga tegishlisi.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Vaqt chizig'i ──
   Raqamli taymer yaqindan o'qiladi, lekin proyektor oldidagi sinf
   uni ko'rmaydi. Arqondagidek rangli chiziq masofadan ham tushunarli:
   yashil → sariq → qizil. */
.timer-bar {
  height: 7px;
  margin-top: 8px;
  border-radius: var(--ll-r-pill);
  background: var(--ll-surface2);
  overflow: hidden;
}

.timer-bar > i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: var(--ll-r-pill);
  transform-origin: left;
  background: linear-gradient(90deg, var(--ll-ok), var(--ll-warn) 60%, var(--ll-err));
  transition: transform .25s linear;
}

/* Baholanadigan sessiyada taymer yo'q — chiziq ham yashiriladi */
.timer-bar.hidden { display: none; }

/* ── Kombo chipi ──
   Arqondagi `.streak-chip` bilan bir xil ko'rinish: ketma-ket to'g'ri
   javoblar sinfga darhol ko'rinadigan mukofot beradi. */
.question-card { position: relative; }

.streak-chip {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  background: linear-gradient(135deg, var(--ll-warn), var(--ll-err));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 14px;
  border-radius: var(--ll-r-pill);
  box-shadow: var(--ll-sh);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}

.streak-chip.show { opacity: 1; transform: translateX(-50%) scale(1.08); }

/* ── To'liq ekran ──
   FAQAT o'yin qobig'i kattalashadi. Ilgari `documentElement`
   so'ralardi — proyektorda brauzer sahifasi butunicha chiqardi.
   To'liq ekranda sozlash paneli ham, sarlavha ham kerak emas:
   sinf savolni, hisobni va poyga sahnasini ko'rishi kerak. */
.race-shell:fullscreen,
.race-shell:-webkit-full-screen {
  max-width: none;
  width: 100vw;
  height: 100vh;
  padding: 18px clamp(16px, 3vw, 54px);
  overflow-y: auto;
  background: var(--ll-bg-grad);
  background-attachment: fixed;
}

.race-shell:fullscreen .race-brand,
.race-shell:-webkit-full-screen .race-brand { display: none; }

.race-shell:fullscreen .race-back,
.race-shell:-webkit-full-screen .race-back { display: none; }

.race-shell:fullscreen .question-text,
.race-shell:-webkit-full-screen .question-text { font-size: clamp(26px, 3.2vw, 46px); }

.race-shell:fullscreen .answer-button,
.race-shell:-webkit-full-screen .answer-button { font-size: clamp(17px, 1.7vw, 26px); }

.race-shell:fullscreen .timer-value,
.race-shell:-webkit-full-screen .timer-value { font-size: 36px; }

/* Bellashuv sozlamalari paneli — sarlavhadan keyin nafas joyi.
   Panel ichini eg-match-setup.js chizadi (arqon bilan umumiy). */
#matchSettings { margin-top: 14px; }
#matchSettings .ds-sec:last-child { margin-bottom: 0; }
