body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #121212;
  color: #fff;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

main {
  flex: 1;
  padding: 1em;
}

#logo {
  margin: .5rem 0;
  text-align: center;
  border-radius: 25%;
}

#logo img {
  height: 9rem;
}

p {
  text-align: center;
  padding: 0 1em;
  margin: 1.5rem 0 2rem;
  font-style: oblique;
}

#section-container {
  display: flex;
  gap: 1em;
  padding: 0 1em;
}

.team {
  background-color: #1e1e1e;
  width: 50%;
  padding: 1em;
  margin-bottom: 1em;
  border-radius: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.team h2 {
  margin-bottom: 0.5em;
}

.team label {
  margin-top: 0.5em;
}

.team input {
  width: 50px;
  padding: 0.3em;
  background-color: #222;
  color: #00ff5a;
  border: 1px solid #00ff88;
  margin-bottom: 0.5em;
  border-radius: 5px;
}

.errore {
  color: #ff4d4d;
  font-size: 0.85em;
  display: block;
  margin-top: -0.3em;
  margin-bottom: 0.5em;
  min-height: 1em;
}

.esito-successo {
  color: #00ff88;
  font-weight: bold;
  text-align: center;
  margin-top: 1em;
}

.esito-errore {
  color: #ff4d4d;
  font-weight: bold;
  text-align: center;
  margin-top: 1em;
}

.input-errore {
  border: 2px solid #ff4d4d !important;
  background-color: #331111;
}

.errore-output {
  background-color: #331111;
  color: #ff4d4d;
  border: 1px solid #ff4d4d;
  text-align: center;
}

#button-group {
  display: flex;
  justify-content: center;
  gap: 1em;
  margin-top: 2em;
}

#btn {
  padding: 0.7em 1.5em;
  font-size: 1em;
  font-weight: bold;
  background-color: #00ff5a;
  color: black;
  border: 1px solid white;
  border-radius: 5px;
  cursor: pointer;
  display: block;
  transition: background-color 0.3s;
}

#btn:hover {
  background-color: white;
}

#reset {
  padding: 0.7em 1.5em;
  font-size: 1em;
  background-color: white;
  font-weight: bold;
  color: black;
  border: 2px solid #d0ffd0;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#reset:hover {
  background-color: #00ff5a;
}

.hidden {
  display: none !important;
}

#output {
  display: flex;
  justify-content: center;
  gap: 2em;
  margin: 3rem 0;
  align-items: center;
  padding: 0 1em;
}

#risultato {
  background-color: #1a1a1a;
  padding: 1em;
  border-radius: 10px;
  font-size: 1.2em;
  width: 50%;
}

#esito-nobet {
  text-align: center;
  color: #9CA3AF;
  font-size: 1.5rem;
  margin-bottom: 1.5em;
}

#pronostico {
  position: relative;
  margin-bottom: 1.5em;
  font-size: 2rem;
}

#esito {
  font-weight: bold;
  color: #d0ffd0;
}

#pronostico i {
  margin-right: .5em;
  vertical-align: middle;
}

#aggiungiMatch {
  position: absolute;
  right: 1em;
  top: .5rem;
  padding: 0.5em 1em;
  background-color: #eee;
  border: 1px solid #ccc;
  border-radius: 5px;
  cursor: pointer;
}

#aggiungiMatch.aggiunto {
  background-color: #00ff5a;
  cursor: default;
  color: black;
  font-weight: bold;
}

#aggiungiMatch.aggiunto i {
  margin-right: 5px;
}

#probs-container {
  text-align: center;
}

#probs-container h4 {
  font-style: oblique;
  font-weight: normal;
}

.vittoria {
  color:#00ff5a;
  font-weight: bold;
}

.pareggio {
  color: #eee;
  font-weight: bold;
  margin: 1em auto;
}

.sconfitta {
  color: #ff4d4d;
  font-weight: bold;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.modal-content {
  background-color: #1e1e1e;
  padding: 1.5em;
  border-radius: 10px;
  text-align: center;
  max-width: 90%;
}

.modal-content input, .modal-content textarea {
  width: calc(100% - 1.5em);
  margin: 0.5em 0;
  padding: 0.5em;
  background-color: #222;
  color: #00ff5a;
  border: 1px solid #00ff88;
  border-radius: 5px;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 1em;
  margin-top: 1em;
}

.modal-buttons button {
  padding: 0.6em 1.2em;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

#modal-save {
  background-color: #00ff5a;
  color: black;
}

#modal-save:hover {
  background-color: white;
}

#modal-cancel {
  background-color: #ff4d4d;
  color: black;
}

#modal-cancel:hover, .remove-btn:hover {
  background-color: #ff4d4d7a;
  color: white;
}

.fade-in {
  opacity: 0;
  transform: translateY(-10px);
  animation: fadeInAnim 0.4s forwards;
}

@keyframes fadeInAnim {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#list-container {
  text-align: center;
  width: 50vw;
  margin: 0 auto;
}

#lista-match {
  list-style: none;
  padding: 0;
  margin: 0;
}

#lista-match li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #1e1e1e;
  padding: 0.5em 1em;
  border-radius: 8px;
  margin-bottom: 0.5em;
}

#lista-match button {
  margin-left: 0.5em;
  background-color: transparent;
  border: none;
  cursor: pointer;
  font-size: 1em;
  color: #00ff88;
}

#svuotaLista {
  margin-top: 10px;
  background: #eee;
  border: 1px solid #ccc;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}

#svuotaLista:hover,
#aggiungiMatch:not(.aggiunto):hover {
  background: #ddd;
}

.remove-btn {
  background-color: #ff4d4d;
  color: white;
}

.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.cancel-btn {
  background-color: #444;
  color: white;
}

.cancel-btn:hover {
  background-color: white;
  color: #444;
}

canvas {
  margin: 0;
  max-width: 50%;
  max-height: 180px;
  flex-shrink: 0;
}

#form-contatto textarea {
  resize: vertical;
}

#form-contatto button {
  padding: 0.6em 1.2em;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
}

#invia-feedback {
  background-color: #00ff5a;
  color: black;
}

#invia-feedback:hover {
  background-color: white;
}

.esito-messaggio {
  display: block;
  margin-top: 0.8em;
  font-size: 0.9em;
}

footer {
  margin-top: 1rem;
  text-align: center;
  color: #888;
  padding: 1em;
}

footer a {
  color: #d0ffd0;
  text-decoration: none;
}

footer a:hover {
  color: #00ff88;
}

/* Only Mobile */
@media (max-width: 600px) {
  .team label {
    display: block;
  }

  .team input {
    text-align: center;
  }

  #output {
    flex-direction: column;
  }

  canvas {
    max-width: 100%;
    height: auto;
  }

  #aggiungiMatch {
    position: static;
    display: block;
    margin-top: 1rem;
    width: 100%;
  }

  #pronostico {
    text-align: center;
    padding-right: 0;
  }

  #list-container {
    width: unset;
  }

  #button-group {
    flex-direction: column;
    gap: 0.5em;
  }

  .modal-content {
    width: calc(100% - 1em);
    padding: 1em;
    margin:0 .5em;
  }
}

/* Versione Desktop */
@media (min-width: 600px) {
  #modal-contatto .modal-content{
    min-width: 400px;
  }
}
