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

html {
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  background: #050508;
  color: #e5e5e5;
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  /* Player iframe and chat iframe share this height when chat is open (side-by-side). */
  --event-player-chat-h: 600px;
  /* Chat is slightly TALLER than the player on purpose. The chat widget's
     own composer (username + send) sits under its message list and needs
     ~612px total; at the player's 600px it fell just below the fold and
     needed scrolling. 650 clears it with a little slack for busy chats
     without leaving a dead gap under the composer. */
  --event-chat-h: 650px;
}

.nav {
  background: #0a0a0f;
  padding: 7px 14px;
  border-bottom: 1px solid #1a1a2e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left,
.nav-right {
  display: flex;
  gap: 14px;
  flex-wrap: nowrap;
  align-items: center;
}

.nav-right {
  margin-left: auto;
}

.site {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #fff;
  padding: 2px 0;
}

.site img {
  height: 30px;
  width: auto;
  display: block;
}

.site-logo {
  height: 34px;
  width: auto;
  display: block;
}

.site:hover {
  opacity: 0.95;
}

.site:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 2px;
}

.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-link {
  color: #93c5fd;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  min-height: 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.nav-link:hover {
  color: #bfdbfe;
}

.nav-link:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Same gold WorldCup26 control as the homepage */
.wc26-btn {
  background: transparent;
  border: 0;
  color: #cbd5e1;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0;
  border-radius: 0;
  text-decoration: none;
  white-space: nowrap;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.wc26-btn:hover {
  color: #fff;
}

/* Partner link strip — shown when /event slug uses the t-suffix mode. */
.alt {
  background: transparent;
  border-bottom: 0;
  padding: 8px 14px;
  font-size: 0.72rem;
  text-align: center;
  display: block;
}

.alt a {
  color: #fff;
  text-decoration: none;
  margin: 0 6px;
  font-weight: 400;
}

.wrap {
  display: block;
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px;
}

.event-layout {
  display: block;
}

.chat-sidebar {
  display: none;
}

.chat-box {
  background: #0a0a0f;
  border: 1px solid #1a1a2e;
  border-radius: 12px;
  overflow: hidden;
}

.chat-box iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-col {
  max-width: 1235px;
  min-width: 0;
  margin: 0 auto;
}

.chat-open .event-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 0;
  column-gap: 10px;
  align-items: start;
}

.chat-open .chat-sidebar {
  display: flex;
  flex-direction: column;
  align-self: start;
  width: 100%;
  min-height: 0;
  gap: 10px;
}

.chat-open .player-col {
  max-width: none;
}

.chat-open .chat-box {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-open .chat-sidebar .stream-help {
  margin-top: 0;
}

/* Title + chat toggle — own strip above the player (not inside the video card) */
.event-toolbar {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(0, 3fr) minmax(100px, 1fr);
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  margin-bottom: 6px;
  background: #0a0a0f;
  border: 1px solid #1a1a2e;
  border-radius: 10px;
}

.event-toolbar-center {
  grid-column: 2;
  min-width: 0;
  text-align: center;
}

.event-toolbar-title {
  margin: 0;
  text-align: center;
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  min-width: 0;
}

.event-mirror-banner {
  margin-top: 14px;
  padding: 14px 14px 6px;
  border: 0;
  border-top: 1px solid #1a2234;
  border-radius: 0;
  background: none;
}

.event-picker-title {
  margin: 0 0 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #475569;
  text-transform: uppercase;
}

.event-backups-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.event-backups-label {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: #9ca3af;
  flex-shrink: 0;
  line-height: 1.4;
}

.event-backups-label strong {
  font-weight: 800;
  text-transform: uppercase;
}

.event-backups-total {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #9ca3af;
  text-transform: uppercase;
}

.event-source-groups {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Channel = a labelled band on a vertical accent spine, not a boxed card.
   Feeds render as inline chips so the panel reads as one continuous list. */
.event-source-group {
  position: relative;
  padding: 12px 0 12px 14px;
  border-left: 2px solid #1e293b;
  transition: border-color 0.15s;
}

.event-source-group + .event-source-group {
  margin-top: 2px;
}

.event-source-group-current {
  border-left-color: #3b82f6;
}

.event-source-group-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.event-source-group-heads {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.event-source-group-name {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e2e8f0;
  line-height: 1.2;
}

.event-source-group-current .event-source-group-name {
  color: #93c5fd;
}

.event-source-group-tagline {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0;
  color: #64748b;
}

.event-source-group-count {
  margin-left: auto;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: #475569;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Feeds: inline chips, wrapping. */
.event-source-rows {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.event-source-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid #1e293b;
  border-radius: 8px;
  background: #0b1120;
  color: #cbd5e1;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.event-source-row:hover {
  background: #111c33;
  border-color: #334155;
  color: #fff;
}

.event-source-row:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.event-source-row-current {
  background: #12233f;
  border-color: #3b82f6;
  color: #fff;
}

/* Quality: a small dot + letters, not a coloured block. */
.event-source-qual {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0;
  border: 0;
  background: none;
  min-width: 0;
}

.event-source-qual-hd {
  color: #4ade80;
}

.event-source-qual-sd {
  color: #64748b;
}

.event-source-label {
  font-size: 0.84rem;
  font-weight: 600;
  min-width: 0;
}

.event-source-lang {
  font-size: 0.7rem;
  color: #64748b;
}

.event-source-current {
  font-size: 0.6rem;
  color: #93c5fd;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.event-backup-link {
  color: #3b82f6;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid #1e3a5c;
  background: #0d1520;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.event-backup-link:hover {
  background: #172554;
  border-color: #3b82f6;
  color: #93c5fd;
}

.event-backup-current {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #22c55e;
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid #14532d;
  background: #052e16;
}

button.event-backup-link {
  font: inherit;
  cursor: pointer;
}

.event-backup-link.event-backup-current {
  color: #22c55e;
  border-color: #14532d;
  background: #052e16;
}

.event-backup-link.event-backup-current:hover {
  background: #064e22;
  border-color: #22c55e;
  color: #86efac;
}

.event-backup-count {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  font-size: 0.62rem;
  font-weight: 800;
  text-align: center;
  border-radius: 8px;
  background: #1e293b;
  color: #e0e0e0;
  vertical-align: middle;
}

.event-backup-link.event-backup-current .event-backup-count {
  background: #14532d;
  color: #bbf7d0;
}

.event-toolbar-actions {
  grid-column: 3;
  justify-self: end;
}

.player-box {
  background: #0a0a0f;
  border: 1px solid #1a1a2e;
  border-radius: 10px;
  overflow: hidden;
}

.chat-open .player-box {
  display: flex;
  flex-direction: column;
}

.info {
  padding: 14px 16px;
  border-bottom: 1px solid #1a1a2e;
  text-align: center;
}

.info-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
  line-height: 1.3;
}

.info-meta {
  color: #6b7280;
  font-size: 0.8rem;
  line-height: 1.5;
}

.player-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: #050508;
  border-bottom: 1px solid #1a1a2e;
  align-items: center;
}