/* ===========================
   PISTO PLAY — BOMB.CSS
   Estilos del Modo Bomba 💣
   =========================== */

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bomb-primary:   #FF3B30;
  --bomb-secondary: #FF6B35;
  --bomb-dark:      #1a0500;
  --bomb-dark2:     #2a0a00;
  --bomb-glow:      rgba(255, 59, 48, 0.6);
  --bomb-shield:    #22c55e;
  --bomb-shield-glow: rgba(34, 197, 94, 0.5);
  --bomb-safe:      #3B82F6;
  --bomb-text:      #fff8f5;
  --bomb-muted:     #cc9080;
}

/* ── Page Base ─────────────────────────────────────────── */
.bomb-page {
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #3d0800 0%, #1a0500 40%, #0d0200 100%);
  color: var(--bomb-text);
  font-family: 'Outfit', sans-serif;
  position: relative;
  overflow-x: hidden;
}

/* ── Header ────────────────────────────────────────────── */
.bomb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(26,5,0,0.9), transparent);
  backdrop-filter: blur(8px);
}

.bomb-header-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--bomb-primary);
  text-transform: uppercase;
}

.bomb-back-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: var(--bomb-text);
  padding: 0.45rem 0.9rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.bomb-back-btn:hover { background: rgba(255,255,255,0.15); }

/* ── Player Queue ──────────────────────────────────────── */
.bomb-player-queue-wrap {
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.5rem 1rem;
}
.bomb-player-queue-wrap::-webkit-scrollbar { display: none; }

#bomb-player-queue {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  min-width: max-content;
}

.bomb-queue-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transition: transform 0.3s;
  opacity: 0.45;
}
.bomb-queue-item.active { opacity: 1; transform: scale(1.15); }

.bomb-queue-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  border: 2px solid transparent;
  transition: border-color 0.3s;
}
.bomb-queue-item.active .bomb-queue-avatar {
  border-color: var(--bomb-primary);
  box-shadow: 0 0 10px var(--bomb-glow);
}

.bomb-queue-name {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--bomb-muted);
  text-align: center;
  max-width: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bomb-queue-item.active .bomb-queue-name { color: var(--bomb-text); }

/* ── Bomb Area ─────────────────────────────────────────── */
#bomb-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  gap: 1rem;
}

/* ── Bomb Visual ───────────────────────────────────────── */
#bomb-visual {
  width: 110px;
  height: 110px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5rem;
  filter: drop-shadow(0 0 20px var(--bomb-glow));
  animation: bomb-pulse 2s ease-in-out infinite;
  cursor: default;
  user-select: none;
  transition: filter 0.5s;
}

@keyframes bomb-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.08); }
}

.bomb-tick {
  animation: bomb-tick-anim 0.15s ease-out !important;
}
@keyframes bomb-tick-anim {
  0%   { transform: scale(1.18) rotate(-3deg); }
  50%  { transform: scale(1.05) rotate(3deg); }
  100% { transform: scale(1); }
}

/* Tension levels */
#bomb-area.tension-0 #bomb-visual {
  animation: bomb-pulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(255,100,50,0.5));
}
#bomb-area.tension-1 #bomb-visual {
  animation: bomb-pulse 1.0s ease-in-out infinite;
  filter: drop-shadow(0 0 28px rgba(255,59,48,0.8));
}
#bomb-area.tension-2 #bomb-visual {
  animation: bomb-shake 0.3s ease-in-out infinite;
  filter: drop-shadow(0 0 40px var(--bomb-primary));
}

@keyframes bomb-shake {
  0%   { transform: rotate(-4deg) scale(1.05); }
  25%  { transform: rotate(4deg) scale(1.1); }
  50%  { transform: rotate(-3deg) scale(1.05); }
  75%  { transform: rotate(3deg) scale(1.08); }
  100% { transform: rotate(-4deg) scale(1.05); }
}

/* ── Current Player ────────────────────────────────────── */
.bomb-current-player-wrap {
  text-align: center;
}

.bomb-turn-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--bomb-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.2rem;
}

#bomb-current-player {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--bomb-text);
  transition: color 0.3s;
}

.player-pop {
  animation: player-pop-anim 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes player-pop-anim {
  0%   { transform: scale(0.8); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Card ──────────────────────────────────────────────── */
#bomb-card {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(145deg, rgba(255,59,48,0.12), rgba(255,107,53,0.06));
  border: 2px solid rgba(255,59,48,0.35);
  border-radius: 20px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.4s;
}

#bomb-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255,59,48,0.08), transparent 60%);
  pointer-events: none;
}

.card-enter {
  animation: card-enter-anim 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes card-enter-anim {
  from { transform: translateX(-40px) scale(0.92); opacity: 0; }
  to   { transform: translateX(0) scale(1); opacity: 1; }
}

#bomb-card-type {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--bomb-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

#bomb-card-text {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--bomb-text);
}

/* Shield card style */
#bomb-card.shield-card {
  border-color: rgba(34,197,94,0.5);
  background: linear-gradient(145deg, rgba(34,197,94,0.12), rgba(34,197,94,0.04));
}
#bomb-card.shield-card::before {
  background: radial-gradient(circle at top left, rgba(34,197,94,0.1), transparent 60%);
}

/* ── Action Buttons ────────────────────────────────────── */
.bomb-actions {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  max-width: 480px;
}

.bomb-btn {
  flex: 1;
  padding: 1rem;
  border-radius: 16px;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.15s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.bomb-btn:active { transform: scale(0.96); }

.bomb-btn-fail {
  background: linear-gradient(135deg, #FF3B30, #CC2A21);
  color: white;
  box-shadow: 0 4px 20px rgba(255,59,48,0.4);
}
.bomb-btn-fail:hover { box-shadow: 0 6px 28px rgba(255,59,48,0.6); }

.bomb-btn-pass {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  box-shadow: 0 4px 20px rgba(34,197,94,0.4);
}
.bomb-btn-pass:hover { box-shadow: 0 6px 28px rgba(34,197,94,0.6); }

/* ── Screens ───────────────────────────────────────────── */
.bomb-screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}
.bomb-screen.active { display: flex; }

/* Setup Screen */
#setup-screen {
  background: radial-gradient(ellipse at top, #3d0800 0%, #1a0500 60%, #0d0200 100%);
}

.setup-title {
  font-size: 2.2rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 0.5rem;
}

.setup-subtitle {
  color: var(--bomb-muted);
  text-align: center;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.setup-bomb {
  font-size: 6rem;
  text-align: center;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 30px rgba(255,59,48,0.7));
  animation: bomb-pulse 2s ease-in-out infinite;
}

.setup-players-wrap {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.bomb-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: white;
  border: 2px solid rgba(255,255,255,0.2);
}

.difficulty-section {
  width: 100%;
  max-width: 400px;
  margin-bottom: 1.5rem;
}

.difficulty-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bomb-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
  text-align: center;
}

.difficulty-btns {
  display: flex;
  gap: 0.75rem;
}

.difficulty-btn {
  flex: 1;
  padding: 0.85rem;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--bomb-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.difficulty-btn.active {
  border-color: var(--bomb-primary);
  background: rgba(255,59,48,0.18);
  color: var(--bomb-text);
  box-shadow: 0 0 12px rgba(255,59,48,0.3);
}

.bomb-start-btn {
  width: 100%;
  max-width: 400px;
  padding: 1.1rem;
  border-radius: 18px;
  border: none;
  background: linear-gradient(135deg, #FF3B30, #FF6B35);
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 28px rgba(255,59,48,0.5);
  transition: transform 0.15s, box-shadow 0.2s;
  letter-spacing: 0.03em;
}
.bomb-start-btn:active { transform: scale(0.97); }
.bomb-start-btn:hover { box-shadow: 0 8px 36px rgba(255,59,48,0.7); }

/* ── Explosion Screen ──────────────────────────────────── */
#explosion-screen {
  background: #0d0000;
  text-align: center;
}

.explosion-animate {
  animation: explosion-flash 0.8s ease-out;
}

@keyframes explosion-flash {
  0%   { background: #FF0000; }
  30%  { background: #FF6B35; }
  100% { background: #0d0000; }
}

.explosion-emoji {
  font-size: 7rem;
  margin-bottom: 0.5rem;
  animation: explosion-pop 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes explosion-pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.explosion-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--bomb-primary);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#exploded-player-name {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--bomb-text);
  margin-bottom: 1.5rem;
}

.explosion-card {
  background: rgba(255,59,48,0.12);
  border: 2px solid rgba(255,59,48,0.4);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  max-width: 400px;
  width: 100%;
}

.explosion-card-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--bomb-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

#explosion-card-text {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--bomb-text);
}

.explosion-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 400px;
}

/* ── Results Screen ────────────────────────────────────── */
#results-screen {
  background: radial-gradient(ellipse at top, #1a0500 0%, #0d0200 100%);
  gap: 1.25rem;
  overflow-y: auto;
}

.results-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--bomb-text);
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
  max-width: 400px;
}

.stat-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,59,48,0.2);
  border-radius: 14px;
  padding: 1rem;
  text-align: center;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--bomb-primary);
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--bomb-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
}

.results-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 400px;
}

/* ── Game Screen ───────────────────────────────────────── */
#game-screen {
  padding-bottom: 2rem;
}

/* ── Coming Soon Badge (for modes.html) ────────────────── */
.mode-card.bomba {
  background: linear-gradient(145deg, rgba(255,59,48,0.08), rgba(255,107,53,0.04));
  border: 1px solid rgba(255,59,48,0.25);
  position: relative;
  overflow: hidden;
}

.badge-coming-soon {
  background: linear-gradient(135deg, #FF3B30, #FF6B35);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.coming-soon-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(1px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  cursor: not-allowed;
}

.coming-soon-label {
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: 1px solid rgba(255,255,255,0.2);
}

/* ── Pack Elite Banner ─────────────────────────────────── */
.pack-elite-banner {
  background: linear-gradient(135deg, rgba(255,59,48,0.15), rgba(255,107,53,0.1), rgba(124,58,237,0.1));
  border: 1px solid rgba(255,59,48,0.35);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  position: relative;
  overflow: hidden;
}
.pack-elite-banner:hover { border-color: rgba(255,59,48,0.6); transform: translateY(-1px); }
.pack-elite-banner:active { transform: scale(0.98); }

.pack-elite-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: linear-gradient(135deg, #FF3B30, #FF6B35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pack-elite-title {
  font-size: 1rem;
  font-weight: 800;
  color: white;
  margin: 0.15rem 0 0.1rem;
}

.pack-elite-savings {
  font-size: 0.78rem;
  color: var(--text-muted, #a39bbc);
}

/* ── Utility ───────────────────────────────────────────── */
.btn-bomb-primary {
  width: 100%;
  padding: 1rem;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #FF3B30, #FF6B35);
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255,59,48,0.4);
  transition: transform 0.15s;
}
.btn-bomb-primary:active { transform: scale(0.97); }

.btn-bomb-secondary {
  width: 100%;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-bomb-secondary:hover { background: rgba(255,255,255,0.1); }

/* ── Tutorial Screen ───────────────────────────────────── */
#tutorial-screen {
  background: radial-gradient(ellipse at top, #3d0800 0%, #1a0500 60%, #0d0200 100%);
  overflow-y: auto;
  gap: 0;
  padding: 2rem 1.5rem;
  justify-content: flex-start;
}

.tutorial-bomb {
  font-size: 5rem;
  text-align: center;
  margin: 0.5rem 0 0.75rem;
  filter: drop-shadow(0 0 30px rgba(255,59,48,0.8));
  animation: bomb-pulse 2s ease-in-out infinite;
}

.tutorial-title {
  font-size: 2rem;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.tutorial-tagline {
  text-align: center;
  color: var(--bomb-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* "¿Qué es la Bomba?" highlight card */
.tutorial-what-card {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(135deg, rgba(245,158,11,0.18), rgba(255,107,53,0.12));
  border: 1.5px solid rgba(245,158,11,0.45);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
  animation: tutorial-step-in 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}

.tutorial-what-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 800;
  color: #f59e0b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.55rem;
}

.tutorial-what-desc {
  font-size: 0.85rem;
  color: var(--bomb-text);
  line-height: 1.55;
  margin: 0;
  opacity: 0.9;
}

.tutorial-what-desc strong {
  color: #fbbf24;
  font-weight: 700;
}

.tutorial-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 400px;
  margin-bottom: 1.75rem;
}

.tutorial-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,59,48,0.18);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  animation: tutorial-step-in 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
.tutorial-step:nth-child(1) { animation-delay: 0.05s; }
.tutorial-step:nth-child(2) { animation-delay: 0.12s; }
.tutorial-step:nth-child(3) { animation-delay: 0.19s; }
.tutorial-step:nth-child(4) { animation-delay: 0.26s; }

@keyframes tutorial-step-in {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.tutorial-step-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 0.1rem;
}

.tutorial-step-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--bomb-text);
  margin-bottom: 0.2rem;
}

.tutorial-step-desc {
  font-size: 0.82rem;
  color: var(--bomb-muted);
  line-height: 1.45;
}

/* ── Danger Countdown Overlay ──────────────────────────── */
.danger-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: transparent;
}

.danger-overlay.active {
  animation: danger-bg-flash 0.5s ease-in-out infinite alternate;
}

@keyframes danger-bg-flash {
  from { background: rgba(255, 0, 0, 0);   }
  to   { background: rgba(255, 0, 0, 0.18); }
}

.danger-countdown {
  font-size: 9rem;
  font-weight: 900;
  color: #FF3B30;
  text-shadow: 0 0 60px rgba(255,59,48,0.9), 0 0 120px rgba(255,59,48,0.5);
  animation: danger-count-pop 0.25s cubic-bezier(0.34,1.56,0.64,1);
  line-height: 1;
}

@keyframes danger-count-pop {
  from { transform: scale(2.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.danger-label {
  font-size: 1.1rem;
  font-weight: 900;
  color: #FF3B30;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-top: 0.5rem;
  animation: danger-label-pulse 0.4s ease-in-out infinite alternate;
}

@keyframes danger-label-pulse {
  from { opacity: 0.6; transform: scale(0.97); }
  to   { opacity: 1;   transform: scale(1.03); }
}

/* Extra shake for tension-2 card area */
#bomb-area.tension-2 #bomb-card {
  animation: card-danger-shake 0.2s ease-in-out infinite;
  border-color: var(--bomb-primary) !important;
  box-shadow: 0 0 30px rgba(255,59,48,0.5);
}
@keyframes card-danger-shake {
  0%, 100% { transform: translateX(-2px); }
  50%       { transform: translateX(2px); }
}

#bomb-area.tension-2 .bomb-actions .bomb-btn {
  animation: btn-pulse-danger 0.5s ease-in-out infinite alternate;
}
@keyframes btn-pulse-danger {
  from { box-shadow: 0 4px 20px rgba(255,59,48,0.4); }
  to   { box-shadow: 0 8px 40px rgba(255,59,48,0.85); }
}
