:root {
  color-scheme: dark;
  --bg: #040508;
  --surface: rgba(18, 23, 32, 0.9);
  --surface-alt: rgba(14, 20, 27, 0.86);
  --surface-strong: rgba(9, 14, 20, 0.95);
  --accent: #61f0a6;
  --accent-strong: #ffd166;
  --accent-secondary: #2dd5d6;
  --accent-soft: rgba(45, 213, 214, 0.22);
  --text: #f5f7f9;
  --muted: rgba(188, 230, 228, 0.82);
  --border: rgba(36, 140, 148, 0.32);
  --shadow: 0 34px 70px rgba(2, 6, 10, 0.65);
  --radius-large: 28px;
  --radius-medium: 20px;
  --radius-small: 12px;
  --transition: 220ms ease;
  --team-accent: #61f0a6;
  --team-accent-alt: rgba(45, 213, 214, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
  background:
    radial-gradient(circle at 18% -10%, rgba(97, 240, 166, 0.12), transparent 55%),
    radial-gradient(circle at 82% 0%, rgba(36, 140, 148, 0.2), transparent 55%),
    linear-gradient(180deg, rgba(12, 16, 20, 0.96), rgba(6, 9, 12, 0.98) 45%, rgba(2, 3, 6, 0.98));
  background-color: var(--bg);
  color: var(--text);
  min-height: 100%;
}

.page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.main-title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.season-title {
  font-size: 1.8rem;
  color: #666;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  position: relative;
  min-height: 80px;
}

.spinner-ring {
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 50%;
  animation: spin 2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(1) {
  width: 80px;
  height: 80px;
  margin-left: -40px;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  animation-delay: -0.45s;
}

.spinner-ring:nth-child(2) {
  width: 64px;
  height: 64px;
  margin-left: -32px;
  border: 3px solid transparent;
  border-top-color: var(--accent-secondary);
  animation-delay: -0.3s;
}

.spinner-ring:nth-child(3) {
  width: 48px;
  height: 48px;
  margin-left: -24px;
  border: 3px solid transparent;
  border-top-color: var(--accent-strong);
  animation-delay: -0.15s;
}

.loading-text {
  margin-top: 100px;
  font-size: 1.1rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.app-sidebar {
  width: 280px;
  padding: 2.5rem 1.5rem;
  background:
    linear-gradient(180deg, rgba(9, 12, 18, 0.98), rgba(4, 7, 12, 0.96));
  border-right: 1px solid var(--border);
  backdrop-filter: blur(24px);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  z-index: 20;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-branding {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.sidebar-logo,
.sidebar-logo img {
  display: inline-flex;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 2px rgba(94, 243, 140, 0.18);
  overflow: hidden;
}

.sidebar-logo {
  flex-shrink: 0;
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-close {
  display: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  margin-left: auto;
  transition: color var(--transition);
}

.sidebar-close:hover,
.sidebar-close:focus-visible {
  color: var(--text);
  outline: none;
}

.sidebar-close span {
  display: block;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  display: block;
}

.brand-tagline {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.view-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 2.5rem;
}

.view-header h1 {
  margin: 0;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: clamp(2.25rem, 4vw, 3rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.view-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-group-title {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-link {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-small);
  text-align: left;
  cursor: pointer;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}

.nav-link:hover {
  color: var(--text);
  background: rgba(45, 213, 214, 0.08);
  transform: translateX(4px);
}

.nav-link.active {
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(97, 240, 166, 0.35);
}

.nav-link.external {
  text-decoration: none;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem clamp(1.25rem, 3vw, 2.5rem);
  background: rgba(9, 14, 20, 0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.topbar-context {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.control select {
  appearance: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-small);
  border: 1px solid var(--border);
  background: rgba(5, 8, 12, 0.9);
  color: var(--text);
  font-size: 0.95rem;
  min-width: 120px;
}

.topbar-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.topbar-actions .cta,
.topbar-actions .secondary {
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.app-content {
  flex: 1;
  padding: 2.5rem clamp(1.25rem, 3vw, 2.8rem) 4rem;
  max-width: 1420px;
  width: 100%;
  margin: 0 auto;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
  margin-top: 2rem;
}

.matchups-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  margin-top: 2rem;
}

.matchups-chart {
  margin-top: 1.75rem;
}

.chart-container {
  position: relative;
  height: 400px;
  max-height: 400px;
  width: 100%;
}

.chart-container canvas {
  max-height: 100%;
}

.history-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.front-office-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.directory-card,
.transaction-card,
.versus-card,
.rules-card {
  width: 100%;
}

.franchise-directory {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.franchise-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  padding: 1.25rem;
  background: rgba(8, 12, 18, 0.8);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform var(--transition), border-color var(--transition);
}

.franchise-card:hover {
  transform: translateY(-4px);
  border-color: rgba(97, 240, 166, 0.35);
}

.franchise-card-champion {
  border: 2px solid #FFD700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.franchise-card-champion:hover {
  border-color: #FFD700;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.franchise-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.franchise-card header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.franchise-card .badge {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.franchise-card .badge-former {
  background: rgba(150, 150, 150, 0.2);
  color: rgba(200, 200, 200, 0.8);
  margin-left: 0.5rem;
}

.franchise-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  font-size: 0.85rem;
}

.franchise-card dt {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
}

.franchise-card dd {
  margin: 0;
  font-weight: 600;
}

.transaction-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.transaction-chip {
  background: rgba(10, 18, 24, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.transaction-chip span {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  color: var(--muted);
}

.transaction-chip strong {
  font-size: 1.35rem;
}

.transaction-table {
  width: 100%;
  border-collapse: collapse;
}

.transaction-table th,
.transaction-table td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid rgba(45, 213, 214, 0.08);
}

.transaction-table tbody tr:hover {
  background: rgba(45, 213, 214, 0.06);
}

/* Transaction Feed Styles */
.transaction-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 600px;
  overflow-y: auto;
  padding: 0.5rem;
}

.txn-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: rgba(10, 14, 20, 0.5);
  border-radius: var(--radius-small);
  border-left: 3px solid rgba(45, 213, 214, 0.3);
  transition: all 0.2s ease;
}

.txn-item:hover {
  background: rgba(10, 14, 20, 0.7);
  border-left-color: var(--accent);
  transform: translateX(2px);
}

.txn-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(45, 213, 214, 0.1);
  border-radius: 50%;
}

.txn-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.txn-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.txn-type {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding: 0.25rem 0.5rem;
  background: rgba(45, 213, 214, 0.15);
  border-radius: var(--radius-small);
}

.txn-time {
  font-size: 0.75rem;
  color: rgba(213, 231, 236, 0.6);
}

.txn-detail {
  font-size: 0.9rem;
  line-height: 1.5;
}

.txn-detail strong {
  color: var(--accent);
  font-weight: 600;
}

.txn-player {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  background: rgba(45, 213, 214, 0.08);
  border-radius: var(--radius-small);
  font-weight: 600;
}

.txn-player em {
  font-style: normal;
  font-weight: 400;
  font-size: 0.85em;
  opacity: 0.7;
}

.txn-additional {
  font-size: 0.8rem;
  color: rgba(213, 231, 236, 0.6);
  font-style: italic;
}

.txn-trade {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(45, 213, 214, 0.05);
  border-radius: var(--radius-small);
  border: 1px solid rgba(45, 213, 214, 0.15);
}

.txn-trade-side {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.txn-trade-side strong {
  color: var(--accent);
  font-size: 0.9rem;
}

.txn-trade-divider {
  text-align: center;
  font-size: 1.2rem;
  color: rgba(213, 231, 236, 0.4);
  padding: 0.25rem 0;
}

/* Transaction type specific colors */
.txn-add .txn-icon {
  background: rgba(76, 175, 80, 0.15);
}

.txn-add .txn-type {
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
}

.txn-drop .txn-icon {
  background: rgba(244, 67, 54, 0.15);
}

.txn-drop .txn-type {
  background: rgba(244, 67, 54, 0.15);
  color: #f44336;
}

.txn-add-drop .txn-icon {
  background: rgba(255, 152, 0, 0.15);
}

.txn-add-drop .txn-type {
  background: rgba(255, 152, 0, 0.15);
  color: #ff9800;
}

.txn-trade .txn-icon {
  background: rgba(156, 39, 176, 0.15);
}

.txn-trade .txn-type {
  background: rgba(156, 39, 176, 0.15);
  color: #9c27b0;
}

.txn-commish .txn-icon {
  background: rgba(255, 193, 7, 0.15);
}

.txn-commish .txn-type {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
}

@media (max-width: 720px) {
  .txn-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .txn-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .txn-trade {
    gap: 0.5rem;
  }
}

/* Hot & Cold Players Styles */
.hot-cold-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1rem;
}

.hot-players-section h3,
.cold-players-section h3 {
  font-size: 1rem;
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(45, 213, 214, 0.2);
}

.hot-players-list,
.cold-players-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.player-activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: rgba(10, 14, 20, 0.4);
  border-radius: var(--radius-small);
  transition: all 0.2s ease;
}

.player-activity-item:hover {
  background: rgba(10, 14, 20, 0.6);
  transform: translateX(2px);
}

.player-rank {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: rgba(213, 231, 236, 0.4);
  min-width: 30px;
  text-align: center;
}

.player-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.player-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.player-details {
  font-size: 0.75rem;
  color: rgba(213, 231, 236, 0.6);
}

.player-count {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}

.count-value {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--accent);
}

.count-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(213, 231, 236, 0.5);
}

@media (max-width: 960px) {
  .hot-cold-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 720px) {
  .player-activity-item {
    padding: 0.6rem;
    gap: 0.75rem;
  }

  .player-rank {
    font-size: 1rem;
    min-width: 25px;
  }

  .player-name {
    font-size: 0.85rem;
  }

  .count-value {
    font-size: 1rem;
  }
}

.versus-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

.versus-table th,
.versus-table td {
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(45, 213, 214, 0.08);
  font-size: 0.85rem;
  text-align: center;
}

.versus-table th {
  background: rgba(10, 16, 22, 0.9);
  position: sticky;
  top: 0;
  z-index: 1;
}

.versus-table td.team-label,
.versus-table th.team-label {
  text-align: left;
  position: sticky;
  left: 0;
  background: rgba(10, 16, 22, 0.92);
  z-index: 2;
}

.versus-table td.positive {
  background: rgba(97, 240, 166, 0.12);
  color: var(--accent);
}

.versus-table td.negative {
  background: rgba(255, 75, 110, 0.12);
  color: #ff8fa4;
}

.versus-table td.neutral {
  color: var(--muted);
  background: rgba(45, 213, 214, 0.05);
}

.versus-table td.self-cell {
  background: rgba(9, 12, 18, 0.95);
  color: var(--muted);
}

.versus-note {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: rgba(210, 221, 226, 0.7);
}

.front-office-feed {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.front-office-entry {
  background: rgba(8, 12, 18, 0.78);
  border: 1px solid rgba(45, 213, 214, 0.12);
  border-radius: var(--radius-small);
  padding: 1.2rem 1.35rem;
  display: grid;
  gap: 0.5rem;
}

.front-office-entry header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.front-office-meta {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(213, 231, 236, 0.68);
}

.front-office-entry header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.front-office-entry p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.front-office-entry a {
  color: var(--accent);
}

/* Yahoo Postgame Stories */
.story-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* Story Card - Single-sided design */
.story-card {
  position: relative;
  border-radius: var(--radius-small);
  border: 1px solid rgba(45, 213, 214, 0.12);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(8, 12, 18, 0.82);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.story-card:hover {
  transform: translateY(-2px);
  border-color: rgba(45, 213, 214, 0.25);
}

.story-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.story-card-week {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(213, 231, 236, 0.68);
}

.story-card-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.625rem;
  border-radius: 3px;
  font-weight: 700;
}

.story-card-badge.playoff {
  background: rgba(255, 107, 53, 0.15);
  color: #ff6b35;
  border: 1px solid rgba(255, 107, 53, 0.3);
}

.story-card-matchup {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.story-card-team {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1rem;
  background: rgba(10, 14, 20, 0.6);
  border-radius: var(--radius-small);
  border-left: 3px solid transparent;
}

.story-card-team.winner {
  border-left-color: var(--accent);
  background: rgba(45, 213, 214, 0.08);
}

.story-card-team-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.winner-badge {
  font-size: 1rem;
  line-height: 1;
}

.story-card-team-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.story-card-team-score {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-display);
}

.story-card-vs {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(213, 231, 236, 0.5);
}

.story-card-margin {
  text-align: center;
  padding: 0.625rem;
  background: rgba(45, 213, 214, 0.06);
  border-radius: var(--radius-small);
  font-size: 0.85rem;
  color: rgba(213, 231, 236, 0.85);
}

.story-card-margin strong {
  color: var(--accent);
  font-weight: 700;
}

.story-card-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(45, 213, 214, 0.15), rgba(45, 213, 214, 0.08));
  border: 1px solid rgba(45, 213, 214, 0.3);
  border-radius: var(--radius-small);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.story-card-link:hover {
  background: linear-gradient(135deg, rgba(45, 213, 214, 0.25), rgba(45, 213, 214, 0.15));
  border-color: rgba(45, 213, 214, 0.5);
  transform: translateY(-1px);
}

.story-card-link svg {
  flex-shrink: 0;
}

.flip-card-back-link a:hover {
  background: rgba(45, 213, 214, 0.2);
  transform: translateY(-1px);
}

/* Inline Recap Styles for Generated Stories */
.recap-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: linear-gradient(135deg, var(--accent), rgba(45, 213, 214, 0.6));
  color: var(--bg);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-radius: var(--radius-small);
  margin-bottom: 0.75rem;
}

.recap-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recap-score-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(10, 14, 20, 0.5);
  border-radius: var(--radius-small);
  border: 1px solid rgba(45, 213, 214, 0.15);
}

.recap-team {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.recap-team-name {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recap-team-score {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--accent);
}

.recap-winner .recap-team-name {
  color: var(--accent);
}

.recap-winner .winner-badge {
  font-size: 1.2rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.recap-loser {
  opacity: 0.7;
}

.recap-divider {
  text-align: center;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(213, 231, 236, 0.5);
  padding: 0.25rem 0;
}

.recap-margin {
  text-align: center;
  padding: 0.75rem;
  background: rgba(45, 213, 214, 0.08);
  border-radius: var(--radius-small);
  font-size: 0.85rem;
  color: rgba(213, 231, 236, 0.9);
}

.recap-margin strong {
  color: var(--accent);
  font-weight: 700;
}

.recap-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(45, 213, 214, 0.12);
}

.recap-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: center;
}

.recap-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(213, 231, 236, 0.5);
}

.recap-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.recap-action {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(45, 213, 214, 0.12);
}

.yahoo-story-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: linear-gradient(135deg, rgba(45, 213, 214, 0.15), rgba(45, 213, 214, 0.08));
  border: 1px solid rgba(45, 213, 214, 0.3);
  border-radius: var(--radius-small);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.yahoo-story-link:hover {
  background: linear-gradient(135deg, rgba(45, 213, 214, 0.25), rgba(45, 213, 214, 0.15));
  border-color: rgba(45, 213, 214, 0.5);
  transform: translateY(-1px);
}

.yahoo-story-link svg {
  flex-shrink: 0;
}

/* Generated recap cards have slightly different styling */
.flip-card.generated-recap {
  height: 520px;
}

@media (max-width: 720px) {
  .story-grid {
    grid-template-columns: 1fr;
  }

  .story-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
}

.rules-sections {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.rules-section {
  border: 1px solid rgba(45, 213, 214, 0.12);
  border-radius: var(--radius-small);
  background: rgba(8, 12, 18, 0.82);
  padding: 1rem 1.2rem;
}

.rules-section summary {
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
}

.rules-content {
  margin-top: 1rem;
}

.rules-content ul {
  margin: 0;
  padding-left: 1.5rem;
  list-style: disc;
}

.rules-content li {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 0.5rem;
}

.rules-content strong {
  color: var(--text);
}

.scoring-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.scoring-group {
  background: rgba(10, 14, 20, 0.6);
  border: 1px solid rgba(45, 213, 214, 0.08);
  border-radius: var(--radius-small);
  padding: 1rem;
}

.scoring-group h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.scoring-group ul {
  margin: 0;
  padding-left: 1.2rem;
  list-style: none;
}

.scoring-group li {
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.scoring-note {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
}

.rules-intro {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 1rem 0;
  font-style: italic;
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
}

.rules-note {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  background: rgba(45, 213, 214, 0.05);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-small);
  font-size: 0.9rem;
  color: var(--muted);
}

.rules-note em {
  font-style: italic;
}

.prize-breakdown {
  margin-top: 0.5rem;
  padding-left: 1.5rem;
}

.prize-breakdown li {
  margin-bottom: 0.5rem;
  color: var(--muted);
  line-height: 1.8;
}

.history-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: rgba(10, 14, 20, 0.6);
  border: 1px solid rgba(45, 213, 214, 0.12);
  border-radius: var(--radius-small);
}

.history-stat {
  text-align: center;
}

.history-stat-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
}

.history-stat-label {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.3;
}

.dynasty-list {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.8;
  margin: 0.75rem 0;
  padding: 1rem;
  background: rgba(45, 213, 214, 0.03);
  border-radius: var(--radius-small);
  border: 1px solid rgba(45, 213, 214, 0.1);
}

.rules-content h4 {
  margin: 1.5rem 0 0.75rem 0;
  font-size: 1.05rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.rules-content h4:first-child {
  margin-top: 0;
}

.hero-dashboard {
  padding: 0;
  margin-bottom: 2.25rem;
}

.hero-dashboard .hero-text p {
  max-width: 680px;
}

.chart-card canvas {
  width: 100%;
  min-height: 280px;
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease-out;
  z-index: 999;
  pointer-events: none;
  will-change: opacity;
}

.sidebar-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 1080px) {
  .app-sidebar {
    width: 240px;
  }
}

@media (max-width: 960px) {
  .sidebar-overlay {
    display: block;
  }
  .app-shell {
    flex-direction: column;
  }

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translate3d(-100%, 0, 0);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    height: 100vh;
    will-change: transform;
  }

  .app-sidebar.open {
    transform: translate3d(0, 0, 0);
  }

  /* Disable transition during gesture dragging for smooth follow */
  .app-sidebar.dragging {
    transition: none !important;
  }

  .sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .view-header {
    margin-bottom: 2rem;
  }

  .app-topbar {
    justify-content: space-between;
  }

  .topbar-context {
    flex: 1;
    justify-content: flex-end;
  }

  .mobile-toggle {
    display: inline-flex;
  }

  .app-content {
    padding-top: 1.5rem;
  }
}

@media (max-width: 720px) {
  .app-topbar {
    flex-wrap: wrap;
  }

  .topbar-context {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
    order: 2;
  }

  .control {
    width: 100%;
  }

  .control select {
    width: 100%;
    min-width: unset;
  }

  .view-header h1 {
    font-size: clamp(2rem, 6vw, 2.5rem);
  }

  .view-subtitle {
    font-size: 0.85rem;
  }

  .view-grid {
    grid-template-columns: 1fr;
  }

  .matchups-top-grid {
    grid-template-columns: 1fr;
  }

  .chart-container {
    height: 300px;
    max-height: 300px;
  }

  .franchise-card dl {
    grid-template-columns: 1fr;
  }

  .transaction-summary {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .topbar-actions {
    width: 100%;
    order: 3;
    justify-content: center;
    margin-top: 0.5rem;
  }

  .topbar-actions .cta,
  .topbar-actions .secondary {
    flex: 1;
    padding: 0.5rem 1rem;
    font-size: 0.65rem;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: var(--accent-strong);
}

.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

.hero {
  padding: 2rem 0 4rem;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  flex-wrap: wrap;
}

.top-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 220px;
}

.top-nav a {
  font-weight: 500;
  color: var(--muted);
  transition: color var(--transition);
}

.top-nav a:hover {
  color: var(--accent-strong);
}

.brand-mark {
  display: inline-flex;
  line-height: 0;
}

.brand-title {
  font-weight: 700;
  font-size: clamp(2.2rem, 9vw, 4.8rem);
  line-height: 1;
  letter-spacing: 0.04em;
  display: block;
}

.nav-admin {
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  transition: border-color var(--transition), color var(--transition);
}

.nav-admin:hover {
  border-color: var(--accent-strong);
  color: var(--text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 700;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex: 1 1 320px;
  min-width: 0;
}

.brand img {
  width: clamp(60px, 10vw, 110px);
  height: clamp(60px, 10vw, 110px);
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 2px rgba(94, 243, 140, 0.18);
}

.hero-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  margin-top: 2.5rem;
  align-items: center;
}

.hero-aside {
  display: grid;
  gap: 1.5rem;
}

.hero-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.hero-gallery img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: var(--radius-small);
  border: 1px solid rgba(97, 240, 166, 0.25);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  background: radial-gradient(circle at center, rgba(97, 240, 166, 0.15), rgba(6, 3, 16, 0.8));
  padding: 0.35rem;
}

.hero-text h2 {
  font-size: clamp(2.5rem, 5vw, 3.6rem);
  margin-bottom: 1rem;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}

.hero-text p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-actions {
  margin-top: 2rem;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.hero-actions a {
  padding: 0.85rem 1.8rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform var(--transition), box-shadow var(--transition),
    background var(--transition);
  text-align: center;
  min-width: 0;
}

.hero-actions .cta {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #07120b;
  box-shadow: var(--shadow);
}

.hero-actions .cta:hover {
  transform: translateY(-3px);
}

.hero-actions .secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.hero-actions .secondary:hover {
  border-color: var(--accent-strong);
  color: var(--text);
}

.hero-stats {
  display: grid;
  gap: 1rem;
}

.hero-stat {
  padding: 1.5rem;
  background: var(--surface);
  border-radius: var(--radius-medium);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-stat h3 {
  margin: 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.hero-stat strong {
  display: block;
  margin-top: 0.5rem;
  font-size: 2rem;
  font-weight: 700;
}

.section {
  margin-top: 4rem;
}

.section-heading h2 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  margin-bottom: 0.5rem;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  max-width: 620px;
  line-height: 1.6;
}

.season-controls {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.season-controls label {
  font-weight: 600;
}

#season-select,
#week-select,
#draft-round-select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  padding: 0.6rem 0.9rem;
  font-size: 1rem;
}

.season-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.season-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  padding: 1.75rem;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.card header > div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card header h3 {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.card header p {
  margin: 0;
  color: var(--muted);
}

.header-split {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.draft-controls {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.season-wide {
  margin-top: 1.75rem;
}

.season-wide .card {
  width: 100%;
}

.highlights-card {
  display: flex;
  flex-direction: column;
}

.season-highlight-body {
  margin-top: 1.25rem;
}

.season-highlight-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.season-highlight-list li strong {
  display: block;
  font-size: 1.05rem;
  margin-top: 0.25rem;
}

.season-highlight-list .note {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.2rem;
  display: block;
}

/* Current Streaks Styles */
.streaks-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.streak-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(10, 14, 20, 0.5);
  border-radius: var(--radius-small);
  border-left: 3px solid var(--accent);
  transition: all 0.2s ease;
}

.streak-item:hover {
  background: rgba(10, 14, 20, 0.7);
  transform: translateX(3px);
}

.streak-item.win-streak {
  border-left-color: #ff4757;
}

.streak-item.lose-streak {
  border-left-color: #5f27cd;
}

.streak-icon {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.streak-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.streak-team {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.streak-label {
  font-size: 0.85rem;
  color: rgba(213, 231, 236, 0.7);
}

.streak-count {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-display);
}

/* Consistency Meter Styles */
.consistency-explainer {
  background: rgba(10, 14, 20, 0.3);
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: var(--radius-small);
}

.consistency-explainer p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: rgba(213, 231, 236, 0.85);
}

.consistency-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.consistency-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(10, 14, 20, 0.5);
  border-radius: var(--radius-small);
  border-left: 3px solid var(--accent);
  transition: all 0.2s ease;
}

.consistency-item:hover {
  background: rgba(10, 14, 20, 0.7);
  transform: translateX(3px);
}

.consistency-rank {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  width: 35px;
  text-align: center;
  flex-shrink: 0;
}

.consistency-badge {
  font-size: 1.5rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.consistency-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.consistency-team {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.consistency-team h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.consistency-team h3 a {
  color: var(--text);
  text-decoration: none;
}

.consistency-team h3 a:hover {
  color: var(--accent);
}

.consistency-level {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.consistency-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.consistency-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.consistency-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.consistency-stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* Draft Grade Analysis Styles */
.draft-grade-explainer {
  background: rgba(10, 14, 20, 0.3);
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: var(--radius-small);
}

.draft-grade-explainer p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: rgba(213, 231, 236, 0.85);
}

.draft-grade-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.draft-grade-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(10, 14, 20, 0.5);
  border-radius: var(--radius-small);
  border-left: 3px solid var(--accent);
  transition: all 0.2s ease;
}

.draft-grade-item:hover {
  background: rgba(10, 14, 20, 0.7);
  transform: translateX(3px);
}

.draft-grade-badge {
  font-size: 1.5rem;
  font-weight: 700;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  font-family: var(--font-display);
}

.draft-grade-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.draft-grade-team {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.draft-grade-team h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.draft-grade-team h3 a {
  color: var(--text);
  text-decoration: none;
}

.draft-grade-team h3 a:hover {
  color: var(--accent);
}

.draft-grade-verdict {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.draft-grade-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.draft-grade-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.draft-grade-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.draft-grade-stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* Playoff Breakdown Styles */
.playoff-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.playoff-breakdown-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: rgba(10, 14, 20, 0.5);
  border-radius: var(--radius-small);
  border-left: 3px solid var(--accent);
  transition: all 0.2s ease;
}

.playoff-breakdown-item:hover {
  background: rgba(10, 14, 20, 0.7);
  transform: translateX(3px);
}

.playoff-rank-badge {
  font-size: 1.5rem;
  font-weight: 700;
  min-width: 50px;
  text-align: center;
  color: var(--accent);
  flex-shrink: 0;
}

.playoff-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.playoff-team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.playoff-team-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.playoff-team-header h3 a {
  color: var(--text);
  text-decoration: none;
}

.playoff-team-header h3 a:hover {
  color: var(--accent);
}

.playoff-efficiency {
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.playoff-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.playoff-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.playoff-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.playoff-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

@media (max-width: 768px) {
  .playoff-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Weekly Scoring Heatmap Styles */
.heatmap-container {
  overflow-x: auto;
  margin-top: 1rem;
}

.heatmap-grid {
  display: inline-block;
  min-width: 100%;
}

.heatmap-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.heatmap-label {
  width: 180px;
  flex-shrink: 0;
  padding: 0.5rem;
}

.heatmap-week-label {
  width: 65px;
  text-align: center;
  padding: 0.5rem 0.25rem;
  flex-shrink: 0;
}

.heatmap-row {
  display: flex;
  align-items: stretch;
  margin-bottom: 0.25rem;
}

.heatmap-team-label {
  width: 180px;
  flex-shrink: 0;
  padding: 0.75rem 0.5rem;
  background: rgba(10, 14, 20, 0.5);
  border-radius: var(--radius-small) 0 0 var(--radius-small);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.heatmap-team-label a {
  color: var(--text);
  text-decoration: none;
}

.heatmap-team-label a:hover {
  color: var(--accent);
}

.heatmap-cell {
  width: 65px;
  flex-shrink: 0;
  padding: 0.75rem 0.25rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  border-left: 1px solid rgba(45, 213, 214, 0.1);
  transition: all 0.2s ease;
  cursor: default;
}

.heatmap-cell:hover {
  transform: scale(1.1);
  z-index: 10;
  box-shadow: 0 0 10px rgba(45, 213, 214, 0.3);
}

.heatmap-row:last-child .heatmap-team-label {
  border-radius: var(--radius-small) 0 0 var(--radius-small);
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(45, 213, 214, 0.1);
}

.heatmap-legend-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.heatmap-legend-gradient {
  flex: 1;
  height: 24px;
  background: linear-gradient(to right, rgb(26, 31, 46), rgb(45, 213, 214), rgb(255, 209, 102), rgb(255, 107, 107));
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(8, 12, 18, 0.9);
}

@media (max-width: 960px) {
  .heatmap-label,
  .heatmap-team-label {
    width: 140px;
  }

  .heatmap-week-label,
  .heatmap-cell {
    width: 55px;
  }
}

/* Trend Chart Styles */
.trend-chart-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.trend-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.trend-controls select {
  min-width: 200px;
  max-width: 300px;
  background: rgba(10, 14, 20, 0.5);
  border: 1px solid rgba(45, 213, 214, 0.3);
  color: var(--text);
  padding: 0.5rem;
  border-radius: var(--radius-small);
  font-size: 0.85rem;
}

.trend-controls select:focus {
  outline: none;
  border-color: var(--accent);
}

.trend-controls option {
  background: #0a0e14;
  color: var(--text);
  padding: 0.5rem;
}

.trend-controls option:checked {
  background: var(--accent);
  color: #0a0e14;
}

.season-summary h3 {
  margin-top: 0;
  font-size: 1.5rem;
}

.season-summary .champion-name {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.4rem 0;
}

.season-summary .season-overview {
  margin: 1.25rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem 1.5rem;
}

.season-summary .season-overview-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.season-summary .season-overview-item .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.season-summary .season-overview-item .value {
  font-size: clamp(1.15rem, 3.6vw, 1.6rem);
  font-weight: 700;
}

.season-summary .season-overview-item .note {
  color: var(--muted);
  font-size: 0.85rem;
}

.season-summary .champion-manager,
.season-summary .champion-record {
  color: var(--muted);
  margin: 0.2rem 0;
}

.season-summary .champion-manager {
  font-weight: 500;
}


.summary-grid {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.summary-grid > div {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.summary-grid .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.summary-grid strong {
  font-size: 1.1rem;
}

.summary-grid .note {
  color: var(--muted);
  font-size: 0.85rem;
}

.season-meta .season-identity {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, transparent 45%, rgba(36, 140, 148, 0.12) 65%, rgba(97, 240, 166, 0.16));
  pointer-events: none;
}

.card > * {
  position: relative;
  z-index: 1;
}

.table-wrapper {
  margin-top: 1rem;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

thead th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

tbody tr:last-child td {
  border-bottom: none;
}

.standings-list {
  margin-top: 1.25rem;
  display: grid;
  gap: 1rem;
}

.standings-card header p {
  margin: 0.35rem 0 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-weight: 600;
}

.standings-entry {
  padding: 1rem 1.4rem;
  border-radius: var(--radius-medium);
  border: 1px solid rgba(36, 140, 148, 0.28);
  background: linear-gradient(135deg, rgba(14, 18, 24, 0.9), rgba(6, 10, 16, 0.95));
  box-shadow: 0 18px 36px rgba(4, 8, 12, 0.45);
  display: grid;
  gap: 0.75rem;
}

.standings-entry-header {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  gap: 1.25rem;
  align-items: center;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}

.standings-entry-header > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.standings-entry-header .label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.standings-entry-header .value {
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.standings-entry-header .seed-value {
  color: var(--accent-strong);
}

.standings-entry-header .team-group {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 0.6rem;
}

.standings-entry-header .team-group .label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}

.standings-entry-header .team-group .name {
  font-size: clamp(1.05rem, 3.4vw, 1.35rem);
  font-weight: 600;
}

.standings-entry-header .team-group .alias {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

.standings-entry-header .record-value {
  color: var(--text);
}

.standings-entry-metrics {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.5rem 1.25rem;
}

.standings-entry-metrics div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.standings-entry-metrics dt {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.standings-entry-metrics dd {
  margin: 0;
  font-weight: 600;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.matchup-list {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
}

.draft-card header {
  align-items: center;
}

.round-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.round-filter span {
  display: block;
}

.round-filter select {
  min-width: 120px;
}

.draft-card .table-wrapper {
  max-height: 360px;
  overflow-y: auto;
}

.matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-small);
  background: var(--surface-alt);
}

.matchup strong {
  font-size: 1.1rem;
}

.matchup .team {
  display: flex;
  flex-direction: column;
}

.matchup .team span:last-child {
  color: var(--muted);
  font-size: 0.85rem;
}

.matchup .team span:last-child:empty {
  display: none;
}

.matchup .score-block {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}

.matchup .score {
  font-size: 1.4rem;
  font-weight: 700;
}

.matchup .divider {
  color: var(--muted);
  font-weight: 600;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: grid;
  gap: 0.9rem;
}

.timeline li {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface-alt);
  padding: 0.9rem 1rem;
  border-radius: var(--radius-small);
}

.timeline li .year {
  font-weight: 700;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  letter-spacing: 0.06em;
  color: var(--accent-strong);
}

.dynasty-list {
  margin-top: 1.25rem;
  display: grid;
  gap: 1rem;
}

.dynasty-item {
  display: grid;
  gap: 0.4rem;
}

.dynasty-item header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.record-book {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.9rem;
}

.record-book li {
  background: var(--surface-alt);
  padding: 1rem 1.1rem;
  border-radius: var(--radius-small);
  display: grid;
  gap: 0.4rem;
}

.record-book span.label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.spotlight-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 1rem;
  align-items: center;
}

.spotlight-card img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.4);
}

.spotlight-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.3rem;
}

.spotlight-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.identity-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.identity-status {
  color: var(--muted);
  font-size: 0.95rem;
}

.identity-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.identity-hint {
  font-size: 0.9rem;
  color: var(--muted);
}

.pill-button {
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition),
    transform var(--transition), box-shadow var(--transition);
}

.pill-button:hover:not(:disabled) {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.pill-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.pill-button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  color: #001421;
  box-shadow: var(--shadow);
}

.identity-table-wrapper {
  margin-top: 1rem;
}

.identity-table-wrapper table tbody td {
  vertical-align: top;
}

.identity-table-wrapper table thead th {
  white-space: nowrap;
}

.identity-table-wrapper table tbody td:first-child {
  min-width: 110px;
}

.identity-table-wrapper table tbody td:nth-child(2) {
  min-width: 160px;
}

.identity-table-wrapper table tbody td:nth-child(3) {
  min-width: 110px;
}

.identity-franchise {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.identity-meta {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.alias-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  margin: 0.15rem;
  border-radius: 999px;
  background: rgba(36, 140, 148, 0.18);
  color: var(--text);
  font-size: 0.78rem;
  white-space: nowrap;
}

.alias-chip.more {
  background: rgba(36, 140, 148, 0.12);
  color: var(--accent-secondary);
}

.alias-chip.muted {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.tag.success {
  background: rgba(97, 240, 166, 0.18);
  color: #7cffba;
}

.tag.warning {
  background: rgba(255, 191, 71, 0.18);
  color: #ffbf47;
}

.tag.muted {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.identity-select {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

.identity-select input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.identity-builder,
.identity-raw {
  background: rgba(12, 6, 22, 0.8);
  border-radius: var(--radius-small);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
}

.identity-builder summary,
.identity-raw summary {
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.identity-builder-body {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.identity-input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.identity-input-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.identity-input-grid input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  color: var(--text);
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
}

.identity-input-grid input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(94, 231, 255, 0.2);
}

.identity-builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

#identity-snippet {
  width: 100%;
  min-height: 120px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  color: var(--accent);
  font-family: 'Space Grotesk', 'Inter', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.9rem;
  padding: 1rem;
  resize: vertical;
}

.identity-raw p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.75rem 0 1rem;
}

.admin-page .hero-actions {
  margin-top: 1.5rem;
}

.admin-hero {
  padding-bottom: 2rem;
}

.footer {
  margin-top: 5rem;
  padding: 3rem 0 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 960px) {
  .season-panels {
    grid-template-columns: 1fr;
  }

  .round-filter {
    width: 100%;
    justify-content: space-between;
  }

  .draft-card .table-wrapper {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .top-nav ul {
    display: none;
  }

  .hero {
    padding-top: 1.5rem;
  }

  .hero-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card {
    padding: 1.4rem;
  }

  .matchup {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .matchup .score {
    font-size: 1.2rem;
  }

  .matchup .score-block {
    justify-content: center;
  }
}

/* Franchise team page */
.team-page {
  padding-bottom: 6rem;
}

.team-hero {
  padding: 2rem 0 3.5rem;
  background: transparent;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: none;
}

.team-hero-body {
  max-width: 720px;
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.team-hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  margin: 0;
}

.team-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  transition: color var(--transition);
}

.breadcrumb:hover {
  color: var(--text);
}

.team-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.team-tag {
  background: var(--team-accent-alt);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.team-aliases {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.team-aliases .label {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.team-alias-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.team-chip {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
}

.team-chip.muted {
  opacity: 0.6;
}

.team-main {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.team-section {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.team-summary-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.team-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: var(--shadow);
}

.team-summary-card strong {
  font-size: 2rem;
  font-weight: 700;
  color: var(--team-accent);
}

.team-summary-card .note {
  color: var(--muted);
  font-size: 0.9rem;
}

.team-season-list {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.season-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  box-shadow: var(--shadow);
}

.season-card.champion {
  border-color: var(--team-accent);
  box-shadow: 0 0 0 1px var(--team-accent), var(--shadow);
}

.season-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.season-year {
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-gold {
  background: linear-gradient(120deg, #ffd25f, #ff9f43);
  color: #2e1600;
}

.badge.muted {
  background: rgba(255, 255, 255, 0.05);
}

.season-record {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.season-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.season-note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.team-highlight-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.team-highlight-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: var(--shadow);
}

.team-highlight-list strong {
  font-size: 1.6rem;
}

.team-highlight-list .note {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.team-highlight-list .empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

.team-draft-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius-medium);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.team-draft-table th,
.team-draft-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.team-draft-table th {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.team-draft-table tbody tr:last-child td {
  border-bottom: none;
}

.team-draft-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.team-draft-controls select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  padding: 0.45rem 0.75rem;
  font-size: 0.95rem;
}

.team-error {
  background: rgba(255, 99, 132, 0.12);
  border: 1px solid rgba(255, 99, 132, 0.4);
  color: #ffb3c1;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-medium);
  font-weight: 500;
}

.team-loading {
  background: var(--surface-alt);
  border-radius: var(--radius-medium);
  padding: 1.5rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty-state {
  color: var(--muted);
  font-style: italic;
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .team-hero {
    padding-bottom: 2.5rem;
  }

  .team-main {
    gap: 2.5rem;
  }

  .team-summary-grid {
    grid-template-columns: 1fr;
  }

  .team-season-list {
    grid-template-columns: 1fr;
  }

  .team-highlight-list {
    grid-template-columns: 1fr;
  }
}

.history-grid,
.draft-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.draft-archive-card header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.draft-archive-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.draft-archive-controls select {
  min-width: 140px;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  padding: 0.55rem 0.8rem;
  font-size: 0.95rem;
}

.draft-archive-card .table-wrapper {
  max-height: 420px;
  overflow-y: auto;
}

.draft-archive-table tbody td:first-child,
.draft-archive-table tbody td:nth-child(2) {
  text-align: right;
}

.draft-archive-table tbody td:nth-child(3) {
  min-width: 180px;
}

.draft-archive-table tbody td:nth-child(4) {
  min-width: 220px;
}

.empty-note {
  color: var(--muted);
  font-style: italic;
}

/* =========================
   Tables – readability pass
   ========================= */

table {
  line-height: 1.35;
  table-layout: auto;
}

thead th {
  padding: 0 0.75rem 0.75rem;
}

tbody td {
  padding: 0.55rem 0.75rem;
}

#draft-table {
  min-width: 620px;
}

#draft-table th:nth-child(1),
#draft-table th:nth-child(2),
#draft-table td:nth-child(1),
#draft-table td:nth-child(2) {
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#draft-table th:nth-child(6),
#draft-table th:nth-child(7),
#draft-table td:nth-child(6),
#draft-table td:nth-child(7) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#draft-table th:nth-child(3),
#draft-table td:nth-child(3) {
  min-width: 180px;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

/* Draft Lab (league pages): remove "Rostered %" (7th col) */
#draft-table th:nth-child(7),
#draft-table td:nth-child(7),
#draft-archive-table th:nth-child(7),
#draft-archive-table td:nth-child(7) {
  display: none;
}

/* Team page Draft table: remove "Team Name" (5th col) */
.team-draft-table th:nth-child(5),
.team-draft-table td:nth-child(5) {
  display: none;
}

/* Gallery images: consistent boxes on desktop, no crop on phones */
.hero-gallery img { aspect-ratio: 4 / 3; object-fit: cover; }           /* MDN */
/* On narrow screens, show full image without cropping */
@media (max-width: 720px) {
  .hero-gallery img { object-fit: contain; background: rgba(255,255,255,0.03); }  /* MDN */
}

/* Screen reader only: Hide visually but keep available to assistive technologies */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* =========================
   Power Rankings
   ========================= */

.power-rankings-explainer {
  background: rgba(97, 240, 166, 0.08);
  border: 1px solid rgba(97, 240, 166, 0.2);
  border-radius: var(--radius-medium);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.power-rankings-explainer strong {
  color: var(--accent);
}

.power-rankings-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.power-ranking-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.power-ranking-item:hover {
  transform: translateX(4px);
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(97, 240, 166, 0.15);
}

.power-ranking-item.rank-1 {
  border: 2px solid #FFD700;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), var(--surface-alt));
  box-shadow: 0 4px 24px rgba(255, 215, 0, 0.2);
}

.power-ranking-item.rank-2 {
  border: 2px solid #C0C0C0;
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.08), var(--surface-alt));
}

.power-ranking-item.rank-3 {
  border: 2px solid #CD7F32;
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.08), var(--surface-alt));
}

.power-ranking-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: var(--accent-soft);
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--accent);
  flex-shrink: 0;
}

.power-ranking-item.rank-1 .power-ranking-badge {
  background: rgba(255, 215, 0, 0.2);
  color: #FFD700;
}

.power-ranking-item.rank-2 .power-ranking-badge {
  background: rgba(192, 192, 192, 0.2);
  color: #C0C0C0;
}

.power-ranking-item.rank-3 .power-ranking-badge {
  background: rgba(205, 127, 50, 0.2);
  color: #CD7F32;
}

.power-ranking-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.power-ranking-team {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.power-ranking-team h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.power-ranking-team h3 a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}

.power-ranking-team h3 a:hover {
  color: var(--accent);
}

.power-ranking-record {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.power-ranking-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.power-ranking-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.power-ranking-stat-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
}

.power-ranking-stat-value {
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

.power-ranking-movement {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(100, 100, 100, 0.15);
  color: var(--muted);
  flex-shrink: 0;
}

.power-ranking-movement.up {
  background: rgba(34, 197, 94, 0.15);
  color: #22C55E;
}

.power-ranking-movement.down {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

.power-ranking-trend {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .power-ranking-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .power-ranking-badge {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }

  .power-ranking-stats {
    gap: 1rem;
  }
}

/* =========================
   Player Search
   ========================= */

.player-search-controls {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.player-search-input {
  flex: 1;
  min-width: 300px;
  padding: 0.85rem 1.25rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.player-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.player-search-input::placeholder {
  color: var(--muted);
}

.player-search-button {
  padding: 0.85rem 2rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-medium);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.player-search-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(97, 240, 166, 0.3);
}

.player-search-button:active {
  transform: translateY(0);
}

.player-search-results {
  margin-top: 2rem;
}

.player-result {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: border-color var(--transition);
}

.player-result:hover {
  border-color: var(--accent);
}

.player-result-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.player-result-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.player-result-position {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.player-draft-history {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.player-draft-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(97, 240, 166, 0.05);
  border-radius: var(--radius-small);
  font-size: 0.9rem;
}

.player-draft-year {
  font-weight: 700;
  color: var(--accent);
  min-width: 60px;
}

.player-draft-pick {
  color: var(--muted);
  min-width: 120px;
}

.player-draft-team {
  flex: 1;
  text-align: right;
}

.player-draft-team a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}

.player-draft-team a:hover {
  color: var(--accent);
}

.player-search-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.player-search-hint {
  margin-top: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(97, 240, 166, 0.08);
  border: 1px solid rgba(97, 240, 166, 0.2);
  border-radius: var(--radius-medium);
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

@media (max-width: 720px) {
  .player-search-controls {
    flex-direction: column;
  }

  .player-search-input {
    min-width: 100%;
  }

  .player-search-button {
    width: 100%;
  }

  .player-draft-entry {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .player-draft-team {
    text-align: left;
  }
}

/* =========================
   Data Export
   ========================= */

.export-button {
  padding: 0.5rem 1rem;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.export-button:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.export-button:active {
  transform: translateY(0);
}

@media (max-width: 720px) {
  .export-button {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
}

/* =========================
   Theme Toggle
   ========================= */

.theme-toggle-button {
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle-button:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* =========================
   Light Mode Theme
   ========================= */

[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --surface: rgba(248, 250, 252, 0.95);
  --surface-alt: rgba(241, 245, 249, 0.95);
  --surface-strong: rgba(226, 232, 240, 0.98);
  --accent: #059669;
  --accent-strong: #f59e0b;
  --accent-secondary: #0ea5e9;
  --accent-soft: rgba(16, 185, 129, 0.15);
  --text: #0f172a;
  --muted: rgba(51, 65, 85, 0.8);
  --border: rgba(203, 213, 225, 0.5);
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] body {
  background:
    radial-gradient(circle at 18% 10%, rgba(16, 185, 129, 0.08), transparent 50%),
    radial-gradient(circle at 82% 0%, rgba(14, 165, 233, 0.08), transparent 50%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.98) 45%, rgba(226, 232, 240, 0.98));
  background-color: var(--bg);
}

[data-theme="light"] .app-sidebar {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.96));
  border-right-color: var(--border);
}

[data-theme="light"] .nav-link:hover {
  background: rgba(16, 185, 129, 0.1);
}

[data-theme="light"] .nav-link.active {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.3);
}

[data-theme="light"] .app-topbar {
  background: rgba(248, 250, 252, 0.95);
  border-bottom-color: var(--border);
}

[data-theme="light"] .control select {
  background: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .card,
[data-theme="light"] .franchise-card,
[data-theme="light"] .power-ranking-item,
[data-theme="light"] .player-result {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--border);
}

[data-theme="light"] .franchise-card:hover,
[data-theme="light"] .power-ranking-item:hover {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

[data-theme="light"] .power-ranking-badge,
[data-theme="light"] .player-result-position,
[data-theme="light"] .franchise-card .badge {
  background: var(--accent-soft);
  color: var(--accent);
}

[data-theme="light"] .power-rankings-explainer,
[data-theme="light"] .player-search-hint {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

[data-theme="light"] table tbody tr:hover {
  background: rgba(16, 185, 129, 0.05);
}

[data-theme="light"] .hero-stats {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(14, 165, 233, 0.08));
}

[data-theme="light"] .loading-overlay {
  background: var(--bg);
}

[data-theme="light"] .cta {
  background: var(--accent);
  color: white;
}

[data-theme="light"] .cta:hover {
  background: #047857;
}

@media (max-width: 720px) {
  .theme-toggle-button {
    font-size: 0.7rem;
    padding: 0.5rem 1rem;
  }
}

/* =========================
   Accessibility
   ========================= */

/* Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  font-weight: 600;
  z-index: 10000;
  border-radius: 0 0 var(--radius-small) 0;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
}

/* Improve focus visibility across the site */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Ensure sufficient color contrast for nav group titles */
.nav-group-title {
  font-size: 0.75rem;
  font-weight: 600;
}

/* Improve focus for nav links */
.nav-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Better focus for cards and interactive elements */
.franchise-card:focus-within,
.power-ranking-item:focus-within,
.player-result:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Ensure table headers are properly styled */
thead th {
  font-weight: 700;
  text-align: left;
}

/* Improve contrast for muted text in light mode */
[data-theme="light"] .muted,
[data-theme="light"] .view-subtitle,
[data-theme="light"] .brand-tagline,
[data-theme="light"] .nav-group-title {
  color: rgba(51, 65, 85, 0.9);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Exception: Loading spinner is functional, not decorative */
  .spinner-ring {
    animation-duration: 2s !important;
    animation-iteration-count: infinite !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border: rgba(97, 240, 166, 0.6);
  }

  .nav-link.active {
    border: 2px solid var(--accent);
  }

  .franchise-card,
  .power-ranking-item,
  .player-result {
    border-width: 2px;
  }
}

/* Focus indicator for keyboard navigation */
*:focus {
  scroll-margin-block: 5rem;
}

/* =========================
   Enhanced Mobile Responsiveness
   ========================= */

/* Larger touch targets for mobile */
@media (max-width: 960px) {
  .nav-link,
  button,
  .cta,
  .secondary,
  .franchise-card,
  .power-ranking-item {
    min-height: 44px;
    min-width: 44px;
  }

  .nav-link {
    padding: 0.85rem 1rem;
  }

  /* Better spacing on mobile */
  .app-content {
    padding: 1.5rem 1rem 3rem;
  }

  .view-header {
    margin-bottom: 1.5rem;
  }

  .view-header h1 {
    font-size: 2rem;
  }

  /* Stack topbar controls vertically */
  .topbar-context {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .control {
    width: 100%;
  }

  .control select {
    width: 100%;
    min-width: 100%;
  }

  /* Improve table readability */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    font-size: 0.85rem;
  }

  thead th,
  tbody td {
    padding: 0.65rem 0.5rem;
  }

  /* Better hero layout */
  .hero {
    flex-direction: column;
  }

  .hero-text,
  .hero-aside {
    width: 100%;
  }

  .hero-gallery {
    grid-template-columns: 1fr;
  }

  /* Improve franchise directory grid */
  .franchise-directory {
    grid-template-columns: 1fr;
  }

  /* Better card spacing */
  .view-grid,
  .matchups-top-grid,
  .history-grid,
  .front-office-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  /* Optimize draft controls */
  .draft-controls,
  .draft-archive-controls {
    flex-direction: column;
    gap: 0.75rem;
  }

  .draft-controls label,
  .draft-archive-controls label {
    width: 100%;
  }

  .draft-controls select,
  .draft-archive-controls select {
    width: 100%;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .view-header h1 {
    font-size: 1.75rem;
  }

  .view-subtitle {
    font-size: 0.85rem;
  }

  .card header h2 {
    font-size: 1.25rem;
  }

  /* Smaller buttons */
  .cta,
  .secondary,
  .theme-toggle-button,
  .export-button,
  .player-search-button {
    font-size: 0.7rem;
    padding: 0.5rem 1rem;
  }

  /* Tighter spacing */
  .app-content {
    padding: 1rem 0.75rem 2rem;
  }

  .card {
    padding: 1rem;
  }

  /* Simplify power rankings on tiny screens */
  .power-ranking-stats {
    flex-direction: column;
    gap: 0.75rem;
  }

  .power-ranking-stat {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .app-sidebar {
    height: auto;
    max-height: 100vh;
    overflow-y: auto;
  }

  .loading-overlay {
    padding: 1rem;
  }

  .loading-spinner {
    transform: scale(0.75);
  }
}

/* Tablet optimizations */
@media (min-width: 721px) and (max-width: 1080px) {
  .franchise-directory {
    grid-template-columns: repeat(2, 1fr);
  }

  .view-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }

  .matchups-top-grid {
    grid-template-columns: 1fr;
  }
}

/* Print styles */
@media print {
  .app-sidebar,
  .app-topbar,
  .footer,
  .skip-link,
  .mobile-toggle,
  .export-button,
  .theme-toggle-button {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .app-main {
    margin: 0;
    padding: 0;
  }

  .app-content {
    padding: 0;
    max-width: 100%;
  }

  .card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body {
    background: white;
    color: black;
  }
}

/* iOS safe area support */
@supports (padding: max(0px)) {
  .app-content {
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
    padding-bottom: max(4rem, env(safe-area-inset-bottom));
  }

  .app-topbar {
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
  }

  .app-sidebar {
    padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
  }
}

/* Improved mobile sidebar */
@media (max-width: 960px) {
  .app-sidebar {
    position: fixed;
    transform: translate3d(-100%, 0, 0);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    width: 280px;
    z-index: 1000;
    will-change: transform;
  }

  .app-sidebar.active {
    transform: translate3d(0, 0, 0);
  }

  /* Disable transition during gesture dragging for smooth follow */
  .app-sidebar.dragging {
    transition: none !important;
  }

  .sidebar-close {
    display: block;
  }

  .mobile-toggle {
    display: flex;
  }

  .app-main {
    width: 100%;
  }
}

/* =========================
   Error Boundary
   ========================= */

.error-boundary {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

.error-boundary-content {
  background: var(--surface);
  border: 2px solid #EF4444;
  border-radius: var(--radius-large);
  padding: 2.5rem;
  max-width: 600px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.error-boundary-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: shake 0.5s ease;
}

.error-boundary-content h2 {
  margin: 0 0 1rem;
  color: #EF4444;
  font-size: 1.75rem;
}

.error-boundary-content p {
  margin: 0 0 2rem;
  color: var(--muted);
  line-height: 1.6;
}

.error-boundary-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.error-boundary-button {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-medium);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.error-boundary-button.primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.error-boundary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.error-boundary-details {
  margin-top: 2rem;
  text-align: left;
}

.error-boundary-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.5rem;
}

.error-boundary-details summary:hover {
  color: var(--text);
}

.error-boundary-stack {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-small);
  font-size: 0.75rem;
  color: #EF4444;
  overflow-x: auto;
  max-height: 200px;
  font-family: 'Monaco', 'Courier New', monospace;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

/* Awards & Achievements Styles */
.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
}

.award-card {
  position: relative;
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem;
  background: rgba(10, 14, 20, 0.6);
  border-radius: var(--radius-small);
  border: 1px solid rgba(45, 213, 214, 0.15);
  transition: all 0.3s ease;
  overflow: hidden;
}

.award-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--award-color, var(--accent));
  opacity: 0.8;
}

.award-card:hover {
  background: rgba(10, 14, 20, 0.8);
  border-color: var(--award-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.award-icon {
  font-size: 3rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, rgba(var(--award-color-rgb, 45, 213, 214), 0.2), rgba(var(--award-color-rgb, 45, 213, 214), 0.05));
  border-radius: 50%;
  border: 2px solid rgba(var(--award-color-rgb, 45, 213, 214), 0.3);
}

.award-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.award-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(213, 231, 236, 0.7);
  margin: 0;
}

.award-description {
  font-size: 0.825rem;
  color: rgba(213, 231, 236, 0.65);
  line-height: 1.5;
  font-style: italic;
  margin-top: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(45, 213, 214, 0.1);
}

.award-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--award-color, var(--accent));
  line-height: 1.2;
  text-shadow: 0 0 20px rgba(var(--award-color-rgb, 45, 213, 214), 0.3);
}

.award-holder {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 0.25rem;
}

.award-context {
  font-size: 0.8rem;
  color: rgba(213, 231, 236, 0.6);
  line-height: 1.4;
  margin-top: 0.25rem;
}

.award-calculation {
  font-size: 0.75rem;
  color: rgba(213, 231, 236, 0.5);
  line-height: 1.4;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(45, 213, 214, 0.08);
  font-family: 'Courier New', monospace;
}

@media (max-width: 960px) {
  .awards-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 720px) {
  .awards-grid {
    grid-template-columns: 1fr;
  }

  .award-card {
    gap: 1rem;
    padding: 1.25rem;
  }

  .award-icon {
    width: 60px;
    height: 60px;
    font-size: 2.5rem;
  }

  .award-value {
    font-size: 1.5rem;
  }

  .award-holder {
    font-size: 1rem;
  }

  .error-boundary-content {
    padding: 1.5rem;
  }

  .error-boundary-icon {
    font-size: 3rem;
  }

  .error-boundary-content h2 {
    font-size: 1.5rem;
  }

  .error-boundary-actions {
    flex-direction: column;
  }

  .error-boundary-button {
    width: 100%;
  }
}
