/* ==========================================================================
   Cangrejos vs. Cocineros: Navidad — v3 Toon 9:16 TikTok Live HUD & Dock
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

:root {
  --bg-dark: #0a070d;
  --crab-color: #ff2752;
  --crab-glow: #00e5ff;
  --chef-color: #ff8c1a;
  --gold: #ffd83b;
  --xmas-green: #1db954;
  --panel-bg: rgba(17, 11, 29, 0.97);
  --card-bg: rgba(29, 19, 48, 0.92);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 35% 50%, #201130 0%, #09060d 100%);
  font-family: 'Segoe UI', 'Trebuchet MS', system-ui, -apple-system, sans-serif;
  color: #ffffff;
}

#app-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100vw;
  height: 100vh;
  padding: 8px;
}

/* MODO TRANSMISIÓN LIMPIO (TECLA H): Oculta todo panel de pruebas y deja 9:16 puro */
body.broadcast-clean #app-shell {
  padding: 0;
  gap: 0;
  background: #000000;
}
body.broadcast-clean #control-panel {
  display: none !important;
}

/* ==========================================================================
   LIENZO VERTICAL 9:16 (1080x1920 PROPORCIÓN EXACTA)
   ========================================================================== */
#stage-9x16 {
  position: relative;
  height: min(98vh, calc((100vw - 430px) * 16 / 9));
  aspect-ratio: 9 / 16;
  background: #140b18;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.8), 0 0 0 3px rgba(255, 216, 59, 0.38);
  cursor: pointer;
  flex-shrink: 0;
}

body.broadcast-clean #stage-9x16 {
  height: 100vh;
  max-width: 100vw;
  border-radius: 0;
  box-shadow: none;
}

#canvas-holder,
#canvas-holder canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* ==========================================================================
   STREAM HUD INTERNO (Barra Tira y Afloja, Marcadores, Gratitud al Usuario)
   ========================================================================== */
#stream-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6.4% 3.2% 2.4%;
}

.hud-top {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.title-ribbon {
  align-self: center;
  background: linear-gradient(90deg, #b8142c, #197a38, #b8142c);
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 3px 14px;
  font-size: clamp(10px, 1.42vh, 15px);
  font-weight: 900;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
}

.scoreboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.team-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(14, 10, 22, 0.82);
  border: 2px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
}
.crab-badge {
  border-color: #ff4769;
  box-shadow: 0 0 12px rgba(255, 39, 82, 0.35);
}
.chef-badge {
  border-color: #ff9d3b;
  box-shadow: 0 0 12px rgba(255, 140, 26, 0.35);
}
.team-badge .emoji {
  font-size: clamp(18px, 2.5vh, 27px);
}
.team-badge .meta {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.team-badge .meta.right {
  text-align: right;
}
.team-name {
  font-size: clamp(8.5px, 1.1vh, 11.5px);
  font-weight: 800;
  opacity: 0.92;
}
.team-pts {
  font-size: clamp(15px, 2.15vh, 23px);
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 2px 4px #000;
}

.timer-orb {
  min-width: 54px;
  text-align: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: radial-gradient(circle, #2e1d3a, #120b18);
  border: 2.5px solid var(--gold);
  font-weight: 900;
  font-size: clamp(14px, 1.95vh, 20px);
  color: #fff8cc;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

/* BARRA DIVIDIDA TUG OF WAR + PÍLDORA CENTRAL DE RELOJ */
.tug-bar-wrap {
  position: relative;
  width: 100%;
  height: clamp(26px, 3.3vh, 34px);
  border-radius: 999px;
  overflow: visible;
  display: flex;
  border: 2.5px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.72);
  background: #1a1226;
}

.tug-fill {
  height: 100%;
  display: flex;
  align-items: center;
  font-weight: 900;
  font-size: clamp(11px, 1.5vh, 15px);
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.9);
  transition: width 0.08s linear;
}
.crab-fill {
  background: linear-gradient(90deg, #ff1744, #ff5277, #00d4ff);
  justify-content: flex-start;
  padding-left: 11px;
  border-radius: 999px 0 0 999px;
}
.chef-fill {
  background: linear-gradient(90deg, #ffae00, #ff6d00, #d84315);
  justify-content: flex-end;
  padding-right: 11px;
  border-radius: 0 999px 999px 0;
}
.tug-side-tag {
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.tug-center-pill {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: radial-gradient(circle, #2b1a3d 0%, #120a1c 100%);
  border: 2px solid var(--gold);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.75);
  font-size: clamp(11px, 1.48vh, 14.5px);
  font-weight: 900;
  color: #fff8cc;
  pointer-events: none;
  z-index: 3;
}
.tug-swords {
  font-size: clamp(11px, 1.4vh, 14px);
}

/* DIVISIÓN CLARA DE REGALOS POR EQUIPO EN PANTALLA 9:16 */
.team-gifts-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 2px;
}
.team-gift-box {
  background: rgba(12, 8, 22, 0.72);
  backdrop-filter: blur(5px);
  border-radius: 11px;
  padding: 4px 6px 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}
.team-gift-box.crab-gifts {
  border-color: rgba(0, 229, 255, 0.62);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.2);
}
.team-gift-box.chef-gifts {
  border-color: rgba(255, 157, 59, 0.72);
  box-shadow: 0 0 12px rgba(255, 140, 26, 0.22);
}
.tg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: clamp(8.5px, 1.08vh, 11px);
  font-weight: 900;
  letter-spacing: 0.3px;
  margin-bottom: 3px;
  text-shadow: 0 1px 3px #000;
}
.crab-gifts .tg-header {
  color: #5ef2ff;
}
.chef-gifts .tg-header {
  color: #ffc266;
}
.tg-wins {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0.5px 5px;
  border-radius: 999px;
  background: rgba(255, 216, 59, 0.18);
  border: 1px solid rgba(255, 216, 59, 0.55);
  color: #ffe875;
  font-size: clamp(8px, 1.0vh, 10.2px);
}
.tg-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.chef-gifts .tg-pills {
  justify-content: flex-end;
}
.tg-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1.5px 5px;
  border-radius: 6px;
  font-size: clamp(8.0px, 1.02vh, 10.4px);
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  white-space: nowrap;
}
.tg-pill.tg-chat {
  background: rgba(0, 229, 255, 0.22);
  border-color: rgba(0, 229, 255, 0.65);
  color: #b8f8ff;
}
.tg-pill.tg-chat-chef {
  background: rgba(255, 152, 0, 0.24);
  border-color: rgba(255, 183, 77, 0.68);
  color: #ffe4b5;
}
.tg-pill.tg-glasses {
  background: rgba(255, 166, 0, 0.25);
  border-color: #ffb74d;
  color: #fff3cd;
}
.tg-pill.tg-epic {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.35), rgba(236, 72, 153, 0.35));
  border-color: #f472b6;
}

/* AVATARES CIRCULARES DE DONADORES + MVP + FILA DINÁMICA */
.donor-avatar-xs {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.4px solid #ffe600;
  flex-shrink: 0;
  background: #1d1230;
}
.donor-avatar-sm {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.6px solid #ffe600;
  flex-shrink: 0;
  background: #1d1230;
}

/* BARRA DE DURACIÓN DEL SHOW PROGRESIVO + CHAT GRATIS + MVP + COLA VIP */
.show-hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-height: 20px;
}
.chat-vote-hint {
  flex: 1;
  min-width: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(14, 10, 26, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: clamp(8px, 1.02vh, 10.6px);
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.chat-vote-hint b {
  color: #ffe600;
}
.mvp-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 48%;
  padding: 2px 7px 2px 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(45, 24, 84, 0.92), rgba(88, 28, 135, 0.92));
  border: 1.4px solid #ffd83b;
  font-size: clamp(8px, 1.0vh, 10.4px);
  font-weight: 900;
  color: #fff3b0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}
.mvp-live-pill[hidden],
.chat-vote-hint[hidden] {
  display: none !important;
}
.show-progress-wrap {
  display: none;
  position: relative;
  flex: 1;
  height: 20px;
  border-radius: 999px;
  background: rgba(16, 10, 28, 0.88);
  border: 1.5px solid #38bdf8;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
}
.show-progress-wrap.show {
  display: flex;
  align-items: center;
  justify-content: center;
}
.show-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  background: linear-gradient(90deg, #ec4899, #8b5cf6, #06b6d4);
  opacity: 0.82;
}
.show-progress-label {
  position: relative;
  z-index: 2;
  font-size: clamp(8.5px, 1.12vh, 11.5px);
  font-weight: 900;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 3px #000;
  padding: 0 8px;
  white-space: nowrap;
}
.vip-queue-badge {
  display: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #160c1f;
  font-size: clamp(8.5px, 1.08vh, 11px);
  font-weight: 900;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55);
}
.vip-queue-badge.show {
  display: inline-block;
}

/* ALERTA MUERTE SÚBITA ÚLTIMOS 10s */
.sudden-banner {
  display: none;
  text-align: center;
  padding: 4px 10px;
  border-radius: 10px;
  background: linear-gradient(90deg, #ff0044, #ff9900, #ff0044);
  border: 2px solid #fff700;
  font-weight: 900;
  font-size: clamp(10px, 1.35vh, 13.5px);
  text-shadow: 0 2px 4px #000;
  animation: pulseFast 0.38s infinite alternate;
}
.sudden-banner.active {
  display: block;
}

@keyframes pulseFast {
  from { transform: scale(0.98); box-shadow: 0 0 8px #ff0044; }
  to   { transform: scale(1.03); box-shadow: 0 0 22px #ffe600; }
}

/* POPUPS CÓMICOS ESTILO CARICATURA */
#comic-popups {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.comic-pop {
  position: absolute;
  transform: translate(-50%, -50%) scale(var(--pop-scale, 1));
  font-family: 'Impact', 'Arial Black', sans-serif;
  font-size: clamp(16px, 2.5vh, 28px);
  letter-spacing: 0.8px;
  color: var(--pop-color, #ffe600);
  -webkit-text-stroke: 1.6px #120817;
  text-shadow: 0 4px 0 #120817, 0 6px 14px rgba(0, 0, 0, 0.75);
  white-space: nowrap;
  animation: comicPopAnim 0.92s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes comicPopAnim {
  0%   { opacity: 0; transform: translate(-50%, -20%) scale(0.3) rotate(-8deg); }
  25%  { opacity: 1; transform: translate(-50%, -65%) scale(calc(var(--pop-scale, 1) * 1.15)) rotate(4deg); }
  75%  { opacity: 1; transform: translate(-50%, -95%) scale(var(--pop-scale, 1)) rotate(-2deg); }
  100% { opacity: 0; transform: translate(-50%, -130%) scale(0.85); }
}

/* GLOBO CÓMICO DE GRATITUD COMPACTO (CON AVATAR Y EN ZONA SEGURA SUPERIOR SIN TAPAR PERSONAJES!) */
.gratitude-bubble {
  position: absolute;
  left: 50%;
  top: 20.0%;
  transform: translateX(-50%) scale(0.55);
  opacity: 0;
  width: auto;
  min-width: 152px;
  max-width: 192px;
  text-align: center;
  padding: 4px 9px 5px;
  border-radius: 11px;
  background: linear-gradient(180deg, #fffdf5 0%, #fff2d6 100%);
  color: #1c0f2b;
  border: 2px solid #1c0f2b;
  box-shadow: 0 4px 0 #1c0f2b, 0 7px 14px rgba(0, 0, 0, 0.58);
  transition: transform 0.22s cubic-bezier(0.2, 1.15, 0.35, 1), opacity 0.18s ease;
  pointer-events: none;
  z-index: 8;
}
.gratitude-bubble::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px 6px 0 6px;
  border-style: solid;
  border-color: #1c0f2b transparent transparent transparent;
}
.gratitude-bubble.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  animation: bubbleFloat 0.65s infinite alternate ease-in-out;
}
.gratitude-bubble.team-chef {
  background: linear-gradient(180deg, #fff9ec 0%, #ffe4b5 100%);
}
.gb-top-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 1px;
}
.gb-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ec4899, #8b5cf6);
  color: #ffffff;
  font-size: clamp(7.5px, 0.88vh, 9px);
  font-weight: 900;
}
.gratitude-bubble.team-chef .gb-badge {
  background: linear-gradient(90deg, #ea580c, #f59e0b);
}
.gb-title {
  font-family: 'Impact', 'Arial Black', sans-serif;
  font-size: clamp(10.5px, 1.25vh, 13px);
  color: #d91448;
  letter-spacing: 0.3px;
  line-height: 1.08;
}
.gratitude-bubble.team-chef .gb-title {
  color: #c2410c;
}
.gb-sub {
  font-size: clamp(8px, 0.94vh, 9.5px);
  font-weight: 800;
  color: #2e1b46;
  margin-top: 1px;
  line-height: 1.12;
}

@keyframes bubbleFloat {
  from { transform: translateX(-50%) translateY(0px) scale(1); }
  to   { transform: translateX(-50%) translateY(-3px) scale(1.015); }
}

/* TOAST COMPACTO DE REGALO / VOTO CHAT (REUBICADO ARRIBA A LA DERECHA: CERO CRUCE CON MEMES Y CERO CRUCE CON CHAT TIKTOK!) */
.gift-toast {
  position: absolute;
  left: auto;
  right: 3.4%;
  top: 19.8%;
  transform: translateY(-6px) scale(0.88);
  transform-origin: top right;
  opacity: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(14, 10, 26, 0.93);
  border: 2px solid var(--gold);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.75);
  transition: transform 0.20s cubic-bezier(0.2, 0.9, 0.3, 1.18), opacity 0.18s ease, top 0.18s ease;
  width: auto;
  max-width: 66%;
  pointer-events: none;
  z-index: 9;
}
.gratitude-bubble.show ~ .gift-toast {
  top: 28.4%;
}
.gift-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.gift-toast.team-crab {
  border-color: #33e5ff;
}
.gift-toast.team-chef {
  border-color: #ff9800;
}
.toast-icon {
  font-size: 19px;
  line-height: 1;
}
.toast-body {
  min-width: 0;
}
.toast-title {
  font-weight: 900;
  font-size: clamp(10px, 1.28vh, 12.6px);
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast-sub {
  font-weight: 700;
  font-size: clamp(8.8px, 1.08vh, 11px);
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* BANNER CORTO DE RESOLUCIÓN DE RONDA (3s) */
.round-banner {
  position: absolute;
  top: 24%;
  left: 50%;
  transform: translateX(-50%) scale(0.7);
  opacity: 0;
  width: 90%;
  text-align: center;
  padding: 10px 14px;
  border-radius: 16px;
  font-weight: 900;
  font-size: clamp(14px, 2.05vh, 21px);
  border: 3px solid #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.82);
  transition: all 0.25s ease;
  z-index: 10;
}
.round-banner.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
.round-banner.crab-win {
  background: linear-gradient(135deg, #d81b60, #0091ea);
  border-color: #ffe600;
}
.round-banner.chef-win {
  background: linear-gradient(135deg, #e65100, #fbc02d);
  border-color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.75);
}

/* OVERLAY DE CARGA */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(14, 9, 20, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  z-index: 20;
  transition: opacity 0.35s ease;
}
.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.loader-box .spinner {
  font-size: 42px;
  margin-bottom: 10px;
  animation: spinBounce 0.9s infinite alternate;
}
.loader-box h2 {
  font-size: 18px;
  margin-bottom: 6px;
  color: var(--gold);
}
.loader-box p {
  font-size: 13px;
  opacity: 0.8;
}
@keyframes spinBounce {
  from { transform: translateY(0) scale(0.95); }
  to   { transform: translateY(-10px) scale(1.08); }
}

/* ==========================================================================
   PANEL LATERAL DERECHO DE SIMULACIÓN Y CONTROL DE STREAM
   ========================================================================== */
#control-panel {
  width: 398px;
  max-height: 98vh;
  overflow-y: auto;
  background: var(--panel-bg);
  border: 1px solid rgba(154, 117, 226, 0.26);
  border-radius: 16px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.72);
}

#control-panel::-webkit-scrollbar {
  width: 6px;
}
#control-panel::-webkit-scrollbar-thumb {
  background: rgba(148, 112, 219, 0.45);
  border-radius: 999px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.panel-header h1 {
  font-size: 15px;
  color: var(--gold);
}
.panel-header p {
  font-size: 11px;
  color: #cbbdd9;
  margin-top: 2px;
}
kbd {
  background: #362c47;
  border: 1px solid #756394;
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 800;
  color: #fff;
}

.panel-card {
  background: var(--card-bg);
  border: 1px solid rgba(173, 136, 255, 0.16);
  border-radius: 12px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.panel-card h2 {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  color: #c4b5fd;
}
.panel-card h3 {
  font-size: 11.5px;
  color: #cfc0e3;
}

button {
  cursor: pointer;
  border: none;
  font-family: inherit;
  color: #fff;
  transition: transform 0.08s ease, filter 0.12s ease, border-color 0.14s ease;
}
button:hover {
  filter: brightness(1.14);
}
button:active {
  transform: scale(0.96);
}

.header-btn-group {
  display: flex;
  align-items: center;
  gap: 5px;
}
.btn-ghost {
  background: #332944;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.btn-ghost.active-guide {
  background: #0d5c75;
  border-color: #38bdf8;
  color: #e0f2fe;
}

.tiktok-row {
  display: flex;
  gap: 6px;
}
.tiktok-row input {
  flex: 1;
  background: #130d21;
  border: 1px solid #4f3d75;
  border-radius: 8px;
  padding: 6px 9px;
  color: #fff;
  font-size: 12.5px;
}
.btn-connect {
  background: linear-gradient(135deg, #ff1744, #d500f9);
  padding: 6px 11px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 12px;
}
.btn-disconnect {
  background: #3b2e4a;
  padding: 6px 9px;
  border-radius: 8px;
  font-weight: 800;
}

.coin-tester-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 10, 28, 0.65);
  padding: 5px 7px;
  border-radius: 8px;
  border: 1px dashed rgba(255, 216, 59, 0.35);
}
.coin-tester-row label {
  font-size: 11.5px;
  font-weight: 700;
  color: #fde047;
  white-space: nowrap;
}
.coin-tester-row input {
  width: 78px;
  background: #120b20;
  border: 1px solid #6b539c;
  border-radius: 6px;
  padding: 4px 7px;
  color: #fff;
  font-weight: 800;
  font-size: 12.5px;
}
.btn-coin-send {
  flex: 1;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 800;
  color: #140b1c;
}

.status-pill {
  font-size: 10.8px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.35);
  color: #cbd5e1;
}
.status-connected {
  background: rgba(29, 185, 84, 0.22);
  border: 1px solid #1db954;
  color: #86efac;
}
.status-connecting {
  background: rgba(255, 193, 7, 0.2);
  border: 1px solid #ffc107;
  color: #fde047;
}
.status-error {
  background: rgba(239, 68, 68, 0.22);
  border: 1px solid #ef4444;
  color: #fca5a5;
}

/* EXPRESIONES FACIALES 3D (MORPHS) + REGALOS POR EQUIPO EN PANEL */
.expr-section {
  background: linear-gradient(145deg, rgba(30, 18, 54, 0.96), rgba(19, 13, 36, 0.96));
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.expr-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}
.expr-btn {
  padding: 6px 4px;
  border-radius: 8px;
  font-size: 10.8px;
  font-weight: 800;
  background: #271a42;
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-align: center;
  white-space: nowrap;
}
.expr-feliz { border-color: rgba(74, 222, 128, 0.55); }
.expr-enojado { border-color: rgba(248, 113, 113, 0.6); }
.expr-fuerza { border-color: rgba(250, 204, 21, 0.65); }
.expr-triste { border-color: rgba(96, 165, 250, 0.6); }

.progressive-section {
  background: rgba(21, 12, 38, 0.96);
  border: 1px solid rgba(144, 97, 249, 0.32);
}
.progressive-heading {
  font-size: 10.8px !important;
  font-weight: 900;
  color: #a78bfa !important;
  letter-spacing: 0.35px;
}
.team-columns-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  align-items: start;
}
.team-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  border-radius: 10px;
}
.crab-col {
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 229, 255, 0.32);
}
.chef-col {
  background: rgba(255, 140, 26, 0.07);
  border: 1px solid rgba(251, 146, 60, 0.38);
}
.team-col-title {
  font-size: 10.5px;
  font-weight: 900;
  text-align: center;
  padding-bottom: 2px;
  letter-spacing: 0.3px;
}
.crab-col .team-col-title { color: #5ef2ff; }
.chef-col .team-col-title { color: #fdba74; }

.prog-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1.5px;
  padding: 5.5px 7.5px;
  border-radius: 9px;
  background: linear-gradient(145deg, #241545 0%, #1b1035 100%);
  border: 1px solid rgba(56, 189, 248, 0.36);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.prog-card:hover {
  border-color: #38bdf8;
  background: linear-gradient(145deg, #2d1b56 0%, #211342 100%);
}
.prog-card.chef-prog {
  background: linear-gradient(145deg, #3b1c16 0%, #2a1215 100%);
  border-color: rgba(251, 146, 60, 0.52);
}
.prog-card.chef-vip-glasses {
  border: 1.5px solid #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.25);
}
.prog-card.galaxy-prog {
  background: linear-gradient(135deg, #2b1254 0%, #192458 55%, #3b0d4a 100%);
  border: 1.5px solid #e879f9;
  box-shadow: 0 0 12px rgba(217, 70, 239, 0.28);
}
.prog-title {
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
}
.prog-sub {
  font-size: 10.2px;
  font-weight: 600;
  color: #b4a5d9;
  line-height: 1.15;
}
.chef-prog .prog-sub {
  color: #fdba74;
}
.galaxy-prog .prog-sub {
  color: #f5d0fe;
}

.btn-sudden-trigger {
  width: 100%;
  padding: 6px;
  border-radius: 8px;
  background: linear-gradient(90deg, #8e0e28, #b56200);
  border: 1px solid #ffd54f;
  font-weight: 800;
  font-size: 11.5px;
}

/* Gags Grid */
.gag-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.gag-btn {
  background: #31244a;
  border: 1px solid rgba(255, 255, 255, 0.13);
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
}
.win-test-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 2px;
}
.btn-win-crab {
  background: #0d6e8a;
  padding: 6px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}
.btn-win-chef {
  background: #9c4a08;
  padding: 6px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

/* Audio & Scene Options */
.audio-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.btn-audio {
  background: #2f2642;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}
.btn-audio.active-toggle {
  background: #1b6b3a;
  border-color: #4ade80;
}
.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
}
.slider-row input {
  flex: 1;
}
.scene-opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
}
.scene-opts select {
  width: 100%;
  margin-top: 3px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #161026;
  color: #fff;
  border: 1px solid #5b4686;
  font-weight: 700;
}
.chk-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #d6cae8;
  cursor: pointer;
}

/* Inspector & Feed */
details summary {
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  color: #93c5fd;
}
.inspector-box {
  margin-top: 6px;
  padding: 7px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  font-size: 10.5px;
  line-height: 1.4;
  color: #e2e8f0;
}
.inspector-box hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 5px 0;
}
.event-feed {
  max-height: 92px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 10.5px;
  background: rgba(0, 0, 0, 0.32);
  padding: 5px 7px;
  border-radius: 7px;
}
.feed-item {
  color: #d8cee8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 2px;
}

/* ==========================================================================
   SISTEMA MULTIMEDIA v45: MEMES GIF + VENTANA VIP DEBAJO DEL GATO + GUÍA TIKTOK
   ========================================================================== */

/* 1. STICKER FLOTANTE DE MEMES GIF (Esquina superior izquierda bajo HUD, sin tapar duelo 3D!) */
.meme-sticker-box {
  position: absolute;
  top: 20.0%;
  left: 3.4%;
  width: 24.5%;
  max-width: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(15, 9, 28, 0.90);
  border: 2.2px solid #ffe600;
  border-radius: 12px;
  padding: 3px 3px 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.78), 0 0 14px rgba(255, 230, 0, 0.36);
  opacity: 0;
  transform: scale(0.45) rotate(-8deg);
  transition: transform 0.24s cubic-bezier(0.2, 1.25, 0.35, 1), opacity 0.18s ease;
  pointer-events: none;
  z-index: 7;
}
.meme-sticker-box.show {
  opacity: 1;
  transform: scale(1) rotate(-3.5deg);
  animation: memeBob 0.75s infinite alternate ease-in-out;
}
.meme-sticker-box.theme-furia {
  border-color: #ff2752;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.82), 0 0 18px rgba(255, 39, 82, 0.65);
}
.meme-sticker-box.theme-dj {
  border-color: #00f0ff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.82), 0 0 18px rgba(0, 240, 255, 0.55);
}
.meme-sticker-img {
  width: 100%;
  max-height: 106px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.meme-sticker-tag {
  margin-top: 2px;
  font-size: clamp(7.5px, 0.92vh, 9.6px);
  font-weight: 900;
  letter-spacing: 0.3px;
  color: #fff8cc;
  text-shadow: 0 1px 3px #000;
  text-align: center;
  line-height: 1.08;
}

@keyframes memeBob {
  from { transform: scale(1) rotate(-3.5deg) translateY(0); }
  to   { transform: scale(1.03) rotate(-1.5deg) translateY(-3px); }
}

/* 2. VENTANA VIP DE BAILE DIVIDIDO: SIEMPRE EN ESQUINA INFERIOR DERECHA DEBAJO DEL CHEF GATO!
      (Así jamás choca con la caja inferior izquierda de comentarios de TikTok LIVE) */
.vip-dance-card {
  position: absolute;
  left: auto;
  right: 3.4%;
  bottom: 11.4%;
  width: 35.5%;
  max-width: 158px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(18, 11, 34, 0.95) 0%, rgba(10, 6, 20, 0.96) 100%);
  border: 2.4px solid #33f0ff;
  border-radius: 13px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.82), 0 0 18px rgba(0, 229, 255, 0.44);
  opacity: 0;
  transform: translateY(18px) scale(0.75);
  transition: transform 0.26s cubic-bezier(0.2, 1.18, 0.34, 1), opacity 0.20s ease;
  pointer-events: none;
  z-index: 9;
}
.vip-dance-card.side-crab {
  left: auto;
  right: 3.4%;
  border-color: #33f0ff;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.82), 0 0 18px rgba(0, 229, 255, 0.44);
}
.vip-dance-card.side-chef {
  left: auto;
  right: 3.4%;
  border-color: #ff9d2e;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.82), 0 0 18px rgba(255, 145, 0, 0.48);
}
.vip-dance-card.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.vip-dance-badge {
  padding: 3px 6px;
  font-size: clamp(7.8px, 0.98vh, 10.2px);
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.3px;
  background: linear-gradient(90deg, #ff1744, #00b8d4);
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}
.vip-dance-card.side-chef .vip-dance-badge {
  background: linear-gradient(90deg, #ff6d00, #ffb300);
}
.vip-dance-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 636 / 664;
  background: #0d0816;
  overflow: hidden;
}
.vip-dance-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  display: none;
}
.vip-dance-video.active-vid {
  display: block;
}
.vip-dance-donor {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 6px;
  font-size: clamp(7.8px, 0.95vh, 9.8px);
  font-weight: 800;
  color: #ffe89e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(0, 0, 0, 0.62);
}
#vip-dance-donor-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 3. CINEMÁTICA GRANDE CENTRAL DE TRIUNFO DE RONDA + MVP DE LA RONDA */
.victory-cinema-modal {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%) scale(0.76);
  width: 92%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(22, 13, 40, 0.97) 0%, rgba(11, 7, 22, 0.98) 100%);
  border: 3px solid #ffe600;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.92), 0 0 32px rgba(255, 216, 59, 0.52);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.18, 1.15, 0.32, 1), opacity 0.22s ease;
  z-index: 14;
}
.victory-cinema-modal.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}
.victory-cinema-modal.crab-win {
  border-color: #00e5ff;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.92), 0 0 34px rgba(0, 229, 255, 0.55);
}
.victory-cinema-modal.chef-win {
  border-color: #ffb300;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.92), 0 0 34px rgba(255, 160, 0, 0.58);
}
.victory-cinema-header {
  padding: 7px 10px;
  text-align: center;
  font-weight: 900;
  font-size: clamp(12.5px, 1.72vh, 17px);
  letter-spacing: 0.4px;
  background: linear-gradient(90deg, #ff1744, #0091ea);
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.85);
}
.victory-cinema-modal.chef-win .victory-cinema-header {
  background: linear-gradient(90deg, #e65100, #ffb300);
}
.victory-cinema-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #090510;
  overflow: hidden;
}
.victory-cinema-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.victory-cinema-video.active-vid {
  display: block;
}
.victory-mvp-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 10px;
  background: linear-gradient(90deg, rgba(64, 28, 118, 0.92), rgba(112, 26, 117, 0.92));
  border-top: 1px solid rgba(255, 216, 59, 0.45);
  font-size: clamp(9.5px, 1.24vh, 12.2px);
  font-weight: 900;
  color: #ffe885;
}
.victory-cinema-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(8, 5, 16, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.victory-cinema-sub {
  font-size: clamp(10px, 1.32vh, 13px);
  font-weight: 800;
  color: #fff3c4;
}
.btn-skip-victory {
  pointer-events: auto;
  cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: clamp(9.5px, 1.18vh, 11.5px);
  font-weight: 800;
  transition: background 0.15s ease, transform 0.12s ease;
}
.btn-skip-victory:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: scale(1.04);
}

/* 4. GUÍA CONMUTABLE DE ZONAS SEGURAS DE TIKTOK LIVE (TECLA G) */
.tiktok-safezone-guide {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 18;
}
.tiktok-safezone-guide[hidden] {
  display: none !important;
}
.sz-zone {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1.8px dashed rgba(255, 77, 109, 0.85);
  background: rgba(255, 39, 82, 0.16);
  color: #ffe4e6;
  font-size: clamp(8.5px, 1.08vh, 11px);
  font-weight: 800;
  text-shadow: 0 1px 3px #000;
  border-radius: 10px;
  padding: 4px 6px;
}
.sz-top {
  top: 0.4%;
  left: 2%;
  right: 2%;
  height: 5.6%;
}
.sz-comments {
  left: 2.5%;
  width: 57.5%;
  bottom: 5.6%;
  height: 28.2%;
  border-color: rgba(56, 189, 248, 0.88);
  background: rgba(14, 116, 144, 0.20);
  color: #e0f2fe;
}
.sz-comments span {
  font-size: clamp(7.5px, 0.95vh, 9.8px);
  font-weight: 700;
  color: #bae6fd;
  margin-top: 2px;
}
.sz-right-icons {
  right: 1.8%;
  width: 11.5%;
  bottom: 5.6%;
  height: 5.4%;
  font-size: clamp(7px, 0.88vh, 9px);
}
.sz-bottom {
  left: 2%;
  right: 2%;
  bottom: 0.4%;
  height: 4.8%;
}

.video-unmute-pill {
  pointer-events: auto;
  position: absolute;
  right: 6px;
  bottom: 6px;
  border: 1.5px solid #ffe600;
  background: rgba(14, 8, 26, 0.88);
  color: #ffe600;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
  z-index: 4;
}

.media-preview-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 6px;
}
.media-test-btn {
  font-size: 10.5px;
  padding: 5px 4px;
}

@media (max-width: 900px) {
  #app-shell {
    flex-direction: column;
    overflow-y: auto;
    height: auto;
  }
  #stage-9x16 {
    height: 82vh;
  }
  #control-panel {
    width: 95vw;
    max-height: none;
  }
}
