/* ===================================================================
   TICTACBOOM.CSS - ESTILOS OFICIALES (JUEGOS STAHLGRAF)
   © 2026 Stahlgraf Games. Todos los derechos reservados.
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800;900&family=Inter:wght@300;400;500;600;700;800;900&family=Bungee&display=swap');

:root {
  --bg-dark: #090606;
  --bg-gradient: linear-gradient(135deg, #0d0606 0%, #170b09 50%, #080505 100%);
  
  --bomb-black: #1e1e24;
  --flame-orange: #f97316;
  --flame-amber: #f59e0b;
  --flame-red: #ef4444;
  --flame-crimson: #dc2626;

  --gold: #fbbf24;
  --gold-light: #fde047;

  --text-white: #f8fafc;
  --text-muted: #a8a29e;
  
  --glass-bg: rgba(23, 14, 13, 0.88);
  --glass-border: rgba(249, 115, 22, 0.15);

  --font-title: 'Cinzel', serif;
  --font-impact: 'Bungee', cursive, sans-serif;
  --font-sans: 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-dark);
  background-image: var(--bg-gradient);
  color: var(--text-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 25%, rgba(249, 115, 22, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 80% 75%, rgba(220, 38, 38, 0.08) 0%, transparent 45%);
  z-index: 0;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

/* Enlaces superiores */
.back-link-top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s;
  cursor: pointer;
}

.back-link-top:hover {
  color: var(--flame-amber);
  border-color: var(--flame-orange);
  background: rgba(249, 115, 22, 0.1);
}

/* Contenedor principal de pantallas */
.screen-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ==================== TARJETA CONTENEDORA ==================== */
.tb-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 1.75rem 1.4rem;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.7), 0 0 25px rgba(249, 115, 22, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Encabezado */
.tb-header {
  text-align: center;
  margin-bottom: 1.6rem;
}

.tb-badge {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.35);
  color: #fb923c;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 999px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

.tb-title {
  font-family: var(--font-impact);
  font-size: clamp(2rem, 8vw, 2.9rem);
  font-weight: 400;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #fdba74 0%, #f97316 45%, #ef4444 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.4rem;
  text-shadow: 0 2px 20px rgba(249, 115, 22, 0.3);
}

.tb-slogan {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 520px;
  margin: 0 auto;
}

/* Secciones de configuración */
.tb-section {
  margin-bottom: 1.4rem;
}

.tb-section-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fdba74;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Grillas de botones de selección */
.tb-btn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.5rem;
}

.tb-pill-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-white);
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.tb-pill-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(249, 115, 22, 0.3);
}

.tb-pill-btn.active {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.25) 0%, rgba(239, 68, 68, 0.2) 100%);
  border-color: var(--flame-orange);
  color: #fdba74;
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.3);
}

/* Lista de Jugadores */
.tb-players-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.3rem;
}

.tb-players-container::-webkit-scrollbar {
  width: 5px;
}
.tb-players-container::-webkit-scrollbar-thumb {
  background: rgba(249, 115, 22, 0.3);
  border-radius: 10px;
}

.tb-player-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.45rem 0.75rem;
  border-radius: 12px;
}

.tb-player-avatar {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.tb-player-input {
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  width: 100%;
  outline: none;
}

.tb-btn-del-player {
  background: transparent;
  border: none;
  color: #78716c;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.tb-btn-del-player:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.tb-btn-add-player {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.6rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(249, 115, 22, 0.35);
  color: #fdba74;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.tb-btn-add-player:hover {
  background: rgba(249, 115, 22, 0.08);
  border-color: var(--flame-orange);
}

/* Botón comenzar grande */
.btn-tb-start {
  width: 100%;
  padding: 1.05rem 1.5rem;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #ef4444 100%);
  color: #fff;
  font-family: var(--font-impact);
  font-size: 1.25rem;
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow: 0 6px 30px rgba(249, 115, 22, 0.45);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.btn-tb-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 35px rgba(249, 115, 22, 0.6);
}

/* ==================== PANTALLA DE BOMBA EN VIVO ==================== */
.tb-game-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tb-round-badge {
  font-size: 0.8rem;
  font-weight: 800;
  color: #fdba74;
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

.tb-lives-counter-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #cbd5e1;
}

/* Turno del jugador actual */
.tb-turn-hero {
  text-align: center;
  margin-bottom: 1rem;
}

.tb-current-player-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid var(--flame-orange);
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.25);
  font-size: 1.15rem;
  font-weight: 800;
}

/* BOMBA CENTRAL ANIMADA */
.tb-bomb-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 1rem 0 1.5rem 0;
  position: relative;
}

.tb-bomb-icon-wrap {
  width: 140px;
  height: 140px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.tb-bomb-graphic {
  font-size: 6rem;
  filter: drop-shadow(0 0 20px rgba(249, 115, 22, 0.35));
  transition: transform 0.2s;
  animation: bombPulse 1.2s infinite ease-in-out;
}

@keyframes bombPulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 15px rgba(249, 115, 22, 0.3)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 35px rgba(239, 68, 68, 0.6)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 15px rgba(249, 115, 22, 0.3)); }
}

.tb-bomb-graphic.urgent {
  animation: bombPulseFast 0.4s infinite ease-in-out;
}

@keyframes bombPulseFast {
  0% { transform: scale(1.02); filter: drop-shadow(0 0 25px rgba(239, 68, 68, 0.7)); }
  50% { transform: scale(1.18); filter: drop-shadow(0 0 50px rgba(239, 68, 68, 0.95)); }
  100% { transform: scale(1.02); filter: drop-shadow(0 0 25px rgba(239, 68, 68, 0.7)); }
}

/* Tarjeta del Desafío Activo */
.tb-challenge-card {
  width: 100%;
  background: linear-gradient(180deg, #181111 0%, #100b0b 100%);
  border: 2px solid rgba(249, 115, 22, 0.35);
  border-radius: 22px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.75);
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}

.tb-challenge-badges-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.tb-challenge-dice-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  color: #fff;
}

.tb-challenge-dice-badge strong {
  color: var(--gold-light);
  letter-spacing: 1px;
}

.tb-challenge-rule-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.95rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: rgba(239, 68, 68, 0.16);
  border: 1.5px solid #ef4444;
  color: #fca5a5;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.3);
}

.tb-position-tip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(249, 115, 22, 0.25);
  font-size: 0.88rem;
  color: #fed7aa;
  margin-bottom: 0.65rem;
}

.tb-position-tip strong {
  color: #fde047;
  font-weight: 800;
}

.tb-challenge-main-text {
  font-family: var(--font-impact);
  font-size: clamp(2.3rem, 10vw, 3.6rem);
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 0 25px rgba(249, 115, 22, 0.5);
  margin-bottom: 0.4rem;
  word-break: break-word;
}

.tb-challenge-desc {
  font-size: 0.9rem;
  line-height: 1.45;
  color: #d6d3d1;
  max-width: 480px;
  margin: 0 auto;
}

/* BOTÓN GIGANTE PASAR BOMBA */
.btn-pass-bomb {
  width: 100%;
  padding: 1.35rem 1.5rem;
  border-radius: 20px;
  border: none;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-family: var(--font-impact);
  font-size: clamp(1.2rem, 5vw, 1.5rem);
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.45);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.btn-pass-bomb:active {
  transform: scale(0.97);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

/* ==================== PANTALLA DE EXPLOSIÓN (BOOM!) ==================== */
.tb-explosion-wrap {
  text-align: center;
  padding: 1rem 0;
  animation: shakeScreen 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeScreen {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-7px, 0, 0); }
  40%, 60% { transform: translate3d(7px, 0, 0); }
}

.tb-boom-title {
  font-family: var(--font-impact);
  font-size: clamp(3rem, 12vw, 4.8rem);
  color: #ef4444;
  letter-spacing: 3px;
  text-shadow: 0 0 35px rgba(239, 68, 68, 0.8), 0 0 70px rgba(249, 115, 22, 0.5);
  margin-bottom: 0.5rem;
}

.tb-victim-card {
  background: rgba(239, 68, 68, 0.1);
  border: 1.5px solid rgba(239, 68, 68, 0.4);
  border-radius: 20px;
  padding: 1.4rem;
  margin: 1.25rem 0;
}

.tb-victim-name {
  font-family: var(--font-title);
  font-size: 1.7rem;
  font-weight: 900;
  color: #fca5a5;
  margin-bottom: 0.4rem;
}

/* ==================== PODIO & GANADOR ==================== */
.tb-players-status-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1.25rem 0;
}

.tb-player-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tb-player-status-row.eliminated {
  opacity: 0.5;
  text-decoration: line-through;
}

/* ==================== MODAL DE REGLAS (FLOTANTE) ==================== */
.tb-rules-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.tb-rules-overlay.hidden {
  display: none !important;
}

.tb-rules-card {
  background: #150d0c;
  border: 1.5px solid rgba(249, 115, 22, 0.45);
  border-radius: 22px;
  max-width: 620px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.6rem 1.4rem;
  color: #fff;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95);
  margin: auto;
}

.tb-rules-card::-webkit-scrollbar {
  width: 6px;
}
.tb-rules-card::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
}
.tb-rules-card::-webkit-scrollbar-thumb {
  background: rgba(249, 115, 22, 0.4);
  border-radius: 10px;
}

/* ==================== BOTÓN & MODAL DE SALIDA ==================== */
.btn-exit-game {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.btn-exit-game:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.tb-exit-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.tb-exit-overlay.hidden {
  display: none !important;
}

.tb-exit-card {
  background: #150d0c;
  border: 1.5px solid rgba(249, 115, 22, 0.45);
  border-radius: 22px;
  max-width: 440px;
  width: 100%;
  padding: 1.75rem 1.5rem;
  color: #fff;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95);
  margin: auto;
  text-align: center;
}

.tb-exit-title {
  font-family: var(--font-title);
  font-size: 1.45rem;
  color: #fdba74;
  margin-bottom: 0.5rem;
}

.tb-exit-desc {
  font-size: 0.92rem;
  line-height: 1.5;
  color: #d6d3d1;
  margin-bottom: 1.4rem;
}

.tb-exit-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn-exit-resume {
  width: 100%;
  padding: 0.85rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-exit-restart {
  width: 100%;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(249, 115, 22, 0.35);
  background: rgba(249, 115, 22, 0.1);
  color: #fdba74;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-exit-hub {
  width: 100%;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: block;
}
