/*
 * Avtoatvet — "Match markazi" dizayni.
 * Har reel jonli o'yin: hisob izoh : direkt : havola. Tablo har doim qorong'i (stadion chirog'i ostidagi tablo kabi),
 * qolgan sahifa foni va matni Telegram mavzusidan olinadi (yorug'/qorong'i o'zi moslashadi).
 */

/* ---------- 1. Ranglar va o'lchamlar ---------- */
:root {
  /* Telegram mavzusi (Mini App) yoki zaxira (sayt) */
  --ground: var(--tg-theme-secondary-bg-color, #eef1ee);
  --surface: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #ffffff));
  --ink: var(--tg-theme-text-color, #101512);
  --muted: var(--tg-theme-hint-color, #66706a);
  --action: var(--tg-theme-button-color, #13854a);
  --action-ink: var(--tg-theme-button-text-color, #ffffff);
  --link: var(--tg-theme-link-color, #13854a);
  --danger: var(--tg-theme-destructive-text-color, #d93a2f);

  /* Tablo — mavzuga bog'liq emas, doim qorong'i */
  --board: #0c1611;
  --board-2: #13211a;
  --board-seam: rgba(214, 255, 230, .09);
  --board-ink: #f3f7f4;
  --board-dim: #8fa79a;
  --live: #2ed47a;
  --live-deep: #1fa35c;
  --foul: #ff5a4f;
  --lead: #ffc23d;

  --seam: rgba(102, 112, 106, .2);          /* 1px ajratuvchi chiziqlar */
  --tint: rgba(19, 133, 74, .1);
  --danger-tint: rgba(217, 58, 47, .1);

  --font-score: "Big Shoulders", "Arial Narrow", sans-serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --gap: 16px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  :root {
    --seam: color-mix(in srgb, var(--muted) 24%, transparent);
    --tint: color-mix(in srgb, var(--action) 12%, transparent);
    --danger-tint: color-mix(in srgb, var(--danger) 12%, transparent);
  }
}
/* Saytda qorong'i rejim (Telegram ranglari bo'lmaganda) */
@media (prefers-color-scheme: dark) {
  html.web {
    --ground: #0a0f0c; --surface: #121a15; --ink: #e9efeb; --muted: #8b998f;
    --action: #2ed47a; --action-ink: #06140c; --link: #5fe39a; --danger: #ff6b61;
    --seam: rgba(139, 153, 143, .18); --tint: rgba(46, 212, 122, .12); --danger-tint: rgba(255, 107, 97, .12);
  }
  html.web .board { box-shadow: inset 0 0 0 1px var(--board-seam); }
}

/* ---------- 2. Asos va brauzer elementlari ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--ground); color: var(--ink); }
body {
  font: 15px/1.45 var(--font-ui);
  padding: 14px 16px calc(28px + env(safe-area-inset-bottom));
  overscroll-behavior-y: none;
  caret-color: var(--action);
  accent-color: var(--action);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--live); color: var(--board); }
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; border-radius: 6px; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }
a { color: var(--link); text-underline-offset: 3px; }
html { scrollbar-color: var(--seam) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--seam); border-radius: 10px; border: 3px solid var(--ground); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon { width: 20px; height: 20px; flex: none; }

.loader { display: grid; place-items: center; min-height: 60vh; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--seam); border-top-color: var(--live-deep);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 3. Sarlavha (masthead) ---------- */
.masthead { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; }
.wordmark {
  font: 800 26px/1 var(--font-score); letter-spacing: .01em; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px; margin: 0;
}
.wordmark .mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--board); color: var(--live);
  display: grid; place-items: center;
}
.wordmark .mark svg { width: 16px; height: 16px; }
.masthead .spacer { flex: 1; }
.handle {
  font-size: 13px; font-weight: 600; color: var(--muted); padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--seam);
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--seam); background: var(--surface);
  display: grid; place-items: center; color: var(--ink); transition: background .2s var(--ease);
}
.icon-btn:hover { background: var(--tint); }
.page-title { font: 800 30px/1.05 var(--font-score); text-transform: uppercase; letter-spacing: .005em; margin: 6px 0 16px; }
.webback {
  border: 0; background: transparent; color: var(--link); font-weight: 600; padding: 6px 0; margin-bottom: 4px;
  display: inline-flex; align-items: center; gap: 4px;
}
.webback svg { width: 18px; height: 18px; }

/* ---------- 3b. Instagram akkauntlar (almashtiruvchi va ruxsat belgilari) ---------- */
.accounts { display: flex; gap: 6px; overflow-x: auto; margin: -4px -16px 14px; padding: 2px 16px 4px; scrollbar-width: none; }
.accounts::-webkit-scrollbar { display: none; }
.acc {
  display: inline-flex; align-items: center; gap: 7px; flex: none; border: 1px solid var(--seam); background: var(--surface);
  color: var(--ink); border-radius: 999px; padding: 7px 12px 7px 9px; font: 650 14px/1 var(--font-ui);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.acc .ig { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--muted); }
.acc em { font: 800 14px/1 var(--font-score); font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.acc.on { background: var(--board); color: var(--board-ink); border-color: var(--board); }
.acc.on .ig { border-color: var(--live); background: var(--live); }
.acc.on em { color: var(--board-dim); }
.acc.add { color: var(--link); border-style: dashed; padding-left: 10px; }
.acc.add svg { width: 15px; height: 15px; }
.acc:not(.on):hover { background: var(--tint); }
html.web .accounts { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; flex-wrap: wrap; }

.acc-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.acc-chip {
  border: 1px solid var(--seam); background: transparent; color: var(--muted); border-radius: 8px;
  padding: 6px 10px; font: 600 13px/1 var(--font-ui); transition: background .2s var(--ease), color .2s var(--ease);
}
.acc-chip.on { background: var(--board); border-color: var(--board); color: var(--board-ink); }
.member.wrap { flex-wrap: wrap; }
.member .access { flex-basis: 100%; padding-left: 50px; }
.avatar.ig-av { background: transparent; border: 1px solid var(--seam); }
.avatar.ig-av .ig { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--live-deep); }
.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
.settings .section-head { margin-top: 20px; }

/* ---------- 4. Tablo (scoreboard) ---------- */
.board {
  /* projektor yorug'i: tepadan tushadigan xira yashil nur, pastga qarab so'nadi */
  background: radial-gradient(120% 70% at 50% -15%, rgba(46, 212, 122, .13), transparent 62%), var(--board);
  color: var(--board-ink); border-radius: var(--r-lg);
  padding: 16px 16px 14px; position: relative; overflow: hidden;
}
/* Telegram qorong'i mavzusida tablo fon bilan qo'shilib ketmasin */
html.tg-dark .board { box-shadow: 0 0 0 1px rgba(214, 255, 230, .14), 0 10px 28px rgba(0, 0, 0, .35); }
html.tg-dark .wordmark .mark, html.web .wordmark .mark { box-shadow: 0 0 0 1px var(--seam); }
.grow { flex: 1; min-width: 0; }
.board::before {             /* tablo lampalari to'ri — juda xira */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(214, 255, 230, .07) 1px, transparent 1.2px);
  background-size: 6px 6px;
}
.board > * { position: relative; }
.board-top { display: flex; align-items: center; gap: 12px; }
.crest {
  width: 46px; height: 60px; border-radius: 10px; object-fit: cover; flex: none; background: var(--board-2);
  box-shadow: 0 0 0 1px var(--board-seam);
}
.crest.blank { display: grid; place-items: center; color: var(--board-dim); }
.crest.blank svg { width: 20px; height: 20px; }
.board-name { font-weight: 650; font-size: 16px; line-height: 1.25; }
.board-sub { font-size: 12px; color: var(--board-dim); margin-top: 2px; }
.state {
  display: inline-flex; align-items: center; gap: 6px; font: 700 12px/1 var(--font-ui);
  letter-spacing: .08em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px;
}
.state i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state.live { color: var(--live); background: rgba(46, 212, 122, .12); }
.state.live i { animation: blink 1.6s steps(2, jump-none) infinite; }
.state.off { color: var(--foul); background: rgba(255, 90, 79, .12); }
@keyframes blink { 50% { opacity: .25; } }

.scoreline {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: end;
  margin: 18px 0 6px; text-align: center;
}
.score b {
  display: block; font: 800 clamp(48px, 15vw, 76px)/.85 var(--font-score); font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.score span {
  display: block; margin-top: 8px; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--board-dim);
}
.score.final b { color: var(--lead); }
.colon { font: 800 clamp(34px, 9vw, 52px)/1 var(--font-score); color: var(--board-dim); padding-bottom: 26px; }
.board-foot {
  display: flex; gap: 14px; flex-wrap: wrap; border-top: 1px solid var(--board-seam); margin-top: 12px; padding-top: 10px;
  font-size: 12px; color: var(--board-dim);
}
.board-foot b { color: var(--board-ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.board-foot .grow { flex: 1; }
.board.empty .score b { color: var(--board-dim); }
.board-cta { margin-top: 14px; }

/* ---------- 5. O'yinlar ro'yxati (fixtures) ---------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 8px;
}
.section-head h2 { font: 800 20px/1 var(--font-score); text-transform: uppercase; margin: 0; letter-spacing: .01em; }
.section-head .muted { font-size: 13px; }
.fixtures { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.fixture-head { display: none; }
.fixture {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 48px; gap: 12px; align-items: center;
  padding: 12px 14px; cursor: pointer; transition: background .2s var(--ease); position: relative;
}
.fixture + .fixture { border-top: 1px solid var(--seam); }
.fixture:hover { background: var(--tint); }
.fixture.off { color: var(--muted); }
.fixture.off .thumb { filter: grayscale(1); opacity: .6; }
.thumb { width: 40px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--seam); }
.thumb.blank { display: grid; place-items: center; color: var(--muted); }
.thumb.blank svg { width: 18px; height: 18px; }
.fx-name { font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; }
.fx-name .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--live-deep); }
.fixture.off .fx-name .dot { background: var(--foul); }
.fx-keys { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.key {
  font: 600 12px/1 var(--font-ui); padding: 4px 7px; border-radius: 6px; background: var(--tint); color: var(--link);
}
.mini-score {
  font: 800 22px/1 var(--font-score); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right;
}
.mini-score .sep { color: var(--muted); padding: 0 1px; }
.mini-score .fin { color: var(--live-deep); }
.fixture.is-lead .mini-score .fin { color: var(--lead); }   /* amber faqat yetakchi reel golida */
.mini-label { display: block; font: 600 10px/1 var(--font-ui); letter-spacing: .1em; color: var(--muted); margin-top: 4px; text-transform: uppercase; }
.lead-flag { position: absolute; left: 0; top: 12px; bottom: 12px; width: 1px; background: var(--lead); }

/* yoqish/o'chirish */
.switch { position: relative; width: 48px; height: 28px; flex: none; justify-self: end; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--seam); transition: background .25s var(--ease); }
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.12); transition: transform .3s var(--ease);
}
.switch input:checked + span { background: var(--live-deep); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--action); outline-offset: 2px; }

/* ---------- 6. Tugmalar va maydonlar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--r-md); padding: 11px 16px; font-weight: 650;
  background: var(--tint); color: var(--link); white-space: nowrap; transition: transform .15s var(--ease), filter .2s;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--action); color: var(--action-ink); }
.btn.live { background: var(--live); color: var(--board); }
.btn.block { width: 100%; }
.btn.quiet { background: transparent; color: var(--muted); border: 1px solid var(--seam); }
.btn:disabled { opacity: .5; cursor: default; }
.danger-zone { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--seam); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger-tint); width: 100%; }
.btn.danger:hover { background: var(--danger-tint); }

label.field { display: block; margin-top: 12px; }
label.field > span { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.counter { font-variant-numeric: tabular-nums; font-weight: 500; }
.counter.over { color: var(--danger); font-weight: 700; }
.input, .textarea {
  width: 100%; border: 1px solid var(--seam); background: var(--ground); border-radius: var(--r-md);
  padding: 11px 12px; outline: none; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .9; }
.input:focus, .textarea:focus { border-color: var(--action); box-shadow: 0 0 0 3px var(--tint); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
.add-row { display: flex; gap: 8px; margin-top: 10px; }
.add-row .input { flex: 1; min-width: 0; }

/* ---------- 7. Reel tanlash ---------- */
.lead { color: var(--muted); margin: -8px 0 16px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; border-radius: var(--r-lg); overflow: hidden; }
.post { position: relative; aspect-ratio: 9 / 13; border: 0; padding: 0; background: var(--seam); overflow: hidden; }
.post img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.post:not(:disabled):hover img { transform: scale(1.04); }
.post .badge {
  position: absolute; left: 6px; bottom: 6px; display: inline-flex; gap: 4px; align-items: center;
  font: 700 12px/1 var(--font-ui); color: #fff; background: rgba(12, 22, 17, .72); padding: 4px 6px; border-radius: 6px;
}
.post .badge svg { width: 12px; height: 12px; }
.post .taken {
  position: absolute; inset: 0; background: rgba(12, 22, 17, .72); color: var(--live);
  display: grid; place-items: center; font: 800 16px/1 var(--font-score); letter-spacing: .06em; text-transform: uppercase;
}
.post:disabled { cursor: default; }
.manual { margin-top: 16px; background: var(--surface); border-radius: var(--r-lg); padding: 14px; }
.manual h3 { margin: 0; font-size: 15px; }

/* ---------- 8. Tahrirlagich ---------- */
.editor-head { display: flex; gap: 12px; align-items: center; }
.editor-head .switch { margin-left: auto; }
.head-score { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.head-score b { font: 800 28px/1 var(--font-score); font-variant-numeric: tabular-nums; }
.head-score .sep { color: var(--board-dim); font: 800 22px/1 var(--font-score); }
.head-score .fin { color: var(--lead); }
.head-score small { font-size: 10px; color: var(--board-dim); letter-spacing: .08em; text-transform: uppercase; margin-left: 4px; white-space: nowrap; }
@media (max-width: 599px) { .head-score small { display: none; } }   /* telefonda ostidagi qatorlar bosqichlarni nomlaydi */
.editor-head .crest { width: 52px; height: 68px; }
.name-input {
  width: 100%; border: 0; background: transparent; color: var(--board-ink); padding: 4px 0;
  font: 800 24px/1.1 var(--font-score); text-transform: uppercase; outline: none; border-bottom: 1px dashed var(--board-seam);
}
.name-input::placeholder { color: var(--board-dim); }
.name-input:focus { border-bottom-color: var(--live); }
.editor-head .switch span { background: rgba(214, 255, 230, .16); }
.editor-head .switch input:checked + span { background: var(--live-deep); }

/* o'yin statistikasi — chiziqlar uzunligi raqamga aniq proporsional */
.matchstats { display: grid; gap: 9px; margin-top: 16px; }
.ms-row { display: grid; grid-template-columns: 112px 1fr 40px; gap: 10px; align-items: center; font-size: 12px; color: var(--board-dim); }
.ms-row b { color: var(--board-ink); font: 800 18px/1 var(--font-score); text-align: right; font-variant-numeric: tabular-nums; }
.ms-bar { height: 6px; background: var(--board-2); border-radius: 3px; overflow: hidden; }
.ms-bar i { display: block; height: 100%; background: var(--live); border-radius: 3px; transform-origin: left; }
.ms-row.final i { background: var(--lead); }

.tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 18px 0 4px; padding: 4px;
  background: var(--surface); border-radius: var(--r-md);
}
.tabs button {
  border: 0; background: transparent; padding: 9px; border-radius: 9px; font-weight: 650; color: var(--muted);
  transition: background .2s var(--ease), color .2s;
}
.tabs button[aria-selected="true"] { background: var(--board); color: var(--board-ink); }
.editor-grid { display: block; }
.pane-chain > .section-head, .pane-preview > .section-head { display: none; }   /* telefonda tablar sarlavha vazifasini bajaradi */
.settings > div + div { margin-top: 12px; }
.pane-preview { display: none; }
.editor-grid.show-preview .pane-chain { display: none; }
.editor-grid.show-preview .pane-preview { display: block; }

/* zanjir — o'yin voqealari lentasi */
.chain { position: relative; margin-top: 12px; }
.event { position: relative; padding-left: 48px; }
.event + .event { margin-top: 10px; }
.event::before {
  content: ""; position: absolute; left: 17px; top: 40px; bottom: -12px; width: 2px; background: var(--seam);
}
.event:last-child::before { display: none; }
.minute {
  position: absolute; left: 0; top: 4px; width: 36px; height: 36px; border-radius: 10px;
  background: var(--board); color: var(--live); display: grid; place-items: center;
}
.minute svg { width: 18px; height: 18px; }
.event.final .minute { color: var(--live); }
.event-card { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.event-toggle {
  width: 100%; border: 0; background: transparent; text-align: left; padding: 12px 14px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center;
}
.event-toggle strong { font-size: 15px; }
.event-toggle .summary { grid-column: 1; font-size: 13px; color: var(--muted); }
.event-toggle .chev { grid-row: 1 / span 2; grid-column: 2; color: var(--muted); transition: transform .3s var(--ease); }
.event.open .chev { transform: rotate(180deg); }
.event-body { display: none; padding: 0 14px 14px; }
.event.open .event-body { display: block; }
.event.invalid .event-toggle .summary { color: var(--danger); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 2px; padding: 6px 4px 6px 11px; border-radius: 8px;
  background: var(--board); color: var(--board-ink); font: 700 15px/1 var(--font-ui);
}
.tag button {
  border: 0; background: transparent; color: var(--board-dim); width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center; padding: 0;
}
.tag button svg { width: 14px; height: 14px; }
.replies { display: grid; gap: 6px; }
.reply {
  display: flex; gap: 8px; align-items: center; padding: 9px 8px 9px 12px; border-radius: var(--r-md); background: var(--ground);
}
.reply span { flex: 1; min-width: 0; word-break: break-word; }
.x-btn {
  border: 0; background: transparent; color: var(--muted); width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; flex: none;
}
.x-btn:hover { background: var(--danger-tint); color: var(--danger); }
.x-btn svg { width: 16px; height: 16px; }
.hint { font-size: 13px; color: var(--muted); margin: 0 0 10px; }

/* mijoz ko'radigan suhbat */
.thread {
  background: var(--surface); border-radius: var(--r-lg); padding: 16px 14px; display: grid; gap: 10px;
}
.thread-day {
  justify-self: center; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.msg { max-width: 84%; display: grid; gap: 4px; }
.msg.them { justify-self: start; }
.msg.us { justify-self: end; }
.msg .who { font-size: 11px; color: var(--muted); padding: 0 6px; }
.msg.us .who { text-align: right; }
.bubble { border-radius: 18px; overflow: hidden; border: 1px solid var(--seam); background: var(--ground); }
.msg.them .bubble { border-bottom-left-radius: 6px; }
.msg.us .bubble { border-bottom-right-radius: 6px; }
.bubble .txt { padding: 9px 12px; white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.bubble .bbtn {
  border-top: 1px solid var(--seam); padding: 9px 12px; text-align: center; color: var(--link); font-weight: 650; font-size: 14px;
}
.comment-line { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.comment-line .av { width: 26px; height: 26px; border-radius: 50%; background: var(--seam); flex: none; }
.comment-line b { font-weight: 650; }
.reply-line { margin-left: 34px; }
.thread-note {
  justify-self: center; font-size: 12px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center;
  border: 1px dashed var(--seam); border-radius: 999px; padding: 5px 10px;
}
.thread-note svg { width: 14px; height: 14px; }

.error-box {
  color: var(--danger); background: var(--danger-tint); padding: 11px 13px; border-radius: var(--r-md);
  margin-top: 14px; font-size: 14px; display: flex; gap: 8px; align-items: flex-start;
}
.error-box svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.save-bar { margin-top: 18px; }

/* ---------- 9. Jamoa (sozlamalar) ---------- */
.panel { background: var(--surface); border-radius: var(--r-lg); padding: 4px 14px; }
.panel + .panel { margin-top: 12px; }
.panel.pad { padding: 14px; }
.panel h3 { margin: 0 0 4px; font-size: 15px; }
.member { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.member + .member { border-top: 1px solid var(--seam); }
.avatar {
  width: 38px; height: 38px; border-radius: 10px; background: var(--board); color: var(--live);
  display: grid; place-items: center; font: 800 18px/1 var(--font-score); text-transform: uppercase; flex: none;
}
.avatar.pending { background: transparent; border: 1px dashed var(--seam); color: var(--muted); }
.member .grow { flex: 1; min-width: 0; }
.member .meta { font-size: 12px; color: var(--muted); }
.role {
  font: 700 11px/1 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; padding: 5px 7px; border-radius: 6px;
  background: var(--board); color: var(--board-ink);
}

/* ---------- 10. Kirish va ruxsat yo'q ---------- */
.gate { min-height: 86vh; display: grid; place-items: center; }
.gate .board { width: 100%; max-width: 420px; padding: 28px 22px 22px; text-align: center; }
.gate .wordmark { justify-content: center; font-size: 34px; color: var(--board-ink); }
.gate .wordmark .mark { background: var(--live); color: var(--board); width: 34px; height: 34px; border-radius: 9px; }
.gate .wordmark .mark svg { width: 20px; height: 20px; }
.gate p { color: var(--board-dim); margin: 10px auto 0; max-width: 32ch; }
.gate .scoreline { margin: 22px 0 4px; }
.gate .score b { font-size: 54px; color: var(--board-dim); }
.tg-login { min-height: 48px; display: flex; justify-content: center; align-items: center; margin-top: 18px; }
.gate .note { font-size: 12px; margin-top: 16px; }
.id-plate {
  margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--board-2); border-radius: var(--r-md); padding: 10px 10px 10px 16px;
}
.id-plate b { font: 800 30px/1 var(--font-score); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.gate .error-box { text-align: left; }

.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 10; transform: translateX(-50%);
  background: var(--board); color: var(--board-ink); padding: 11px 16px; border-radius: var(--r-md); font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .25); display: inline-flex; gap: 8px; align-items: center; max-width: calc(100% - 32px);
}
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); flex: none; }

/* ---------- 11. Kompyuter (sayt) ---------- */
html.web body { max-width: 1120px; margin: 0 auto; padding: 22px 28px 56px; }
html.web .fixture { cursor: pointer; }
@media (min-width: 900px) {
  /* kompyuterda tablo butun kenglikda tepada, o'yinlar ostida */
  html.web .home .board { padding: 22px 26px 18px; }
  html.web .home .scoreline { max-width: 640px; margin-left: auto; margin-right: auto; }   /* hisob bitta butun bo'lib o'qilsin */
  html.web .home .score b { font-size: clamp(76px, 8vw, 120px); }
  html.web .home .colon { font-size: clamp(52px, 5vw, 80px); padding-bottom: 34px; }
  html.web .home .crest { width: 56px; height: 72px; }
  html.web .home .board-name { font-size: 19px; }
  html.web .fixture-head {
    display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 48px; gap: 12px; padding: 10px 14px;
    font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
    border-bottom: 1px solid var(--seam);
  }
  html.web .grid { grid-template-columns: repeat(6, 1fr); }
  html.web .tabs { display: none; }
  html.web .editor-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: start; }
  html.web .editor-grid .pane-chain, html.web .editor-grid .pane-preview { display: block; }
  html.web .pane-chain > .section-head, html.web .pane-preview > .section-head { display: flex; }
  html.web .settings > div + div { margin-top: 0; }
  html.web .pane-preview { position: sticky; top: 20px; }
  html.web .settings { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
  html.web .settings .panel + .panel { margin-top: 0; }
}

/* ---------- 12. Harakat: tablo raqamlari aylanadi (yagona asosiy animatsiya) ---------- */
.roll { display: inline-block; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
