/* ============================================================
   Stream viewer replica — plain CSS (no framework)
   Palette & metrics mirror the original Tailwind build.
   ============================================================ */

:root {
  --bg: #0e0e10;
  --twitch: #9147ff;
  --kick: #53fc18;
  --gray-100: #f3f4f6;
  --gray-400: #9ca3af;
  --ring: rgba(255, 255, 255, 0.15);
  --chip: rgba(255, 255, 255, 0.1);
  --chat-w: 21.25rem; /* md:w-85 */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.scrollbar-thin { scrollbar-width: thin; scrollbar-color: #ffffff38 transparent; }
.scrollbar-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: #ffffff38; border-radius: 999px; }

/* ---------- generic pill button (original btn classes) ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  cursor: pointer;
  border-radius: 9999px;
  background: var(--chip);
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-100);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  outline: 1px solid var(--ring);
  outline-offset: -1px;
  transition: background-color .15s, color .15s, outline-color .15s, transform .08s;
}
.pill:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  outline-color: rgba(145, 71, 255, 0.5);
}
.pill:active { transform: scale(0.98); }

/* ============================================================
   HOME
   ============================================================ */

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}
@media (min-width: 768px) { .stage { flex-direction: row; } }

.video-pane {
  position: relative;
  isolation: isolate;
  z-index: 0;
  width: 100%;
  flex-shrink: 0;
  aspect-ratio: 16 / 9;
  background: var(--bg);
}
@media (min-width: 768px) {
  .video-pane { aspect-ratio: auto; height: 100%; flex: 1 1 0%; min-width: 0; }
}

/* --- waiting overlay --- */
.waiting {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  overflow-y: auto;
  text-align: center;
  background:
    radial-gradient(120% 85% at 50% 0%, rgba(145, 71, 255, 0.22), transparent 62%),
    radial-gradient(90% 70% at 50% 100%, rgba(145, 71, 255, 0.10), transparent 65%),
    var(--bg);
  opacity: 1;
  transition: opacity .5s ease-out;
}
/* margen auto en el wrapper: centra cuando cabe y colapsa a 0 cuando no,
   de modo que el contenido se muestre desde arriba y se pueda hacer scroll */
.waiting-inner {
  margin: auto;
  width: 100%;
  max-width: 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: waiting-in .5s ease-out both;
}
@media (min-width: 768px) { .waiting-inner { gap: 14px; } }
.waiting[data-hidden] { opacity: 0; pointer-events: none; }

@keyframes waiting-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.waiting-title {
  margin: 0;
  font-size: clamp(2.75rem, 11vw, 6rem); /* 44px → 96px */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 1.05;
  color: var(--gray-100);
}

@media (max-width: 767.98px) {
  .waiting { padding: 10px 12px; }
  .waiting-inner { gap: 8px; }
}

/* --- player iframe --- */
.player {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease-out;
  background: var(--bg);
}
.player[data-on] { opacity: 1; pointer-events: auto; }

/* --- player badges --- */
.badge {
  position: absolute;
  top: 12px;
  z-index: 50;
  display: none;
  align-items: center;
  cursor: pointer;
  border: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.75);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  outline: 1px solid var(--ring);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.badge[data-shown] { opacity: 1; pointer-events: auto; }
.badge.right { right: 12px; }
.badge.center { left: 50%; transform: translateX(-50%); }
/* fila de badges a la izquierda: Ver en VK */
.badge-row {
  position: absolute;
  top: 12px;
  z-index: 50;
  display: flex;
  gap: 10px;
}
.badge-row.left { left: 12px; }
.badge-row .badge { position: static; }
/* badge del canal del chat: logo + color del proveedor */
.badge-logo { width: 16px; height: 16px; object-fit: contain; margin-right: 6px; }
.badge[data-provider="twitch"] { background: var(--twitch); }
.badge[data-provider="twitch"] .badge-logo { filter: brightness(0) invert(1); }
.badge[data-provider="kick"] { background: var(--kick); color: #0b0b0b; }
.badge[data-provider="kick"] .badge-logo { filter: brightness(0); }
@media (min-width: 768px) {
  .badge { display: inline-flex; }
  .stage[data-mode="waiting"] .badge.right,
  .stage[data-mode="waiting"] .badge.center,
  .stage[data-mode="waiting"] .badge-row { display: none !important; }
}

/* --- chat panel --- */
.chat {
  min-height: 0;
  width: 100%;
  flex: 1 1 auto;
  background: var(--bg);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 768px) {
  .chat { height: 100%; flex: 0 0 auto; width: var(--chat-w); }
}
.stage[data-chat-hidden] .chat { display: none; }
.chat iframe { display: block; width: 100%; height: 100%; border: 0; }

/* hidden dev leftover from the original — intentionally NOT replicated */

/* ============================================================
   404
   ============================================================ */
.center-page {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
}
.center-page h1 { margin: 0; font-size: 28px; font-weight: 700; }
.center-page p { margin: 0; color: var(--gray-400); font-size: 14px; }
