/* Live results page. Path: static/css/results-live.css
   Stadium ground, one accent per committee, tabular figures. 375px baseline. */

.lv-hero[hidden], .lv-lastgame[hidden], .lv-pop[hidden], .lv-logo[hidden] { display: none; }

.lv-hero {
    background: radial-gradient(1200px 400px at 20% -20%, #2b3a55 0%, #101722 60%, #0b1017 100%);
    color: #fff;
    margin: -20px -20px 18px;
    padding: 22px 20px 0;
    border-bottom: 3px solid #b6ed3a;
}
.lv-hero[data-event-type="NQAC"] { border-bottom-color: #7a1f3d; }
.lv-hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1180px; margin: 0 auto; }
.lv-hero-text { min-width: 0; }
.lv-live-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: #ffb3b3; font-weight: 700; }
.lv-live-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff3b3b; animation: lv-pulse 1.4s ease-out infinite; }
@keyframes lv-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,59,59,.7); } 70% { box-shadow: 0 0 0 9px rgba(255,59,59,0); } 100% { box-shadow: 0 0 0 0 rgba(255,59,59,0); } }
.lv-title { margin: 6px 0 4px; font-size: clamp(22px, 4vw, 38px); line-height: 1.05; letter-spacing: -0.5px; }
.lv-sub { font-size: 13px; opacity: .8; }
.lv-sep { opacity: .5; margin: 0 6px; }
.lv-logo { height: 72px; max-width: 140px; object-fit: contain; flex: 0 0 auto; }

.lv-divtabs { display: flex; flex-wrap: wrap; gap: 8px; max-width: 1180px; margin: 16px auto 0; padding-bottom: 12px; }
.lv-divtab { border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: normal; text-align: left; }
.lv-divtab[aria-selected="true"] { background: #b6ed3a; color: #101722; border-color: #b6ed3a; }
.lv-hero[data-event-type="NQAC"] .lv-divtab[aria-selected="true"] { background: #7a1f3d; color: #fff; border-color: #7a1f3d; }

.lv-block { max-width: 1180px; margin: 0 auto 26px; }
.lv-h2 { font-size: 15px; letter-spacing: 3px; text-transform: uppercase; color: #4a5568; margin: 0 0 10px; }
.lv-hint { margin: -4px 0 10px; font-size: 12px; color: #718096; }
.lv-empty { padding: 18px; background: #fff; border-radius: 12px; color: #718096; font-size: 14px; border: 1px dashed #d7dce6; }

/* Last game strip */
.lv-lastgame { max-width: 1180px; margin: 0 auto 26px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.lv-lg-card { background: #101722; color: #fff; border-radius: 12px; padding: 12px 14px; }
.lv-lg-head { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; opacity: .7; margin-bottom: 6px; }
.lv-lg-row { display: flex; justify-content: space-between; align-items: baseline; font-variant-numeric: tabular-nums; }
.lv-lg-team { font-weight: 700; }
.lv-lg-score { font-size: 20px; font-weight: 800; }
.lv-lg-meta { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; opacity: .65; margin-top: 4px; font-variant-numeric: tabular-nums; }
.lv-lg-res-W { color: #b6ed3a; } .lv-lg-res-L { color: #ff8a8a; } .lv-lg-res-D, .lv-lg-res-BYE { color: #ffd66b; }

/* Standings table */
.lv-standings table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; font-variant-numeric: tabular-nums; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.lv-standings th, .lv-standings td { padding: 10px 10px; text-align: right; font-size: 14px; border-bottom: 1px solid #edf0f5; }
.lv-standings th { background: #101722; color: #fff; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }
.lv-standings th:first-child, .lv-standings td:first-child, .lv-standings th.lv-team, .lv-standings td.lv-team { text-align: left; }
.lv-standings td.lv-team { font-weight: 700; white-space: normal; }
.lv-standings tr:nth-child(1) td.lv-rank { color: #6b9e1c; font-weight: 800; }
.lv-standings .lv-logo-sm { height: 22px; width: 22px; object-fit: contain; vertical-align: middle; margin-right: 6px; border-radius: 4px; }
.lv-delta-up { color: #2f855a; font-size: 11px; } .lv-delta-down { color: #c53030; font-size: 11px; }
.lv-standings-scroll { overflow-x: auto; }

/* All Stars: rank, photo and name on one line, the figures on the next,
   the game pills on the third. Nothing wider than the phone. */
.lv-allstars { display: grid; gap: 8px; }
.lv-as-row { background: #fff; border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: 28px 40px minmax(0, 1fr); grid-template-areas: "rank photo name" "stats stats stats" "pills pills pills"; gap: 6px 8px; align-items: center; box-shadow: 0 1px 2px rgba(0,0,0,.06); overflow: hidden; }
.lv-as-rank { grid-area: rank; font-weight: 800; color: #4a5568; font-variant-numeric: tabular-nums; }
.lv-as-photo { grid-area: photo; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #243447; }
.lv-as-name { grid-area: name; min-width: 0; }
.lv-as-name button { all: unset; cursor: pointer; font-weight: 800; font-size: 15px; color: #14181f; white-space: normal; overflow-wrap: anywhere; }
.lv-as-name button:hover, .lv-as-name button:focus { color: #6b9e1c; }
.lv-as-team { display: block; font-size: 12px; color: #718096; }
.lv-as-stats { grid-area: stats; display: flex; flex-wrap: wrap; gap: 4px 6px; font-variant-numeric: tabular-nums; }
.lv-as-stats div { display: inline-flex; align-items: baseline; gap: 4px; background: #f1f4f9; border-radius: 6px; padding: 3px 8px; font-size: 11px; color: #4a5568; }
.lv-as-stats strong { font-size: 14px; color: #14181f; }
.lv-as-stats div:first-child { background: #101722; color: #cbd2de; }
.lv-as-stats div:first-child strong { color: #b6ed3a; }
.lv-as-pills { grid-area: pills; display: flex; flex-wrap: wrap; gap: 4px; }
.lv-pill { all: unset; cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; min-width: 40px; padding: 3px 5px; border-radius: 8px; background: #edf0f5; font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 700; color: #14181f; }
.lv-pill small { font-size: 10px; font-weight: 600; color: #718096; }
.lv-pill.lv-pill-W { background: #e6f6d5; } .lv-pill.lv-pill-L { background: #fde8e8; } .lv-pill.lv-pill-BYE { background: #fff5d6; } .lv-pill.lv-pill-D { background: #ede4fb; }
.lv-pill:hover, .lv-pill:focus { outline: 2px solid #b6ed3a; }
@media (min-width: 820px) {
    .lv-as-row { grid-template-columns: 34px 44px minmax(160px, 1fr) auto; grid-template-areas: "rank photo name stats" "pills pills pills pills"; }
    .lv-as-photo { width: 44px; height: 44px; }
}

/* Next round */
.lv-nextround { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.lv-nr-card { background: #fff; border-radius: 12px; padding: 10px 12px; font-size: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.lv-nr-lane { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: #718096; }

/* Popover / bottom sheet */
.lv-pop { position: fixed; inset: 0; background: rgba(8,12,18,.55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.lv-pop-card { background: #fff; width: 100%; max-height: 88vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 18px 16px 24px; position: relative; }
.lv-pop-body { padding-right: 44px; }
.lv-pop-close { position: absolute; top: 8px; right: 10px; border: 0; background: #edf0f5; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; cursor: pointer; }
@media (min-width: 820px) {
    .lv-pop { align-items: center; }
    .lv-pop-card { width: min(980px, 94vw); max-height: 90vh; border-radius: 16px; }
}

/* Game grid */
.lv-grid-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: nowrap; }
.lv-grid-head .lv-grid-title { flex: 1 1 auto; min-width: 0; }
.lv-grid-head .lv-grid-meta { flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-grid-title { font-weight: 800; font-size: 17px; }
.lv-grid-meta { font-size: 12px; color: #718096; }
.lv-grid-scroll { overflow-x: auto; }
.lv-grid { display: grid; grid-template-columns: repeat(10, minmax(64px, 1fr)); gap: 4px; min-width: 700px; }
.lv-frame { background: #101722; color: #fff; border-radius: 8px; padding: 6px 4px 4px; text-align: center; font-variant-numeric: tabular-nums; }
.lv-frame-n { font-size: 10px; letter-spacing: 2px; opacity: .6; }
.lv-frame-marks { display: flex; justify-content: flex-end; gap: 3px; margin: 3px 0; }
.lv-mark { flex: 1; background: rgba(255,255,255,.08); border-radius: 4px; padding: 3px 0; font-weight: 800; font-size: 15px; }
.lv-mark-X { background: #b6ed3a; color: #101722; } .lv-mark-S { background: #ffd66b; color: #101722; }
.lv-mark-split { text-decoration: underline; text-decoration-color: #ff8a8a; text-decoration-thickness: 2px; }
.lv-frame-speeds { display: flex; justify-content: flex-end; gap: 3px; font-size: 10px; opacity: .8; }
.lv-frame-speeds span { flex: 1; }
.lv-frame-total { font-size: 15px; font-weight: 800; margin-top: 3px; }
.lv-frame-pins { margin: 4px auto 0; width: 44px; height: 36px; }
.lv-frame-leave { font-size: 10px; opacity: .8; min-height: 12px; }
.lv-grid-foot { font-size: 12px; color: #718096; margin-top: 8px; }

/* The hidden attribute must win over display:flex or the sheet sits over the page. */
.lv-pop[hidden] { display: none; }

/* Tabs */
.lv-tabs { display: flex; flex-wrap: wrap; gap: 8px; max-width: 1180px; margin: 16px auto 0; padding-bottom: 12px; }
.lv-subtabs { margin: 0 auto 4px; padding-bottom: 0; flex-direction: column; gap: 6px; }
.lv-subrow { display: flex; flex-wrap: wrap; gap: 8px; }
.lv-subtabs .lv-divtab { border-color: #cbd2de; background: #fff; color: #14181f; }
.lv-subtabs .lv-divtab[aria-selected="true"] { background: #101722; color: #fff; border-color: #101722; }
.lv-h3 { font-size: 13px; margin: 14px 0 6px; color: #4a5568; }
.lv-divcell { font-weight: 400; color: #718096; }
.lv-lastgame { margin-bottom: 18px; }

/* Matchups: head to head cards, the winner of each pair lit. */
.lv-matchups { display: grid; gap: 12px; }
.lv-mu-card { background: #101722; color: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.lv-mu-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 12px 14px; background: linear-gradient(135deg, #1c2a40, #101722); }
.lv-mu-team { min-width: 0; }
.lv-mu-right { text-align: right; }
.lv-mu-name { font-weight: 800; font-size: 15px; letter-spacing: .5px; text-transform: uppercase; overflow-wrap: anywhere; }
.lv-mu-total { font-size: 30px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; margin-top: 2px; }
.lv-mu-res-W { color: #b6ed3a; } .lv-mu-res-L { color: #ff8a8a; } .lv-mu-res-D, .lv-mu-res-BYE { color: #ffd66b; }
.lv-mu-mid { text-align: center; }
.lv-mu-game { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; opacity: .7; }
.lv-mu-vs { font-size: 18px; font-weight: 900; opacity: .85; }
.lv-mu-line { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .8; }
.lv-mu-body { padding: 6px 10px 10px; }
.lv-mu-row { display: grid; grid-template-columns: 1fr 20px 1fr; align-items: center; gap: 6px; padding: 6px 0; border-top: 1px solid rgba(255,255,255,.08); }
.lv-mu-pos { text-align: center; font-size: 11px; opacity: .55; font-variant-numeric: tabular-nums; }
.lv-mu-bowler { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; min-width: 0; padding: 4px 8px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.lv-mu-bowler.lv-mu-right { flex-direction: row-reverse; }
.lv-mu-card { --lv-mu-scale: 1; }
.lv-mu-bname { font-size: calc(13px * var(--lv-mu-scale)); white-space: nowrap; overflow: hidden; min-width: 0; flex: 1 1 auto; }
/* A bowler's name never wraps: every row stays one line high. A name too long
   for its cell is shrunk to fit by results-live.js (fitNames). */
/* A handicap total shows the scratch score in brackets beside it. */
.lv-mu-score { font-weight: 800; font-size: calc(16px * var(--lv-mu-scale)); white-space: nowrap; flex: 0 0 auto; }
.lv-mu-score small { font-weight: 500; font-size: calc(10px * var(--lv-mu-scale)); opacity: .7; margin-left: 2px; }
.lv-mu-pt { flex: 0 0 auto; }
.lv-mu-won { background: rgba(182,237,58,.14); }
.lv-mu-won .lv-mu-score { color: #b6ed3a; }
.lv-mu-vac { font-size: 12px; opacity: .5; }

/* Slide switches */
.lv-switchrow { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; width: 100%; }
.lv-switchrow .lv-switch { min-width: 0; }
.lv-switchrow .lv-switch-opt { padding: 7px 4px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.lv-switch { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; background: #e4e8ef; border-radius: 999px; padding: 3px; isolation: isolate; }
.lv-switch-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); background: #101722; border-radius: 999px; transition: transform .18s ease; z-index: 0; }
.lv-switch-right .lv-switch-thumb { transform: translateX(100%); }
.lv-switch-opt { all: unset; cursor: pointer; position: relative; z-index: 1; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #4a5568; text-align: center; white-space: nowrap; transition: color .18s; }
.lv-switch-opt.is-on { color: #fff; }
.lv-hero[data-event-type="NQAC"] ~ * .lv-switch-thumb { background: #7a1f3d; }

.lv-mu-line { font-size: 20px; font-weight: 900; }
.lv-mu-pt { font-size: 11px; font-weight: 700; opacity: .75; min-width: 22px; text-align: center; background: rgba(255,255,255,.08); border-radius: 6px; padding: 1px 4px; }
.lv-mu-won .lv-mu-pt { background: #b6ed3a; color: #101722; opacity: 1; }

/* The game strip stays on one line and slides sideways; everything else fits. */
/* The game pills wrap and shrink to the page width; the row never runs off the
   side of a phone. */
.lv-gamerow { flex-wrap: wrap; gap: 6px; padding-bottom: 2px; }
.lv-gamerow .lv-divtab { flex: 0 0 auto; padding: 5px 9px; font-size: 12px; min-width: 0; }

/* Legend and instructions above the individual list */
.lv-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 0 0 10px; font-size: 12px; color: #4a5568; }
.lv-legend-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -3px; margin-right: 4px; }
.lv-instructions { background: #101722; color: #cbd2de; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 0 0 10px; line-height: 1.45; }
.lv-instructions strong { color: #b6ed3a; }

/* High Games tab: the standings table look, one list under another. The first
   text column is the name, so it stays left and may wrap on a phone. */
.lv-high { margin-bottom: 18px; }
.lv-high-title { margin-top: 6px; }
.lv-high td.lv-high-score { font-weight: 800; color: #14181f; }

/* On a phone the page padding drops to 16px, so the hero bleeds by 16px, not
   20px. At 20px it stood 4px past each edge and the whole page slid sideways. */
@media (max-width: 700px) {
    .lv-hero { margin: -16px -16px 18px; }
}

/* A bowler who can no longer reach the minimum games for All Stars. */
.lv-as-row.lv-as-out { opacity: 0.5; }
.lv-as-row.lv-as-out .lv-as-name button { font-style: italic; }

/* Matchups game pills: every game the division has bowled fits ONE row across
   the page, the pills shrinking to share the width. Nothing slides off the
   page and nothing scrolls sideways. */
.lv-gamerow { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; width: 100%; overflow: hidden; }
.lv-gamerow .lv-divtab { min-width: 0; padding: 7px 0; font-size: clamp(9px, 2.6vw, 13px); text-align: center; white-space: nowrap; }

/* Award pills: each voted award in its own colour, in the tab row. */
.lv-divtab.lv-award-pill.lv-award-c1 { border-color: #f5d56a; color: #f5d56a; }
.lv-divtab.lv-award-pill.lv-award-c2 { border-color: #7dd3fc; color: #7dd3fc; }
.lv-divtab.lv-award-pill.lv-award-c3 { border-color: #f9a8d4; color: #f9a8d4; }
.lv-divtab.lv-award-pill.lv-award-c4 { border-color: #c4b5fd; color: #c4b5fd; }
.lv-divtab.lv-award-pill.lv-award-c5 { border-color: #fdba74; color: #fdba74; }
.lv-divtab.lv-award-pill.lv-award-c1[aria-selected="true"] { background: #f5d56a; color: #101722; }
.lv-divtab.lv-award-pill.lv-award-c2[aria-selected="true"] { background: #7dd3fc; color: #101722; }
.lv-divtab.lv-award-pill.lv-award-c3[aria-selected="true"] { background: #f9a8d4; color: #101722; }
.lv-divtab.lv-award-pill.lv-award-c4[aria-selected="true"] { background: #c4b5fd; color: #101722; }
.lv-divtab.lv-award-pill.lv-award-c5[aria-selected="true"] { background: #fdba74; color: #101722; }
.lv-award-winner { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 14px; margin: 8px 0; border-radius: 12px; background: #101722; color: #fff; border-left: 6px solid #b6ed3a; }
.lv-award-winner.lv-award-c1 { border-left-color: #f5d56a; } .lv-award-winner.lv-award-c2 { border-left-color: #7dd3fc; }
.lv-award-winner.lv-award-c3 { border-left-color: #f9a8d4; } .lv-award-winner.lv-award-c4 { border-left-color: #c4b5fd; } .lv-award-winner.lv-award-c5 { border-left-color: #fdba74; }
.lv-award-name { font-size: 20px; font-weight: 800; }
.lv-award-team { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: #b6ed3a; }

/* A finished event: the same page, marked FINAL. */
.lv-final-badge { color: #b6ed3a; }
.lv-hero[data-event-type="NQAC"] .lv-final-badge { color: #ffd0dc; }

/* A row of choice pills (the four divisions under an award, and any other
   choice with more than two options) is ONE row: the pills share the page
   width and shrink to fit. Same rule as the game strip. */
.lv-fitrow { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; width: 100%; overflow: hidden; }
.lv-fitrow .lv-divtab { min-width: 0; padding: 7px 2px; font-size: clamp(9px, 2.8vw, 13px); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
