* {
  box-sizing: border-box;
}

:root {
  --verde-cancha: #1e7d32;
  --verde-oscuro: #145a24;
  --blanco-linea: rgba(255, 255, 255, 0.55);
  --amarillo: #ffcc00;
  --dorado: #d4af37;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Rubik', sans-serif;
  background:
    repeating-linear-gradient(
      90deg,
      var(--verde-cancha) 0,
      var(--verde-cancha) 60px,
      var(--verde-oscuro) 60px,
      var(--verde-oscuro) 120px
    );
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 48px;
  position: relative;
  overflow-x: hidden;
}

.field-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 50%, transparent 0, transparent 90px, var(--blanco-linea) 91px, var(--blanco-linea) 93px, transparent 94px),
    linear-gradient(var(--blanco-linea), var(--blanco-linea));
  background-size: 100% 100%, 100% 3px;
  background-position: 50% 50%, 50% 50%;
  background-repeat: no-repeat;
  opacity: 0.6;
}

.header {
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  text-align: center;
}

.ball {
  font-size: 2.4rem;
  animation: spin 4s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.title {
  font-family: 'Bebas Neue', 'Rubik', sans-serif;
  font-size: 2.6rem;
  letter-spacing: 2px;
  line-height: 1;
  margin: 0;
  color: var(--amarillo);
  text-shadow: 3px 3px 0 var(--verde-oscuro), -1px -1px 0 #000;
}

.title span {
  display: block;
  font-size: 1.6rem;
  color: #fff;
  letter-spacing: 4px;
}

.card {
  z-index: 1;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  border: 3px solid var(--amarillo);
  border-radius: 18px;
  padding: 24px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.step {
  margin-bottom: 24px;
}

.step h2,
.marcador h2 {
  font-family: 'Bebas Neue', 'Rubik', sans-serif;
  letter-spacing: 1px;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}

.step-num {
  background: var(--amarillo);
  color: var(--verde-oscuro);
  font-weight: 800;
  font-family: 'Rubik', sans-serif;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.players {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.player-btn {
  background: #fff;
  color: var(--verde-oscuro);
  border: 3px solid transparent;
  border-radius: 12px;
  padding: 14px 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.player-btn:hover {
  transform: translateY(-2px);
}

.player-btn.selected {
  border-color: var(--amarillo);
  background: #fff8dc;
}

.btn-sortear {
  width: 100%;
  background: var(--amarillo);
  color: var(--verde-oscuro);
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-sortear:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-sortear:not(:disabled):hover {
  transform: scale(1.02);
}

.btn-ball {
  font-size: 1.3rem;
  display: inline-block;
}

.btn-sortear.spinning .btn-ball {
  animation: spin 0.6s linear infinite;
}

.hint {
  text-align: center;
  margin: 10px 0 0;
  font-size: 0.9rem;
  opacity: 0.85;
}

.resultado {
  text-align: center;
  background: rgba(255, 255, 255, 0.12);
  border: 2px dashed var(--amarillo);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 24px;
  animation: pop 0.4s ease;
}

@keyframes pop {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.resultado-label {
  margin: 0 0 8px;
  font-size: 1rem;
}

.team-reveal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.team-flag {
  font-size: 2.6rem;
}

.team-name {
  font-family: 'Bebas Neue', 'Rubik', sans-serif;
  font-size: 2.2rem;
  letter-spacing: 2px;
  color: var(--amarillo);
}

.tabla-marcador {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
}

.tabla-marcador th,
.tabla-marcador td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.tabla-marcador th {
  background: var(--verde-oscuro);
  font-family: 'Bebas Neue', 'Rubik', sans-serif;
  letter-spacing: 1px;
}

.tabla-marcador td.pendiente {
  opacity: 0.6;
  font-style: italic;
}

.btn-reset {
  margin-top: 14px;
  width: 100%;
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  font-weight: 600;
}

.btn-reset:hover {
  border-color: var(--amarillo);
  color: var(--amarillo);
}

.footer {
  z-index: 1;
  margin-top: 20px;
  font-size: 0.8rem;
  opacity: 0.75;
  text-align: center;
}

@media (max-width: 420px) {
  .title { font-size: 2rem; }
  .title span { font-size: 1.2rem; }
}
