:root {
  --blanco-brillante: #ffffff;
  --amarillo-intenso: #ffcc00;
  --naranja: #ff6600;
  --rojo: #ff0000;
  --rojo-oscuro: #8b0000;
  --negro-transparente: rgba(0,0,0,0.7);
  --linea-dorada: #ffd700;
  --payline-yellow: #ffff00;
  --payline-orange: #ff8000;
  --payline-green: #00ff00;
  --payline-purple: #8000ff;
  --payline-blue: #00ccff;
  --payline-red: #ff0000;
}

body {
  margin: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(120deg, var(--rojo-oscuro), var(--rojo), var(--naranja), var(--amarillo-intenso), var(--blanco-brillante));
  background-size: 400% 400%;
  animation: fireGradient 15s ease infinite;
  display: flex; flex-direction: column; align-items: center; min-height: 100vh;
  color: white;
}
@keyframes fireGradient {
  0%{background-position:0% 50%}
  50%{background-position:100% 50%}
  100%{background-position:0% 50%}
}

h1 {
  margin-top: 1rem; font-weight: 900; font-size: 2.5rem; text-shadow: 0 0 8px #ff6600;
}
#balance-container {
  margin: 1rem; font-size: 1.6rem; font-weight: 700;
  color: var(--amarillo-intenso);
}

#slot-wrapper {
  position: relative;
  width: 90vw;
  max-width: 800px;
  border: 2px solid var(--linea-dorada);
  background: rgba(0,0,0,0.3);
  user-select: none;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  height: 370px; /* altura fija para acomodar columnas */
}

#slot-container {
  grid-column: 1 / 8;
  display: flex;
  justify-content: space-between;
  height: 100%;
  position: relative;
}

.slot-column {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  border-left: 1px solid var(--linea-dorada);
  border-right: 1px solid var(--linea-dorada);
  background: rgba(0,0,0,0.4);
  width: 12.5%;
  height: 100%;
}

.col7 .slot-cell {
  flex: 1 1 auto;
  height: calc(100% / 7);
  border-bottom: 1px solid var(--linea-dorada);
}

.col5 .slot-cell {
  flex: 1 1 auto;
  height: calc(100% / 5);
  border-bottom: 1px solid var(--linea-dorada);
}

.slot-cell {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2.8rem;
  background-color: rgba(0,0,0,0.5);
  position: relative;
  transition: transform 0.3s ease;
}

.slot-cell.win {
  animation: glowPulse 1.2s infinite alternate;
  z-index: 10;
}

@keyframes glowPulse {
  0% { text-shadow: 0 0 5px var(--amarillo-intenso), 0 0 10px var(--naranja);}
  100% { text-shadow: 0 0 15px var(--amarillo-intenso), 0 0 30px var(--naranja);}
}

#paylines-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* Controles */
#controls {
  margin: 1rem 0;
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; justify-content: center;
}
#controls label {
  font-weight: 700;
}
#bet {
  padding: 0.3rem 0.5rem;
  font-size: 1rem;
  border-radius: 5px;
  border: none;
  outline: none;
}
#spin-btn, #auto-btn {
  background: var(--rojo);
  color: white;
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 5px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
#spin-btn:disabled, #auto-btn:disabled {
  background: gray;
  cursor: not-allowed;
}
#message {
  min-height: 2rem;
  margin-top: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  text-align: center;
  color: var(--amarillo-intenso);
  text-shadow: 0 0 10px var(--amarillo-intenso);
}

/* Responsive */
@media (max-width: 600px) {
  .slot-cell {
    font-size: 2rem;
  }
  #slot-wrapper {
    width: 98vw;
    height: 320px;
  }
}
