* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

header {
  text-align: center;
  margin-bottom: 25px;
  width: 100%;
}

h1 {
  color: #2c3e50;
  font-size: 2.5rem;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 10px;
}

.subtitle {
  color: #7f8c8d;
  font-size: 1.1rem;
}

.controles {
  margin-bottom: 25px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 800px;
}

.controles input {
  padding: 12px 15px;
  border: 2px solid #3498db;
  border-radius: 8px;
  min-width: 220px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.controles input:focus {
  outline: none;
  border-color: #2980b9;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

button {
  padding: 12px 20px;
  cursor: pointer;
  min-width: 140px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 3px 5px rgba(0,0,0,0.1);
}

button:hover {
  background: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 5px 8px rgba(0,0,0,0.15);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#addParticipant {
  background: #2ecc71;
}

#addParticipant:hover {
  background: #27ae60;
}

#start {
  background: #e74c3c;
}

#start:hover {
  background: #c0392b;
}

#reset {
  background: #9b59b6;
}

#reset:hover {
  background: #8e44ad;
}

.contenedor-de-ruedas {
  position: relative;
  width: 420px;
  height: 420px;
  margin-bottom: 30px;
}

#rueda {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  border: 8px solid #2c3e50;
  box-sizing: border-box;
  transition: transform 3s cubic-bezier(0.17, 0.67, 0.12, 0.99);
  background: #ecf0f1;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.puntero {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-top: 40px solid #e74c3c;
  z-index: 10;
  filter: drop-shadow(0 3px 2px rgba(0,0,0,0.3));
}

.resultados {
  display: flex;
  justify-content: space-around;
  width: 100%;
  max-width: 700px;
  margin-top: 20px;
  gap: 25px;
}

.perdedores {
  width: 48%;
  
  padding: 20px;
  border: 1px solid #003151;
  border-radius: 12px;
  background: white;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.ganadores {
  width: 48%;
  height: 208px;
  padding: 20px;
  border: 1px solid #003151;
  border-radius: 12px;
  background: white;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.perdedores li {
  margin-bottom: 5px;
  color: #c3cfe2;
  background-color: #074246;
}

.resultados h2 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #003151;
}

ul {
  list-style-type: none;
  padding: 0;
  margin: 10px 0 0 0;
  min-height: 100px;
}

ul li {
  padding: 8px 12px;
  margin: 5px 0;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #e74c3c;
  font-weight: 500;
}

#winnerDisplay {
  font-weight: bold;
  font-size: 1.8rem;
  text-align: center;
  margin-top: 15px;
  color: #27ae60;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.segmento {
  position: absolute;
  width: 50%;
  height: 50%;
  transform-origin: bottom right;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /*clip-path: polygon(0 0, 100% 0, 100% 100%);*/
}



.texto-segmento {
  position: absolute;
  width: 100px;
  text-align: center;
  font-weight: bold;
  font-size: 13px;
  transform-origin: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  left: 140px;
  top: 150px;
  transform: skewY(-60deg) rotate(67deg);
  color: rgb(255, 255, 255);
}

.mensaje-vacio {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7f8c8d;
  font-size: 1.2rem;
  font-style: italic;
}

.participants-count {
  position: absolute;
  top: 20px;
  right: -50px;
  background: #3498db;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: bold;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
  .controles {
    flex-direction: column;
    align-items: center;
  }
 
  .contenedor-de-ruedas {
    width: 320px;
    height: 320px;
  }
 
  .resultados {
    flex-direction: column;
    align-items: center;
  }
 
  .perdedores, .ganadores {
    width: 100%;
  }
  .texto-segmento {
    position: absolute;
    width: 100px;
    text-align: center;
    font-weight: bold;
    font-size: 13px;
    transform-origin: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    left: 90px;
    top: 75px;
    transform: skewY(-60deg) rotate(67deg);
    color: rgb(255, 255, 255);
  }
}