* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Arial", sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #ffdde1, #ee9ca7, #a1c4fd);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.contenedor {
  width: 100%;
  max-width: 430px;
  text-align: center;
  background: rgba(255, 255, 255, 0.92);
  padding: 28px 22px;
  border-radius: 28px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  border: 3px solid rgba(255, 255, 255, 0.8);
}
.encabezado-juego {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 12px;
}

.logo-canal {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid #ff4fa3;
  background: white;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.titulo-canal {
  text-align: left;
}

.titulo-canal .marca {
  margin-bottom: 6px;
}

.titulo-canal h1 {
  margin-bottom: 0;
}
.marca {
  display: inline-block;
  background: #ff4fa3;
  color: white;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

h1 {
  font-size: 38px;
  color: #2d2a7f;
  margin-bottom: 8px;
}

.subtitulo {
  font-size: 16px;
  font-weight: normal;
  color: #555;
  margin-bottom: 18px;
}
.formulario-jugadores {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.formulario-jugadores h3 {
  color: #2d2a7f;
  font-size: 18px;
}

.formulario-jugadores input {
  width: 100%;
  padding: 13px 15px;
  border: 2px solid #d6d9ff;
  border-radius: 14px;
  font-size: 16px;
  outline: none;
  text-align: center;
}

.formulario-jugadores input:focus {
  border-color: #ff4fa3;
  box-shadow: 0 0 0 3px rgba(255, 79, 163, 0.18);
}
.selector-dificultad {
  display: none;
  flex-direction: column;
  gap: 9px;
  margin-top: 4px;
  padding: 12px;
  border-radius: 18px;
  background: #fff7fb;
  border: 2px dashed #ff9ccc;
}

.selector-dificultad p {
  color: #2d2a7f;
  font-weight: bold;
  font-size: 15px;
  margin-bottom: 2px;
}

.selector-dificultad label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  background: white;
  color: #2d2a7f;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  border: 2px solid #f4c6dc;
  text-align: left;
}

.selector-dificultad input {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  accent-color: #ff4fa3;
}
.boton-iniciar {
  padding: 13px 18px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(34, 197, 94, 0.3);
}

.boton-iniciar:hover {
  transform: translateY(-2px);
}

.tablero-bloqueado {
  opacity: 0.45;
  pointer-events: none;
}
.selector-modo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.selector-modo label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  background: #f3f4ff;
  color: #2d2a7f;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  border: 2px solid #d6d9ff;
  text-align: left;
}

.selector-modo input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: #ff4fa3;
}

.selector-modo span {
  flex: 1;
}
.mensaje {
  display: inline-block;
  background: #f3f4ff;
  color: #2d2a7f;
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 22px;
}

.tablero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  justify-content: center;
  margin: 0 auto 24px;
  max-width: 330px;
}

.casilla {
  aspect-ratio: 1 / 1;
  width: 100%;
  font-size: 48px;
  font-weight: bold;
  border: none;
  border-radius: 22px;
  background: linear-gradient(145deg, #ffffff, #e7e9ff);
  color: #2d2a7f;
  cursor: pointer;
  box-shadow:
    0 7px 0 #c8cdf7,
    0 10px 20px rgba(0, 0, 0, 0.12);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.2s ease;
}

.casilla:hover {
  transform: translateY(-3px);
  background: linear-gradient(145deg, #fff5fb, #e3f0ff);
}

.casilla:active {
  transform: translateY(4px);
  box-shadow:
    0 3px 0 #c8cdf7,
    0 6px 12px rgba(0, 0, 0, 0.12);
}

.casilla:disabled {
  cursor: not-allowed;
}

.boton-reiniciar {
  width: 100%;
  max-width: 260px;
  padding: 14px 22px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff4fa3, #7c3aed);
  color: white;
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(124, 58, 237, 0.35);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.boton-reiniciar:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(124, 58, 237, 0.42);
}

.boton-reiniciar:active {
  transform: translateY(2px);
}

@media (max-width: 420px) {
  .contenedor {
    padding: 24px 16px;
  }

  h1 {
    font-size: 32px;
  }

  .casilla {
    font-size: 42px;
    border-radius: 18px;
  }
}
.casilla.x {
  color: #ff4fa3;
}

.casilla.o {
  color: #2563eb;
}
@media (max-width: 420px) {
  .encabezado-juego {
    flex-direction: column;
    gap: 8px;
  }

  .titulo-canal {
    text-align: center;
  }

  .logo-canal {
    width: 90px;
    height: 90px;
  }
}
.celebracion {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(12, 10, 35, 0.72);
  z-index: 999;
  overflow: hidden;
  padding: 20px;
}

.celebracion.activa {
  display: flex;
}

.cartel-ganador {
  position: relative;
  z-index: 2;
  width: min(92vw, 520px);
  background: linear-gradient(135deg, #ffffff, #fff1fb);
  border: 5px solid #ff4fa3;
  border-radius: 32px;
  padding: 34px 24px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  animation: aparecerCartel 0.6s ease;
}

.trofeos {
  font-size: 54px;
  margin-bottom: 12px;
  animation: saltarTrofeo 0.9s ease infinite alternate;
}

.cartel-ganador h2 {
  font-size: clamp(32px, 7vw, 58px);
  color: #2d2a7f;
  line-height: 1.1;
  margin-bottom: 22px;
}

.boton-cerrar {
  padding: 13px 24px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff4fa3, #7c3aed);
  color: white;
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
}

.fuegos-artificiales span {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: explotar 1.4s ease-out infinite;
}

.fuegos-artificiales span:nth-child(1) {
  top: 18%;
  left: 18%;
  background: #ff4fa3;
  animation-delay: 0s;
}

.fuegos-artificiales span:nth-child(2) {
  top: 22%;
  right: 18%;
  background: #ffe600;
  animation-delay: 0.25s;
}

.fuegos-artificiales span:nth-child(3) {
  bottom: 20%;
  left: 22%;
  background: #4cc9f0;
  animation-delay: 0.5s;
}

.fuegos-artificiales span:nth-child(4) {
  bottom: 18%;
  right: 22%;
  background: #22c55e;
  animation-delay: 0.75s;
}

.fuegos-artificiales span:nth-child(5) {
  top: 48%;
  left: 10%;
  background: #fb7185;
  animation-delay: 1s;
}

.fuegos-artificiales span:nth-child(6) {
  top: 45%;
  right: 10%;
  background: #a78bfa;
  animation-delay: 1.2s;
}

@keyframes explotar {
  0% {
    transform: scale(0);
    opacity: 1;
    box-shadow:
      0 0 0 #fff,
      0 0 0 #fff,
      0 0 0 #fff,
      0 0 0 #fff,
      0 0 0 #fff,
      0 0 0 #fff;
  }

  70% {
    transform: scale(1.1);
    opacity: 1;
    box-shadow:
      0 -55px 0 #ff4fa3,
      40px -40px 0 #ffe600,
      55px 0 0 #4cc9f0,
      40px 40px 0 #22c55e,
      0 55px 0 #fb7185,
      -40px 40px 0 #a78bfa,
      -55px 0 0 #ffffff,
      -40px -40px 0 #f97316;
  }

  100% {
    transform: scale(1.4);
    opacity: 0;
    box-shadow:
      0 -75px 0 transparent,
      55px -55px 0 transparent,
      75px 0 0 transparent,
      55px 55px 0 transparent,
      0 75px 0 transparent,
      -55px 55px 0 transparent,
      -75px 0 0 transparent,
      -55px -55px 0 transparent;
  }
}

@keyframes aparecerCartel {
  from {
    transform: scale(0.65);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes saltarTrofeo {
  from {
    transform: translateY(0) rotate(-2deg);
  }

  to {
    transform: translateY(-8px) rotate(2deg);
  }
}
.cartel-empate {
  border-color: #64748b;
  background: linear-gradient(135deg, #ffffff, #eef2ff);
}

.cartel-empate h2 {
  color: #334155;
}

.caritas-empate {
  font-size: 46px;
  margin-bottom: 14px;
  animation: caritaTriste 0.9s ease infinite alternate;
}

.celebracion.empate .fuegos-artificiales {
  display: none;
}

@keyframes caritaTriste {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(6px);
  }
}
.boton-suscripcion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 300px;
  margin-top: 14px;
  padding: 15px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff0000, #ff4fa3, #7c3aed);
  color: #ffffff;
  text-decoration: none;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.3px;
  box-shadow: 0 10px 24px rgba(255, 0, 0, 0.35);
  border: 3px solid #ffffff;
  animation: pulsoSuscripcion 1.4s infinite;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.boton-suscripcion:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 30px rgba(255, 0, 0, 0.45);
}

.boton-suscripcion:active {
  transform: translateY(2px) scale(0.98);
}

@keyframes pulsoSuscripcion {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.5);
  }

  70% {
    box-shadow: 0 0 0 14px rgba(255, 0, 0, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
  }
}
.casilla-ganadora {
  background: linear-gradient(145deg, #fff7ad, #ffd166) !important;
  animation: brillarGanadora 0.7s ease infinite alternate;
  box-shadow:
    0 0 18px rgba(255, 209, 102, 0.9),
    0 7px 0 #f59e0b,
    0 12px 24px rgba(245, 158, 11, 0.35) !important;
}

@keyframes brillarGanadora {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.08);
  }
}
@media (max-width: 480px) {
  body {
    align-items: flex-start;
    padding: 12px;
  }

  .contenedor {
    max-width: 100%;
    min-height: auto;
    padding: 20px 14px;
    border-radius: 24px;
  }

  .encabezado-juego {
    gap: 8px;
  }

  .logo-canal {
    width: 76px;
    height: 76px;
  }

  h1 {
    font-size: 30px;
  }

  .subtitulo {
    font-size: 14px;
    margin-bottom: 14px;
  }

  .mensaje {
    font-size: 15px;
    padding: 9px 12px;
    margin-bottom: 16px;
  }

  .formulario-jugadores h3 {
    font-size: 16px;
  }

  .formulario-jugadores input {
    font-size: 15px;
    padding: 12px 13px;
  }

  .tablero {
    width: 100%;
    max-width: 300px;
    gap: 9px;
    margin-bottom: 18px;
  }

  .casilla {
    font-size: 40px;
    border-radius: 17px;
  }

  .boton-reiniciar,
  .boton-iniciar,
  .boton-suscripcion {
    max-width: 100%;
    font-size: 15px;
    padding: 13px 18px;
  }

  .cartel-ganador {
    padding: 28px 18px;
    border-radius: 26px;
  }

  .trofeos {
    font-size: 42px;
  }

  .cartel-ganador h2 {
    font-size: 34px;
  }
}

@media (max-width: 340px) {
  .tablero {
    max-width: 260px;
    gap: 8px;
  }

  .casilla {
    font-size: 34px;
    border-radius: 15px;
  }

  h1 {
    font-size: 26px;
  }

  .marca {
    font-size: 13px;
    padding: 7px 12px;
  }
}