body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #18392b;
  color: white;
}

.game {
  width: min(100% - 24px, 800px);
  margin: 0 auto;
  padding: 16px 0;
}

h1 {
  text-align: center;
  font-size: clamp(2rem, 8vw, 3rem);
}

.balance {
  font-size: clamp(1.4rem, 6vw, 2rem);
  text-align: center;
  margin-bottom: 20px;
}

.horses {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.horse-card {
  background: #255c45;
  padding: 16px;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  touch-action: manipulation;
}

.horse-card.selected {
  border-color: gold;
  background: #31795b;
}

.controls {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.controls label {
  display: grid;
  gap: 6px;
  font-size: 1rem;
}

input,
button {
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
}

input {
  padding: 12px;
  font-size: 18px;
}

button {
  padding: 14px 18px;
  font-size: 18px;
  cursor: pointer;
  touch-action: manipulation;
}

#message {
  text-align: center;
  font-size: 1.1rem;
  min-height: 28px;
}

.track {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.lane {
  position: relative;
  height: 44px;
  background: #6b4f2a;
  border-radius: 6px;
  overflow: hidden;
}

.horse-runner {
  position: absolute;
  left: 0;
  top: 6px;
  font-size: 28px;
  transition: left 2s ease-out;
}

@media (min-width: 650px) {
  .controls {
    display: flex;
    justify-content: center;
    align-items: end;
  }

  input {
    width: 140px;
  }

  button {
    width: auto;
  }
}