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

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

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;
}

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

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

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

.site:hover {
  opacity: 0.95;
}

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

.nav-link {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 16px;
  border-radius: 8px;
  background: #0d1520;
  border: 1px solid #1e3a5c;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.nav-link:hover {
  background: #1d4ed8;
  border-color: #3b82f6;
  color: #60a5fa;
}

/* Same gold WorldCup26 control as the homepage */
.wc26-btn {
  background: linear-gradient(180deg, #e8c547 0%, #9a7318 100%);
  border: 1px solid #d4af37;
  color: #141109;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.wc26-btn:hover {
  filter: brightness(1.06);
  color: #0a0906;
}

.alt {
  background: #0d1520;
  border-bottom: 1px solid #1a1a2e;
  padding: 8px 14px;
  font-size: 0.72rem;
  text-align: center;
  display: none;
}

.has-alt .alt {
  display: block;
}

/* Main nav (.nav) is always shown; trailing t / ?t only toggles the partner strip (.alt). */

.alt a {
  color: #3b82f6;
  text-decoration: none;
  margin: 0 6px;
  font-weight: 600;
}

.wrap {
  display: block;
  max-width: 1180px;
  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: 980px;
  min-width: 0;
  margin: 0 auto;
}

.chat-open .event-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  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;
}

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

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

/* 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: 10px 14px;
  margin-bottom: 10px;
  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: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  min-width: 0;
}

.event-mirror-banner {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #1a1a2e;
}

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

.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-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;
}

.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;
}

.btn {
  background: #0d1520;
  border: 1px solid #252535;
  color: #9ca3af;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  text-decoration: none;
}

.btn:hover {
  background: #15151f;
  border-color: #3b82f6;
  color: #3b82f6;
}

.btn.on {
  background: #1d4ed8;
  border-color: #3b82f6;
  color: #3b82f6;
}

.chat-toggle-btn {
  border-color: #2563eb;
  color: #e0f2fe;
  background: #0f172a;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 10px 14px;
  min-height: 40px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

.chat-toggle-btn:hover {
  background: #172554;
  border-color: #3b82f6;
  color: #fff;
}

.player-embed-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.player {
  position: relative;
  padding-top: 0;
  height: auto;
  background: #000;
  aspect-ratio: 16 / 9;
  content-visibility: auto;
  contain-intrinsic-size: auto 520px;
}

.player iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 1;
}

.player-spinner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 2;
}

.player-spinner.hidden {
  display: none;
}

.player-spinner .spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #1e3a5c;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.feedback-btn {
  background: #0d1520;
  border: 1px solid #1e3a5c;
  color: #3b82f6;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

.feedback-btn:hover {
  background: #1d4ed8;
  border-color: #3b82f6;
  color: #60a5fa;
}

.feedback-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.feedback-modal.open {
  display: flex;
}

.feedback-modal-box {
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.feedback-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.feedback-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.feedback-modal-close {
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  font-size: 1.5rem;
  line-height: 1;
}

.feedback-modal-close:hover {
  color: #fff;
}

.feedback-modal-body {
  padding: 20px;
}

.feedback-intro {
  color: #999;
  font-size: 0.9rem;
  margin-bottom: 12px;
  line-height: 1.5;
}

.feedback-vpn {
  color: #3b82f6;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 16px;
  line-height: 1.5;
}

.feedback-vpn a {
  color: #3b82f6;
  text-decoration: underline;
}

.feedback-vpn a:hover {
  color: #93c5fd;
}

/* Help box under player */
.stream-help {
  margin: 0;
  padding: 12px 14px;
  background: #050508;
  border-top: 1px solid #1a1a2e;
  border-radius: 0 0 10px 10px;
}

.stream-help-alert {
  margin: 0 0 14px;
  padding: 10px 12px;
  background: rgba(244, 68, 68, 0.08);
  border: 1px solid rgba(244, 68, 68, 0.25);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.85rem;
  line-height: 1.45;
}

.stream-help-card {
  background: #0b0b12;
  border: 1px solid #1f1f27;
  border-radius: 9px;
  padding: 12px 16px;
}

.stream-help-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stream-help-line {
  color: #cccccc;
  font-size: 0.85rem;
  line-height: 1.55;
  text-align: left;
}

.stream-help-line--primary {
  color: #3b82f6;
  font-style: italic;
}

.stream-help-bullet {
  margin-right: 6px;
  color: inherit;
}

.stream-help-line--primary .stream-help-feedback {
  color: #3b82f6;
}

.stream-help-feedback {
  background: transparent;
  border: none;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 0;
  font: inherit;
  font-style: italic;
  font-weight: inherit;
}

.stream-help-feedback:hover {
  color: #60a5fa;
}

.stream-help-line--links a {
  color: #cccccc;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 400;
}

.stream-help-line--links a:hover {
  color: #e5e5e5;
}

.stream-help-pipe {
  color: #888;
  margin: 0 6px;
}

.feedback-field {
  margin-bottom: 12px;
}

.feedback-field textarea {
  width: 100%;
  padding: 12px 14px;
  background: #050505;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  color: #e5e5e5;
  font-family: inherit;
  font-size: 0.9rem;
  min-height: 120px;
  resize: vertical;
}

.feedback-field textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.feedback-field textarea::placeholder {
  color: #666;
}

.feedback-count {
  color: #666;
  font-size: 0.8rem;
  margin-top: 6px;
  text-align: right;
}

.feedback-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.feedback-cancel {
  background: #333;
  border: 1px solid #444;
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.feedback-cancel:hover {
  background: #444;
}

.feedback-send {
  background: #3b82f6;
  border: 1px solid #3b82f6;
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.feedback-send:hover {
  background: #60a5fa;
}

.feedback-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.help {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #1a1a2e;
  font-size: 0.85rem;
  color: #9ca3af;
  line-height: 1.6;
  background: #0a0a0f;
}

.help h4 {
  margin-bottom: 8px;
  color: #3b82f6;
}

.help a {
  color: #3b82f6;
  font-weight: 600;
}

.help a:hover {
  color: #60a5fa;
}

.help p {
  margin-bottom: 6px;
}

.site-footer {
  margin-top: 22px;
  padding: 18px 16px;
  border-top: 1px solid #1a1a2e;
  text-align: center;
  font-size: 0.85rem;
  color: #6b7280;
  line-height: 1.6;
}

.site-footer .copyright {
  margin-bottom: 10px;
  color: #9ca3af;
}

.site-footer .disclaimer {
  max-width: 1240px;
  margin: 0 auto;
  color: #6b7280;
}

.site-footer a {
  color: #3b82f6;
  text-decoration: none;
}

.site-footer a:hover {
  color: #60a5fa;
}

@media (max-width: 1200px) {
  .chat-open .event-layout {
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 0;
    column-gap: 10px;
  }
}

@media (max-width: 900px) {
  .wrap {
    padding: 12px;
  }

  .player-col {
    max-width: 100%;
    min-width: 0;
    margin: 0 auto;
  }
}

@media (max-width: 980px) {
  .chat-open .event-layout {
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 0;
    column-gap: 10px;
  }
}

@media (max-width: 820px) {
  .chat-open .event-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .chat-open .player {
    height: 440px !important;
    aspect-ratio: auto !important;
  }

  .chat-open .chat-box {
    width: 100% !important;
    height: 440px !important;
    max-height: min(440px, calc(100vh - 180px));
  }
}

/* Hard lock: grid + aligned tops; column widths come from .event-layout @media (not !important — fixes stacked layout <820px) */
.chat-open #eventLayout {
  display: grid !important;
  column-gap: 10px !important;
  row-gap: 0 !important;
  align-items: start !important;
}

.chat-open #main,
.chat-open #chatSidebar {
  margin: 0 !important;
  padding: 0 !important;
}

.chat-open #main {
  max-width: none !important;
}

.chat-open #chatSidebar {
  display: block !important;
}

/* Side-by-side: player and chat same fixed height; toolbar is full-width above this row */
.chat-open .player {
  height: var(--event-player-chat-h) !important;
  aspect-ratio: auto !important;
  flex-shrink: 0;
}

.chat-open .chat-box {
  height: var(--event-player-chat-h) !important;
  max-height: min(var(--event-player-chat-h), calc(100vh - 120px)) !important;
  box-sizing: border-box;
  width: 350px;
  max-width: 100%;
  flex-shrink: 0;
}

.chat-open .chat-box iframe {
  flex: 1;
  min-height: 0;
}

@media (max-width: 520px) {
  .event-toolbar {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .event-toolbar-center {
    grid-column: 1;
  }

  .event-toolbar-title {
    font-size: 1rem;
  }

  .event-toolbar-actions {
    grid-column: 1;
    justify-self: center;
  }
}

@media (max-width: 600px) {
  .wrap {
    padding: 10px;
  }

  .nav {
    padding: 10px 12px;
  }

  .nav-link {
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  .site img {
    height: 28px;
  }

  .player-actions {
    padding: 10px 12px;
    gap: 6px;
  }

  .btn {
    padding: 10px 12px;
    font-size: 0.8rem;
    min-height: 42px;
    min-width: 42px;
  }

  .info {
    padding: 12px;
  }

  .info-title,
  .event-toolbar-title {
    font-size: 1rem;
  }

  .info-meta {
    font-size: 0.75rem;
  }

  .help {
    padding: 12px;
    font-size: 0.8rem;
  }

  .site-footer {
    padding: 16px 12px;
    font-size: 0.8rem;
  }
}

