:root {
  color-scheme: dark;
  --bg: #050506;
  --panel: #101014;
  --panel-2: #18191f;
  --line: #33343c;
  --line-strong: #4b1f25;
  --text: #f4f6fb;
  --muted: #adb2bf;
  --accent: #ef1b24;
  --accent-2: #f8fafc;
  --gold: #f5b21b;
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; }
body {
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background:
    linear-gradient(180deg, rgba(239, 27, 36, 0.16) 0, rgba(5, 5, 6, 0) 260px),
    linear-gradient(180deg, #09090b 0, #111217 42%, var(--bg) 100%);
  color: var(--text);
}

body.modal-open {
  overflow: hidden;
}

body.team-route #hero,
body.team-route #heroTitlebar,
body.team-route #introCopy,
body.team-route #homeTabs,
body.team-route #summary,
body.team-route #teamsGrid {
  display: none !important;
}

body.team-route #teamDetail {
  display: block !important;
}

.shell {
  width: min(1480px, 100%);
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px;
}

.hero, .panel, .team-card, .video-card, .player-modal-dialog, .team-detail {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    rgba(16, 16, 20, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.36);
}

.mode-banner {
  margin: 0 0 18px;
  padding: 16px 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-weight: 800;
  letter-spacing: .02em;
}

.mode-banner.demo {
  background: linear-gradient(90deg, rgba(245, 178, 27, 0.22), rgba(245, 178, 27, 0.08));
  color: #fde68a;
}

.mode-banner.live {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.22), rgba(34, 197, 94, 0.08));
  color: #bbf7d0;
}

.mode-banner strong {
  display: inline-block;
  margin-right: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 0;
  width: 100vw;
  max-width: 100vw;
  margin: 0 calc(50% - 50vw) 14px;
  min-height: 0;
  background:
    linear-gradient(90deg, rgba(5, 5, 6, 0.98), rgba(111, 11, 18, 0.48) 34%, rgba(18, 18, 22, 0.78) 50%, rgba(111, 11, 18, 0.48) 66%, rgba(5, 5, 6, 0.98)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 38%, rgba(0, 0, 0, 0.34));
  border-color: rgba(239, 27, 36, 0.42);
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}

.hero::after {
  content: none;
}

.hero > * {
  min-width: 0;
}

.brand-banner {
  display: block;
  width: 100%;
  height: clamp(190px, 34vw, 440px);
  max-height: none;
  aspect-ratio: 1983 / 793;
  object-fit: cover;
  object-position: center;
  background:
    linear-gradient(90deg, rgba(5, 5, 6, 0.96), rgba(111, 11, 18, 0.54) 36%, rgba(12, 12, 15, 0.78) 50%, rgba(111, 11, 18, 0.54) 64%, rgba(5, 5, 6, 0.96)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.36));
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 4vw, 46px);
}

.lede { margin: 0; color: var(--muted); max-width: 70ch; }

.hero-actions,
.team-right,
.team-detail-grid,
.player-modal-meta {
  min-width: 0;
}

.hero-titlebar {
  margin: 0 0 14px;
  padding: 6px 0 0;
  text-align: center;
}

.hero-title {
  margin: 0;
  font-family: "Inter Tight", "Segoe UI", Arial, sans-serif;
  font-size: clamp(23px, 2.7vw, 36px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: .015em;
  text-transform: uppercase;
  color: #f9d978;
  background: linear-gradient(180deg, #fff7cc 0%, #f9d978 22%, #f1b92b 55%, #b97b09 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 0 rgba(255, 248, 204, 0.28), 0 10px 22px rgba(245, 178, 27, 0.18);
  text-wrap: balance;
}

.intro-copy {
  margin: 0 0 18px;
  padding: 16px 22px 0;
  text-align: center;
}

.intro-text {
  margin: 0;
  max-width: 92ch;
  color: var(--muted);
  font-size: clamp(14px, 1.35vw, 17px);
  line-height: 1.75;
  margin-inline: auto;
  position: relative;
}

.intro-text::before {
  content: "";
  display: block;
  width: min(140px, 28vw);
  height: 2px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(245, 178, 27, 0), rgba(245, 178, 27, 0.92) 18%, rgba(239, 27, 36, 0.9) 82%, rgba(239, 27, 36, 0));
  box-shadow: 0 0 18px rgba(239, 27, 36, 0.28);
}

.home-toolbar {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 18px;
  margin: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
  margin: 0;
}

.mode-switch {
  display: flex;
  gap: 10px;
}

.button {
  background: linear-gradient(90deg, #b90f18, var(--accent));
  color: #fff7f7;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  box-shadow: 0 10px 28px rgba(239, 27, 36, 0.22);
}

.button.secondary {
  background: rgba(255,255,255,.055);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.button.active {
  background: linear-gradient(90deg, #b90f18, var(--accent));
  color: #fff7f7;
}

.button:hover { filter: brightness(1.05); }

.status {
  color: var(--muted);
  font-size: 14px;
  min-height: 18px;
  text-align: right;
}

.toolbar-status {
  margin: 8px 0 18px;
}

.site-footer {
  margin-top: 28px;
  padding: 12px 4px 24px;
  text-align: center;
}

.shell-narrow {
  width: min(900px, 100%);
  max-width: 900px;
}

.legal-header {
  margin-bottom: 18px;
}

.legal-title {
  margin: 10px 0 8px;
  font-size: clamp(30px, 4vw, 42px);
}

.legal-updated {
  margin: 0;
  color: var(--muted);
}

.legal-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    rgba(16, 16, 20, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.36);
  padding: 24px;
}

.legal-card h2 {
  margin: 22px 0 8px;
  font-size: 20px;
}

.legal-card p {
  margin: 0 0 12px;
  color: var(--text);
  line-height: 1.65;
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.home-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.home-tab {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding: 11px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .02em;
}

.home-tab.active {
  background: linear-gradient(90deg, #b90f18, var(--accent));
  color: #fff7f7;
  border-color: rgba(239, 27, 36, 0.72);
}

.filter-chip {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.filter-chip.active {
  background: linear-gradient(90deg, #b90f18, var(--accent));
  color: #fff7f7;
  border-color: rgba(239, 27, 36, 0.72);
}

.summary .panel {
  padding: 16px;
  border-color: rgba(239, 27, 36, 0.22);
}

.summary .label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
}

.summary .value {
  font-size: 26px;
  font-weight: 800;
  margin-top: 6px;
  color: var(--accent-2);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.team-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  align-items: start;
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.1);
}

.team-left {
  position: sticky;
  top: 16px;
  text-align: left;
}

.team-title, .team-detail-title {
  margin: 0;
  font-size: 20px;
}

.team-kicker {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  margin-bottom: 8px;
}

.team-meta { color: var(--muted); font-size: 13px; }
.team-badge {
  display: inline-flex;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
}
.team-badge.ok { color: #b7f7cc; }
.team-badge.missing { color: #fcd34d; }
.team-badge.error { color: #fca5a5; }

.team-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.team-filters .filter-chip {
  padding: 8px 10px;
  font-size: 12px;
}

.team-filter-label {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.content-filters {
  margin-top: 6px;
}

.filter-count {
  margin-left: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.team-detail-note {
  margin-top: 12px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
}

.team-detail-note.error {
  color: #fca5a5;
}

.team-search-copy {
  margin: 0 0 10px;
  color: var(--text);
  line-height: 1.6;
}

.team-detail-stats {
  color: var(--muted);
  font-size: 13px;
}

.channel-status-list {
  margin-top: 14px;
}

.channel-status-items {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.channel-status-items li {
  margin: 0 0 8px;
}

.mini-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}

.videos {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
  align-items: stretch;
  -webkit-overflow-scrolling: touch;
}

.videos .video-card {
  flex: 0 0 300px;
  min-width: 300px;
  max-width: 300px;
  scroll-snap-align: start;
}

.videos::-webkit-scrollbar {
  height: 10px;
}

.videos::-webkit-scrollbar-thumb {
  background: rgba(239, 27, 36, .42);
  border-radius: 999px;
}

.team-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.news-section {
  background: rgba(255,255,255,.02);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.news-section-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.news-section-header h3 {
  margin: 0;
  font-size: 16px;
}

.digest-panel {
  gap: 12px;
}

.digest-hero {
  background: linear-gradient(90deg, rgba(239, 27, 36, 0.14), rgba(245, 178, 27, 0.06));
}

.digest-top-update {
  font-size: 16px;
  line-height: 1.5;
  font-weight: 700;
}

.digest-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.digest-list li {
  margin: 0 0 10px;
  line-height: 1.5;
}

.news-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.news-badge.official {
  color: #bbf7d0;
}

.news-badge.reliable {
  color: #dbeafe;
}

.news-badge.rumour {
  color: #fde68a;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,.03);
}

.team-active-labels {
  margin-top: 6px;
  color: #cbd5e1;
}

.video-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
}

.video-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(239, 27, 36, 0.42), 0 22px 60px rgba(0, 0, 0, 0.36);
}

.skeleton-card {
  pointer-events: none;
}

.skeleton-videos {
  overflow: hidden;
}

.skeleton-video-card {
  flex: 0 0 300px;
  min-width: 300px;
  max-width: 300px;
}

.team-loading-card {
  pointer-events: none;
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255,255,255,.07);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
  animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-title {
  height: 28px;
  width: 72%;
}

.skeleton-meta {
  height: 14px;
  width: 88%;
  margin-top: 10px;
}

.skeleton-filter-row {
  margin-top: 14px;
}

.skeleton-chip {
  width: 72px;
  height: 34px;
  border-radius: 8px;
}

.skeleton-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.skeleton-line {
  height: 14px;
  width: 100%;
}

.skeleton-line.short {
  width: 55%;
}

@keyframes skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}

@keyframes thumb-placeholder-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.video-select, .more-button {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.more-card {
  justify-content: center;
}

.more-button {
  height: 100%;
  min-height: 220px;
  align-items: center;
  justify-content: center;
}

.more-button-label {
  font-size: 22px;
  font-weight: 800;
}

.thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #111827;
}

.thumb-placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.09), rgba(255,255,255,.05));
  background-size: 200% 100%;
  animation: thumb-placeholder-shimmer 1.8s linear infinite;
}

.thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  background: #111827;
  opacity: 1;
  transition: opacity .24s ease;
}

.thumb-pending {
  opacity: 0;
}

.thumb-ready {
  opacity: 1;
}

.thumb-fallback {
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  font-size: 14px;
  font-weight: 700;
}

.video-title {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.35;
}

.video-meta { color: var(--muted); font-size: 13px; }

.empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
}

.setup-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-top: 10px;
}

.team-detail {
  margin-bottom: 18px;
  padding: 18px;
}

.team-detail-header {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.team-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.player-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.player-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 6, 0.78);
}

.player-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100vw - 32px));
  margin: 32px auto;
  padding: 18px;
}

.player-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
}

.player-modal-frame-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #020617;
  border: 1px solid var(--line);
}

.player-modal-frame {
  width: 100%;
  height: 100%;
  border: 0;
}

.player-modal-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
}

.player-modal-title {
  margin: 0;
  font-size: 20px;
}

@media (max-width: 900px) {
  .shell {
    padding: 18px;
  }

  .home-toolbar {
    align-items: center;
  }

  .hero-actions {
    align-items: center;
    width: auto;
    justify-content: flex-end;
  }

  .hero-actions .button {
    width: auto;
    max-width: 100%;
  }

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

  .team-left {
    position: static;
  }
}

@media (max-width: 700px) {
  .shell {
    padding: 12px;
  }

  .home-toolbar {
    gap: 8px 10px;
  }

  .home-tab,
  .hero-actions .button {
    min-height: 42px;
    padding: 10px 14px;
    font-size: 14px;
  }

  .hero,
  .team-card,
  .team-detail,
  .player-modal-dialog {
    border-radius: 8px;
  }

  .hero,
  .team-card,
  .team-detail {
    padding: 14px;
  }

  .hero {
    padding: 0;
  }

  h1 {
    font-size: clamp(28px, 8vw, 36px);
  }

  .brand-banner {
    height: clamp(130px, 36vw, 220px);
    object-position: center;
  }

  #refreshButton {
    min-height: 38px;
    padding: 9px 12px;
    font-size: 13px;
    box-shadow: 0 8px 20px rgba(239, 27, 36, 0.18);
  }

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

  .summary .value {
    font-size: 22px;
  }

  .team-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .team-filters .filter-chip {
    flex: 0 0 auto;
  }

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

  .videos {
    gap: 10px;
    margin-right: -4px;
    padding-right: 22px;
    padding-bottom: 8px;
  }

  .videos .video-card {
    flex: 0 0 calc((100vw - 48px) / 2.2);
    min-width: calc((100vw - 48px) / 2.2);
    max-width: calc((100vw - 48px) / 2.2);
  }

  .video-card {
    padding: 10px;
  }

  .video-title {
    font-size: 15px;
  }

  .player-modal {
    padding: 8px;
  }

  .player-modal-dialog {
    margin: 0;
    width: 100%;
    max-height: calc(100vh - 16px);
    overflow: auto;
    padding: 14px;
  }

  .player-modal-close {
    top: 10px;
    right: 10px;
  }

  .player-modal-title {
    font-size: 18px;
    padding-right: 44px;
  }

  .player-modal-meta {
    align-items: flex-start;
  }

  .team-detail-header {
    flex-direction: column;
    align-items: stretch;
  }

  .team-detail-header .button {
    width: 100%;
  }
}

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

  .mode-banner {
    padding: 14px;
  }

  .team-title,
  .team-detail-title {
    font-size: 18px;
  }

  .videos {
    padding-right: 18px;
  }

  .videos .video-card {
    flex: 0 0 calc((100vw - 34px) / 2.15);
    min-width: calc((100vw - 34px) / 2.15);
    max-width: calc((100vw - 34px) / 2.15);
  }
}
