* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Jua", "Orbitron", Arial, sans-serif;
  background: linear-gradient(135deg, #f7b42c 0%, #fc575e 100%);
  color: #222;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header,
footer {
  text-align: center;
}

header {
  padding: 2rem 1rem 1rem 1rem;
}

header p {
  margin-bottom: 0.5em;
  font-size: 1.1rem;
  color: #555;
}

h1 {
  font-family: "Orbitron", sans-serif;
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
  color: #2c3e50;
}

main {
  flex-grow: 1;
  position: relative;
  padding-bottom: 2rem;
}

.track-container {
  max-width: 800px;
  margin: 0 auto 1.5rem;
  background: #ffffff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.track {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  position: relative;
  height: 50px;
  border-bottom: 1px solid #e0e0e0;
}

.track:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.emoji {
  font-size: 2.2rem;
  width: 45px;
  text-align: center;
  margin-right: 10px;
  color: #555;
}

.horses {
  flex: 1;
  display: flex;
  align-items: center;
  height: 100%;
  position: relative;
}

.horse {
  width: 48px;
  height: 48px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid #d1d1d1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: left 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  position: absolute;
  left: 0;
  color: #333;
}

.finish-line {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    #555 0px,
    #555 4px,
    #fff 4px,
    #fff 8px
  );
  border-radius: 3px;
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  gap: 1.2rem;
}

#draw-btn,
#restart-btn,
#draw-hidden-btn {
  font-family: "Jua", sans-serif;
  font-size: 1.25rem;
  padding: 0.8em 2.2em;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
  font-weight: bold;
  letter-spacing: 0.5px;
  min-width: 200px;
  text-align: center;
}

#draw-btn {
  background-color: #fc575e;
  color: #fff;
}

#draw-btn:hover {
  background-color: #e0434b;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
}

#draw-hidden-btn {
  background-color: #4a90e2;
  color: #fff;
}

#draw-hidden-btn:hover {
  background-color: #357abd;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
}

#draw-hidden-btn:disabled {
  background-color: #ccc;
  color: #666;
  cursor: not-allowed;
}

#restart-btn {
  background-color: #f7b42c;
  color: #333;
}

#draw-btn:active,
#restart-btn:active,
#draw-hidden-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

footer #restart-btn {
  margin-top: 0.5rem;
  font-size: 1.1rem;
  padding: 0.6em 1.8em;
}
footer #restart-btn:hover {
  background-color: #d89b22;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
}

#winner-banner {
  font-family: "Orbitron", sans-serif;
  font-size: 2.2rem;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(135deg, #f7b42c 0%, #fc575e 100%);
  border-radius: 15px;
  padding: 1.5em 2.5em;
  display: none;
  text-align: center;
  animation: pop 0.7s cubic-bezier(0.68, -0.55, 0.27, 1.55);

  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: auto;
  min-width: 300px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

@keyframes pop {
  0% {
    transform: translateX(-50%) scale(0.5);
    opacity: 0;
  }
  80% {
    transform: translateX(-50%) scale(1.1);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}

#last-card {
  margin: 1rem auto 1.5rem;
  font-size: 1.2rem;
  min-height: 3em;
  padding: 1em 1.5em;
  background-color: #ffffff;
  border-radius: 10px;
  text-align: center;
  width: 90%;
  max-width: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  color: #444;
  font-family: "Jua", sans-serif;
}

footer {
  margin-top: auto;
  background-color: #ffffff;
  border-top: 1px solid #e0e0e0;
  padding: 1.5rem 0;
  padding-bottom: 1rem;
  font-size: 0.9rem;
  color: #666;
}

footer p a {
  color: #3498db;
  text-decoration: none;
}

footer p a:hover {
  text-decoration: underline;
  color: #2980b9;
}

@media (max-width: 600px) {
  h1 {
    font-size: 2rem;
  }
  header p {
    font-size: 0.9rem;
    padding: 0 1rem;
  }
  .track-container {
    padding: 1.5rem;
    margin: 0 1.5rem 1.5rem;
  }
  .horse {
    width: 40px;
    height: 40px;
    font-size: 1.8rem;
  }
  .emoji {
    font-size: 1.8rem;
    width: 35px;
  }
  .track {
    height: 45px;
    margin-bottom: 1rem;
  }
  #draw-btn,
  #restart-btn,
  #draw-hidden-btn {
    font-size: 1.1rem;
    padding: 0.8em 1.5em;
    width: 80%;
    max-width: 300px;
    min-width: auto;
  }
  footer #restart-btn {
    font-size: 1rem;
    padding: 0.7em 1.5em;
    width: 60%;
  }
  #last-card {
    font-size: 1rem;
    width: 90%;
    padding: 0.8em 1em;
  }
  #winner-banner {
    font-size: 1.8rem;
    padding: 1.2em 1.5em;
    width: 90%;
    min-width: auto;
  }
}
