:root {
  color-scheme: light;
  --paper: #f4efe5;
  --surface: #fffdf8;
  --ink: #111c25;
  --muted: #4d5960;
  --teal: #087c73;
  --line: #cfc4b3;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 84% -4%, #b77a2133, transparent 28rem), linear-gradient(135deg, #faf7f0, var(--paper) 50%, #e9e1d4);
  font: 16px/1.6 Verdana, Geneva, sans-serif;
  min-height: 100vh;
}
a { color: var(--teal); overflow-wrap: anywhere; }
.live-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: clamp(.75rem, 2vw, 2rem); align-items: center; min-height: 4.25rem; padding: .55rem clamp(.75rem, 1.25vw, 1.5rem); border-bottom: 1px solid var(--line); }
.live-brand { display: flex; gap: 1rem; align-items: baseline; min-width: max-content; }
.live-brand > a { flex-shrink: 0; white-space: nowrap; }
.live-header a { color: var(--ink); font: bold 1.8rem Georgia, serif; text-decoration: none; }
.live-header-context, .live-note { color: var(--muted); font-size: .85rem; }
main { width: 100%; max-width: none; margin: 0; padding: clamp(.7rem, 1.2vw, 1.25rem) clamp(.75rem, 1.25vw, 1.5rem) clamp(1rem, 3vw, 3rem); }
h1, h2 { font-family: Georgia, "Times New Roman", serif; line-height: 1.1; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.75rem, 3vw, 2.75rem); margin: .1rem 0 .35rem; }
h2 { font-size: 1.5rem; }
p { overflow-wrap: anywhere; }
.kicker { font-size: .75rem; font-weight: bold; letter-spacing: .2em; color: var(--teal); }
.live-competition-head { display: grid; gap: .12rem; justify-items: end; min-width: 0; margin: 0; text-align: right; }
.live-competition-head > #competition-meta { width: 100%; margin: 0; overflow: hidden; color: var(--muted); font-size: clamp(.68rem, .8vw, .78rem); line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.live-title-row { display: flex; align-items: center; justify-content: flex-end; gap: .65rem; min-width: 0; width: 100%; }
.live-title-row h1 { min-width: 0; margin: 0; overflow: hidden; font: 800 clamp(.82rem, 1vw, 1.05rem)/1.2 Verdana, Geneva, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.live-status-badge { flex: 0 0 auto; margin: 0; padding: .35rem .7rem; color: #fff; background: #374151; font-size: .72rem; font-weight: bold; text-transform: uppercase; letter-spacing: .08em; }
.live-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: .4rem; }
.live-header-actions a.live-header-calculator { min-height: 36px; padding: .45rem .7rem; color: #fff; background: var(--teal); font: bold .72rem/1.4 Verdana, sans-serif; white-space: nowrap; }
.live-header-refresh { min-height: 36px; padding: .45rem .7rem; font-size: .72rem; white-space: nowrap; }
.live-tracking-status { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.live-tracking-status .is-stale { color: #9a3412; }
button { min-height: 44px; padding: .75rem 1rem; font: bold .9rem/1.4 Verdana, sans-serif; color: #fff; background: var(--teal); border: 0; cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 3px solid #b77a21; outline-offset: 3px; }
.live-views { display: flex; gap: .5rem; overflow-x: auto; margin: 1.25rem 0 0; padding: .35rem; background: #111c25; }
.live-views[hidden] { display: none; }
.live-views button { flex: 0 0 auto; color: #d9e2e5; background: transparent; }
.live-views button[aria-pressed="true"] { color: #111c25; background: #f3c971; }
.live-active:empty { display: none; }
.live-combined { display: grid; gap: .75rem; }
.live-combined[hidden], .live-queue[hidden], .live-scoreboard-tools[hidden] { display: none; }
.live-queue { padding: .85rem 1rem 1rem; color: #fff; background: #111c25; border-top: 4px solid var(--teal); }
.live-panel-heading { display: flex; align-items: baseline; gap: .75rem; margin-bottom: .65rem; }
.live-panel-heading .kicker { margin: 0; color: #f3c971; }
.live-panel-heading h2 { margin: 0; font: bold 1rem Verdana, sans-serif; }
.live-queue ol { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .35rem; margin: 0; padding: 0; list-style: none; }
.live-queue li { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); gap: .15rem .5rem; align-items: center; min-width: 0; padding: .55rem .65rem; background: #26343e; border-left: 3px solid transparent; }
.live-queue li.is-active { color: #111c25; background: #f3c971; border-color: var(--teal); }
.live-queue-position { grid-row: 1 / 3; display: grid; place-items: center; width: 1.65rem; height: 1.65rem; color: #fff; background: #087c73; border-radius: 50%; font-weight: bold; }
.live-queue-identity { min-width: 0; }
.live-queue-identity .live-athlete-link { display: block; width: 100%; overflow: hidden; font-size: .8rem; font-weight: bold; text-overflow: ellipsis; white-space: nowrap; }
.live-queue-identity small { display: block; overflow: hidden; color: #bcc7cb; font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }
.live-queue li.is-active small { color: #334047; }
.live-queue-attempt { grid-column: 2; color: #f3c971; font-size: .66rem; text-transform: uppercase; }
.live-queue li.is-active .live-queue-attempt { color: #065e57; }
.live-queue li > strong { grid-column: 2; font-size: .95rem; }
.live-scoreboard-panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); }
.live-scoreboard-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; padding: .5rem .75rem; border-bottom: 1px solid var(--line); }
.live-scoreboard-tools label { font-size: .75rem; font-weight: bold; text-transform: uppercase; letter-spacing: .05em; }
.live-scoreboard-tools select { min-height: 38px; min-width: min(25rem, 100%); padding: .4rem 2.25rem .4rem .75rem; color: var(--ink); background: #fff; border: 1px solid var(--line); font: bold .85rem Verdana, sans-serif; }
.live-scoreboard-tools button { margin-left: auto; color: var(--ink); background: #f3c971; }
.live-table-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--line); max-height: 75vh; }
.live-table-wrap[hidden], .live-alt-view[hidden], .live-athlete[hidden] { display: none; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .85rem; font-variant-numeric: tabular-nums; }
caption { text-align: left; padding: .75rem; font-weight: bold; }
th, td { padding: .7rem .8rem; text-align: left; border-bottom: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: break-word; min-width: 6rem; max-width: 25rem; }
thead th { position: sticky; top: 0; background: var(--ink); color: #fff; z-index: 1; }
tbody tr:nth-child(even) { background: #f7f2e9; }
tbody tr:hover { background: #d9f0eb; }
tbody tr.is-active-athlete { background: #fff0b8; box-shadow: inset 5px 0 var(--teal); }
.live-scoreboard { width: max-content; min-width: 100%; table-layout: fixed; font-size: clamp(.7rem, .75vw, .82rem); line-height: 1.2; }
.live-scoreboard-lifts-1 { width: max(100%, 57.75rem); }
.live-scoreboard-lifts-2 { width: max(100%, 73rem); }
.live-scoreboard-lifts-3 { width: max(100%, 88.25rem); }
.live-scoreboard col.live-col-place, .live-scoreboard col.live-col-lot { width: 2.75rem; }
.live-scoreboard col.live-col-name { width: 10.5rem; }
.live-scoreboard col.live-col-affiliation, .live-scoreboard col.live-col-category { width: 4.5rem; }
.live-scoreboard col.live-col-bodyweight { width: 4rem; }
.live-scoreboard col.live-col-attempt { width: 3.75rem; }
.live-scoreboard col.live-col-lift-result { width: 4rem; }
.live-scoreboard col.live-col-total { width: 5rem; }
.live-scoreboard col.live-col-points { width: 4rem; }
.live-scoreboard col.live-col-projection { width: 4.5rem; }
.live-scoreboard caption { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.live-scoreboard th, .live-scoreboard td { min-width: 0; max-width: none; overflow: hidden; padding: .5rem .45rem; text-align: center; text-overflow: ellipsis; white-space: nowrap; border-right: 1px solid rgba(207,196,179,.35); }
.live-scoreboard th:nth-child(3), .live-scoreboard td:nth-child(3),
.live-scoreboard th:nth-child(4), .live-scoreboard td:nth-child(4) { text-align: left; }
.live-scoreboard td:nth-child(3) { line-height: 1.15; text-overflow: clip; white-space: normal; }
.live-scoreboard th:nth-child(6), .live-scoreboard td:nth-child(6) { text-align: right; }
.live-scoreboard thead .live-scoreboard-primary th { top: 0; background: #21190f; }
.live-scoreboard thead .live-scoreboard-secondary th { top: 2.15rem; color: #21190f; background: #eee5d4; }
.live-scoreboard tbody tr:nth-child(even) { background: #fbf7ee; }
.live-scoreboard tbody tr.is-active-athlete { background: #fff0b8; }
.live-scoreboard .live-attempt-cell.is-good, .live-scoreboard .live-lift-best.has-result { color: #fff; background: #087c45; font-weight: bold; }
.live-scoreboard .live-attempt-cell.is-bad { color: #fff; background: #ce2222; font-weight: bold; text-decoration: line-through; }
.live-scoreboard .live-attempt-cell.is-skipped { color: #fff; background: #8c3b16; font-weight: bold; }
.live-scoreboard .live-attempt-cell.is-pending { background: #e2b85c; font-weight: bold; }
.live-scoreboard .live-attempt-cell { position: relative; padding-bottom: 13px; }
.live-scoreboard .live-total { font-weight: bold; }
.live-scoreboard .live-projection { background: #d9efee; font-weight: bold; }
.live-scoreboard .live-category-row th { position: static; padding: .65rem .8rem; color: #fff; background: #2b2924; text-align: left; font-size: .9rem; }
.live-athlete-link { min-height: 0; padding: 0; color: inherit; background: transparent; text-align: left; text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .16em; }
#live-active { font-weight: bold; white-space: pre-wrap; }
#live-video { margin-top: 2rem; padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); }
#live-video button { display: block; margin: 1rem 0; }
#live-video iframe { display: block; margin-top: 1rem; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.live-video-fullscreen { background: #111c25; }
.live-alt-view { overflow-x: auto; padding: 1rem; background: var(--surface); border: 1px solid var(--line); }
.live-alt-view.is-sorsa { padding: 0; overflow: hidden; border: 1px solid #222; }
.live-sorsa-sheet { color: #000; background: #fff; font-family: "Times New Roman", serif; line-height: 1.1; }
.live-sorsa-top { display: flex; align-items: center; gap: 12px; padding: 5px 10px; background: #e4e4e4; border-bottom: 1px solid #111; }
.live-sorsa-top span { font: 11px "Segoe UI", sans-serif; }
.live-sorsa-metadata, .live-sorsa-grid { display: grid; grid-template-columns: 14% minmax(0, 1fr); }
.live-sorsa-metadata { border-bottom: 1px solid #000; font-size: clamp(11px, .95vw, 18px); }
.live-sorsa-legend { padding: 4px; border-right: 1px solid #000; white-space: pre-line; font: 11px/1.2 "Segoe UI", sans-serif; }
.live-sorsa-info { display: grid; align-content: start; gap: 2px; min-width: 0; padding: 4px 8px 0; }
.live-sorsa-info > * { overflow-wrap: anywhere; }
.live-sorsa-loading { display: flex; align-items: center; justify-content: space-between; gap: 8px; max-width: 550px; background: #ffffb8; border: 1px solid #000; }
.live-sorsa-loading strong { flex-shrink: 0; }
.live-sorsa-grid { height: clamp(340px, calc(100dvh - 300px), 850px); }
.live-sorsa-order { min-width: 0; overflow: auto; padding: 6px 3px; background: #ffffb8; border-right: 2px solid #000; font-size: clamp(10px, .85vw, 16px); }
.live-sorsa-order > strong { white-space: pre-line; }
.live-sorsa-order h3 { margin: 12px 0 4px; font: bold 12px "Times New Roman", serif; }
.live-sorsa-order p { font-size: 11px; }
.live-sorsa-queue-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; padding: 3px 0; }
.live-sorsa-order > .live-sorsa-queue-row:first-of-type { margin-top: 15px; }
.live-sorsa-queue-row button { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-sorsa-scroll { min-width: 0; min-height: 0; overflow: auto; }
.live-sorsa { width: 100%; min-width: 1100px; table-layout: fixed; border-collapse: collapse; font: clamp(10px, .86vw, 16px)/1.05 "Times New Roman", serif; }
.live-sorsa col { width: 3.2%; }
.live-sorsa col.live-sorsa-col-place, .live-sorsa col.live-sorsa-col-mn, .live-sorsa col.live-sorsa-col-lot { width: 2.8%; }
.live-sorsa col.live-sorsa-col-category { width: 4.5%; }
.live-sorsa col.live-sorsa-col-weight { width: 4.2%; }
.live-sorsa col.live-sorsa-col-name { width: 17%; }
.live-sorsa col.live-sorsa-col-club { width: 5%; }
.live-sorsa col.live-sorsa-col-total { width: 4%; }
.live-sorsa col.live-sorsa-col-gl { width: 4.5%; }
.live-sorsa col.live-sorsa-col-rack { width: 3.6%; }
.live-sorsa th, .live-sorsa td { position: static; min-width: 0; max-width: none; height: clamp(18px, 2.2vh, 26px); overflow: hidden; padding: 1px 3px; border: 1px dotted #222; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.live-sorsa thead { position: sticky; top: 0; z-index: 1; }
.live-sorsa thead th { color: #000; background: #e4e4e4; border: 1px solid #222; font-size: .86em; white-space: pre-line; }
.live-sorsa tbody tr { background: #fff; box-shadow: none; }
.live-sorsa tbody th { text-align: left; }
.live-sorsa .live-sorsa-group th { padding-left: 20%; font-weight: bold; }
.live-sorsa .live-sorsa-best { background: #caffca; font-weight: bold; }
.live-sorsa .live-sorsa-total { background: #e5e5e5; font-weight: bold; }
.live-sorsa .live-sorsa-gl { background: #dfdcea; font-weight: bold; }
.live-sorsa .is-good { font-weight: bold; text-decoration: underline; }
.live-sorsa .is-bad { color: #fff; background: #ff1414; font-weight: bold; text-decoration: line-through; }
.live-sorsa .is-skipped { color: #fff; background: #8c3b16; }
.live-sorsa tr.is-current { background: #fff7c2; }
.live-sorsa .is-current-attempt { outline: 3px solid #14793c; outline-offset: -3px; }
.live-sorsa-sheet .live-athlete-link { font: bold 1em/1.05 "Times New Roman", serif; }
.live-sorsa .live-record-mark { margin: 0 0 0 1px; padding: 0 1px; font-size: .6em; }
.live-sorsa td.live-sorsa-attempt { position: relative; padding-bottom: 8px; }
@media (max-width: 700px) {
  .live-sorsa-metadata, .live-sorsa-grid { grid-template-columns: 120px minmax(0, 1fr); }
}
.live-record-mark { display: inline-block; margin-left: .35rem; padding: .05rem .25rem; color: #fff; background: #d53b16; font-size: .65rem; font-weight: 900; line-height: 1.2; vertical-align: text-bottom; animation: record-pulse 1.4s ease-in-out infinite; }
.live-scoreboard .live-record-mark { position: absolute; bottom: 1px; left: 2px; margin: 0; padding: 0 .15rem; font-size: .48rem; }
.live-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.live-card { padding: 1.25rem; border-top: 4px solid var(--teal); background: #f7f2e9; }
.live-card h2 { margin-top: 0; }
.live-card-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.live-card-heading h2 { margin: 0; }
.live-group-status { padding: .2rem .45rem; color: #fff; background: #58636a; font-size: .65rem; font-weight: bold; text-transform: uppercase; }
.live-group-status.is-active { background: var(--teal); }
.live-group-status.is-completed { background: #374151; }
.live-group-status.is-upcoming { color: var(--ink); background: #f3c971; }
.live-card ol { margin: 0; padding-left: 1.5rem; }
.live-card li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.live-card li span { display: block; color: var(--muted); font-size: .78rem; }
.live-athlete { position: fixed; z-index: 10; top: 1rem; right: 1rem; bottom: 1rem; width: min(44rem, calc(100vw - 2rem)); padding: clamp(1rem, 3vw, 2rem); overflow: auto; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-top: 7px solid var(--teal); box-shadow: 0 1.25rem 5rem #111c2566; }
.live-athlete-close { float: right; color: #fff; background: #111c25; }
.live-athlete h2 { margin: .25rem 0; font-size: clamp(2rem, 5vw, 3.25rem); }
.live-athlete-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 1.5rem 0; }
.live-athlete-summary div { padding: .75rem; background: #e8eee9; }
.live-athlete-summary span, .live-athlete-summary strong { display: block; }
.live-athlete-summary span { color: var(--muted); font-size: .75rem; text-transform: uppercase; }
.live-athlete-summary strong { font: bold 1.6rem Georgia, serif; }
.live-attempt-table .is-good td:nth-child(4) { color: #087c45; font-weight: bold; }
.live-attempt-table .is-bad td:nth-child(4), .live-attempt-table .is-skipped td:nth-child(4) { color: #a22012; font-weight: bold; }
.live-benchmark-source { margin-top: -.4rem; color: var(--muted); font-size: .78rem; }
.live-benchmark-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .5rem; }
.live-benchmark-grid article { padding: .75rem; background: #edf1ee; border-left: 4px solid #64727a; }
.live-benchmark-grid article.is-up { border-color: #087c45; }
.live-benchmark-grid article.is-down { border-color: #b13722; }
.live-benchmark-grid span, .live-benchmark-grid strong, .live-benchmark-grid small { display: block; }
.live-benchmark-grid span { color: var(--muted); font-size: .7rem; text-transform: uppercase; }
.live-benchmark-grid strong { font: bold 1.35rem Georgia, serif; }
.live-benchmark-grid small { color: var(--muted); }
.live-lights { display: inline-flex; gap: .25rem; min-width: 2.75rem; }
.live-light { width: .75rem; height: .75rem; border: 1px solid #26343e; border-radius: 50%; }
.live-light.is-good { background: #fff; }
.live-light.is-bad { background: #e03223; }
.live-cell-lights { position: absolute; bottom: 1px; left: 50%; transform: translateX(-50%); min-width: 0; gap: 2px; height: 6px; pointer-events: none; }
.live-cell-lights .live-light { width: 6px; height: 6px; box-shadow: 0 0 0 1px #ffffff88; }
.live-award-category { margin-bottom: 2rem; }
.live-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; align-items: end; }
.live-podium-place { display: flex; flex-direction: column; gap: .35rem; min-height: 10rem; padding: 1rem; background: #e4e9e9; border-top: 6px solid #7a8790; }
.live-podium-place.place-1 { min-height: 13rem; border-color: #d39b26; order: 2; }
.live-podium-place.place-2 { min-height: 11.5rem; border-color: #aab2b6; order: 1; }
.live-podium-place.place-3 { border-color: #a75b32; order: 3; }
.live-podium-place > strong { font: bold 2.4rem Georgia, serif; }
@media (max-width: 640px) {
  main { padding-top: .75rem; }
  h1 { font-size: clamp(1.55rem, 9vw, 2.2rem); }
  .live-header-context { font-size: .75rem; }
  .live-brand { gap: .5rem; }
  .live-brand .live-header-context { min-width: 0; font-size: .65rem; overflow-wrap: anywhere; }
  th, td { padding: .6rem; }
  .live-athlete-summary, .live-podium { grid-template-columns: 1fr; }
  .live-podium-place { min-height: 0 !important; order: initial !important; }
  .live-title-row { align-items: flex-start; }
  .live-status-badge { margin: 0; }
  .live-panel-heading { align-items: flex-start; flex-direction: column; gap: .15rem; }
  .live-queue ol { grid-template-columns: 1fr; }
  .live-scoreboard-tools { align-items: stretch; flex-direction: column; }
  .live-scoreboard-tools select { min-width: 0; width: 100%; }
  .live-scoreboard-tools button { margin-left: 0; }
}
@media (max-width: 900px) {
  .live-header { grid-template-columns: minmax(0, 1fr) auto; gap: .25rem .75rem; }
  .live-brand { min-width: 0; }
  .live-competition-head { grid-column: 1 / -1; grid-row: 2; justify-items: start; text-align: left; }
  .live-title-row { justify-content: flex-start; }
  .live-title-row h1, .live-competition-head > #competition-meta { overflow: visible; text-overflow: clip; white-space: normal; }
  .live-header-actions { grid-column: 2; grid-row: 1; }
}
@media (min-width: 641px) and (max-width: 1100px) {
  .live-queue ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .live-scoreboard-lifts-1,
  .live-scoreboard-lifts-2,
  .live-scoreboard-lifts-3 { width: 100%; min-width: 0; }
  .live-scoreboard col.live-col-place,
  .live-scoreboard col.live-col-lot { width: 3%; }
  .live-scoreboard col.live-col-name { width: 12%; }
  .live-scoreboard col.live-col-affiliation,
  .live-scoreboard col.live-col-category { width: 5%; }
  .live-scoreboard col.live-col-bodyweight { width: 4%; }
  .live-scoreboard col.live-col-attempt { width: 4.1%; }
  .live-scoreboard col.live-col-lift-result { width: 4.4%; }
  .live-scoreboard col.live-col-total { width: 5.5%; }
  .live-scoreboard col.live-col-points { width: 4.4%; }
  .live-scoreboard col.live-col-projection { width: 5.3%; }
}
@media (prefers-reduced-motion: no-preference) {
  main { animation: reveal .3s ease-out both; }
  @keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  @keyframes record-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
}
@media (prefers-reduced-motion: reduce) {
  .live-record-mark { animation: none; }
}
