/* =============================================================================
   LIVE PROP TRACKER — Schedule page live/completed game view
   ============================================================================= */

/* =============================================================================
   BANNER — Single-row scoreboard layout
   [logo] [team name] [score ◂] [status + quarter table] [▸ score] [team name] [logo]
   ============================================================================= */

#roster-display[data-mode="prop-tracker"] .matchup-banner {
  flex-direction: row;
  align-items: center;
  gap: 0;
}

/* Edge logos — pushed to far left / right */
.sb-edge-logo {
  width: 64px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.sb-edge-logo img {
  width: 68px;
  height: 68px;
  object-fit: contain;
}
/* Team short name — hidden on desktop, visible on mobile */
.sb-team-code {
  display: none;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--wb-text, #fff);
}

/* Team name sections — fill available space */
.sb-team-side {
  flex: 1;
  min-width: 0;
  padding: 0 12px;
}
.sb-away-side {
  text-align: right;
}
.sb-home-side {
  text-align: left;
}
.sb-team-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--wb-text, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Score blocks */
.sb-score-block {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 0 6px;
}
.banner-pts {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.banner-pts.score-winning {
  color: #4ade80;
}
.banner-pts.score-losing {
  color: #f87171;
}

/* Center: status text + quarter table */
#roster-display[data-mode="prop-tracker"] .banner-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  flex-shrink: 0;
}

.scoreboard-status {
  font-size: 14px;
  font-weight: 600;
  color: #4ade80;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.scoreboard-status.final {
  color: #9ca3af;
}

/* Quarter scoreboard table */
.sb-table {
  border-collapse: collapse;
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.4;
}
.sb-table th {
  font-weight: 600;
  color: #6b7280;
  padding: 0 6px 4px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.sb-table td {
  padding: 1px 6px;
  text-align: center;
}
.sb-table .sb-tcode {
  font-weight: 600;
  color: #9ca3af;
  text-align: left;
  padding-right: 10px;
}
.sb-table .sb-total {
  font-weight: 700;
  color: #fff;
}

/* =============================================================================
   PLAYER CARD (horizontal stat cells layout)
   ============================================================================= */

.prop-tracker-player-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.prop-tracker-player-card:hover {
  border-color: rgba(255,255,255,0.2);
}

/* Header: avatar + name */
.pt-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.pt-name {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  color: #fff;
}
.pt-first-name {
  font-size: 15px;
  font-weight: 500;
  color: #9ca3af;
}
.pt-last-name {
  font-size: 15px;
  font-weight: 700;
}

.pt-avatar {
  width: 36px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
}
.pt-team-badge {
  position: absolute;
  bottom: -2px;
  right: -6px;
  width: 18px;
  height: 18px;
  overflow: hidden;
  background: transparent;
  border: none;
}
.pt-team-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.pt-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pt-initials {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
}

/* Stats row — horizontal cells */
.pt-stats-row {
  display: flex;
  gap: 12px;
}

.pt-stat-cell {
  flex: 1;
  min-width: 0;
}

/* Stat head: label + value/line */
.pt-stat-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
}

.pt-stat-label {
  font-size: 14px;
  font-weight: 500;
  color: #9ca3af;
  letter-spacing: 0.3px;
}

.pt-stat-value {
  font-size: 14px;
  font-weight: 500;
  color: #9ca3af;
  line-height: 1;
  letter-spacing: 0.04em;
}
.pt-stat-line {
  font-size: 14px;
  font-weight: 500;
  color: #9ca3af;
}

/* Thin progress bar */
.pt-bar {
  position: relative;
  height: 4px;
  border-radius: 2px;
  margin-bottom: 6px;
}

.pt-bar-track {
  position: absolute;
  inset: 0;
  background: #2a2a2a;
  border-radius: 2px;
}

.pt-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  border-radius: 2px;
  background: #3b82f6;
  transition: width 0.5s ease-out;
  z-index: 1;
}

/* Exceeded / covered → green bar */
.pt-bar.exceeded .pt-bar-fill {
  background: #2ecc71;
}

/* Status label */
.pt-stat-status {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.pt-stat-status.status-covered {
  color: #2ecc71;
}
.pt-stat-status.status-progress {
  color: #6b7280;
}
.pt-stat-status.status-missed {
  color: #e74c3c;
}

/* =============================================================================
   COMBO STATS TOGGLE
   ============================================================================= */

.prop-combo-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0 2px;
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  user-select: none;
}
.prop-combo-toggle:hover {
  color: #9ca3af;
}
.combo-arrow {
  font-size: 1.6em;
  font-weight: 300;
  transition: transform 0.2s ease;
  display: inline-block;
  line-height: 1;
  margin-top: -2px;
}
.prop-tracker-player-card.combo-open .combo-arrow {
  transform: rotate(90deg);
}
.prop-combo-section {
  display: none;
  gap: 12px;
}
.prop-tracker-player-card.combo-open .prop-combo-section {
  display: flex;
  margin-top: 10px;
}

/* No props empty state */
.prop-tracker-empty {
  text-align: center;
  padding: 32px 16px;
  color: #6b7280;
  font-size: 14px;
}

/* Combined column hidden on desktop (two-column team layout) */
#roster-display .combined-column { display: none; }

/* =============================================================================
   GAME BODY — Desktop: props left, PBP right (side-by-side)
   ============================================================================= */

.game-body {
  display: flex;
  gap: 0;
  align-items: flex-start;
}

.game-body > .props-content {
  flex: 1;
  min-width: 0;
}

.game-body > #pbp-mount {
  width: 360px;
  flex-shrink: 0;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  position: sticky;
  top: 80px;
  padding: 0 16px 16px 0;
}

/* Remove top margin on PBP container when side-by-side */
.game-body > #pbp-mount .pbp-container {
  margin-top: 0;
  border-radius: 0 0 12px 0;
}

/* PBP feed fills available height in sidebar */
.game-body > #pbp-mount .pbp-feed {
  max-height: calc(100vh - 260px);
}

/* Widen container to fit PBP sidebar on desktop */
#roster-display[data-mode="prop-tracker"] .game-container {
  max-width: 1400px;
}

/* Tab bar — hidden on desktop */
.game-tab-bar {
  display: none;
}

/* =============================================================================
   SWIPEABLE SCOREBOARD — Desktop defaults (Panel 2 + dots hidden)
   ============================================================================= */

.game-sb-swipe {
  display: contents;
}
.game-sb-panel {
  display: contents;
}
.game-sb-panel.game-sb-detail {
  display: none;
}
.game-sb-dots {
  display: none;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 1000px) {
  #roster-display[data-mode="prop-tracker"] .players-grid {
    grid-template-columns: 1fr;
  }

  /* Mobile: show combined column (sorted by highest line), hide team columns */
  /* Scoped to prop-tracker mode so the regular roster view still shows both team columns */
  #roster-display[data-mode="prop-tracker"] .visitor-column,
  #roster-display[data-mode="prop-tracker"] .home-column { display: none; }
  #roster-display[data-mode="prop-tracker"] .combined-column { display: block; }

  /* Banner — show logo + short name, hide full names */
  #roster-display[data-mode="prop-tracker"] .matchup-banner {
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px 16px;
  }
  .sb-edge-logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: auto;
    gap: 20px;
  }
  .sb-edge-logo img {
    width: 72px;
    height: 72px;
  }
  .sb-team-code {
    display: block;
    font-size: 2.0rem;
  }
  /* Home logo on right side of short name */
  .sb-edge-logo:last-child {
    flex-direction: row-reverse;
  }
  .sb-team-side {
    display: none;
  }
  .banner-pts {
    font-size: 3rem;
  }
  .sb-score-block {
    padding: 0 24px;
  }

  /* Scoreboard — large */
  .scoreboard-status {
    font-size: 24px;
  }
  #roster-display[data-mode="prop-tracker"] .banner-center {
    padding: 0 20px;
    gap: 6px;
  }
  .sb-table {
    font-size: 24px;
  }
  .sb-table th,
  .sb-table td {
    padding: 2px 8px;
  }

  /* Player cards — larger */
  .prop-tracker-player-card {
    padding: 20px;
    margin-bottom: 14px;
  }
  .pt-card-header {
    gap: 16px;
  }
  .pt-first-name {
    font-size: 24px;
  }
  .pt-last-name {
    font-size: 24px;
  }
  .pt-avatar {
    width: 52px;
    height: 52px;
  }
  .pt-team-badge {
    width: 26px;
    height: 26px;
    bottom: -3px;
    right: -8px;
  }
  .pt-initials {
    width: 52px;
    height: 52px;
    font-size: 18px;
  }
  .pt-stat-label {
    font-size: 24px;
  }
  .pt-stat-value {
    font-size: 24px;
  }
  .pt-stat-line {
    font-size: 24px;
  }
  .pt-bar {
    height: 6px;
    border-radius: 3px;
    margin-bottom: 8px;
  }
  .pt-bar-track,
  .pt-bar-fill {
    border-radius: 3px;
  }
  .pt-stat-status {
    font-size: 24px;
    gap: 4px;
  }
  .pt-stat-head {
    gap: 8px;
    margin-bottom: 8px;
  }
  .pt-stats-row {
    gap: 16px;
  }
  .pt-card-header {
    margin-bottom: 18px;
  }

  /* Combo toggle */
  .prop-combo-toggle {
    font-size: 24px;
    gap: 4px;
    padding: 12px 0 4px;
  }
  .combo-arrow {
    font-size: 40px;
    margin-top: -3px;

  }
  .prop-combo-section {
    gap: 16px;
  }

  /* Empty state */
  .prop-tracker-empty {
    font-size: 20px;
    padding: 48px 16px;
  }

  /* ── Swipeable scoreboard panels — mobile ── */

  .game-sb-swipe {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  .game-sb-swipe::-webkit-scrollbar {
    display: none;
  }

  .game-sb-panel {
    flex-shrink: 0;
    width: 100%;
    scroll-snap-align: start;
    box-sizing: border-box;
  }

  /* Panel 1: replicate banner flex layout for inner elements */
  .game-sb-panel:not(.game-sb-detail) {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }

  /* Hide quarter table from Panel 1 on mobile (swipe to Panel 2 for details) */
  .game-sb-panel:not(.game-sb-detail) .sb-table {
    display: none;
  }

  /* Show Panel 2 on mobile */
  .game-sb-panel.game-sb-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
  }

  /* Panel 2 detail layout */
  .game-sb-detail-inner {
    display: inline-flex;
    flex-direction: column;
  }

  .game-sb-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
  }

  .game-sb-qtr-labels {
    display: flex;
    gap: 0;
    font-size: 24px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
  }
  .game-sb-qtr-labels > span {
    min-width: 56px;
    text-align: center;
  }

  .game-sb-team-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 0;
  }

  .game-sb-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
  }

  .game-sb-name {
    font-size: 28px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    margin-right: 10px;
  }

  .game-sb-scores {
    display: flex;
    gap: 0;
    font-size: 28px;
    color: rgba(255, 255, 255, 0.5);
    margin-left: auto;
  }
  .game-sb-scores > span {
    min-width: 56px;
    text-align: center;
  }
  .game-sb-scores .game-sb-total {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
  }

  /* Dot indicators */
  .game-sb-dots {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 0 2px;
  }
  .game-sb-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0.25;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .game-sb-dot.game-sb-dot--active {
    opacity: 0.9;
    transform: scale(1.25);
  }

  /* ── Game body — stacked on mobile ── */
  .game-body {
    flex-direction: column;
  }

  .game-body > .props-content {
    width: 100%;
    min-width: unset;
  }

  .game-body > #pbp-mount {
    width: 100%;
    max-height: none;
    overflow-y: visible;
    position: static;
    padding: 0;
  }

  .game-body > #pbp-mount .pbp-container {
    border-radius: 0;
  }

  .game-body > #pbp-mount .pbp-feed {
    max-height: none;
  }

  /* ── Tab bar — visible on mobile ── */
  .game-tab-bar {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .game-tab {
    flex: 1;
    appearance: none;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(255, 255, 255, 0.4);
    font-family: inherit;
    font-size: 24px;
    font-weight: 600;
    padding: 14px 0;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
  }

  .game-tab:hover {
    color: rgba(255, 255, 255, 0.6);
  }

  .game-tab.active {
    color: rgba(var(--theme-accent-rgb, 0, 211, 189), 1);
    border-bottom-color: rgba(var(--theme-accent-rgb, 0, 211, 189), 1);
  }

  /* tab-hidden only applies on mobile; desktop never uses it */
  .tab-hidden {
    display: none !important;
  }
}
