/* /static/css/injured-players.css — Injured Players cheat sheet */

.injured-players-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
  border: none;
  min-height: 100vh;
}

.inj-page-card {
  padding: 0;
  border: none;
  background: none;
}

.inj-loading,
.inj-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--theme-text-secondary, #8B949E);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 15px;
}

/* ── Tile grid ─────────────────────────────────────────── */
.inj-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.inj-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 12px;
  background: var(--theme-card-bg, rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.inj-tile:hover {
  transform: translateY(-2px);
  border-color: var(--theme-accent, #00D3BD);
  box-shadow: 0 4px 20px rgba(0, 211, 189, 0.08);
}

.inj-tile:active {
  transform: scale(0.97);
}

.inj-tile-matchup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.inj-tile-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.inj-tile-name {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--theme-text-primary, #E6EDF3);
  white-space: nowrap;
}

.inj-tile-at {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--theme-text-secondary, #8B949E);
  flex-shrink: 0;
}

.inj-tile-time {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 11px;
  color: var(--theme-text-tertiary, #6E7681);
  text-align: center;
}

.inj-tile-counts {
  display: flex;
  align-items: center;
  gap: 6px;
}
.inj-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--theme-text-secondary, #8B949E);
  padding: 0 8px;
}
.inj-count-out {
  background: rgba(248, 81, 73, 0.15);
  color: #f85149;
}

/* ── Modal overlay + panel ─────────────────────────────── */
.inj-overlay {
  position: fixed;
  inset: 0;
  background: var(--theme-bg-primary, #0D1117);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px 20px;
  overflow-y: auto;
}

.inj-modal {
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 120px);
  background: var(--theme-card-bg, rgba(30, 30, 30, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.inj-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.inj-modal-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.inj-modal-title {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--theme-text-primary, #E6EDF3);
  white-space: nowrap;
}

.inj-modal-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--theme-text-secondary, #8B949E);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.inj-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--theme-text-primary, #E6EDF3);
}

.inj-modal-body {
  overflow-y: auto;
  padding: 4px 0;
  flex: 1;
  min-height: 0;
}

/* Body scroll lock */
html.inj-lock,
body.inj-lock {
  overflow: hidden !important;
  overscroll-behavior: none;
}

/* ── Player row (reused inside modal) ─────────────────── */
.inj-player-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-family: Inter, system-ui, -apple-system, sans-serif;
}
.inj-player-row:last-child {
  border-bottom: none;
}

.inj-player-team-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ── Player avatar + team badge combo ──────────────────── */
.inj-avatar-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.inj-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.inj-avatar-badge {
  position: absolute;
  bottom: -3px;
  right: -5px;
  width: 16px;
  height: 16px;
  object-fit: contain;
}
.inj-avatar-wrap-sm {
  /* Matches .inj-avatar-wrap — beneficiary avatars same size as injured player */
}

.inj-player-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--theme-text-primary, #E6EDF3);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease;
}
.inj-player-name:hover {
  color: var(--theme-accent, #00D3BD);
}

/* Designation badge */
.inj-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.inj-badge-out {
  background: rgba(248, 81, 73, 0.15);
  color: #f85149;
}
.inj-badge-questionable {
  background: rgba(210, 153, 34, 0.15);
  color: #d29922;
}
.inj-badge-probable {
  background: rgba(63, 185, 80, 0.15);
  color: #3fb950;
}

/* Description */
.inj-desc {
  font-size: 14px;
  color: var(--theme-text-secondary, #8B949E);
  flex-basis: 100%;
  padding-left: 30px;
  line-height: 1.4;
}

/* Return date */
.inj-return {
  font-size: 11px;
  font-style: italic;
  color: var(--theme-text-tertiary, #6E7681);
  flex-basis: 100%;
  padding-left: 30px;
}

/* Details wrapper — hidden by default, revealed via .details-open on the row */
.inj-details {
  display: none;
}
.inj-player-row.details-open .inj-details {
  display: contents;
}

/* Details toggle button */
.inj-details-toggle {
  background: none;
  border: none;
  padding: 0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--theme-accent, #00D3BD);
  cursor: pointer;
  flex-shrink: 0;
}
.inj-player-row.details-open .inj-details-toggle {
  color: var(--theme-text-tertiary, #6E7681);
}

/* ── Beneficiary row (inserted after Out players) ──────── */
.inj-beneficiary {
  padding: 6px 20px 10px 52px;
  font-size: 12px;
  color: var(--theme-text-secondary, #8B949E);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-family: Inter, system-ui, -apple-system, sans-serif;
}
.inj-beneficiary-name {
  font-weight: 600;
  color: var(--theme-accent, #00D3BD);
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.inj-beneficiary-name:hover {
  opacity: 0.8;
}
.inj-beneficiary-stat {
  color: var(--theme-accent, #00D3BD);
  font-weight: 600;
}
.inj-beneficiary-stat.neg {
  color: var(--theme-text-tertiary, #6E7681);
}
.inj-beneficiary-games {
  color: var(--theme-text-tertiary, #6E7681);
  font-style: italic;
}
/* ── Scenario label ("If OUT:" / "If IN:") ─────────────── */
.inj-scenario-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--theme-accent, #00D3BD);
  flex-shrink: 0;
  white-space: nowrap;
}
.inj-scenario-label.down {
  color: #f85149;
}

/* ── Down direction variants (If IN — negative impact) ──── */
.inj-beneficiary.down {
  opacity: 0.92;
}
.inj-beneficiary-stat.down {
  color: #f85149;
  font-weight: 600;
}

.inj-beneficiary-loading {
  color: var(--theme-text-tertiary, #6E7681);
  font-style: italic;
  padding: 6px 20px 10px 52px;
  font-size: 12px;
  font-family: Inter, system-ui, -apple-system, sans-serif;
}

/* Remove border between beneficiary stats and its markets row */
.inj-beneficiary + .inj-beneficiary-markets {
  border-top: none;
}
.inj-beneficiary:has(+ .inj-beneficiary-markets) {
  border-bottom: none;
}

/* ── Beneficiary markets (O/U buttons) ─────────────────── */
.inj-beneficiary-markets {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 20px 10px 52px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.inj-mkt-group {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 4px;
}
.inj-mkt-label {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--theme-text-tertiary, #6E7681);
  white-space: nowrap;
}
.inj-beneficiary-markets .ou-buttons {
  display: flex;
  gap: 4px;
}
.inj-beneficiary-markets .ou-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.15);
  color: #e2e8f0;
}
.inj-beneficiary-markets .ou-btn:hover {
  background: rgba(30, 41, 59, 0.8);
  transform: translateY(-1px);
}
.inj-beneficiary-markets .ou-btn.over {
  border-color: rgba(74, 222, 128, 0.4);
}
.inj-beneficiary-markets .ou-btn.over:hover {
  border-color: rgba(74, 222, 128, 0.6);
  background: rgba(74, 222, 128, 0.1);
}
.inj-beneficiary-markets .ou-btn.over.in-parlay {
  background: rgba(74, 222, 128, 0.25);
  border-color: rgba(74, 222, 128, 0.6);
  color: #4ade80;
}
.inj-beneficiary-markets .ou-btn.under {
  border-color: rgba(248, 113, 113, 0.4);
}
.inj-beneficiary-markets .ou-btn.under:hover {
  border-color: rgba(248, 113, 113, 0.6);
  background: rgba(248, 113, 113, 0.1);
}
.inj-beneficiary-markets .ou-btn.under.in-parlay {
  background: rgba(248, 113, 113, 0.25);
  border-color: rgba(248, 113, 113, 0.6);
  color: #f87171;
}
.inj-beneficiary-markets .ou-btn .ou-odds {
  font-weight: 400;
  opacity: 0.7;
  font-size: 10px;
}

/* ── Light theme ────────────────────────────────────────── */
[data-theme="light"] .inj-tile {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .inj-tile:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .inj-count-badge {
  background: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .inj-count-out {
  background: rgba(248, 81, 73, 0.12);
}
[data-theme="light"] .inj-modal {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .inj-modal-header {
  background: rgba(0, 0, 0, 0.03);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .inj-modal-close {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .inj-modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .inj-player-row {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .inj-beneficiary {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .inj-beneficiary-markets {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .inj-beneficiary-markets .ou-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: #1e293b;
}
[data-theme="light"] .inj-beneficiary-markets .ou-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .inj-overlay {
  background: var(--theme-bg-primary, #ffffff);
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .injured-players-container {
    padding: 8px 0;
    max-width: 950px;
  }
  .inj-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .inj-tile {
    padding: 24px 24px;
    gap: 10px;
  }
  .inj-tile-logo {
    width: 48px;
    height: 48px;
  }
  .inj-tile-matchup {
    justify-content: center;
    flex-wrap: nowrap;
  }
  .inj-tile-name {
    font-size: 20px;
  }
  .inj-tile-at {
    font-size: 20px;
  }
  .inj-tile-time {
    font-size: 20px;
  }
  .inj-count-badge {
    font-size: 15px;
    height: 32px;
    padding: 0 14px;
  }

  /* Modal sandwiched between top nav and bottom nav */
  .inj-overlay {
    top: calc(env(safe-area-inset-top, 0px) + 90px);
    bottom: calc(var(--pb-bottom-nav-height, 64px) + env(safe-area-inset-bottom, 0px));
    display: block;
    padding: 0;
  }
  .inj-modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0 0 16px 16px;
  }
  .inj-modal-header {
    padding: 22px 24px;
    gap: 14px;
  }
  .inj-modal-logo {
    width: 48px;
    height: 48px;
  }
  .inj-modal-title {
    font-size: 26px;
  }
  .inj-modal-close {
    width: 60px;
    height: 60px;
    font-size: 36px;
    border-radius: 14px;
  }
  .inj-modal-body {
    padding: 8px 0;
  }
  .inj-player-row {
    padding: 18px 24px;
    gap: 14px;
  }
  .inj-player-name {
    font-size: 26px;
  }
  .inj-badge {
    font-size: 17px;
    padding: 5px 14px;
    border-radius: 10px;
  }
  .inj-avatar-wrap {
    width: 58px;
    height: 58px;
  }
  .inj-avatar-wrap .inj-avatar-badge {
    width: 26px;
    height: 26px;
  }
  .inj-desc {
    font-size: 26px;
    padding-left: 72px;
  }
  .inj-return {
    font-size: 19px;
    padding-left: 72px;
  }
  .inj-beneficiary {
    padding: 12px 24px 14px 82px;
    font-size: 20px;
    gap: 10px;
  }
  .inj-beneficiary-loading {
    padding: 12px 24px 14px 82px;
    font-size: 20px;
  }
  .inj-scenario-label {
    font-size: 17px;
  }
  .inj-beneficiary-markets {
    padding: 6px 24px 16px 82px;
    gap: 12px;
  }
  .inj-beneficiary-markets .ou-buttons {
    gap: 8px;
  }
  .inj-beneficiary-markets .ou-btn {
    padding: 18px 24px;
    font-size: 22px;
    border-radius: 10px;
  }
  .inj-mkt-group {
    gap: 6px;
  }
  .inj-mkt-label {
    font-size: 20px;
  }
  .inj-beneficiary-markets .ou-btn .ou-odds {
    font-size: 20px;
    margin-left: 8px;
  }
  .inj-player-team-logo {
    width: 36px;
    height: 36px;
  }
  .inj-details-toggle {
    font-size: 20px;
  }
}
