/* Linn-Mar Basketball — Read-Only Film & Scouting Portal
   Strict Dark Broadcast + Editorial Tokens (Flat surfaces, 1px hairlines, max 2 amber accents) */

:root {
  color-scheme: dark;
  --bg: #0A0A0A;
  --chrome: #0E0E0D;
  --surface: #161615;
  --surface-hover: #1D1C1A;
  --ink: #F5F4F1;
  --dim: #C6C2BC;
  --muted: #8A857E;
  --hairline: #2A2927;
  --amber: #D4A036;
  --on-amber: #0A0A0A;
  --amber-dim: #5C4616;
  --danger-ink: #E07A5F;
  --radius: 7px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --serif: Didot, "Bodoni 72", "Hoefler Text", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  scrollbar-color: #2A2927 #0A0A0A;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: #0A0A0A;
}

*::-webkit-scrollbar-thumb {
  background: #2A2927;
  border-radius: 3px;
}

.hidden {
  display: none !important;
}

/* Typography primitives */
.masthead {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 14px;
}

.masthead-sub {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.085em;
  text-transform: uppercase;
  color: var(--dim);
  margin-top: 6px;
  margin-bottom: 20px;
}

.masthead-sm {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink);
}

.masthead-tag {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.085em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

.micro-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Bordered Surface Tile */
.tile {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 14px;
}

.tile-rule {
  height: 1px;
  background: var(--hairline);
  margin: 10px -14px;
}

.tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tile-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 2px;
}

/* Auth Screen */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.auth-tile {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 24px;
}

.auth-tile .tile-rule {
  margin: 10px -24px;
}

.auth-kicker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  color: var(--muted);
  text-transform: uppercase;
}

.invite-banner {
  border: 1px solid var(--hairline);
  background: var(--bg);
  color: var(--dim);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 12.5px;
  margin-bottom: 14px;
}

.auth-error {
  border: 1px solid var(--danger-ink);
  background: var(--bg);
  color: var(--danger-ink);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 12.5px;
  margin-bottom: 14px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-group label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.085em;
  color: var(--muted);
}

.field-group input,
.field-group select {
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 14px;
  font-family: var(--sans);
  outline: none;
}

.field-group input:focus,
.field-group select:focus {
  border-color: var(--ink);
}

.inviter-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.inviter-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.inviter-result {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inviter-url-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--amber);
  border-radius: 5px;
  color: var(--ink);
  padding: 10px 12px;
  font-family: var(--mono, monospace);
  font-size: 12px;
}

.auth-footnote {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  margin-top: 4px;
}

/* Buttons — Strict Rationed Accent */
button {
  cursor: pointer;
  font-family: var(--sans);
}

.btn-amber {
  background: var(--amber);
  color: var(--on-amber);
  border: 1px solid var(--amber);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.btn-ink-sm {
  background: var(--ink);
  color: var(--on-amber);
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.btn-ink-outline {
  background: transparent;
  color: var(--dim);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.btn-mono {
  background: var(--bg);
  color: var(--dim);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.btn-mono:hover, .chip-btn:hover, .btn-ink-outline:hover {
  border-color: var(--dim);
  color: var(--ink);
}

.full-w {
  width: 100%;
}

/* Monochrome Filter Chips (Selected = Ink Fill, never extra Amber) */
.chip-btn {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: border-color 0.12s ease, color 0.12s ease;
}

.chip-btn.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* Top Navigation Bar (#0E0E0D) */
.topbar {
  background: var(--chrome);
  border-bottom: 1px solid var(--hairline);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.main-tabs {
  display: flex;
  gap: 22px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.085em;
  padding: 8px 2px;
  border-bottom: 2px solid transparent;
}

/* Accent Use #1: Active Navigation Tab Indicator */
.tab-btn.active {
  color: var(--amber);
  border-bottom-color: var(--amber);
}

.user-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--dim);
  text-transform: uppercase;
}

/* Views & Team Strip */
.view-panel {
  padding: 16px 20px 32px;
  max-width: 1640px;
  margin: 0 auto;
}

.team-strip-wrap {
  margin-bottom: 14px;
}

.team-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 4px;
  scrollbar-width: thin;
}

.team-pill {
  flex: 0 0 auto;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 8px 13px;
  color: var(--dim);
  text-align: left;
  min-width: 138px;
}

.team-pill .tp-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  display: block;
}

.team-pill .tp-sub {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 2px;
  display: block;
}

.team-pill.active {
  background: var(--ink);
  border-color: var(--ink);
}

.team-pill.active .tp-name,
.team-pill.active .tp-sub {
  color: var(--bg);
}

/* Main Scouting Split Layout */
.scouting-grid {
  display: grid;
  grid-template-columns: clamp(300px, 27vw, 355px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.metric-strip {
  display: grid;
  grid-template-columns: 0.75fr 0.85fr 1.35fr 0.95fr;
  gap: 8px;
}

.metric-cell .mc-lbl {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.metric-cell .mc-val {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 2px;
  white-space: nowrap;
}

/* Hairline Roster & Play Lists (Zero Floating Cards) */
.roster-col-hdr {
  display: grid;
  grid-template-columns: 24px minmax(64px, 1.3fr) repeat(5, minmax(32px, 0.85fr));
  gap: 4px;
  padding: 4px 2px 8px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline);
}

.rc-stat {
  text-align: right;
}

.hairline-list {
  display: flex;
  flex-direction: column;
}

.roster-row {
  display: grid;
  grid-template-columns: 24px minmax(64px, 1.3fr) repeat(5, minmax(32px, 0.85fr));
  gap: 4px;
  align-items: center;
  padding: 7.5px 2px;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  color: var(--ink);
  text-align: left;
  width: 100%;
}

.roster-row:hover {
  background: var(--surface-hover);
}

.rr-idx {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.rr-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rr-sub {
  font-size: 10px;
  color: var(--muted);
  margin-left: 5px;
  font-weight: 400;
}

.rr-stat {
  text-align: right;
  font-size: 12px;
  color: var(--dim);
}

.rr-pts {
  font-weight: 600;
  color: var(--ink);
}

/* Accent Use #2: Selected Player / Playing Clip Row Title */
.roster-row.active .rr-idx,
.roster-row.active .rr-name {
  color: var(--amber);
}

.bench-section {
  margin-top: 6px;
}

.bench-toggle-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hairline);
  padding: 9px 2px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* Dossier Tile */
.scouting-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dossier-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.dossier-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 2px;
}

.dossier-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.kpi-box .kpi-l {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.kpi-box .kpi-v {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.dossier-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.dossier-col {
  border-right: 1px solid var(--hairline);
  padding-right: 14px;
}

.dossier-col:last-child {
  border-right: none;
  padding-right: 0;
}

.dossier-list {
  list-style: none;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dossier-list li {
  font-size: 12.5px;
  color: var(--dim);
  padding-left: 12px;
  position: relative;
}

.dossier-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--muted);
}

.target-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.target-pill {
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 4px 9px;
  font-size: 11.5px;
  color: var(--ink);
}

.target-pill:hover {
  border-color: var(--ink);
}

.target-pill.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* Court + Film Split */
.court-film-split {
  display: grid;
  grid-template-columns: minmax(260px, 45%) minmax(280px, 55%);
  gap: 14px;
  align-items: start;
}

.court-toolbar, .film-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.mode-group, .film-controls-right {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.subfilter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.court-svg-container {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 6px;
}

#halfcourt-svg {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
}

.court-zone-hit {
  cursor: pointer;
  transition: fill-opacity 0.15s ease;
}

.court-zone-hit:hover {
  stroke: var(--ink);
  stroke-width: 1.5;
}

.court-item-hit {
  cursor: pointer;
}

.court-caption {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 8px;
}

/* Video Stage & Spotlight Overlay */
.film-tile,
.game-film-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "toolbar"
    "stage"
    "rightbar";
  gap: 10px;
}

.film-toolbar {
  grid-area: toolbar;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
}

.film-right-bar {
  grid-area: rightbar;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.now-playing-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 2px;
}

.video-stage {
  grid-area: stage;
  position: relative;
  width: 100%;
  background: #000;
  border: 1px solid var(--hairline);
  border-radius: 5px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.video-stage video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.spotlight-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.stage-expand-btn {
  position: absolute;
  top: 14px;
  right: 20px;
  z-index: 50;
  cursor: pointer;
  pointer-events: auto;
  background: rgba(10, 10, 10, 0.88);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.92;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.stage-expand-btn:hover {
  opacity: 1;
  border-color: var(--ink);
}

.reel-transport {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.game-reel-transport {
  margin-bottom: 4px;
}

/* Large Screen Mode — Fullscreen Video Left + Docked Right-Side Control Bar */
.film-tile.large-screen-mode,
.film-tile:fullscreen,
.film-tile:-webkit-full-screen,
.game-film-panel.large-screen-mode,
.game-film-panel:fullscreen,
.game-film-panel:-webkit-full-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: var(--bg);
  grid-template-columns: minmax(0, 1fr) var(--ls-sidebar-w, 460px);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "stage toolbar"
    "stage rightbar";
  gap: 0;
}

.film-tile.large-screen-mode.ls-sidebar-collapsed,
.game-film-panel.large-screen-mode.ls-sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr) 0px !important;
}

.film-tile.large-screen-mode.ls-sidebar-collapsed .film-toolbar,
.film-tile.large-screen-mode.ls-sidebar-collapsed .film-right-bar,
.game-film-panel.large-screen-mode.ls-sidebar-collapsed .film-toolbar,
.game-film-panel.large-screen-mode.ls-sidebar-collapsed .film-right-bar {
  overflow: hidden;
  padding: 0 !important;
  border-left: none !important;
}

.ls-resize-handle {
  display: none;
}

.film-tile.large-screen-mode .ls-resize-handle,
.game-film-panel.large-screen-mode .ls-resize-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  bottom: 0;
  right: var(--ls-sidebar-w, 460px);
  width: 10px;
  transform: translateX(50%);
  cursor: ew-resize;
  z-index: 10002;
  background: transparent;
  transition: background 0.15s ease;
}

.film-tile.large-screen-mode.ls-sidebar-collapsed .ls-resize-handle,
.game-film-panel.large-screen-mode.ls-sidebar-collapsed .ls-resize-handle {
  right: 0px !important;
  transform: none;
  width: 24px;
  cursor: pointer;
}

.ls-resize-handle::before {
  content: "⋮";
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 10px 2px;
  pointer-events: none;
}

.ls-resize-handle:hover,
.ls-resize-handle.dragging {
  background: rgba(212, 160, 54, 0.28);
}

.ls-resize-handle:hover::before,
.ls-resize-handle.dragging::before {
  color: var(--amber);
  border-color: var(--amber);
}

.film-tile.large-screen-mode .video-stage,
.film-tile:fullscreen .video-stage,
.film-tile:-webkit-full-screen .video-stage,
.game-film-panel.large-screen-mode .video-stage,
.game-film-panel:fullscreen .video-stage,
.game-film-panel:-webkit-full-screen .video-stage {
  height: 100vh;
  width: 100%;
  border: none;
  border-radius: 0;
  aspect-ratio: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.film-tile.large-screen-mode .film-toolbar,
.film-tile:fullscreen .film-toolbar,
.film-tile:-webkit-full-screen .film-toolbar,
.game-film-panel.large-screen-mode .film-toolbar,
.game-film-panel:fullscreen .film-toolbar,
.game-film-panel:-webkit-full-screen .film-toolbar {
  background: var(--surface);
  border-left: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 14px 16px;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.film-tile.large-screen-mode .film-right-bar,
.film-tile:fullscreen .film-right-bar,
.film-tile:-webkit-full-screen .film-right-bar,
.game-film-panel.large-screen-mode .film-right-bar,
.game-film-panel:fullscreen .film-right-bar,
.game-film-panel:-webkit-full-screen .film-right-bar {
  background: var(--surface);
  border-left: 1px solid var(--hairline);
  padding: 12px 16px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.film-tile.large-screen-mode .clip-reel-list,
.film-tile:fullscreen .clip-reel-list,
.film-tile:-webkit-full-screen .clip-reel-list,
.game-film-panel.large-screen-mode .game-events-list,
.game-film-panel:fullscreen .game-events-list,
.game-film-panel:-webkit-full-screen .game-events-list {
  flex: 1;
  max-height: none;
  overflow-y: auto;
}

.auto-reel-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  letter-spacing: 0.07em;
  color: var(--dim);
  text-transform: uppercase;
  cursor: pointer;
}

.clip-reel-list {
  max-height: 295px;
  overflow-y: auto;
}

.clip-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 6px;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.clip-row:hover {
  background: var(--surface-hover);
}

.clip-row .cr-idx {
  font-size: 11px;
  color: var(--muted);
}

.clip-row .cr-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clip-row .cr-meta {
  font-size: 11px;
  color: var(--muted);
}

.clip-row .cr-chev {
  font-size: 12px;
  color: var(--muted);
}

.clip-row.active .cr-idx,
.clip-row.active .cr-title,
.clip-row.active .cr-chev {
  color: var(--amber);
}

/* Game Film & Box Score View */
.game-view-grid {
  display: grid;
  grid-template-columns: minmax(300px, 50%) minmax(300px, 50%);
  gap: 14px;
  align-items: start;
}

.game-play-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.game-events-list {
  max-height: 360px;
  overflow-y: auto;
}

.box-table-wrap {
  margin-bottom: 18px;
  overflow-x: auto;
}

.box-table-hdr {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 8px 0;
}

table.box-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

table.box-tbl th {
  text-align: right;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 6px 5px;
  border-bottom: 1px solid var(--hairline);
}

table.box-tbl th:first-child,
table.box-tbl td:first-child {
  text-align: left;
}

table.box-tbl td {
  text-align: right;
  padding: 7px 5px;
  border-bottom: 1px solid var(--hairline);
  color: var(--dim);
}

table.box-tbl tr.clickable-box-row {
  cursor: pointer;
}

table.box-tbl tr.clickable-box-row:hover {
  background: var(--surface-hover);
}

table.box-tbl tr.box-total-row td {
  font-weight: 700;
  color: var(--ink);
}

/* Responsive Tablet / iPad & Mobile */
@media (max-width: 1040px) {
  .court-film-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .scouting-grid,
  .game-view-grid {
    grid-template-columns: 1fr;
  }
  #roster-list,
  #bench-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    column-gap: 18px;
  }
  .dossier-columns {
    grid-template-columns: 1fr;
  }
  .dossier-col {
    border-right: none;
    border-bottom: 1px solid var(--hairline);
    padding-right: 0;
    padding-bottom: 10px;
  }
  .dossier-col:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .metric-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Lions Multi-Select Game Filter Dropdown */
.lions-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: -6px;
  margin-bottom: 14px;
}

.ms-dropdown {
  position: relative;
  display: inline-block;
  min-width: 310px;
}

.ms-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: 7px;
  padding: 8px 13px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.ms-trigger:hover,
.ms-trigger[aria-expanded="true"] {
  border-color: var(--ink);
  background: var(--surface-hover);
}

.ms-caret {
  color: var(--muted);
  font-size: 12px;
}

.ms-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 120;
  width: 410px;
  max-width: 92vw;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 7px;
  padding: 10px 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.72);
}

.ms-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.ms-list {
  display: flex;
  flex-direction: column;
  max-height: 340px;
  overflow-y: auto;
}

.ms-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--hairline);
  font-size: 11px;
  color: var(--dim);
}

.ms-row:last-child {
  border-bottom: none;
}

.ms-row-label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: pointer;
  user-select: none;
}

.ms-row-idx {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  width: 18px;
}

.ms-row-check {
  width: 14px;
  height: 14px;
  accent-color: var(--amber);
  cursor: pointer;
}

.ms-row-title {
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.ms-row-meta {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ms-only-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.ms-only-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* Flag Play Error ("The System Got It Wrong") & Inbox Modals */
.flag-trigger-btn {
  border-color: var(--amber);
  color: var(--amber);
}

.flag-trigger-btn:hover {
  background: var(--amber);
  color: var(--on-amber);
}

.cr-flag-btn {
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  margin-left: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.cr-flag-btn:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.cr-flag-btn.flagged {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--on-amber);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25000 !important;
  background: rgba(10, 10, 10, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-tile {
  width: 100%;
  max-width: 540px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 7px;
  padding: 18px 20px;
}

.modal-tile-wide {
  max-width: 780px;
}

.flag-play-summary {
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--ink);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.flags-inbox-list {
  max-height: 62vh;
  overflow-y: auto;
}

.flag-inbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--hairline);
  font-size: 12px;
}

.flag-inbox-row:last-child {
  border-bottom: none;
}

.flag-inbox-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.flag-inbox-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Upload Film Modal & Progress Bar */
.upload-file-box {
  width: 100%;
  background: var(--bg);
  color: var(--ink);
  border: 1px dashed var(--hairline);
  border-radius: 5px;
  padding: 12px;
  font-size: 12px;
  cursor: pointer;
}

.upload-file-box:hover {
  border-color: var(--ink);
}

.upload-progress-wrap {
  margin-bottom: 14px;
}

.upload-progress-track {
  width: 100%;
  height: 7px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  background: var(--amber);
  transition: width 0.15s ease;
}
