/* One tournament's public page */
.th { position: relative; overflow: hidden; color: #fff; background: #0b1a36; }
.th__bg { position: absolute; inset: -40px; background: linear-gradient(160deg, #081226, #12346b) center / cover no-repeat; filter: blur(28px) saturate(1.2); opacity: .55; transform: scale(1.1); }
.th::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(6, 12, 28, .55), rgba(6, 12, 28, .88)); }
.th__in { position: relative; z-index: 1; display: grid; gap: 22px; padding-top: 28px; padding-bottom: 30px; }
.th__poster { display: block; width: min(320px, 72vw); margin: 0 auto; border-radius: 18px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
.th__poster img { display: block; width: 100%; height: auto; }
.th__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.th__chips .chip { background: rgba(255, 255, 255, .14); color: #fff; }
.th__chips .chip--live { background: var(--red); } .th__chips .chip--ok { background: #1f9d45; }
.th h1 { margin: 12px 0 4px; font-size: clamp(22px, 4.2vw, 38px); line-height: 1.45; }
.th__sub { color: #c7d2ea; font-size: 15px; }
.th__facts { display: grid; gap: 8px; margin: 18px 0 0; }
.th__facts div { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 14.5px; }
.th__facts dt { color: #a8b5d6; min-width: 130px; } .th__facts dt i { width: 18px; text-align: center; }
.th__facts dd { margin: 0; font-weight: 700; } .th__facts small { font-weight: 400; color: #ffb4b7; }
.th__facts a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.th__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
@media (min-width: 900px) { .th__in { grid-template-columns: 340px 1fr; align-items: center; gap: 40px; padding-top: 44px; padding-bottom: 44px; } .th__poster { width: 100%; } }

.tnav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: -22px; position: relative; z-index: 2; }
.tnav a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 12.5px; font-weight: 700; text-align: center; transition: transform .15s var(--ease); }
.tnav a:hover { transform: translateY(-2px); }
.tnav i { font-size: 18px; color: var(--red); }
@media (min-width: 900px) { .tnav { grid-template-columns: repeat(8, minmax(0, 1fr)); } .tnav a { font-size: 13.5px; padding: 14px 6px; } }

.tstats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .tstats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tstats .card { padding: 14px 16px; }
.tstats b { display: block; font-size: 26px; font-weight: 900; line-height: 1.2; } .tstats span { color: var(--muted); font-size: 13px; }
.tstats__bar { display: block; height: 5px; border-radius: 5px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.tstats__bar i { display: block; height: 100%; border-radius: 5px; background: var(--green); }

.tcols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 20px; }
@media (min-width: 980px) { .tcols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tres { padding: 6px 14px; }
.tres__r { padding: 10px 0; border-top: 1px solid var(--line); } .tres__r:first-child { border-top: 0; }
.tres__r small { color: var(--muted); font-size: 12px; }
.tres__p { display: flex; align-items: center; gap: 8px; padding: 3px 0; color: var(--muted); }
.tres__p span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tres__p.is-win { color: var(--ink); font-weight: 700; } .tres__p.is-win span::after { content: " 🏆"; }
.tres__j { font-size: 11px; color: var(--muted); text-align: end; margin-top: 2px; }
.tres__p > i { width: 4px; height: 18px; border-radius: 3px; } .is-red { background: #dc3c42; } .is-blue { background: #2563eb; }
.tmed { padding: 6px 14px; }
.tmed__r { display: grid; grid-template-columns: 30px 1fr 40px 40px 40px; gap: 6px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.tmed__r--h { border-top: 0; color: var(--muted); font-size: 12.5px; } .tmed__r b { text-align: center; }
.tmed__r span:nth-child(n+3) { text-align: center; }
.tfiles { padding: 6px; }
.tfiles a { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; font-weight: 700; }
.tfiles a:hover { background: var(--surface-2); } .tfiles i { color: var(--red); }

/* sub-page header and section tabs */
.tp { background: var(--surface); border-bottom: 1px solid var(--line); }
.tp > .wrap:first-child { padding-top: 18px; padding-bottom: 6px; }
.tp__back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; font-weight: 700; max-width: 100%; }
.tp__back:hover { color: var(--red); } .tp__back i { font-size: 11px; }
.tp__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 6px; }
.tp h1 { font-size: clamp(22px, 3.6vw, 30px); display: flex; align-items: center; gap: 10px; }
.tp h1 i { color: var(--red); font-size: .8em; }
.tp__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tp__lead { color: var(--muted); margin-top: 4px; font-size: 14.5px; }
.ttabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-top: 10px; }
.ttabs::-webkit-scrollbar { display: none; }
.ttabs a { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px 12px; font-size: 14px; font-weight: 700; color: var(--muted);
  border-bottom: 3px solid transparent; white-space: nowrap; }
.ttabs a i { font-size: 13px; }
.ttabs a:hover { color: var(--ink); }
.ttabs a.is-on { color: var(--ink); border-bottom-color: var(--red); } .ttabs a.is-on i { color: var(--red); }
.tp__body { padding-top: 22px; }
.tp__foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.tp__note { color: var(--muted); font-size: 13px; margin-top: 10px; }
.tp__search { max-width: 420px; margin-bottom: 14px; }

/* bracket cards */
.brc { padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: transform .15s var(--ease), box-shadow .2s; }
.brc:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.brc[hidden] { display: none; }
.brc__h { display: flex; flex-wrap: wrap; gap: 6px; }
.brc__t { font-size: 15px; line-height: 1.7; }

/* match and medal tables */
.tbl--m td, .tbl--m th { white-space: nowrap; }
.tbl--m tr[hidden] { display: none; }
.tbl--m tr.is-live td { background: var(--accent-soft); }
.tm__a, .tm__b { position: relative; padding-inline-start: 18px !important; }
.tm__a::before, .tm__b::before { content: ""; position: absolute; inset-inline-start: 6px; top: 50%; width: 4px; height: 18px; margin-top: -9px; border-radius: 3px; }
.tm__a::before { background: #dc3c42; } .tm__b::before { background: #2563eb; }
th.tm__a::before, th.tm__b::before { height: 12px; margin-top: -6px; }
.tm__a.is-win, .tm__b.is-win { font-weight: 900; } .tm__a.is-win::after, .tm__b.is-win::after { content: " 🏆"; }
.tm__sc { text-align: center !important; font-weight: 900; }
/* each number isolated: Persian digits joined by ':' would otherwise form one LTR run and put the red score on the blue side */
.tm__sc span, .tm__sc i { unicode-bidi: isolate; } .tm__sc i { font-style: normal; color: var(--muted); margin: 0 5px; }
.md { display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: middle; }
.md--g { background: radial-gradient(circle at 35% 35%, #ffe9a3, #d4a017); } .md--s { background: radial-gradient(circle at 35% 35%, #f4f6f9, #9aa3b2); }
.md--b { background: radial-gradient(circle at 35% 35%, #f5c9a1, #b36a2e); }
.tbl--medals td:nth-child(n+3), .tbl--medals th:nth-child(n+3) { text-align: center; }

/* schedule */
.sch__tools { display: grid; gap: 4px; position: sticky; top: var(--hdr); z-index: 5; background: var(--bg); padding: 8px 0 6px; }
.sch__tools .tabs { margin-bottom: 4px; }
.sch__info { font-size: 12.5px; white-space: nowrap; }
.sch[hidden] { display: none; }
.sch .sec__h h2 { font-size: 19px; display: flex; align-items: center; gap: 8px; }
.sch { padding: 14px 0; }
.sc { display: flex; flex-direction: row-reverse; justify-content: center; align-items: center; }
.sc i { font-style: normal; color: var(--muted); margin: 0 5px; }
.sc--x { font-size: 11px; font-weight: 700; color: var(--muted); }

/* match cards (daily list, live feed) */
.mcds { display: grid; gap: 12px; }
@media (min-width: 1000px) { .mcds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mcd { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.mcd.is-live { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.mcd__h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; }
.mcd__ring { margin-inline-start: auto; }
.mcd__m { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: stretch; }
.mcd__f { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 14px; background: var(--surface-2); border-inline-start: 4px solid; min-width: 0; }
.mcd__f.is-blue { border-color: #2563eb; } .mcd__f.is-red { border-color: #dc3c42; flex-direction: row-reverse; text-align: end; border-inline-start: 0; border-inline-end: 4px solid #dc3c42; }
.mcd__f img { border-radius: 4px; flex: none; }
.mcd__f > div { min-width: 0; display: flex; flex-direction: column; }
.mcd__f b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcd__f small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcd__f.is-win { background: var(--ok-soft); } .mcd__f.is-win b::after { content: " 🏆"; }
.mcd__pen { color: var(--warn) !important; }
.mcd__c { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 76px; text-align: center; }
.mcd__c > b, .mcd__c .sc { font-size: 24px; font-weight: 900; line-height: 1.1; }
.mcd__c small { color: var(--muted); font-size: 12px; }
.mcd__x { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; border-top: 1px solid var(--line); padding-top: 8px; }
@media (max-width: 520px) { .mcd__m { grid-template-columns: minmax(0, 1fr); } .mcd__c { flex-direction: row; justify-content: space-between; }
  .mcd__f.is-red { flex-direction: row; text-align: start; border-inline-end: 0; border-inline-start: 4px solid #dc3c42; order: -1; } .mcd__f.is-blue { order: 1; } }

/* live ring schedule */
.lvr { padding: 18px; display: grid; gap: 14px; }
.lvr h2 { font-size: 19px; }
.lvr__cur { display: grid; gap: 8px; padding: 14px; border-radius: 16px; background: var(--accent-soft); }
.lvr__lbl { font-size: 12.5px; font-weight: 900; color: var(--red); }
.lvr__t { font-weight: 900; font-size: 18px; }
.lvr__sc { font-size: 28px; font-weight: 900; justify-content: flex-start; }
.lvf { display: grid; gap: 4px; }
.lvf__meta { display: flex; flex-wrap: wrap; gap: 4px; }
.lvf__p { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-weight: 700; }
.lvf__p i { font-style: normal; color: var(--muted); font-weight: 400; font-size: 12px; }
.lvf__p .is-red, .lvf__p .is-blue { background: none; padding-inline-start: 10px; border-inline-start: 4px solid; }
.lvf__p .is-red { border-color: #dc3c42; } .lvf__p .is-blue { border-color: #2563eb; }
.lvf__p .is-win::after { content: " 🏆"; }

/* scoreboard / call display boards */
.sbg { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.sbg--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); }
.sb { padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sb.is-live { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.sb__h { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .sb__h > b { font-size: 17px; }
.sb__cat { font-size: 13px; color: var(--muted); font-weight: 700; }
.sb__p { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 14px; color: #fff; }
.sb__p.is-red { background: linear-gradient(135deg, #b5121b, #e0353c); } .sb__p.is-blue { background: linear-gradient(135deg, #1d3fd8, #3b6cf6); }
.sb__p > div { display: flex; flex-direction: column; min-width: 0; } .sb__p small { opacity: .8; font-size: 12px; }
.sb__p b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb__p > span { font-size: 30px; font-weight: 900; line-height: 1; }
.sb__p.is-win b::after { content: " 🏆"; }
.sb__clock { text-align: center; font-size: 22px; font-weight: 900; padding: 6px; border-radius: 12px; background: var(--surface-2); }
.sb__idle { padding: 26px 10px; text-align: center; color: var(--muted); }
.sb .tbl td, .sb .tbl th { padding: 8px 10px; }
.dlall { margin-top: 14px; padding: 16px 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

/* full info page */
.cdr { display: grid; gap: 12px; margin-bottom: 14px; }
@media (min-width: 640px) { .cdr { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cdr__b { padding: 14px 16px; text-align: center; }
.cdr__b > small { color: var(--muted); font-weight: 700; font-size: 13px; }
.cdr__v { display: flex; justify-content: center; gap: 8px; margin-top: 6px; font-weight: 700; }
.cdr__v span { min-width: 58px; padding: 6px 4px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; }
.cdr__v b { font-size: 22px; font-weight: 900; line-height: 1.2; } .cdr__v small { font-size: 11px; color: var(--muted); }
.cdr__v.is-done { color: var(--muted); }
.ifo__i { padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.ifo__i > i { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--red); }
.ifo__i > div { display: flex; flex-direction: column; min-width: 0; } .ifo__i small { color: var(--muted); font-size: 12.5px; }
.ifo__i b { font-size: 14.5px; line-height: 1.7; }
.ifo__tel { color: var(--green); font-weight: 700; font-size: 13.5px; }
.ifo__p { padding: 18px 20px; font-size: 15px; }
.ifo__warn { display: flex; gap: 12px; padding: 14px 16px; margin-bottom: 14px; background: var(--warn-soft); border: 0; color: var(--ink-2); }
.ifo__warn > i { color: var(--warn); margin-top: 6px; } .ifo__warn p { color: var(--muted); font-size: 14px; }
.tbl tr[hidden] { display: none; }
.tbl code { font-size: 12.5px; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); }
.tfiles a small { margin-inline-start: auto; font-weight: 400; }

/* admin preview of unsaved changes */
.pvbar { background: var(--warn-soft); color: var(--warn); font-weight: 700; font-size: 14px; padding: 10px 0; }
.pvbar a { margin-inline-start: 12px; text-decoration: underline; text-underline-offset: 3px; }

/* Call display (site page): same layout as the hall TV — one card per ring, rows of red vs blue. */
.cl { padding: 0; overflow: hidden; min-width: 0; }
.cl.is-live { border-color: var(--green); }
.cl__h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 17px; }
.cl__row { padding: 10px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.cl__row:last-child { border-bottom: 0; }
.cl__row.is-live { background: var(--ok-soft); box-shadow: inset -4px 0 0 var(--green); }
.cl__top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.cl__no { color: var(--ink); font-weight: 800; font-size: 13.5px; }
.cl__cat { color: var(--ink-2); font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl__tm { margin-inline-start: auto; color: var(--gold); font-weight: 700; direction: ltr; }
.cl__tag { background: var(--green); color: #fff; border-radius: 6px; padding: 0 7px; font-weight: 800; font-size: 11.5px; white-space: nowrap; }
.cl__tag--next { background: var(--gold); }
.cl__vs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cl__vs > div { border-inline-start: 4px solid var(--red); padding-inline-start: 8px; font-size: 15.5px; font-weight: 800;
  line-height: 1.35; min-width: 0; overflow-wrap: anywhere; }
.cl__vs > div.cl__b { border-color: #2f6fed; }
.cl__vs small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }

/* schedule: day heading row inside each ring table */
.sch tr.sch__day td { background: var(--surface-2); color: var(--ink); font-weight: 900; font-size: 13px; padding: 8px 12px; }
.sch tr.sch__day td i { color: var(--red); margin-inline-end: 6px; }

/* sortable table headings (info tabs) */
.tbl--sort th.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.tbl--sort th.th-sort::after { content: "95"; margin-inline-start: 6px; opacity: .35; font-weight: 400; }
.tbl--sort th.th-sort[aria-sort="ascending"]::after { content: "B2"; opacity: .9; font-size: .8em; }
.tbl--sort th.th-sort[aria-sort="descending"]::after { content: "BC"; opacity: .9; font-size: .8em; }
.tbl--sort th.th-sort:hover, .tbl--sort th.th-sort:focus-visible { color: var(--ink); outline: none; text-decoration: underline; }
/* a win without points: DSQ / WO beside the athlete at fault (dark red), KO · RSC beside the winner (amber) */
.tm__lab { display: inline-block; margin-inline-start: 6px; padding: 0 6px; border-radius: 5px; font: 800 11px/1.7 Arial, sans-serif; letter-spacing: .3px; color: #fff; background: #7f1d1d; vertical-align: middle; }
.tm__lab--win { background: #b45309; }
