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

:root {
  --bg: #0e0e10;
  --twitch: #9147ff;
  --twitch-light: #bf94ff;
  --kick: #53fc18;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --ring: rgba(255, 255, 255, 0.15);
  --chip: rgba(255, 255, 255, 0.1);
  --chat-w: 21.25rem; /* md:w-85 */
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* { 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); }
.pill:disabled,
.pill:disabled:hover {
  cursor: not-allowed;
  opacity: 0.45;
  background: var(--chip);
  color: var(--gray-100);
  outline-color: var(--ring);
}
.pill img { width: 1.5em; height: 1.5em; object-fit: contain; }
.pill .count { font-family: var(--mono); font-size: .85em; font-variant-numeric: tabular-nums; color: var(--gray-400); }
.pill .count[hidden] { display: none; }

/* ============================================================
   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;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  overflow-y: auto;
  text-align: center;
  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: 8px;
}
@media (min-width: 768px) { .waiting-inner { gap: 12px; } }
.waiting[data-hidden] { opacity: 0; pointer-events: none; }

.emote {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  object-fit: contain;
  opacity: .4;
  user-select: none;
  pointer-events: none;
  filter: grayscale(50%);
  transition: opacity .7s ease;
}
.waiting .row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
@media (max-width: 767.98px) {
  .waiting { padding: 10px 12px; }
  .waiting-inner { gap: 6px; }
  .emote { width: 64px; height: 64px; }
}

code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--gray-800);
  color: var(--gray-200);
  border-radius: 4px;
  padding: 2px 4px;
}

/* --- 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 (Esconder Chat / Cerrar / Esconder listado) --- */
.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.left { left: 12px; }
@media (min-width: 768px) {
  .badge { display: inline-flex; }
  .stage[data-mode="waiting"] .badge.right { display: none !important; }
}
@media (max-width: 767.98px) {
  .badge.always-mobile { display: inline-flex; opacity: 1; pointer-events: auto; }
}

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