/* A carnival event's results page. Path: public/css/results-event.css
   The Intercity Shield live results page (results.tbnq.org.au,
   static/css/results-live.css and athlete-panel.css) on the dark ground of
   results-site.css, in the scoring display's colours: a win is green, a loss
   red, a draw purple, a bye amber. Phone first at 360px: a row never runs off
   the side, the numbers that matter sit beside the name, the rest one line
   under it. Loaded after results-site.css. */

/* ---- Competition switch: Clash or Cup ------------------------------------ */
.lv-comp { position: relative; display: grid; grid-template-columns: 1fr 1fr; max-width: 420px; margin: 14px 0 0; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, 0.45); border: 1px solid var(--rs-line); isolation: isolate; }
.lv-comp:empty { display: none; }
.lv-comp-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 10px; background: linear-gradient(135deg, var(--rs-red), #7f1d1d); box-shadow: 0 0 22px rgba(220, 38, 38, 0.45); transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), background 0.28s ease; z-index: 0; }
.lv-comp.is-right .lv-comp-thumb { transform: translateX(100%); background: linear-gradient(135deg, var(--rs-brand), var(--rs-brand-light)); box-shadow: 0 0 22px rgba(124, 58, 237, 0.5); }
.lv-comp-opt { all: unset; position: relative; z-index: 1; cursor: pointer; text-align: center; padding: 9px 6px; font-family: var(--rs-display); font-size: 20px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rs-muted); transition: color 0.2s ease; }
.lv-comp-opt.is-on { color: #fff; }
.lv-comp-opt small { display: block; font-family: var(--rs-body); font-size: 9px; font-weight: 700; letter-spacing: 0.16em; opacity: 0.8; margin-top: -2px; }

/* ---- Sub tabs ------------------------------------------------------------ */
.lv-subwrap { margin-bottom: 14px; }
.lv-subtabs { display: flex; flex-direction: column; gap: 8px; }
.lv-switchrow { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; width: 100%; }
.lv-switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; min-width: 0; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--rs-line); border-radius: 999px; padding: 3px; isolation: isolate; }
.lv-switch-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); background: linear-gradient(135deg, var(--rs-brand), var(--rs-brand-light)); border-radius: 999px; transition: transform 0.2s 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 6px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--rs-muted); text-align: center; white-space: nowrap; overflow: hidden; transition: color 0.18s; }
.lv-switch-opt.is-on { color: #fff; }
.lv-gamerow { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; width: 100%; }
.lv-gamerow .lv-divtab { min-width: 0; padding: 7px 0; font-size: clamp(10px, 2.9vw, 13px); text-align: center; white-space: nowrap; border-radius: 8px; }
.lv-gamerow .lv-divtab.is-pos { border-style: dashed; border-color: var(--rs-amber); }
.lv-h2 { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 10px; }
.lv-h2 small { font-family: var(--rs-body); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: none; color: var(--rs-muted); }
.lv-note { font-size: 12px; color: var(--rs-muted); margin: -4px 0 10px; }

/* ---- Team standings: one card per team ------------------------------------ */
.lv-list { display: grid; gap: 6px; }
.lv-trow { display: grid; grid-template-columns: 30px 34px minmax(0, 1fr) auto; grid-template-areas: "rank logo name total" "stats stats stats stats"; gap: 4px 8px; align-items: center; padding: 9px 10px; border-radius: 12px; background: var(--rs-panel); border: 1px solid var(--rs-line); }
.lv-trow:nth-child(odd) { background: var(--rs-panel-2); }
.lv-trow.is-first { background: linear-gradient(120deg, rgba(245, 197, 66, 0.2), rgba(255, 255, 255, 0.04) 60%); border-color: rgba(245, 197, 66, 0.45); }
.lv-rank { grid-area: rank; font-family: var(--rs-display); font-size: 20px; color: var(--rs-muted); text-align: center; }
.is-first .lv-rank { color: #f5c542; }
.lv-tlogo { grid-area: logo; width: 34px; height: 34px; object-fit: contain; border-radius: 6px; }
.lv-tlogo-none { display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.08); font-family: var(--rs-display); font-size: 13px; color: var(--rs-muted); }
.lv-tname { grid-area: name; min-width: 0; font-weight: 800; font-size: 15px; line-height: 1.15; overflow-wrap: anywhere; }
.lv-tname small { display: block; font-size: 11px; font-weight: 600; color: var(--rs-muted); }
.lv-ttotal { grid-area: total; text-align: right; line-height: 1; }
.lv-ttotal b { display: block; font-family: var(--rs-display); font-weight: 400; font-size: 26px; letter-spacing: 0.02em; }
.lv-ttotal span { font-size: 9px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--rs-muted); }
.lv-stats { grid-area: stats; display: flex; flex-wrap: wrap; gap: 4px; font-variant-numeric: tabular-nums; }
.lv-stats span { display: inline-flex; align-items: baseline; gap: 4px; background: rgba(255, 255, 255, 0.06); border-radius: 6px; padding: 2px 7px; font-size: 11px; color: var(--rs-muted); }
.lv-stats b { font-size: 13px; color: var(--rs-text); }
.lv-stats .is-w b { color: var(--rs-green); }
.lv-stats .is-l b { color: #f87171; }
/* Strikes, spares and opens: a line of their own, marked in the board's colours. */
.lv-trow.has-marks { grid-template-areas: "rank logo name total" "stats stats stats stats" "marks marks marks marks"; }
.lv-as-row.has-marks { grid-template-areas: "rank photo name total" "stats stats stats stats" "marks marks marks marks" "pills pills pills pills"; }
.lv-stats.lv-marks { grid-area: marks; }
.lv-marks .is-x b { color: var(--rs-purple); }
.lv-marks .is-sp b { color: var(--rs-green); }
.lv-marks .is-op b { color: #f87171; }
.lv-stats b.is-w { color: var(--rs-green); }
.lv-stats b.is-l { color: #f87171; }
.lv-stats .lv-rec b:not(:last-child) { margin-right: 3px; }

/* ---- Bowler rows (All Stars and the Cup) ---------------------------------- */
.lv-as-row { display: grid; grid-template-columns: 30px 38px minmax(0, 1fr) auto; grid-template-areas: "rank photo name total" "stats stats stats stats" "pills pills pills pills"; gap: 5px 8px; align-items: center; padding: 9px 10px; border-radius: 12px; background: var(--rs-panel); border: 1px solid var(--rs-line); }
.lv-as-row:nth-child(odd) { background: var(--rs-panel-2); }
.lv-as-row.is-first { background: linear-gradient(120deg, rgba(245, 197, 66, 0.2), rgba(255, 255, 255, 0.04) 60%); border-color: rgba(245, 197, 66, 0.45); }
.lv-as-row.lv-as-out { opacity: 0.5; }
.lv-as-rank { grid-area: rank; font-family: var(--rs-display); font-size: 20px; color: var(--rs-muted); text-align: center; }
.is-first .lv-as-rank { color: #f5c542; }
.lv-avatar { grid-area: photo; width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--rs-display); font-size: 14px; letter-spacing: 0.04em; background: conic-gradient(from 210deg, var(--rs-brand), var(--rs-purple), var(--rs-red), var(--rs-brand)); box-shadow: inset 0 0 0 3px rgba(10, 10, 13, 0.85); }
.lv-avatar.is-tint { background: var(--lv-tint, var(--rs-brand)); color: var(--lv-tint-text, #fff); box-shadow: none; font-size: 13px; }
/* A tagged face sits over the initials once it loads, inside the colour ring. */
.lv-avatar, .ap-avatar { position: relative; }
.lv-avatar img, .ap-avatar img { position: absolute; top: 2px; left: 2px; width: calc(100% - 4px); height: calc(100% - 4px); border-radius: 50%; object-fit: cover; object-position: 50% 40%; opacity: 0; transition: opacity 0.35s ease; }
.ap-avatar img { top: 3px; left: 3px; width: calc(100% - 6px); height: calc(100% - 6px); }
.lv-avatar.has-photo img, .ap-avatar.has-photo img { opacity: 1; }
.lv-avatar-squad { position: absolute; right: -4px; bottom: -3px; z-index: 1; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: var(--lv-tint, var(--rs-brand)); color: var(--lv-tint-text, #fff); font-size: 10px; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px #0a0a0d; }
.lv-as-name { grid-area: name; min-width: 0; }
.lv-as-name button { all: unset; cursor: pointer; font-weight: 800; font-size: 15px; line-height: 1.15; color: var(--rs-text); overflow-wrap: anywhere; }
.lv-as-name button:hover, .lv-as-name button:focus-visible { color: var(--rs-purple); }
.lv-as-team { display: block; font-size: 11px; color: var(--rs-muted); }
.lv-dest { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; background: rgba(34, 197, 94, 0.16); color: var(--rs-green); vertical-align: 1px; }
.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: 34px; padding: 3px 4px 2px; border-radius: 7px; background: rgba(255, 255, 255, 0.07); font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 800; color: var(--rs-text); transition: transform 0.12s ease; }
.lv-pill:active { transform: scale(0.94); }
.lv-pill small { font-size: 9px; font-weight: 700; color: var(--rs-muted); }
.lv-pill.lv-pill-W { background: rgba(34, 197, 94, 0.22); }
.lv-pill.lv-pill-L { background: rgba(220, 38, 38, 0.24); }
.lv-pill.lv-pill-D { background: rgba(168, 85, 247, 0.28); }
.lv-pill.lv-pill-BYE { background: rgba(245, 158, 11, 0.24); }
.lv-pill.is-high { box-shadow: inset 0 0 0 1.5px #f5c542; }
.lv-pill.is-pos { outline: 1.5px dashed var(--rs-amber); outline-offset: -2px; }
.lv-pill:hover, .lv-pill:focus-visible { outline: 2px solid var(--rs-purple); }

/* Cut line: the ribbon between places that go on and places that do not. */
.lv-cut { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--rs-purple); }
.lv-cut::before, .lv-cut::after { content: ''; flex: 1 1 auto; height: 2px; background: linear-gradient(90deg, transparent, var(--rs-brand-light), transparent); }

.lv-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 0 0 10px; font-size: 11px; color: var(--rs-muted); }
.lv-legend-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; }
.lv-legend .sw-W { background: rgba(34, 197, 94, 0.5); } .lv-legend .sw-L { background: rgba(220, 38, 38, 0.55); }
.lv-legend .sw-D { background: rgba(168, 85, 247, 0.6); } .lv-legend .sw-BYE { background: rgba(245, 158, 11, 0.55); }
.lv-legend .sw-pos { background: transparent; outline: 1.5px dashed var(--rs-amber); outline-offset: -2px; }
.lv-legend .sw-high { background: transparent; box-shadow: inset 0 0 0 1.5px #f5c542; }
.lv-instructions { background: rgba(109, 40, 217, 0.12); border: 1px solid rgba(124, 58, 237, 0.3); color: #d4d4dc; border-radius: 10px; padding: 8px 10px; font-size: 12px; margin: 0 0 10px; line-height: 1.45; }
.lv-instructions strong { color: #fff; }

/* ---- Matchups: head to head cards ---------------------------------------- */
.lv-matchups { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.lv-mu-card { --lv-mu-scale: 1; background: rgba(0, 0, 0, 0.5); color: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--rs-line); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4); }
.lv-mu-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 12px 12px; background: linear-gradient(135deg, rgba(109, 40, 217, 0.4), rgba(26, 5, 8, 0.8)); }
.lv-mu-team { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lv-mu-right { text-align: right; align-items: flex-end; }
.lv-mu-logo { width: 28px; height: 28px; object-fit: contain; }
.lv-mu-name { font-weight: 800; font-size: 13px; letter-spacing: 0.02em; text-transform: uppercase; overflow-wrap: anywhere; line-height: 1.15; }
.lv-mu-total { font-family: var(--rs-display); font-weight: 400; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.lv-mu-res-W { color: var(--rs-green); } .lv-mu-res-L { color: #f87171; } .lv-mu-res-D { color: var(--rs-purple); } .lv-mu-res-BYE { color: var(--rs-amber); }
.lv-mu-mid { text-align: center; }
.lv-mu-game { font-size: 9px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.7; }
.lv-mu-line { font-family: var(--rs-display); font-size: 20px; letter-spacing: 0.04em; }
.lv-mu-body { padding: 6px 8px 8px; }
.lv-mu-row { display: grid; grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr); align-items: center; gap: 4px; padding: 3px 0; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.lv-mu-pos { text-align: center; font-size: 10px; opacity: 0.5; font-variant-numeric: tabular-nums; }
.lv-mu-bowler { display: flex; justify-content: space-between; align-items: baseline; gap: 5px; min-width: 0; padding: 5px 6px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.lv-mu-bowler.lv-mu-right { flex-direction: row-reverse; }
.lv-mu-bname { all: unset; cursor: pointer; font-size: calc(13px * var(--lv-mu-scale)); white-space: nowrap; overflow: hidden; min-width: 0; flex: 1 1 auto; }
.lv-mu-right .lv-mu-bname { text-align: right; }
.lv-mu-score { font-weight: 800; font-size: calc(16px * var(--lv-mu-scale)); white-space: nowrap; flex: 0 0 auto; }
.lv-mu-won { background: rgba(34, 197, 94, 0.16); }
.lv-mu-won .lv-mu-score { color: var(--rs-green); }
.lv-mu-drawn { background: rgba(168, 85, 247, 0.18); }
.lv-mu-vac { font-size: 12px; opacity: 0.5; font-style: italic; }
.lv-mu-seed { font-size: 10px; font-weight: 700; color: var(--rs-muted); }
.lv-mu-lanes { font-size: 10px; letter-spacing: 0.1em; color: var(--rs-muted); }

/* Cup matchplay: one bowler against one bowler. */
.lv-cm-card { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--rs-line); background: rgba(0, 0, 0, 0.45); }
.lv-cm-side { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; min-width: 0; }
.lv-cm-side.is-right { text-align: right; align-items: flex-end; }
.lv-cm-side.is-W { background: linear-gradient(90deg, rgba(34, 197, 94, 0.22), transparent); }
.lv-cm-side.is-right.is-W { background: linear-gradient(270deg, rgba(34, 197, 94, 0.22), transparent); }
.lv-cm-side.is-D { background: rgba(168, 85, 247, 0.16); }
.lv-cm-name { font-weight: 800; font-size: 14px; line-height: 1.15; overflow-wrap: anywhere; }
.lv-cm-top { display: flex; align-items: center; gap: 6px; }
.lv-cm-side.is-right .lv-cm-top { flex-direction: row-reverse; }
.lv-avatar.lv-cm-face { grid-area: auto; flex: 0 0 auto; width: 30px; height: 30px; font-size: 11px; }
.lv-cm-club { font-size: 10px; color: var(--rs-muted); }
.lv-cm-score { font-family: var(--rs-display); font-size: 26px; line-height: 1; margin-top: 2px; }
.is-W .lv-cm-score { color: var(--rs-green); }
.is-L .lv-cm-score { color: #f87171; }
.is-D .lv-cm-score { color: var(--rs-purple); }
.lv-cm-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 6px; font-size: 10px; color: var(--rs-muted); border-left: 1px solid var(--rs-line); border-right: 1px solid var(--rs-line); }
.lv-cm-mid b { font-family: var(--rs-display); font-weight: 400; font-size: 15px; color: var(--rs-text); }

/* ---- Tables (high games) -------------------------------------------------- */
.lv-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 13px; }
.lv-table th { text-align: right; font-size: 9px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--rs-muted); padding: 6px 6px; border-bottom: 1px solid var(--rs-line); }
.lv-table td { text-align: right; padding: 7px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.lv-table th.is-text, .lv-table td.is-text { text-align: left; }
.lv-table td.is-text { overflow-wrap: anywhere; }
.lv-table td.is-text small { display: block; font-size: 10px; color: var(--rs-muted); }
.lv-table td.is-score { font-weight: 800; font-size: 15px; }
.lv-table tr:first-child td.is-score { color: #f5c542; }
.lv-table button { all: unset; cursor: pointer; font-weight: 700; }
.lv-table button:hover { color: var(--rs-purple); }
.lv-highs { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.lv-box { background: var(--rs-panel); border: 1px solid var(--rs-line); border-radius: 12px; padding: 10px; min-width: 0; }
.lv-box h3 { margin: 0 0 4px; font-family: var(--rs-display); font-weight: 400; font-size: 16px; letter-spacing: 0.08em; text-transform: uppercase; }

/* Cup stepladder: the champion first, then where everybody else finished, then
   the matches from the final down. */
.lv-sl-champ { position: relative; overflow: hidden; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; margin-bottom: 8px; border-radius: 14px; background: linear-gradient(120deg, rgba(245, 197, 66, 0.28), rgba(255, 255, 255, 0.04) 65%); border: 1px solid rgba(245, 197, 66, 0.55); }
.lv-sl-champ::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.14), transparent); transform: skewX(-18deg); animation: lv-shine 4.5s ease-in-out 0.6s infinite; pointer-events: none; }
@keyframes lv-shine { 0% { left: -40%; } 40%, 100% { left: 130%; } }
.lv-avatar.lv-sl-champ-face { grid-area: auto; width: 64px; height: 64px; font-size: 22px; box-shadow: 0 0 0 2px #f5c542, 0 0 22px rgba(245, 197, 66, 0.45); }
.lv-sl-champ-text { min-width: 0; }
.lv-sl-champ-tag { display: block; font-size: 10px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: #f5c542; }
.lv-sl-champ-name { all: unset; cursor: pointer; display: block; font-family: var(--rs-display); font-size: 22px; line-height: 1.05; letter-spacing: 0.02em; text-transform: uppercase; overflow-wrap: anywhere; color: var(--rs-text); }
.lv-sl-champ-club { display: block; margin-top: 2px; font-size: 11px; color: var(--rs-muted); }
.lv-sl-champ-score { text-align: right; }
.lv-sl-champ-score b { display: block; font-family: var(--rs-display); font-weight: 400; font-size: 34px; line-height: 1; color: #f5c542; }
.lv-sl-champ-score span { font-size: 11px; color: var(--rs-muted); }
.lv-sl-places { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
@media (min-width: 640px) { .lv-sl-places { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.lv-sl-place { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 6px 7px; border-radius: 10px; background: var(--rs-panel); border: 1px solid var(--rs-line); }
.lv-sl-place-no { flex: 0 0 auto; min-width: 22px; font-family: var(--rs-display); font-size: 14px; color: var(--rs-muted); }
.lv-avatar.lv-sl-place-face { grid-area: auto; flex: 0 0 auto; width: 24px; height: 24px; font-size: 9px; }
.lv-sl-place-name { all: unset; cursor: pointer; min-width: 0; font-weight: 700; font-size: 12px; line-height: 1.15; overflow-wrap: break-word; color: var(--rs-text); }
.lv-sl-place-who { display: flex; flex-direction: column; min-width: 0; }
.lv-sl-place-fig { font-family: var(--rs-display); font-size: 13px; line-height: 1.1; color: var(--rs-muted); }
/* Awards: each award its own block, the winner first. */
.lv-aw-block { margin-bottom: 12px; }
.lv-aw-h3 { margin: 0 0 5px; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rs-muted); }
.lv-sl-champ.is-compact { grid-template-columns: 50px minmax(0, 1fr) auto; gap: 10px; padding: 9px 12px; margin-bottom: 6px; }
.lv-sl-champ.is-compact .lv-sl-champ-face { width: 50px; height: 50px; font-size: 18px; }
.lv-sl-champ.is-compact .lv-sl-champ-name { font-size: 20px; }
.lv-sl-champ.is-compact .lv-sl-champ-score b { font-size: 30px; }
.lv-sl-list .lv-cm-side.is-L { opacity: 0.55; }
.lv-sl-final { border-color: rgba(245, 197, 66, 0.55); box-shadow: 0 8px 24px rgba(245, 197, 66, 0.08); }
.lv-sl-final .lv-cm-mid b { color: #f5c542; }
.lv-cm-mid b { white-space: nowrap; }
.lv-sl-tie { margin-left: 6px; font-family: var(--rs-body); font-size: 11px; color: var(--rs-muted); }
.lv-sl-wait { justify-content: center; opacity: 0.6; }

/* ---- Bottom sheet ---------------------------------------------------------- */
.lv-pop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; }
.lv-pop-card { position: relative; width: 100%; max-height: 90vh; overflow: auto; background: #121217; color: var(--rs-text); border-radius: 18px 18px 0 0; border-top: 2px solid var(--rs-brand); padding: 16px 14px 24px; animation: lv-sheet 320ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes lv-sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.lv-pop-body { padding-right: 36px; }
.lv-pop-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 20px; cursor: pointer; }
.lv-pop-back { all: unset; cursor: pointer; display: inline-block; margin-bottom: 8px; font-size: 12px; font-weight: 800; color: var(--rs-purple); }
@media (min-width: 820px) {
  .lv-pop { align-items: center; }
  .lv-pop-card { width: min(980px, 94vw); border-radius: 18px; border: 1px solid rgba(124, 58, 237, 0.5); }
}

/* ---- One game, frame by frame ---------------------------------------------- */
.lv-grid-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.lv-grid-title { font-family: var(--rs-display); font-weight: 400; font-size: 22px; letter-spacing: 0.03em; text-transform: uppercase; line-height: 1.05; }
.lv-grid-meta { font-size: 12px; color: var(--rs-muted); }
.lv-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
@media (min-width: 640px) { .lv-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); } }
.lv-frame { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--rs-line); border-radius: 8px; padding: 5px 3px 4px; text-align: center; font-variant-numeric: tabular-nums; min-width: 0; }
.lv-frame-n { font-size: 9px; letter-spacing: 0.1em; opacity: 0.6; }
.lv-frame-marks { display: flex; justify-content: flex-end; gap: 2px; margin: 3px 0; }
.lv-mark { flex: 1; min-width: 0; background: rgba(255, 255, 255, 0.08); border-radius: 4px; padding: 3px 0; font-weight: 800; font-size: 14px; }
.lv-mark-X { background: var(--rs-brand-light); color: #fff; }
.lv-mark-S { background: rgba(34, 197, 94, 0.35); color: #fff; }
.lv-mark-split { text-decoration: underline; text-decoration-color: #f87171; text-decoration-thickness: 2px; }
.lv-frame-speeds { display: flex; justify-content: flex-end; gap: 2px; font-size: 9px; opacity: 0.75; }
.lv-frame-speeds span { flex: 1; min-width: 0; }
.lv-frame.is-ten .lv-frame-speeds { gap: 1px; font-size: 7.5px; letter-spacing: -0.02em; }
.lv-frame-total { font-family: var(--rs-display); font-size: 17px; margin-top: 2px; }
.lv-frame-pins { display: block; margin: 3px auto 0; width: 40px; height: 32px; }
.lv-frame-leave { font-size: 9px; opacity: 0.75; min-height: 11px; }
.lv-grid-foot { font-size: 11px; color: var(--rs-muted); margin-top: 8px; }

/* ---- A bowler ---------------------------------------------------------------- */
.ap-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.ap-avatar { width: 64px; height: 64px; flex: 0 0 auto; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--rs-display); font-size: 24px; background: conic-gradient(from 210deg, var(--rs-brand), var(--rs-purple), var(--rs-red), var(--rs-brand)); box-shadow: inset 0 0 0 4px #121217, 0 0 24px rgba(124, 58, 237, 0.45); }
.ap-name { font-family: var(--rs-display); font-weight: 400; font-size: 26px; line-height: 1; letter-spacing: 0.03em; text-transform: uppercase; overflow-wrap: anywhere; }
.ap-team { font-size: 12px; color: var(--rs-muted); margin-top: 2px; }
.ap-section { margin-top: 16px; }
.ap-h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 8px; font-family: var(--rs-display); font-weight: 400; font-size: 18px; letter-spacing: 0.08em; text-transform: uppercase; }
.ap-h3 small { font-family: var(--rs-body); font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--rs-muted); }
.ap-h4 { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rs-muted); margin: 10px 0 6px; }
.ap-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 640px) { .ap-tiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); } }
.ap-tile { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--rs-line); border-radius: 10px; padding: 7px 8px; font-variant-numeric: tabular-nums; min-width: 0; }
.ap-tile-label { font-size: 9px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rs-muted); }
.ap-tile-value { font-family: var(--rs-display); font-size: 22px; line-height: 1.1; margin-top: 2px; color: #fff; }
.ap-tile-value.ap-tile-absent { color: var(--rs-muted); font-size: 16px; }
.ap-tile-value.ap-tile-thin { opacity: 0.7; }
.ap-tile-sub { font-size: 10px; color: var(--rs-muted); margin-top: 1px; }
.ap-note { font-size: 12px; color: var(--rs-muted); margin: 0 0 6px; }

/* ---- Entrance ---------------------------------------------------------------- */
.lv-in { animation: lv-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes lv-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .lv-in, .lv-pop-card, .lv-sl-champ::after { animation: none; }
  .lv-comp-thumb, .lv-switch-thumb { transition: none; }
}

/* ---- Phone: the hero gives way so the answer is on the first screen ------- */
.lv-sub .lv-live-badge { font-size: 10px; vertical-align: 1px; }
.lv-hint { font-size: 12px; color: var(--rs-muted); margin: -4px 0 8px; }
.lv-hint strong { color: var(--rs-text); }
@media (max-width: 560px) {
  .lv-hero { padding-top: 12px; }
  .lv-title { font-size: clamp(26px, 8.4vw, 40px); margin: 4px 0 2px; }
  .lv-sub { font-size: 12px; }
  .lv-comp { margin-top: 10px; max-width: none; }
  .lv-comp-opt { padding: 6px 4px; font-size: 17px; }
  .lv-comp-opt small { display: none; }
  .lv-hero .lv-tabs { margin-top: 10px; padding-bottom: 10px; gap: 5px 6px; }
  .lv-hero .lv-divtab { padding: 6px 11px; font-size: 12.5px; }
  .lv-subwrap { margin-bottom: 10px; }
  .lv-h2 { margin-bottom: 6px; }
  .lv-legend { margin-bottom: 8px; }
  /* A bowler's games as a scorecard: ten to a row, so twenty games are two
     rows and nine are one. */
  .lv-as-row .lv-as-pills { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
  .lv-as-row .lv-pill { min-width: 0; padding: 3px 0 2px; font-size: 12px; }
  .lv-as-row .lv-pill small { font-size: 8px; }
  .lv-gamerow .lv-divtab { padding: 6px 0; }
  .lv-mu-head { padding: 9px 10px; }
  .lv-mu-total { font-size: 26px; }
  .lv-mu-bowler { padding: 4px 6px; }
  /* A row's figures on one line at 360: tighter chips, same order. */
  .lv-stats { gap: 3px; }
  .lv-trow, .lv-as-row { padding-left: 8px; padding-right: 8px; }
  .lv-stats span { gap: 3px; padding: 2px 4px; font-size: 10.5px; }
  .lv-stats b { font-size: 12.5px; }
}
