

.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:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.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: 7px 11px;
  min-height: 34px;
  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;
}

.chat-toggle-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Belt-and-suspenders: kill all chat UI on small viewports regardless of
   what the server-side UA sniff decided. Catches edge cases like
   "request desktop site" on mobile, odd UAs, or DevTools emulation. */
@media (max-width: 899px) {
  .chat-toggle-btn,
  .chat-sidebar,
  .chat-open .chat-sidebar {
    display: none !important;
  }
}

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

.player {
  position: relative;
  background: #000;
  aspect-ratio: 16 / 9;
}

.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: transparent;
  border: 0;
  color: #93c5fd;
  padding: 0;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  gap: 0;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  white-space: nowrap;
}

.feedback-btn:hover {
  color: #bfdbfe;
}

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

.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-close:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 4px;
}

.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-feedback:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 2px;
}

.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-cancel:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.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:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.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) 360px;
    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) 340px;
    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;
  max-height: min(var(--event-player-chat-h), calc(100vh - 120px)) !important;
  aspect-ratio: auto !important;
  flex-shrink: 0;
}

.chat-open .chat-box {
  height: min(var(--event-chat-h), calc(100vh - 90px)) !important;
  max-height: calc(100vh - 90px) !important;
  box-sizing: border-box;
  width: 380px;
  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;
  }
}