body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #2c3e50, #4ca1af);
    color: #ecf0f1;
    font-family: 'Roboto', sans-serif;
    overflow: hidden;
    margin: 0;
}

.roulette-container {
    text-align: center;
    position: relative;
}

.roulette-wheel {
    position: relative;
    width: 400px;
    height: 400px;
    border: 15px solid #34495e;
    border-radius: 50%;
    margin: 0 auto;
    background: radial-gradient(circle, #27ae60, #2ecc71); /* Sfumatura di verde rilassante */
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7), inset 0 0 30px rgba(255, 255, 255, 0.1);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ball {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #f1c40f;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.8);
    transition: all 0.5s ease-in-out;
}

.numbers {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: rotate(-9deg); /* Rotazione per allineare i numeri */
}

.number {
    position: absolute;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    color: #ecf0f1;
    font-size: 14px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s;
    transform-origin: 50% 50%;
}

.number.red {
    background-color: #e74c3c;
}

.number.black {
    background-color: #34495e;
}

.number.green {
    background-color: #27ae60;
}

.number:hover {
    transform: scale(1.3);
}

button {
    margin-top: 20px;
    padding: 15px 25px;
    background-color: #e74c3c;
    color: #ecf0f1;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    transition: background-color 0.3s, transform 0.3s;
}

button:hover {
    background-color: #c0392b;
    transform: scale(1.1);
}

#result {
    margin-top: 20px;
    padding: 10px;
    background-color: #34495e; /* Sfondo nero di base */
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    font-size: 18px;
    transition: all 0.3s ease-in-out;
}

.flash-green {
    animation: flash 2s; /* Aggiungiamo l'animazione flash */
}

@keyframes flash {
    0%, 100% { background-color: #34495e; } /* Colore di base */
    50% { background-color: #2ecc71; } /* Colore verde */
}

/* Animazione fade in e fade out per il risultato */
.fade-in-out {
    animation: fadeInOut 2s forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; background-color: #34495e; }
    50% { opacity: 1; background-color: #2ecc71; }
    100% { opacity: 0; background-color: #34495e; }
}

/* Stili Toggle Switch */
.toggle-container {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    color: #ecf0f1;
}

.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
    margin-right: 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(14px);
}

/* Roulette Animation */
.roulette-wheel.spinning {
    animation: rotate 2s linear infinite;
}

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

/* Aggiungi questa animazione di sfondo */
@keyframes flash-background {
    0%, 100% { background-color: #34495e; } /* Colore di base */
    50% { background-color: #2ecc71; } /* Colore verde */
}

/* Modifica l'animazione di sfondo per la label */
.flash-background {
    animation: flash-background 1s; /* Durata dell'animazione */
}

/* Rimuovi l'animazione di rotazione del testo */
.spinning {
    background-color: #16a085;
    transition: background-color 1s; /* Durata dell'animazione */
}

.history-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 100%;
  height: 35px;
  background-color: #2c3e50; /* Colore di sfondo della pagina */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: auto;
  padding-left: 5px;
}

.history-item {
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 5px;
  font-weight: bold;
  font-size: 14px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.5s, transform 0.5s;
}

.history-item.show {
  opacity: 1;
  transform: translateX(0);
}

.history-item.no-animation {
  opacity: 1;
  transform: translateX(0);
  transition: none; /* Disattiva qualsiasi transizione */
}

.history-item.green {
  background-color: #27ae60; /* Verde */
  color: #ecf0f1; /* Colore del testo */
}

.history-item.red {
  background-color: #e74c3c; /* Rosso */
  color: #ecf0f1; /* Colore del testo */
}

.history-item.black {
  background-color: #34495e; /* Nero */
  color: #ecf0f1; /* Colore del testo */
}

.number.glow {
  box-shadow: 0 0 20px rgba(255, 255, 0, 1);
  color: #fff;
}

/* Posizionamento dei numeri lungo la circonferenza nell'ordine corretto della roulette europea */
.roulette-wheel .number:nth-child(1) { transform: rotate(0deg) translate(130px); }
.roulette-wheel .number:nth-child(2) { transform: rotate(9.73deg) translate(130px); }
.roulette-wheel .number:nth-child(3) { transform: rotate(19.46deg) translate(130px); }
.roulette-wheel .number:nth-child(4) { transform: rotate(29.19deg) translate(130px); }
.roulette-wheel .number:nth-child(5) { transform: rotate(38.92deg) translate(130px); }
.roulette-wheel .number:nth-child(6) { transform: rotate(48.65deg) translate(130px); }
.roulette-wheel .number:nth-child(7) { transform: rotate(58.38deg) translate(130px); }
.roulette-wheel .number:nth-child(8) { transform: rotate(68.11deg) translate(130px); }
.roulette-wheel .number:nth-child(9) { transform: rotate(77.84deg) translate(130px); }
.roulette-wheel .number:nth-child(10) { transform: rotate(87.57deg) translate(130px); }
.roulette-wheel .number:nth-child(11) { transform: rotate(97.3deg) translate(130px); }
.roulette-wheel .number:nth-child(12) { transform: rotate(107.03deg) translate(130px); }
.roulette-wheel .number:nth-child(13) { transform: rotate(116.76deg) translate(130px); }
.roulette-wheel .number:nth-child(14) { transform: rotate(126.49deg) translate(130px); }
.roulette-wheel .number:nth-child(15) { transform: rotate(136.22deg) translate(130px); }
.roulette-wheel .number:nth-child(16) { transform: rotate(145.95deg) translate(130px); }
.roulette-wheel .number:nth-child(17) { transform: rotate(155.68deg) translate(130px); }
.roulette-wheel .number:nth-child(18) { transform: rotate(165.41deg) translate(130px); }
.roulette-wheel .number:nth-child(19) { transform: rotate(175.14deg) translate(130px); }
.roulette-wheel .number:nth-child(20) { transform: rotate(184.87deg) translate(130px); }
.roulette-wheel .number:nth-child(21) { transform: rotate(194.6deg) translate(130px); }
.roulette-wheel .number:nth-child(22) { transform: rotate(204.33deg) translate(130px); }
.roulette-wheel .number:nth-child(23) { transform: rotate(214.06deg) translate(130px); }
.roulette-wheel .number:nth-child(24) { transform: rotate(223.79deg) translate(130px); }
.roulette-wheel .number:nth-child(25) { transform: rotate(233.52deg) translate(130px); }
.roulette-wheel .number:nth-child(26) { transform: rotate(243.25deg) translate(130px); }
.roulette-wheel .number:nth-child(27) { transform: rotate(252.98deg) translate(130px); }
.roulette-wheel .number:nth-child(28) { transform: rotate(262.71deg) translate(130px); }
.roulette-wheel .number:nth-child(29) { transform: rotate(272.44deg) translate(130px); }
.roulette-wheel .number:nth-child(30) { transform: rotate(282.17deg) translate(130px); }
.roulette-wheel .number:nth-child(31) { transform: rotate(291.9deg) translate(130px); }
.roulette-wheel .number:nth-child(32) { transform: rotate(301.63deg) translate(130px); }
.roulette-wheel .number:nth-child(33) { transform: rotate(311.36deg) translate(130px); }
.roulette-wheel .number:nth-child(34) { transform: rotate(321.09deg) translate(130px); }
.roulette-wheel .number:nth-child(35) { transform: rotate(330.82deg) translate(130px); }
.roulette-wheel .number:nth-child(36) { transform: rotate(340.55deg) translate(130px); }
.roulette-wheel .number:nth-child(37) { transform: rotate(350.28deg) translate(130px); }
