/* Live scoreboards (/live, /live/{slug}). A task surface in the Platform system (DESIGN.md):
   condensed display type for names, Extra Condensed numerals for the weight and the clock, mono
   labels, hairlines instead of cards. The one bright thing on the page is the loaded bar in the
   competition plate colours; a good lift turns the stage into the inverse band for a moment.
   Red is the live dot and the referees' red lamp, which is the sport's own signal. */

/* The scoreboard is always the arena (its tokens come from platform.css), like the screen in the hall. */
.live-page { --plate-red:#e4002b; --plate-blue:#0057b8; --plate-yellow:#f2c40f; --plate-green:#009639; --plate-white:#f2f4f6; --steel:#8b939d; --chrome:#c3c9d1; background:var(--bg-main); color:var(--text); }

/* ---------- live dot ---------- */
.lv-dot { display:inline-block; flex:none; width:7px; height:7px; border-radius:50%; background:var(--ink-subtle); }
[data-state="live"] .lv-dot,.live-card.is-live .lv-dot,.lv-dot.is-on { background:var(--signal); animation:lv-dot 1.6s var(--ease-state) infinite; }
@keyframes lv-dot { 0%,100% { opacity:1; } 50% { opacity:.35; } }

/* ---------- head ---------- */
.live-head { padding:clamp(128px,15vh,168px) 0 0; }
.live-head-bar { display:flex; align-items:center; gap:24px; min-height:44px; }
.live-back { display:inline-flex; align-items:center; gap:8px; color:var(--text-muted); text-decoration:none; }
.live-back .ui-icon { width:16px; height:16px; }
.live-back:hover { color:var(--text); }
.live-status { display:inline-flex; align-items:center; gap:8px; margin:0; }
.live-status[data-state="live"] { color:var(--text); }
.live-status[data-state="lost"] { color:var(--miss); }
.live-full { margin-left:auto; display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:0 14px; background:transparent; border:1px solid var(--border); border-radius:3px; color:var(--text-muted); cursor:pointer; transition:color .15s var(--ease-state),border-color .15s var(--ease-state); }
.live-full .ui-icon { width:14px; height:14px; }
.live-full:hover { color:var(--text); border-color:var(--line-strong); }
.live-title { margin:20px 0 0; font-family:var(--font-display); font-weight:800; font-size:clamp(40px,6vw,88px); line-height:.9; letter-spacing:-.008em; text-transform:uppercase; color:var(--text); max-width:22ch; }
.live-meta { margin:16px 0 0; }

/* ---------- the stage: who is on the bar, the weight, the clock and the lamps ---------- */
.live-stage-wrap { padding:clamp(28px,3vw,40px) 0 0; }
.live-stage { position:relative; display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,1fr) minmax(220px,.62fr); gap:24px 40px; align-items:end; padding:32px 0; border-top:1px solid var(--line-strong); border-bottom:1px solid var(--border); min-height:300px; }
.stage-lifter { align-self:stretch; display:flex; flex-direction:column; justify-content:flex-end; min-width:0; }
.stage-lifter .label { margin:0 0 12px; }
.stage-name { margin:0; font-family:var(--font-display); font-weight:800; font-size:clamp(36px,4.4vw,72px); line-height:.92; letter-spacing:-.006em; text-transform:uppercase; color:var(--text); overflow-wrap:anywhere; }
.stage-facts { margin:14px 0 0; font-size:15px; color:var(--text-muted); }
.stage-attempt { margin:18px 0 0; color:var(--primary); }
.stage-weight { min-width:0; }
.stage-kg { display:flex; align-items:baseline; gap:10px; margin:0; line-height:.8; }
.stage-kg .num { font-size:clamp(96px,11.5vw,184px); color:var(--text); }
.stage-unit { font-family:var(--font-mono); font-size:14px; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-subtle); }
.stage-bar { display:block; width:100%; max-width:360px; height:auto; max-height:120px; margin-top:16px; overflow:visible; }
.b-shaft { fill:var(--chrome); opacity:.55; }
.b-steel,.b-collar { fill:var(--steel); }
.b-sleeve { fill:var(--chrome); }
.b-plate { stroke:rgba(0,0,0,.28); stroke-width:1; }
.p-red { fill:var(--plate-red); } .p-blue { fill:var(--plate-blue); } .p-yellow { fill:var(--plate-yellow); } .p-green { fill:var(--plate-green); } .p-white { fill:var(--plate-white); }
.stage-clock { min-width:0; }
.stage-clock>.label { margin:0 0 10px; }
.stage-time { margin:0; font-size:clamp(72px,7.4vw,124px); color:var(--text-muted); transition:color .25s var(--ease-state); }
.live-stage.is-running .stage-time { color:var(--text); }
.live-stage.is-running.is-low .stage-time { color:var(--primary); }
.stage-track { height:2px; margin-top:16px; background:var(--border); overflow:hidden; }
.stage-track i { display:block; height:100%; background:var(--text); transform:scaleX(0); transform-origin:0 50%; }
.stage-lamps { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-top:24px; min-height:32px; }
.stage-lamps .label { margin-right:4px; }
.stage-lamps .lamp-jury { margin-left:12px; }
.lamp { display:inline-block; width:28px; height:28px; border-radius:50%; border:2px solid var(--line-strong); background:transparent; transition:background-color .15s var(--ease-state),border-color .15s var(--ease-state); }
.lamp.lamp-j { width:20px; height:20px; }
.lamp[data-v="voted"] { background:var(--ink-subtle); border-color:var(--ink-subtle); }
.lamp[data-v="good"] { background:#fff; border-color:#fff; }
.lamp[data-v="no"] { background:var(--signal); border-color:var(--signal); }
.live-stage[data-mode="idle"] .stage-weight,.live-stage[data-mode="break"] .stage-weight,.live-stage[data-mode="waiting"] .stage-weight,.live-stage[data-mode="loading"] .stage-weight { visibility:hidden; }
.live-stage[data-mode="idle"] .stage-name,.live-stage[data-mode="loading"] .stage-name { color:var(--text-muted); }

/* GOOD LIFT / NO LIFT and NEW RECORD: over the stage while the board shows them, lamps left visible. */
/* Placed on the lifter and weight columns, so the clock and the lamps stay readable beside it. */
.stage-verdict { position:absolute; inset:0; grid-column:1/3; grid-row:1; z-index:2; display:flex; flex-direction:column; justify-content:center; gap:8px; padding:24px 0; opacity:0; visibility:hidden; pointer-events:none; transition:opacity .16s var(--ease-state),visibility 0s .16s; }
.stage-verdict[data-v] { opacity:1; visibility:visible; transition:opacity .16s var(--ease-state); }
.stage-verdict[data-v="good"],.stage-verdict[data-v="record"] { background:var(--inverse-bg); color:var(--inverse-text); margin-left:calc(-1 * var(--gutter)); padding-left:var(--gutter); padding-right:24px; }
.stage-verdict[data-v="no"] { background:var(--bg-main); color:var(--text); }
.stage-verdict p { margin:0; }
.v-word { font-family:var(--font-display); font-weight:900; font-size:clamp(64px,10vw,168px); line-height:.86; text-transform:uppercase; letter-spacing:-.01em; }
.stage-verdict[data-v="no"] .v-word::before { content:''; display:inline-block; width:.42em; height:.42em; margin-right:.22em; border-radius:50%; background:var(--signal); vertical-align:.12em; }
.stage-verdict .label { color:inherit; opacity:.72; }
.v-title { font-family:var(--font-display); font-weight:800; font-size:clamp(28px,3.4vw,48px); line-height:.95; text-transform:uppercase; }
.v-result { font-size:clamp(72px,9vw,150px); }
.v-who { font-size:18px; }

.stage-ifs { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 16px; max-width:none; margin:0; padding:14px 0; border-bottom:1px solid var(--border); font-size:15px; color:var(--text); }
.stage-ifs .label:first-child { color:var(--primary); }
.stage-record { color:var(--text); }

/* ---------- standings and the side column ---------- */
.live-body { padding:clamp(40px,5vw,72px) 0 var(--section); }
.live-grid { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:40px; align-items:start; }
.live-section-head { display:flex; align-items:baseline; justify-content:space-between; gap:16px; padding-bottom:12px; border-bottom:1px solid var(--line-strong); }
.live-section-head h2,.live-section-head p { margin:0; }
.live-section-head h2 { color:var(--text); }
.live-scroll { overflow-x:auto; overscroll-behavior-x:contain; }
.live-scroll:focus-visible { outline:2px solid var(--primary); outline-offset:4px; }
.live-table { width:100%; min-width:880px; border-collapse:separate; border-spacing:0; font-size:14px; }
.live-table th,.live-table td { padding:8px 4px; text-align:center; white-space:nowrap; border-bottom:1px solid var(--border); }
.live-table thead th { font-family:var(--font-mono); font-size:11px; font-weight:400; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-subtle); padding-top:12px; }
.live-table .live-th-group th { padding:16px 4px 4px; border-bottom:0; }
.live-table .live-th-group .grp { color:var(--text-muted); border-bottom:1px solid var(--line-strong); }
.live-table .c-no { width:40px; }
.live-table td.c-no { font-size:20px; color:var(--text-muted); }
.live-table .c-name { text-align:left; min-width:200px; max-width:300px; padding-left:8px; }
.live-table thead .c-name { padding-left:8px; }
.live-table .c-yob { width:48px; }
.live-table td.c-yob { font-family:var(--font-mono); font-size:12px; color:var(--ink-subtle); }
.live-table .c-att { width:52px; }
.live-table .c-att .att { min-width:46px; height:30px; }
.live-table .c-att .att-none { color:transparent; }
.live-table .c-best { width:52px; }
.live-table td.c-best { font-size:24px; color:var(--text); }
.live-table .c-rank { width:40px; }
.live-table td.c-rank { font-family:var(--font-mono); font-size:13px; color:var(--text-muted); }
.live-table .c-total { width:60px; }
.live-table td.c-total { font-size:28px; color:var(--text); }
.live-table .c-rank .medal-chip { width:26px; height:26px; font-family:var(--font-mono); }
.att-now { background:transparent; border:1px solid var(--primary); color:var(--primary); }
.n-line { display:flex; align-items:center; gap:8px; min-width:0; }
.n-name { font-family:var(--font-display); font-weight:700; font-size:18px; line-height:1.1; text-transform:uppercase; overflow:hidden; text-overflow:ellipsis; }
.n-sub { display:block; margin-top:2px; font-size:11px; }
.n-mark,.n-next { flex:none; padding:1px 6px; border:1px solid var(--border); border-radius:2px; font-size:10px; color:var(--text-muted); }
.n-next { border-color:var(--primary); color:var(--primary); }
.live-row.is-current td { background:var(--surface); }
.live-row.is-current .c-no { box-shadow:inset 3px 0 0 var(--primary); color:var(--primary); }
.live-row.is-current .n-name { color:var(--primary); }
.live-row.is-prev td,.live-row.is-out td { opacity:.62; }
.live-band th { padding:24px 8px 8px; text-align:left; font-family:var(--font-display); font-weight:800; font-size:18px; letter-spacing:.01em; text-transform:uppercase; color:var(--text); border-bottom:1px solid var(--line-strong); }
.live-band:first-child th { padding-top:12px; }
.live-band.is-prev th { color:var(--text-muted); }
.live-empty td { padding:40px 8px; text-align:left; color:var(--text-muted); font-size:15px; }

.live-side { position:sticky; top:var(--sticky-top,116px); display:grid; gap:40px; }
.live-next { list-style:none; margin:0; padding:0; }
.live-next li { display:grid; grid-template-columns:64px minmax(0,1fr); gap:12px; align-items:center; padding:12px 0; border-bottom:1px solid var(--border); }
.nx-kg { font-size:32px; color:var(--text); }
.nx-who { min-width:0; }
.nx-name { display:block; font-family:var(--font-display); font-weight:700; font-size:17px; line-height:1.1; text-transform:uppercase; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nx-sub { display:block; margin-top:2px; font-size:11px; }
.live-next-empty { color:var(--text-muted); }
.live-rec { width:100%; border-collapse:collapse; font-size:13px; }
.live-rec th,.live-rec td { padding:10px 4px; border-bottom:1px solid var(--border); text-align:right; }
.live-rec thead th { font-family:var(--font-mono); font-size:10px; font-weight:400; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-subtle); }
.live-rec tbody th { text-align:left; font-weight:500; color:var(--text-muted); }
.live-rec td { font-size:18px; color:var(--text); }

/* Full screen on a hall screen: the page alone, the head tighter. */
.live-page:fullscreen { overflow:auto; background:var(--bg-main); }
.live-page:fullscreen .live-head { padding-top:24px; }
.live-page:fullscreen .live-back { display:none; }

/* ---------- index: every connection ---------- */
.live-list { list-style:none; margin:0; padding:0; }
.live-card { border-bottom:1px solid var(--border); }
.live-card a { display:grid; grid-template-columns:minmax(0,3fr) minmax(0,2fr) auto; gap:16px 32px; align-items:center; padding:28px 0; color:inherit; text-decoration:none; }
.live-card-main { min-width:0; }
.live-card-state { display:flex; align-items:center; gap:8px; margin:0 0 12px; }
.live-card.is-live .live-card-state { color:var(--text); }
.live-card-title { margin:0; font-family:var(--font-display); font-weight:800; font-size:clamp(26px,3vw,44px); line-height:.95; text-transform:uppercase; color:var(--text); transition:color .15s var(--ease-state),transform .3s var(--ease-state); }
.live-card-sub { margin:10px 0 0; font-size:14px; color:var(--text-muted); }
.live-card-now { min-width:0; display:flex; align-items:baseline; gap:16px; }
.live-card-now .num { font-size:clamp(48px,5vw,80px); color:var(--text); }
.live-card-now .lc-who { min-width:0; }
.live-card-now .lc-name { display:block; font-family:var(--font-display); font-weight:700; font-size:20px; text-transform:uppercase; line-height:1.05; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.live-card-go { display:grid; place-items:center; width:48px; height:48px; border:1px solid var(--line-strong); border-radius:50%; color:var(--text); transition:transform .3s var(--ease-state),border-color .15s var(--ease-state); }
.live-card-go .ui-icon { width:18px; height:18px; }
.live-card a:hover .live-card-title,.live-card a:focus-visible .live-card-title { color:var(--primary); transform:translateX(8px); }
.live-card a:hover .live-card-go { transform:rotate(-45deg); border-color:var(--text); }
.live-card:not(.is-live) .live-card-title { color:var(--text-muted); }
.live-none { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:24px; padding:clamp(40px,5vw,72px) 0 0; }
.live-none-copy { grid-column:1/7; }
.live-none h2 { margin:0; font-family:var(--font-display); font-weight:800; font-size:clamp(32px,4vw,56px); line-height:.92; text-transform:uppercase; color:var(--text); }
.live-none p { margin:16px 0 0; color:var(--text-muted); max-width:44ch; }
.live-none-next { grid-column:8/13; align-self:end; padding-top:20px; border-top:1px solid var(--border); }
.live-none-next .num { display:block; margin:8px 0 6px; font-size:clamp(56px,6vw,96px); color:var(--text); }
.live-none-next strong { display:block; font-family:var(--font-display); font-weight:700; font-size:22px; line-height:1.05; text-transform:uppercase; color:var(--text); }
.live-none-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:28px; }

/* ---------- live notice on other pages ---------- */
.live-notice { display:flex; align-items:center; gap:12px; padding:14px 0; border-bottom:1px solid var(--border); color:var(--text); text-decoration:none; }
.live-notice .label { color:var(--text); }
.live-notice strong { font-family:var(--font-display); font-weight:700; font-size:18px; text-transform:uppercase; line-height:1.05; }
.live-notice .ui-icon { width:16px; height:16px; margin-left:auto; transition:transform .3s var(--ease-state); }
.live-notice:hover .ui-icon { transform:translateX(4px); }
.live-notice:hover strong { color:var(--primary); }

@media (max-width:1100px) {
  .live-grid { grid-template-columns:minmax(0,1fr); }
  .live-side { position:static; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); }
}
@media (max-width:900px) {
  .live-stage { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  .stage-lifter { grid-column:1/-1; }
  .stage-verdict { grid-column:1/-1; }
  .live-card a { grid-template-columns:minmax(0,1fr) auto; }
  .live-card-now { grid-column:1; grid-row:2; }
  .live-card-go { grid-column:2; grid-row:1; }
  .live-none-copy,.live-none-next { grid-column:1/-1; }
}
@media (max-width:600px) {
  .live-head-bar { flex-wrap:wrap; gap:8px 16px; }
  .live-full { display:none; }
  .live-stage { grid-template-columns:minmax(0,1fr) auto; gap:20px; padding:24px 0; min-height:0; }
  .stage-kg .num { font-size:88px; }
  .stage-time { font-size:64px; }
  .stage-clock { text-align:right; }
  .stage-lamps { justify-content:flex-end; }
  .stage-lamps>.label { display:none; }
  .lamp { width:22px; height:22px; }
  .stage-bar { max-height:72px; }
  /* The name stays put while the attempts scroll under it. */
  .live-table .c-name { position:sticky; left:0; z-index:1; background:var(--bg-main); min-width:168px; max-width:190px; box-shadow:1px 0 0 var(--border); }
  .live-row.is-current .c-name { background:var(--surface); }
  .live-table .c-no { display:none; }
  .n-name { font-size:16px; }
}
@media (prefers-reduced-motion:reduce) {
  .lv-dot,[data-state="live"] .lv-dot,.live-card.is-live .lv-dot { animation:none; }
  .stage-verdict,.stage-verdict[data-v] { transition:none; }
}
