/* Billar con potenciadores: estilos propios (la base vive en style.css) */
/* cartel de grupo asignado: SOS LISAS / SOS RAYADAS, letra por letra */
.group-banner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 15;
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: #fde047;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55), 0 0 24px rgba(253, 224, 71, 0.45);
  line-height: 1;
}
.gb-letter {
  display: inline-block;
  opacity: 0;
  animation: gbIn 0.45s cubic-bezier(0.2, 0.8, 0.3, 1.25) forwards;
}
@keyframes gbIn {
  from { opacity: 0; transform: translateY(-38px); }
  to { opacity: 1; transform: translateY(0); }
}
.gb-letter.out {
  opacity: 1;
  animation: gbOut 0.4s ease-in forwards;
}
@keyframes gbOut {
  to { opacity: 0; transform: translateY(46px); }
}
#pl-canvas { touch-action: none; }

/* barra de controles abajo de la canaleta: nada tapa la mesa */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 6px;
  min-height: 56px;
  width: min(440px, 96vw);
}
.mod-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.mod-btn {
  padding: 10px 16px;
  border: 2px solid #f59e0b;
  border-radius: 999px;
  background: rgba(69, 26, 3, 0.85);
  color: #fde68a;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.08s;
}
.mod-btn:active { transform: scale(0.95); }
.mod-btn.armed {
  background: #f59e0b;
  color: #451a03;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.8);
  animation: pulse 0.9s ease-in-out infinite;
}
.mod-btn.vision {
  border-color: #22d3ee;
  background: rgba(8, 51, 68, 0.85);
  color: #a5f3fc;
}
.mod-btn.vision.armed {
  background: #22d3ee;
  color: #083344;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.8);
}
@keyframes pulse { 50% { box-shadow: 0 0 30px rgba(245, 158, 11, 1); } }

/* selector de efecto: bolita blanca donde marcás dónde pega el taco */
.spin-widget {
  display: flex;
  align-items: center;
  gap: 6px;
}
.spin-ball {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, #cbd5e1 70%, #94a3b8);
  border: 2px solid rgba(0, 0, 0, 0.4);
  position: relative;
  touch-action: none;
  cursor: crosshair;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.spin-dot {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #dc2626;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 7px rgba(220, 38, 38, 0.9);
  pointer-events: none;
}
.spin-label {
  font-size: 0.7rem;
  color: #86efac;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* canaleta de retorno de bolas: canal de madera abajo de la mesa */
.ball-return {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 32px;
  padding: 3px 10px;
  margin-top: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2c1a0d 0%, #4a2b16 45%, #1e120a 100%);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  width: min(440px, 96vw); /* mismo ancho que la mesa: canal completo */
}
.rb-ball {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--c);
  flex: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset -3px -4px 6px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.5);
}
.rb-ball.stripe {
  background: linear-gradient(180deg, #f8fafc 22%, var(--c) 22%, var(--c) 78%, #f8fafc 78%);
}
.rb-ball span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #f8fafc;
  color: #111827;
  font-size: 9px;
  font-weight: 800;
  line-height: 13px;
  text-align: center;
}
/* entra RODANDO de derecha a izquierda: giro proporcional a la distancia
   (~3.5 vueltas para 280px con Ø24), desacelera y asienta con un toquecito */
.rb-ball.roll-in {
  animation: rollIn 1.6s cubic-bezier(0.16, 0.6, 0.35, 1);
}
@keyframes rollIn {
  0% { transform: translateX(280px) rotate(1250deg); }
  90% { transform: translateX(-4px) rotate(-16deg); }
  100% { transform: translateX(0) rotate(0deg); }
}


/* tutorial del primer tiro: manito que arrastra hacia atrás y suelta */
.tut-drag {
  position: absolute;
  left: 50%;
  top: 56%; /* fallback: el JS lo ancla a la bola blanca */
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 12;
  color: #eafff3;
  font-size: 0.85rem;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  line-height: 1.3;
}
.tut-anim { position: relative; height: 100px; width: 44px; }
.tut-trail {
  position: absolute;
  left: 50%;
  top: 14px;
  height: 0;
  border-left: 3px dashed rgba(255, 255, 255, 0.65);
  transform: translateX(-50%);
  animation: tutTrail 2.2s ease-in-out infinite;
}
.tut-hand {
  position: absolute;
  left: 50%;
  top: 0;
  width: 52px;
  transform: translateX(-50%) rotate(90deg);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
  animation: tutHand 2.2s ease-in-out infinite;
}
@keyframes tutHand {
  0% { transform: translate(-50%, 0) rotate(90deg) scale(1); opacity: 0; }
  12% { opacity: 1; transform: translate(-50%, 0) rotate(90deg) scale(0.85); }
  60% { transform: translate(-50%, 58px) rotate(90deg) scale(0.85); opacity: 1; }
  75% { transform: translate(-50%, 58px) rotate(90deg) scale(1.08); opacity: 0.9; }
  90%, 100% { opacity: 0; transform: translate(-50%, 58px) rotate(90deg) scale(1); }
}
@keyframes tutTrail {
  0%, 12% { height: 0; opacity: 0.8; }
  60% { height: 58px; opacity: 0.8; }
  75% { height: 58px; opacity: 0.4; }
  90%, 100% { height: 58px; opacity: 0; }
}

/* botones de sabotaje */
.mod-btn.ghost { border-color: #cbd5e1; background: rgba(30, 41, 59, 0.85); color: #e2e8f0; }
.mod-btn.ghost.armed { background: #cbd5e1; color: #1e293b; box-shadow: 0 0 18px rgba(203, 213, 225, 0.8); }
.mod-btn.barrier { border-color: #f97316; background: rgba(67, 20, 7, 0.85); color: #fed7aa; }
.mod-btn.barrier.armed { background: #f97316; color: #431407; box-shadow: 0 0 18px rgba(249, 115, 22, 0.8); }
.mod-btn.fog { border-color: #94a3b8; background: rgba(15, 23, 42, 0.85); color: #cbd5e1; }
.mod-btn.fog.armed { background: #94a3b8; color: #0f172a; box-shadow: 0 0 18px rgba(148, 163, 184, 0.8); }
.mod-btn.cap { border-color: #ef4444; background: rgba(69, 10, 10, 0.85); color: #fecaca; }
.mod-btn.cap.armed { background: #ef4444; color: #450a0a; box-shadow: 0 0 18px rgba(239, 68, 68, 0.8); }


/* pool a pantalla completa: la mesa llena el ancho del teléfono */
.pl-screen { max-width: none; padding-left: 0; padding-right: 0; }

/* cartel de repetición del tiro final */
.replay-tag {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 0.8rem;
  color: #fecaca;
  background: rgba(0, 0, 0, 0.55);
  padding: 6px 14px;
  border-radius: 8px;
  pointer-events: none;
  animation: replayBlink 1.1s steps(2) infinite;
}
@keyframes replayBlink {
  50% { opacity: 0.5; }
}
