/* ===== Reset & base ===== */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0b0b12;
  font-family: 'Poppins', sans-serif;
  color: #fff;
  overflow-x: hidden;
}

body {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Ocultar contornos al enfocar */
input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: none;
}

/* ===== Fondo decorativo ===== */
.bg-glow {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
}

.bg-glow--one {
  width: 500px;
  height: 500px;
  top: -150px;
  left: -120px;
  background: radial-gradient(circle, rgba(255, 204, 0, 0.25), transparent 70%);
}

.bg-glow--two {
  width: 600px;
  height: 600px;
  bottom: -200px;
  right: -180px;
  background: radial-gradient(circle, rgba(120, 60, 255, 0.2), transparent 70%);
}

/* ===== Cabecera ===== */
.page-header {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 32px 20px 8px;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #ffd700, #ff9966);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-header__icon {
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

.page-header__subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
}

/* ===== Contenedor principal ===== */
.container {
  position: relative;
  z-index: 2;
  width: min(94%, 760px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px 0 60px;
  flex: 1;
}

/* Flecha */
.arrow-container {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  z-index: 3;
  display: flex;
  justify-content: center;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
}

.arrow-container img {
  width: 62px;
  height: auto;
}

/* Ruleta */
.wheel-container {
  width: 100%;
  max-width: 640px;
  margin-top: 35px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Halo detrás de la ruleta */
.wheel-glow {
  position: absolute;
  width: 92%;
  padding-top: 92%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.35), transparent 70%);
  filter: blur(30px);
  z-index: 0;
  animation: pulse-glow 3.5s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.05); }
}

.the_wheel {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Botón de la ruleta */
.canvas-button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: transform 0.25s ease-in-out, filter 0.25s ease-in-out;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.55));
}

.canvas-button:hover {
  transform: scale(1.02);
  filter: drop-shadow(0 10px 30px rgba(255, 215, 0, 0.35));
}

.canvas-button:active {
  transform: scale(0.98);
}

.canvas-button canvas {
  max-width: 100%;
  height: auto;
  border-radius: 50%;
  border: 6px solid #ffd700;
  box-shadow:
    0 0 0 3px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(255, 215, 0, 0.45);
  background: #111;
}

.spin-hint {
  margin-top: 22px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.3px;
}

/* ===== Panel de participantes ===== */
.names-container {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 10;
  width: 270px;
  max-width: calc(100vw - 36px);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  padding: 6px;
  display: flex;
  flex-direction: column;
}

/* Botón "Participantes" */
.collapsible-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #fff;
  padding: 10px 8px;
  border-radius: 10px;
  transition: background 0.25s ease, color 0.25s ease;
}

.collapsible-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffd700;
}

.collapsible-button__icon {
  font-size: 18px;
}

.collapsible-button__label {
  flex: 1;
  text-align: left;
}

.collapsible-button__chevron {
  font-size: 18px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.3s ease;
}

.collapsible-button[aria-expanded="true"] .collapsible-button__chevron {
  transform: rotate(45deg);
  color: #ffd700;
}

/* Contenido desplegable */
.content {
  display: none;
  width: 100%;
  padding: 4px 8px 10px;
}

/* Formulario */
form.js-form {
  width: 100%;
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

input[type="text"] {
  flex-grow: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: white;
  font-family: inherit;
  font-size: 14px;
  transition: border 0.2s ease, background 0.2s ease;
}

input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

input[type="text"]:focus {
  border-color: #ffd700;
  background: rgba(255, 255, 255, 0.1);
}

.add-button {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #ffcc00, #ff9500);
  color: #1a1a1a;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 12px rgba(255, 165, 0, 0.35);
}

.add-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 165, 0, 0.45);
}

.add-button:active {
  transform: translateY(0);
}

/* Lista de nombres */
.todo-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.todo-list::-webkit-scrollbar {
  width: 6px;
}

.todo-list::-webkit-scrollbar-track {
  background: transparent;
}

.todo-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.todo-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 215, 0, 0.4);
}

/* Estilo de cada nombre */
.todo-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  animation: item-in 0.2s ease;
}

@keyframes item-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.todo-list li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Estilo del botón eliminar */
.delete-button {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: rgba(255, 90, 90, 0.85);
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

.delete-button:hover {
  background: rgba(255, 60, 60, 0.18);
  color: #ff5a5a;
}

/* Estado vacío */
.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0.7;
}

.checklist-icon {
  margin-bottom: 20px;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .names-container {
    top: 10px;
    left: 10px;
    width: 220px;
  }

  .page-header {
    padding: 20px 16px 4px;
  }

  .wheel-container {
    margin-top: 60px;
  }
}