/* Opus live-player composition, adapted to Relay's shared input and motion. */
#player,
#game-stats-pane {
  --vw: 100vw;
  --vh: 100vh;
  --lp-unit: min(calc(100vw / 120), calc(100vh / 67.5));
  --lp-surface: #0f131c;
  --lp-hair: rgba(255, 255, 255, 0.08);
  font-variant-numeric: tabular-nums;
}
#player {
  overflow: hidden;
  background: #06080d;
}
#video {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;
}
.game-stats-open #video {
  border-radius: calc(var(--lp-unit) * 0.8);
}
#video.video-direct {
  border-radius: 0;
}
#player-ui {
  z-index: 3;
  background: linear-gradient(#0009, transparent 25%, transparent 80%, #0007);
}
#player-ui .lp-chrome-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: calc(var(--lp-unit) * 1);
  padding: calc(var(--lp-unit) * 2.5) calc(var(--lp-unit) * 3);
}
.lp-chrome-fill {
  flex: 1;
}
#player-ui .lp-pill {
  display: flex;
  align-items: center;
  gap: calc(var(--lp-unit) * 0.95);
  height: calc(var(--lp-unit) * 4.5);
  padding: 0 calc(var(--lp-unit) * 1.75) 0 calc(var(--lp-unit) * 0.75);
  border: 0;
  border-radius: calc(var(--lp-unit) * 2.25);
  background: rgba(12, 15, 22, 0.84);
  box-shadow: inset 0 0 0 1px #ffffff40;
  color: var(--text);
  text-align: left;
  white-space: nowrap;
}
#player-ui .lp-pill[data-act='choose-other'] {
  min-width: 0;
  overflow: hidden;
  height: auto;
  min-height: calc(var(--lp-unit) * 5.8);
  padding-top: calc(var(--lp-unit) * 0.65);
  padding-bottom: calc(var(--lp-unit) * 0.65);
}
#player-ui .lp-pill:focus {
  background: var(--volt-500);
  outline: none;
  box-shadow: none;
}
#game-stats-pane .lp-close:focus {
  background: var(--volt-500);
  outline: 2px solid var(--volt-300);
  outline-offset: 3px;
}
.lp-pill-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--lp-unit) * 3);
  height: calc(var(--lp-unit) * 3);
  border-radius: 50%;
  background: #ffffff17;
  color: var(--volt-300);
  font-size: calc(var(--lp-unit) * 1.45);
}
.lp-statsbtn .lp-pill-icon {
  background: #1f7aff40;
  color: #fff;
}
.lp-pill-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.1;
}
.lp-pill-copy b {
  font-size: calc(var(--lp-unit) * 1.35);
  font-weight: 700;
}
#player-title {
  margin-top: calc(var(--lp-unit) * 0.3);
  font-size: calc(var(--lp-unit) * 1);
  color: var(--text-2);
  max-width: 30vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#player-quality {
  display: block;
  margin-top: calc(var(--lp-unit) * 0.3);
  color: var(--volt-300);
  font-size: calc(var(--lp-unit) * 1.1);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
#player-ui .lp-pill:focus #player-quality {
  color: white;
}
.lp-pill svg,
.lp-close svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
#player-ui footer {
  justify-content: flex-end;
  gap: 12px;
}
#player-ui .lp-utility {
  width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  font-size: 20px;
}
.tv #player-ui footer {
  display: none;
}
.lp-message {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 44%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.lp-message #player-status {
  margin: 0;
}
#player-start {
  min-height: 44px;
  padding: 12px 24px;
}

/* Stats sit behind the same video, revealed as its rectangle makes room.
   Pane geometry and focus targets stay fixed throughout the shared transition. */
#game-stats-pane {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: auto;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
  border: 0;
  overscroll-behavior: none;
}
.ls-shell {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  pointer-events: none;
  --tb-a: linear-gradient(90deg, var(--away-secondary), var(--away));
  --tb-h: linear-gradient(90deg, var(--home), var(--home-secondary));
  --ox: calc((var(--vw) - var(--lp-unit) * 120) / 2);
  --oy: calc((var(--vh) - var(--lp-unit) * 67.5) / 2);
  --gap: calc(var(--lp-unit) * 1);
  --top-y: calc(var(--oy) + var(--lp-unit) * 1.4);
  --top-h: calc(var(--lp-unit) * 8.2);
  --sx: calc(var(--ox) + var(--lp-unit) * 2.5);
  --sy: calc(var(--oy) + var(--lp-unit) * 10.4);
  --sw: calc(var(--lp-unit) * 72);
  --sh: calc(var(--lp-unit) * 40.5);
  --side-x: calc(var(--sx) + var(--sw) + var(--gap));
  --side-y: var(--sy);
  --side-w: calc(var(--ox) + var(--lp-unit) * 117.5 - var(--side-x));
  --side-h: calc(var(--oy) + var(--lp-unit) * 65.4 - var(--side-y));
  --bot-x: var(--sx);
  --bot-y: calc(var(--sy) + var(--sh) + var(--gap));
  --bot-w: calc(var(--sw) + var(--gap));
  --bot-h: calc(var(--side-y) + var(--side-h) - var(--bot-y));
  --r: calc(var(--lp-unit) * 1.5);
}
.lp-slot {
  position: absolute;
  left: var(--sx);
  top: var(--sy);
  width: var(--sw);
  height: var(--sh);
  visibility: hidden;
}
.lp-top {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--top-y);
  height: var(--top-h);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lp-match {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--lp-unit) * 2.25);
}
.lp-team {
  display: flex;
  align-items: center;
  gap: calc(var(--lp-unit) * 1.4);
}
.lp-team-h {
  flex-direction: row-reverse;
}
.lp-crest {
  display: block;
  width: calc(var(--lp-unit) * 6.4);
  height: calc(var(--lp-unit) * 6.4);
  flex: none;
}
.lp-crest img,
.lp-small-crest img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.lp-abbr {
  font-size: calc(var(--lp-unit) * 3.4);
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
}
.lp-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: calc(var(--lp-unit) * 13);
}
.lp-score {
  display: flex;
  align-items: center;
  gap: calc(var(--lp-unit) * 0.8);
  font-size: calc(var(--lp-unit) * 4.4);
  font-weight: 800;
  line-height: 1;
}
.lp-score i {
  font-size: 0.55em;
  font-style: normal;
  color: var(--text-3);
}
.lp-vs {
  font-size: calc(var(--lp-unit) * 1.8);
  font-weight: 700;
  color: var(--text-2);
}
.lp-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--lp-unit) * 0.55);
  margin-top: calc(var(--lp-unit) * 1);
  max-width: 30vw;
  text-align: center;
  font-size: calc(var(--lp-unit) * 1.35);
  font-weight: 600;
}
.lp-state .dot {
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--live);
  flex: none;
}
.lp-close {
  position: absolute;
  right: calc(var(--ox) + var(--lp-unit) * 2.5);
  top: calc(var(--top-y) + (var(--top-h) - var(--lp-unit) * 4.25) / 2);
  width: calc(var(--lp-unit) * 4.25);
  height: calc(var(--lp-unit) * 4.25);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  font-size: calc(var(--lp-unit) * 1.7);
  background: #ffffff14;
  box-shadow: inset 0 0 0 1px #ffffff29;
  pointer-events: auto;
}
.lp-side,
.lp-bottom {
  position: absolute;
  overflow: hidden;
}
.lp-side {
  left: var(--side-x);
  top: var(--side-y);
  width: var(--side-w);
  height: var(--side-h);
  border-radius: var(--r) var(--r) var(--r) 0;
  padding: calc(var(--lp-unit) * 1.75) calc(var(--lp-unit) * 2) calc(var(--lp-unit) * 2);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}
.ls-top-surface,
.ls-bottom-surface,
.ls-side-surface {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  background: var(--lp-surface);
  pointer-events: none;
}
.ls-top-surface {
  top: var(--top-y);
  left: var(--sx);
  right: var(--sx);
  bottom: auto;
  height: var(--top-h);
  border-radius: var(--r);
  transform-origin: 50% 0;
}
.ls-side-surface {
  transform-origin: 100% 50%;
}
.ls-bottom-surface {
  transform-origin: 50% 100%;
}
.ls-performers {
  position: relative;
  height: 100%;
}
.lp-fillet {
  transform-origin: 100% 100%;
}
@media (max-width: 959px) and (orientation: portrait) {
  .ls-side-surface {
    transform-origin: 50% 100%;
  }
}
.lp-bottom {
  left: var(--bot-x);
  top: var(--bot-y);
  width: var(--bot-w);
  height: var(--bot-h);
  border-radius: var(--r) 0 0 var(--r);
  padding: calc(var(--lp-unit) * 1.25) calc(var(--lp-unit) * 2) calc(var(--lp-unit) * 1.5)
    calc(var(--lp-unit) * 1.75);
}
.lp-fillet {
  position: absolute;
  width: var(--r);
  height: var(--r);
  left: calc(var(--side-x) - var(--r));
  top: calc(var(--bot-y) - var(--r));
  overflow: hidden;
}
.lp-fillet:before {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: calc(var(--r) * 2);
  height: calc(var(--r) * 2);
  border-radius: 50%;
  box-shadow: var(--r) var(--r) 0 var(--r) var(--lp-surface);
}

/* Open text navigation with a travelling light and immediate focus colour. */
#game-stats-pane .lp-switch {
  position: relative;
  flex: none;
  display: flex;
  height: calc(var(--lp-unit) * 3.8);
  margin: 4px;
  border: 0;
  border-radius: 0;
}
.lp-thumb {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50%;
  height: 3px;
  background: none;
  border-radius: 3px;
  background: none;
  transform: translateX(0);
}
.ls-shell[data-view='players'] .lp-thumb {
  transform: translateX(100%);
}
#game-stats-pane .lp-opt {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: none;
  box-shadow: none;
  outline: none;
  font-size: calc(var(--lp-unit) * 1.35);
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
}
#game-stats-pane .lp-opt[aria-selected='true'] {
  color: var(--text);
}
#game-stats-pane .lp-switch:focus-within {
  outline: none;
}
.lp-thumb:after {
  content: '';
  position: absolute;
  left: calc(50% - 12px);
  width: 24px;
  height: 3px;
  border-radius: 3px;
  background: var(--volt-400);
}
#game-stats-pane .lp-opt:focus {
  color: var(--volt-300);
  background: none;
  outline: none;
  box-shadow: none;
}
#game-stats-pane .lp-switch:focus-within .lp-thumb:after {
  background: var(--volt-300);
  box-shadow: 0 0 14px #3589ff65;
}
.lp-views {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: calc(var(--lp-unit) * 1.25);
  overflow: hidden;
}
.lp-view {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
}
.lp-vhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(var(--lp-unit) * 2.4);
  flex: none;
  font-size: calc(var(--lp-unit) * 1.1);
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.04em;
}
.lp-vhead > span {
  display: flex;
  align-items: center;
  gap: calc(var(--lp-unit) * 0.55);
}
.lp-small-crest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: calc(var(--lp-unit) * 1.9);
  height: calc(var(--lp-unit) * 1.9);
}
.lp-tag {
  color: var(--warn);
  font-size: calc(var(--lp-unit) * 0.95);
  letter-spacing: 0;
}
.lp-rows {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: calc(var(--lp-unit) * 0.5);
}
.lp-row {
  flex: 1 1 0;
  min-height: 0;
  max-height: calc(var(--lp-unit) * 7.4);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-top: 1px solid var(--lp-hair);
}
.lp-row:first-child {
  border-top: 0;
}
.lp-row-line {
  display: flex;
  align-items: baseline;
  min-width: 0;
}
.lp-val {
  flex: none;
  width: calc(var(--lp-unit) * 7);
  font-size: calc(var(--lp-unit) * 2);
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}
.lp-val.h {
  text-align: right;
}
.lp-lbl {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: calc(var(--lp-unit) * 1.2);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-2);
}
.lp-bar {
  display: flex;
  gap: calc(var(--lp-unit) * 0.35);
  height: calc(var(--lp-unit) * 0.4);
  margin-top: calc(var(--lp-unit) * 0.7);
}
.lp-bar span {
  flex: 1;
  height: 100%;
  border-radius: 4px;
  background: #ffffff12;
  overflow: hidden;
}
.lp-bar i {
  display: block;
  height: 100%;
  border-radius: 4px;
  transform: scaleX(var(--v, 1));
  box-shadow: inset 0 0 0 1px #ffffff24;
}
.lp-bar .a i {
  transform-origin: 100% 50%;
  background: var(--tb-a);
}
.lp-bar .h i {
  transform-origin: 0 50%;
  background: var(--tb-h);
}

/* Static glass texture, with no blur layer over the playing video. */
.lp-bhead {
  display: flex;
  align-items: center;
  gap: calc(var(--lp-unit) * 0.6);
  height: calc(var(--lp-unit) * 1.9);
  font-size: calc(var(--lp-unit) * 1.2);
  font-weight: 700;
  color: var(--text);
}
.lp-perfs {
  display: flex;
  gap: calc(var(--lp-unit) * 1);
  height: calc(100% - var(--lp-unit) * 2.4);
  margin-top: calc(var(--lp-unit) * 0.5);
}
.lp-perf-team {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: calc(var(--lp-unit) * 1);
}
.lp-perf {
  position: relative;
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: calc(var(--lp-unit) * 3) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: calc(var(--lp-unit) * 0.5) calc(var(--lp-unit) * 0.7);
  align-items: center;
  padding: calc(var(--lp-unit) * 0.6) calc(var(--lp-unit) * 0.9);
  border: 1px solid #ffffff1a;
  border-radius: calc(var(--lp-unit) * 0.9);
  background:
    repeating-linear-gradient(135deg, #ffffff03 0 1px, transparent 1px 4px),
    linear-gradient(155deg, #ffffff16, #ffffff06 65%), #171c27;
  box-shadow: inset 0 1px 0 #ffffff0c;
  overflow: hidden;
}
.lp-perf .gd-portrait {
  width: calc(var(--lp-unit) * 3);
  height: calc(var(--lp-unit) * 3);
  min-width: 0;
  border-radius: 50%;
  background: #ffffff07;
}
.lp-perf .gd-initials {
  font-size: calc(var(--lp-unit) * 1.1);
}
.lp-perf-copy {
  min-width: 0;
}
.lp-perf-meta {
  display: flex;
  align-items: center;
  gap: calc(var(--lp-unit) * 0.3);
  font-size: calc(var(--lp-unit) * 0.85);
  color: var(--text-2);
  white-space: nowrap;
}
.lp-perf-meta .lp-small-crest {
  width: calc(var(--lp-unit) * 1);
  height: calc(var(--lp-unit) * 1);
}
.lp-perf-name {
  display: block;
  font-size: calc(var(--lp-unit) * 1.25);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lp-perf-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(var(--lp-unit) * 0.35);
  margin: 0;
}
.lp-perf-stats dd {
  margin: 0;
  font-size: calc(var(--lp-unit) * 1.65);
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}
.lp-perf-stats dt {
  margin-top: calc(var(--lp-unit) * 0.15);
  font-size: calc(var(--lp-unit) * 0.8);
  color: var(--text-2);
  white-space: nowrap;
}
.lp-perf.is-empty {
  display: flex;
  justify-content: center;
  font-size: calc(var(--lp-unit) * 1);
  color: var(--text-2);
}
.lp-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  text-align: center;
}
.lp-empty strong {
  font-size: calc(var(--lp-unit) * 1.5);
}
.lp-empty p {
  margin: 0;
  max-width: 28em;
  font-size: calc(var(--lp-unit) * 1.1);
  color: var(--text-2);
  line-height: 1.5;
}
.lp-waiting .nu-loader-dialog {
  min-height: 0;
  color: var(--text-2);
}
.lp-waiting .nu-loader-dialog .nu-loader-mark {
  width: calc(var(--lp-unit) * 3.2);
  height: calc(var(--lp-unit) * 3.2);
}
.lp-waiting .nu-loader-dialog .nu-loader-label {
  font-size: calc(var(--lp-unit) * 1.1);
}

/* Keep the complete composition faded until dismissal cleanup completes. */
#game-stats-pane.motion-closing {
  opacity: 0;
}

@media (max-width: 959px) {
  #player,
  #game-stats-pane {
    --lp-unit: min(16px, calc(100vh / 50), calc(100vw / 23.5));
  }
  #player-ui .lp-chrome-bar {
    padding: calc(env(safe-area-inset-top) + 12px) max(12px, env(safe-area-inset-right)) 12px
      max(12px, env(safe-area-inset-left));
    gap: 8px;
  }
  #player-ui .lp-pill {
    min-height: 44px;
    height: 44px;
    gap: 8px;
    padding: 0 12px 0 6px;
  }
  #player-ui .lp-pill[data-act='choose-other'] {
    min-height: 62px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  #player-quality {
    font-size: 11px;
  }
  .lp-pill-icon {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }
  #player-ui .lp-pill-copy b {
    font-size: 13px;
  }
  #player-title {
    font-size: 11px;
    max-width: 34vw;
    margin-top: 3px;
  }
  .ls-shell {
    --top-y: calc(env(safe-area-inset-top, 0px) + var(--lp-unit) * 0.4);
    --top-h: calc(var(--lp-unit) * 4.4);
    --sx: calc(var(--lp-unit) * 0.6);
    --sy: calc(var(--top-y) + var(--top-h) + var(--lp-unit) * 0.4);
    --sw: calc(var(--vw) - var(--lp-unit) * 1.2);
    --sh: calc(var(--sw) * 0.5625);
    --side-x: var(--sx);
    --side-y: calc(var(--sy) + var(--sh) + var(--lp-unit) * 0.6);
    --side-w: var(--sw);
    --bot-h: calc(var(--lp-unit) * 11.4);
    --bot-x: var(--side-x);
    --bot-w: var(--side-w);
    --bot-y: calc(
      var(--vh) - max(var(--lp-unit) * 0.6, env(safe-area-inset-bottom, 0px)) - var(--bot-h)
    );
    --side-h: calc(var(--bot-y) - var(--side-y));
    --r: calc(var(--lp-unit) * 1.1);
  }
  .lp-top {
    padding: 0 calc(var(--lp-unit) * 3);
  }
  .lp-match {
    gap: calc(var(--lp-unit) * 0.6);
  }
  .lp-team {
    gap: calc(var(--lp-unit) * 0.45);
  }
  .lp-crest {
    width: calc(var(--lp-unit) * 2.6);
    height: calc(var(--lp-unit) * 2.6);
  }
  .lp-abbr {
    font-size: calc(var(--lp-unit) * 1.4);
  }
  .lp-center {
    min-width: calc(var(--lp-unit) * 5.1);
  }
  .lp-score {
    font-size: calc(var(--lp-unit) * 1.8);
    gap: calc(var(--lp-unit) * 0.3);
  }
  .lp-vs {
    font-size: 12px;
  }
  .lp-state {
    font-size: max(10px, calc(var(--lp-unit) * 0.78));
    margin-top: calc(var(--lp-unit) * 0.3);
    gap: 4px;
  }
  .lp-close {
    right: max(calc(var(--lp-unit) * 0.75), env(safe-area-inset-right));
    top: var(--top-y);
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  .lp-side {
    border-radius: var(--r) var(--r) 0 0;
    padding: calc(var(--lp-unit) * 0.65) calc(var(--lp-unit) * 0.9) calc(var(--lp-unit) * 0.5);
  }
  .lp-bottom {
    border-radius: 0 0 var(--r) var(--r);
    padding: calc(var(--lp-unit) * 0.5) calc(var(--lp-unit) * 0.9) calc(var(--lp-unit) * 0.8);
    box-shadow: inset 0 1px 0 var(--lp-hair);
  }
  .lp-fillet {
    display: none;
  }
  #game-stats-pane .lp-switch {
    height: 34px;
  }
  #game-stats-pane .lp-opt {
    font-size: 13px;
  }
  .lp-thumb {
    height: 2px;
  }
  .lp-views {
    margin-top: calc(var(--lp-unit) * 0.5);
  }
  .lp-vhead {
    height: calc(var(--lp-unit) * 1.5);
    font-size: 10px;
  }
  .lp-vhead > span {
    gap: 4px;
  }
  .lp-small-crest {
    width: calc(var(--lp-unit) * 1.2);
    height: calc(var(--lp-unit) * 1.2);
  }
  .lp-tag {
    font-size: 10px;
  }
  .lp-row {
    max-height: calc(var(--lp-unit) * 3.6);
  }
  .lp-val {
    width: calc(var(--lp-unit) * 4);
    font-size: max(14px, calc(var(--lp-unit) * 1.05));
  }
  .lp-lbl {
    font-size: max(11px, calc(var(--lp-unit) * 0.78));
  }
  .lp-bar {
    height: 3px;
    margin-top: 4px;
    gap: 3px;
  }
  .lp-bhead {
    height: 17px;
    font-size: 12px;
  }
  .lp-perfs {
    flex-direction: column;
    height: calc(100% - 21px);
    margin-top: 4px;
    gap: 6px;
  }
  .lp-perf-team {
    min-height: 0;
    gap: 6px;
  }
  .lp-perf {
    grid-template-columns: 26px minmax(0, 1fr);
    padding: 5px 7px;
    gap: 3px 6px;
    border-radius: 9px;
  }
  .lp-perf .gd-portrait {
    width: 26px;
    height: 26px;
  }
  .lp-perf .gd-initials {
    font-size: 11px;
  }
  .lp-perf-name {
    font-size: 12px;
  }
  .lp-perf-meta {
    font-size: 9px;
    gap: 3px;
  }
  .lp-perf-meta .lp-small-crest {
    width: 11px;
    height: 11px;
  }
  .lp-perf-stats {
    gap: 4px;
  }
  .lp-perf-stats dd {
    font-size: 14px;
  }
  .lp-perf-stats dt {
    font-size: 9px;
    margin-top: 1px;
  }
  .lp-perf.is-empty {
    font-size: 11px;
  }
  .lp-empty strong {
    font-size: 14px;
  }
  .lp-empty p {
    font-size: 12px;
    line-height: 1.35;
  }
}
@media (max-width: 959px) and (orientation: portrait) and (max-height: 700px) {
  .lp-perf {
    padding: 3px 6px;
    grid-template-columns: 19px minmax(0, 1fr);
    gap: 1px 4px;
  }
  .lp-perf .gd-portrait {
    width: 19px;
    height: 19px;
  }
  .lp-perf .gd-initials {
    font-size: 9px;
  }
  .lp-perf-meta {
    display: none;
  }
}
/* The scoreboard is about 21.5 units wide with two three-digit scores. Keep it
   centred between gutters that clear the 32px close button. */
@media (max-width: 959px) and (orientation: portrait) {
  .lp-top {
    padding: 0 calc(38px + max(calc(var(--lp-unit) * 0.75), env(safe-area-inset-right)));
  }
  .lp-match {
    --lp-unit: min(16px, calc(100vh / 50), calc((100vw - 96px) / 22));
  }
}
@media (max-width: 959px) and (orientation: landscape) {
  #player,
  #game-stats-pane {
    --lp-unit: min(15px, calc(100vh / 25.5), calc(100vw / 54));
  }
  .ls-shell {
    --pl: max(calc(var(--lp-unit) * 0.7), env(safe-area-inset-left, 0px));
    --pr: max(calc(var(--lp-unit) * 0.7), env(safe-area-inset-right, 0px));
    --top-y: calc(var(--lp-unit) * 0.3);
    --top-h: calc(var(--lp-unit) * 3.2);
    --bot-h: calc(var(--lp-unit) * 6.4);
    --gap: calc(var(--lp-unit) * 0.5);
    --sy: calc(var(--top-y) + var(--top-h) + var(--lp-unit) * 0.25);
    --sh: calc(var(--vh) - var(--sy) - var(--bot-h) - var(--gap) - var(--lp-unit) * 0.6);
    --sw: calc(var(--sh) * 16 / 9);
    --sx: var(--pl);
    --side-x: calc(var(--sx) + var(--sw) + var(--gap));
    --side-y: var(--sy);
    --side-w: calc(var(--vw) - var(--pr) - var(--side-x));
    --side-h: calc(var(--vh) - var(--lp-unit) * 0.6 - var(--side-y));
    --bot-x: var(--sx);
    --bot-y: calc(var(--sy) + var(--sh) + var(--gap));
    --bot-w: calc(var(--sw) + var(--gap));
    --r: calc(var(--lp-unit) * 0.9);
  }
  .lp-top {
    padding: 0;
  }
  .lp-crest {
    width: calc(var(--lp-unit) * 2.3);
    height: calc(var(--lp-unit) * 2.3);
  }
  .lp-abbr {
    font-size: calc(var(--lp-unit) * 1.25);
  }
  .lp-score {
    font-size: calc(var(--lp-unit) * 1.5);
  }
  .lp-state {
    margin-top: 2px;
  }
  .lp-side {
    border-radius: var(--r) var(--r) var(--r) 0;
    padding: calc(var(--lp-unit) * 0.55) calc(var(--lp-unit) * 0.7) calc(var(--lp-unit) * 0.5);
  }
  .lp-bottom {
    border-radius: var(--r) 0 0 var(--r);
    padding: 6px 8px;
    box-shadow: none;
  }
  .lp-fillet {
    display: block;
  }
  .lp-perfs {
    flex-direction: row;
    gap: 5px;
  }
  .lp-perf-team {
    gap: 5px;
  }
  .lp-perf {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding: 4px 6px;
    gap: 5px;
  }
  .lp-perf .gd-portrait,
  .lp-perf-meta {
    display: none;
  }
  .lp-perf-name {
    font-size: 11px;
  }
  .lp-perf-stats {
    gap: 3px;
  }
  .lp-perf-stats dd {
    font-size: 12px;
  }
  .lp-val {
    width: calc(var(--lp-unit) * 3.4);
  }
}

/* The roster alone scrolls; match identity, selectors and performers stay anchored. */
.lp-bhead svg {
  width: 1.15em;
  height: 1.15em;
  stroke: var(--volt-300);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.ls-side-content {
  font-size: var(--lp-unit);
}
.ls-choices {
  display: flex;
  flex: none;
  align-items: center;
  gap: 3px;
  position: relative;
}
#game-stats-pane .ls-choices button,
#game-player-dialog .ls-choices button {
  min-width: 0;
  flex: 1;
  border: 0;
  box-shadow: none;
  outline: none;
  background: transparent;
  color: var(--text-3);
  padding: 0.65em 0.35em;
  border-radius: 0.7em;
  font-size: calc(var(--lp-unit) * 1.1);
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
}
#game-stats-pane .ls-choices button[aria-selected='true'],
#game-player-dialog .ls-choices button[aria-selected='true'] {
  color: var(--text);
  background: #ffffff0e;
}
#game-stats-pane .ls-choices button:focus,
#game-player-dialog .ls-choices button:focus {
  color: #fff;
  background: var(--volt-500);
}
.ls-periods {
  margin: calc(var(--lp-unit) * 0.5) 0 calc(var(--lp-unit) * 0.8);
}
.ls-teams {
  border-bottom: 1px solid var(--lp-hair);
  padding-bottom: calc(var(--lp-unit) * 0.6);
}
#game-stats-pane .ls-teams button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65em;
  font-size: calc(var(--lp-unit) * 1.35);
  padding: 0.45em;
}
.ls-made {
  display: block;
  color: var(--text-3);
  font-size: 0.55em;
  margin-top: 0.2em;
  font-weight: 500;
}
.ls-period-note {
  margin: 0.55em 0 0;
  color: var(--text-3);
  font-size: calc(var(--lp-unit) * 0.85);
  line-height: 1.3;
  flex: none;
}
.ls-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #ffffff22 transparent;
}
.ls-scroll::-webkit-scrollbar {
  width: 3px;
}
.ls-scroll::-webkit-scrollbar-thumb {
  background: #ffffff22;
  border-radius: 4px;
}
.ls-roster-group h3,
.ls-profile-grid h3 {
  margin: 0.8em 0 0.5em;
  text-transform: capitalize;
  font-size: calc(var(--lp-unit) * 1);
  font-weight: 600;
  color: var(--text-2);
}
.ls-roster-columns,
#game-stats-pane .ls-player-row {
  display: grid;
  grid-template-columns: minmax(0, 2.45fr) repeat(6, minmax(0, 1fr));
  align-items: center;
  gap: 3px;
  text-align: right;
}
.ls-roster-columns {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--lp-surface);
  font-size: calc(var(--lp-unit) * 0.85);
  color: var(--text-3);
  padding: 0.7em 0.5em;
}
.ls-roster-columns > span:first-child {
  text-align: left;
}
#game-stats-pane .ls-player-row {
  width: 100%;
  padding: 0.65em 0.4em;
  min-height: calc(var(--lp-unit) * 3.5);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--lp-hair);
  border-radius: 6px;
  color: var(--text);
  font-size: calc(var(--lp-unit) * 1.05);
  font-weight: 500;
  outline: none;
  box-shadow: none;
}
#game-stats-pane .ls-player-row:focus {
  background: #1f7aff35;
  color: #fff;
  box-shadow: inset 3px 0 var(--volt-400);
}
.ls-player-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: left;
  gap: 0.2em;
}
.ls-player-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.ls-player-name small {
  color: var(--text-3);
  font-size: 0.8em;
}
.ls-profile-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: calc(var(--lp-unit) * 1.2);
  padding: calc(var(--lp-unit) * 0.7) 0 calc(var(--lp-unit) * 1.25);
}
.ls-profile-head .gd-portrait {
  width: calc(var(--lp-unit) * 6.5);
  height: calc(var(--lp-unit) * 6.5);
  flex: none;
  border-radius: 50%;
  background: linear-gradient(150deg, #ffffff16, #ffffff04);
}
.ls-profile-head > div {
  min-width: 0;
}
.ls-profile-head h2 {
  font-size: calc(var(--lp-unit) * 1.9);
  line-height: 1.12;
  font-weight: 700;
  margin: 0.25em 0;
}
.ls-profile-head p {
  color: var(--text-3);
  font-size: calc(var(--lp-unit) * 1);
  margin: 0;
}
.ls-profile-team {
  display: flex;
  align-items: center;
  gap: 0.4em;
  color: var(--text-2);
  font-size: calc(var(--lp-unit) * 0.95);
  font-weight: 600;
}
.ls-profile-switch {
  border-top: 1px solid var(--lp-hair);
  padding-top: 0.5em;
}
.ls-season-label {
  flex: none;
  font-size: calc(var(--lp-unit) * 1.05);
  color: var(--text-2);
  margin: 0.7em 0;
}
.ls-profile-grid {
  padding: 0 4px 4px 8px;
  outline: none;
  border-radius: 8px;
}
.ls-profile-grid:focus {
  box-shadow: inset 3px 0 #5597ff;
}
.ls-profile-grid dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 1em;
}
.ls-profile-grid dl > div {
  padding: 0.85em 0.75em;
  border: 1px solid #ffffff0b;
  border-radius: 8px;
  background: linear-gradient(145deg, #ffffff0b, #ffffff03);
}
.ls-profile-grid dt {
  color: var(--text-3);
  font-size: calc(var(--lp-unit) * 0.9);
  line-height: 1.3;
}
.ls-profile-grid dd {
  margin: 0.35em 0 0;
  font-size: calc(var(--lp-unit) * 1.6);
  font-weight: var(--fw-label);
}
@media (max-width: 959px) {
  #game-stats-pane .ls-choices button {
    font-size: 11px;
    padding: 7px 4px;
  }
  #game-stats-pane .ls-teams button {
    font-size: 12px;
    padding: 5px;
  }
  .ls-periods {
    margin: 3px 0 5px;
  }
  .ls-teams {
    padding-bottom: 4px;
  }
  .ls-roster-columns {
    font-size: 9px;
    padding: 5px 3px;
  }
  #game-stats-pane .ls-player-row {
    font-size: 11px;
    padding: 6px 3px;
    min-height: 36px;
  }
  .ls-roster-columns,
  #game-stats-pane .ls-player-row {
    grid-template-columns: minmax(0, 2.4fr) repeat(6, minmax(0, 1fr));
    gap: 2px;
  }
  .ls-period-note {
    font-size: 9px;
    margin-top: 4px;
  }
  .ls-profile-head {
    gap: 9px;
    padding: 3px 0 7px;
  }
  .ls-profile-head .gd-portrait {
    width: 42px;
    height: 42px;
  }
  .ls-profile-head h2 {
    font-size: 17px;
  }
  .ls-profile-head p,
  .ls-profile-team {
    font-size: 10px;
  }
  .ls-season-label {
    font-size: 10px;
    margin: 5px 0;
  }
  .ls-roster-group h3,
  .ls-profile-grid h3 {
    font-size: 10px;
    margin: 6px 0;
  }
  .ls-profile-grid dl {
    gap: 4px;
  }
  .ls-profile-grid dl > div {
    padding: 7px;
  }
  .ls-profile-grid dt {
    font-size: 10px;
  }
  .ls-profile-grid dd {
    font-size: 16px;
  }
}

@media (max-width: 959px) and (orientation: portrait) and (max-height: 700px) {
  .ls-shell {
    --sh: min(calc(var(--sw) * 0.5625), calc(var(--vh) * 0.24));
    --bot-h: 160px;
  }
  .lp-perf {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 4px;
    padding: 4px 6px;
  }
  .lp-perf .gd-portrait {
    display: none;
  }
  .lp-perf-name {
    font-size: 11px;
  }
  .lp-perf-stats dd {
    font-size: 14px;
  }
  .lp-perf-stats dt {
    font-size: 9px;
  }
}
