:root {
  color-scheme: dark;
  background: #000;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  --gutter: clamp(16px, 3vw, 48px);
  --gap: clamp(12px, 1.4vw, 24px);
  --chat-width: clamp(260px, 22vw, 320px);
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #000;
}

.page {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: clamp(88px, 15vh, 136px) minmax(0, 1fr);
  padding: env(safe-area-inset-top) var(--gutter) max(24px, env(safe-area-inset-bottom));
}

.header { display: flex; align-items: center; justify-content: space-between; gap: 32px; min-width: 0; }
h1 { margin: 0; line-height: 0; }
.wordmark { display: block; width: clamp(250px, 36vw, 430px); max-width: 100%; height: auto; }
.socials { display: flex; flex-shrink: 0; justify-content: flex-end; align-items: center; gap: 8px; }
.social-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #242424; border-radius: 10px; color: #ddd; background: #080808; text-decoration: none; transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease; }
.social-button svg { display: block; width: 20px; height: 20px; fill: currentColor; }
.social-button img { display: block; object-fit: contain; }
.pump-logo { filter: grayscale(1) brightness(1.4); }
.social-button:hover { color: #fff; border-color: #555; background: #181818; transform: translateY(-2px); }
.social-button:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.main { min-width: 0; min-height: 0; display: grid; align-items: center; }

.broadcast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--chat-width);
  gap: var(--gap);
  width: 100%;
  height: min(100%, calc((100vw - 2 * var(--gutter) - var(--gap) - var(--chat-width)) * 9 / 16));
  min-height: 200px;
  max-height: 100%;
}

.video, .chat { min-width: 0; min-height: 0; overflow: hidden; background: #000; }
.chat { border: 1px solid #1c1c1c; }
iframe { display: block; width: 100%; height: 100%; border: 0; background: #000; }
.mobile-chat { display: none; color: #aaa; text-decoration: none; font-size: 13px; }
.mobile-chat:hover { color: #fff; }
.mobile-chat:focus-visible { outline: 2px solid #fff; outline-offset: 6px; }

@media (max-width: 720px) {
  .page { grid-template-rows: 138px minmax(0, 1fr); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .header { flex-wrap: wrap; align-content: center; justify-content: flex-end; gap: 16px; padding: 8px 0 18px; }
  h1 { width: 100%; }
  .wordmark { width: min(100%, 370px); }
  .social-button { width: 38px; height: 38px; border-radius: 9px; }
  .main { align-items: start; }
  .broadcast { height: 100%; min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(200px, auto) minmax(0, 1fr); gap: 16px; }
  .video { aspect-ratio: 16 / 9; min-height: 200px; }
}

@media (max-width: 720px) and (max-height: 480px) {
  .page { grid-template-rows: 64px minmax(0, 1fr); }
  .header { flex-wrap: nowrap; gap: 16px; padding: 0; }
  h1 { width: auto; }
  .wordmark { width: 260px; }
  .socials { gap: 6px; }
  .social-button { width: 32px; height: 32px; }
  .social-button svg { width: 17px; height: 17px; }
  .broadcast { grid-template-columns: minmax(0, 1fr) 170px; grid-template-rows: minmax(0, 1fr); gap: 12px; }
  .video { aspect-ratio: auto; min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .social-button { transition: none; }
  .social-button:hover { transform: none; }
}

.mobile-browser .chat { display: grid; place-items: center; }
.mobile-browser #chat { display: none; }
.mobile-browser .mobile-chat { display: inline-flex; align-items: center; gap: 10px; padding: 20px; }
@media (max-width: 720px) {
  .mobile-browser .broadcast { grid-template-rows: minmax(200px, auto) 60px; }
}
