/* Shared layout for the daily guessing games. */

.game {
  max-width: 600px;
  padding-top: 24px;
}

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.top h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.day {
  color: var(--dim);
}

/* Map */

.map-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #111;
}

#map {
  position: absolute;
  inset: 0;
  background: #111;
}

.map-note {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--dim);
  z-index: 1000;
}

/* Status line */

.status {
  min-height: 1.4em;
  margin: 16px 0 12px;
}

.status .dim {
  color: var(--dim);
}

/* Guess input */

.guess {
  position: relative;
  display: flex;
  gap: 8px;
}

.guess input,
.guess button {
  font: inherit;
  font-size: 16px;
  border-radius: 0;
}

.guess input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  background: #000;
  color: #fff;
  border: 1px solid #555;
  outline: none;
}

.guess input:focus {
  border-color: #fff;
}

.guess input::placeholder {
  color: #666;
}

.guess button {
  padding: 12px 20px;
  background: #fff;
  color: #000;
  border: 1px solid #fff;
  cursor: pointer;
  font-weight: 800;
}

.guess button:hover {
  background: #ccc;
  border-color: #ccc;
}

.guess[hidden] {
  display: none;
}

.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 2000;
  max-height: 264px;
  overflow-y: auto;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  background: #000;
  border: 1px solid #fff;
}

.suggestions li {
  padding: 10px 14px;
  cursor: pointer;
}

.suggestions li .country {
  color: var(--dim);
}

.suggestions li[aria-selected="true"],
.suggestions li:hover {
  background: #fff;
  color: #000;
}

.suggestions li[aria-selected="true"] .country,
.suggestions li:hover .country {
  color: #555;
}

/* Guess list */

.guesses {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.guesses li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--faint);
}

.guesses li.empty {
  color: #333;
}

.guesses .country {
  color: var(--dim);
}

.guesses .km {
  white-space: nowrap;
}

.guesses li.correct .km {
  color: var(--good);
}

/* End of game */

.answer {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
