.hl-title {
  max-width: 820px;
  margin-inline: auto;
}

.hl-title > p:not(.yellow-text) {
  max-width: 680px;
  margin-inline: auto;
  color: var(--color-text-50);
}

.hl-mode-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin: 0 auto var(--margin-base);
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.025);
}

.hl-mode-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: calc(var(--border-radius) - 4px);
  background: transparent;
  color: var(--color-text-50);
  font: inherit;
  font-size: var(--font-xs);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.hl-mode-link:hover,
.hl-mode-link:focus-visible {
  border-color: rgba(0, 255, 132, 0.35);
  background: rgba(0, 255, 132, 0.06);
  color: var(--color-cyan);
}

.hl-mode-link.is-active {
  border-color: var(--color-cyan);
  background: var(--color-cyan);
  color: #06100d;
}

/* Game board */
.card-box {
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: var(--margin-base);
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: calc(var(--border-radius) + 6px);
  background:
    radial-gradient(circle at 15% 0%, rgba(0, 255, 132, 0.07), transparent 32%),
    radial-gradient(circle at 85% 0%, rgba(255, 190, 32, 0.07), transparent 32%),
    rgba(5, 5, 5, 0.34);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

#scoreline {
  display: grid;
  grid-template-columns: max-content max-content minmax(160px, 1fr);
  align-items: stretch;
  gap: 8px;
  margin-bottom: var(--margin-base);
}

.hl-score-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--color-text-50);
  font-size: var(--font-sm);
}

.hl-score-item strong {
  color: var(--color-cyan);
  font-size: var(--font-md);
  font-variant-numeric: tabular-nums;
}

.hl-category-item {
  position: relative;
  justify-content: center;
  text-align: center;
}

.hl-category-item strong {
  overflow: hidden;
  color: var(--color-yellow);
  font-size: var(--font-base);
  text-overflow: ellipsis;
  white-space: nowrap;
}

#current-cat-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 34px 0 12px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--color-yellow);
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-align-last: center;
  cursor: pointer;
  outline: none;
}

.hl-category-item.is-select {
  padding: 0;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.hl-category-item.is-select > strong {
  display: none;
}

.hl-category-item.is-select:hover,
.hl-category-item.is-select:focus-within {
  border-color: var(--color-yellow);
  background: rgba(255, 190, 32, 0.06);
}

#current-cat-select option {
  background: var(--color-surface);
  color: var(--color-text-80);
}

#status {
  margin-bottom: var(--margin-sm);
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  color: var(--color-text-50);
  text-align: center;
}

.cards {
  display: grid;
  grid-template-areas: "card-a choices card-b";
  grid-template-columns: minmax(0, 1fr) 178px minmax(0, 1fr);
  align-items: stretch;
  gap: var(--margin-base);
  min-height: 350px;
}

.hl-contestant-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 350px;
  padding: clamp(18px, 3vw, 34px);
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: calc(var(--border-radius) + 4px);
  text-align: center;
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

#cardA {
  grid-area: card-a;
  background:
    radial-gradient(circle at 50% 24%, rgba(0, 255, 132, 0.12), transparent 44%),
    var(--color-surface);
}

#cardB {
  grid-area: card-b;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 190, 32, 0.12), transparent 44%),
    var(--color-surface);
}

.hl-contestant-card::before {
  position: absolute;
  top: 0;
  right: 12%;
  left: 12%;
  height: 2px;
  border-radius: 0 0 3px 3px;
  background: var(--color-cyan);
  content: "";
  opacity: 0.55;
}

#cardB::before {
  background: var(--color-yellow);
}

.hl-contestant-card img {
  width: clamp(92px, 11vw, 124px);
  height: clamp(92px, 11vw, 124px);
  margin-bottom: var(--margin-sm);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.28));
}

.hl-brawler-name {
  max-width: 100%;
  overflow: hidden;
  color: var(--color-text-80);
  font-size: clamp(var(--font-md), 2.2vw, var(--font-lg));
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hl-has-copy {
  margin-top: 7px;
  color: var(--color-text-30);
  font-size: var(--font-sm);
}

.hl-value {
  margin-top: 2px;
  color: var(--color-yellow);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 850;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

#cardA .hl-value {
  color: var(--color-cyan);
}

.hl-stat-name {
  margin-top: 5px;
  color: var(--color-text-50);
  font-size: var(--font-sm);
}

#cardB.is-correct {
  border-color: rgba(0, 255, 132, 0.65);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 132, 0.12), 0 0 28px rgba(0, 255, 132, 0.1);
}

#cardB.is-wrong {
  border-color: rgba(255, 77, 77, 0.7);
  box-shadow: inset 0 0 0 1px rgba(255, 77, 77, 0.12), 0 0 28px rgba(255, 77, 77, 0.1);
}

.choices {
  grid-area: choices;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.hl-guess-actions {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
  height: 100%;
  width: 100%;
}

.guess-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-surface);
  color: var(--color-text-80);
  font-family: inherit;
  font-size: var(--font-base);
  font-weight: 800;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease,
    transform 160ms ease, opacity 160ms ease;
}

.guess-btn span {
  color: var(--color-cyan);
  font-size: 22px;
  line-height: 1;
}

#lower span {
  color: var(--color-yellow);
}

.guess-btn:hover:not(.is-disabled),
.guess-btn:focus-visible:not(.is-disabled) {
  border-color: var(--color-cyan);
  background: var(--color-cyan);
  color: #050505;
  transform: translateY(-2px);
}

.guess-btn:hover:not(.is-disabled) span,
.guess-btn:focus-visible:not(.is-disabled) span {
  color: #050505;
}

#lower:hover:not(.is-disabled),
#lower:focus-visible:not(.is-disabled) {
  border-color: var(--color-yellow);
  background: var(--color-yellow);
}

.guess-btn.is-disabled {
  cursor: pointer;
  opacity: 0.42;
}

#gameover {
  display: none;
  margin-top: var(--margin-base);
  text-align: center;
}

.gameover-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: clamp(28px, 6vw, 64px);
  border: 1px solid rgba(255, 77, 77, 0.3);
  border-radius: calc(var(--border-radius) + 4px);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 77, 77, 0.1), transparent 48%),
    var(--color-surface);
}

.gameover-box h2 {
  margin-bottom: var(--margin-sm);
  color: #ff6868;
}

.gameover-box p {
  margin-bottom: var(--margin-base);
  color: var(--color-text-50);
  font-size: var(--font-md);
}

.gameover-box strong {
  color: var(--color-yellow);
  font-size: var(--font-xl);
}

.gameover-box button {
  min-height: 46px;
  padding: 10px 22px;
  border: 1px solid var(--color-cyan);
  border-radius: var(--border-radius);
  background: var(--color-cyan);
  color: #050505;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.gameover-box button:hover,
.gameover-box button:focus-visible {
  border-color: var(--color-yellow);
  background: var(--color-yellow);
  transform: translateY(-2px);
}

#cardB.hl-card-reveal {
  animation: hl-card-reveal 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

#valB.hl-reveal-pop {
  animation: hl-reveal-pop 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

#score.hl-score-pop {
  animation: hl-score-pop 320ms cubic-bezier(0.2, 1, 0.3, 1);
}

@keyframes hl-reveal-pop {
  0% { opacity: 0; transform: scale(0.75); }
  70% { opacity: 1; transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes hl-card-reveal {
  0% { transform: translateY(8px); }
  55% { transform: translateY(0); }
  100% { transform: translateY(0); }
}

@keyframes hl-score-pop {
  0% { transform: scale(1); }
  55% { transform: scale(1.35); color: var(--color-yellow); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  #cardB.hl-card-reveal,
  #valB.hl-reveal-pop,
  #score.hl-score-pop {
    animation: none;
    transition: none;
  }
}

@media (max-width: 760px) {
  .hl-mode-links {
    width: min(100%, 430px);
  }

  .hl-mode-link {
    flex: 0 0 calc((100% - 8px) / 3);
    min-width: 0;
    padding-inline: 4px;
    font-size: 10px;
  }

  .card-box {
    padding: 10px;
  }

  #scoreline {
    grid-template-columns: auto auto minmax(0, 1fr);
    margin-bottom: 10px;
  }

  .hl-score-item {
    justify-content: center;
    padding: 6px 8px;
  }

  .hl-category-item {
    min-width: 0;
  }

  .cards {
    grid-template-areas:
      "card-a card-b"
      "choices choices";
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-height: 0;
  }

  .hl-contestant-card {
    min-height: 245px;
    padding: 16px 8px;
  }

  .hl-contestant-card img {
    width: clamp(72px, 22vw, 96px);
    height: clamp(72px, 22vw, 96px);
  }

  .hl-brawler-name {
    font-size: var(--font-base);
  }

  .hl-value {
    font-size: clamp(24px, 8vw, 34px);
  }

  .hl-stat-name,
  .hl-has-copy {
    font-size: var(--font-xs);
  }

  .choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .hl-guess-actions {
    display: contents;
  }

  #higher {
    grid-column: 1;
    grid-row: 1;
  }

  #lower {
    grid-column: 2;
    grid-row: 1;
  }

  .guess-btn {
    min-height: 48px;
  }

}

@media (max-width: 460px) {
  .hl-score-item {
    flex-direction: column;
    gap: 0;
    font-size: var(--font-xs);
  }

  .hl-score-item strong {
    font-size: var(--font-base);
  }

  .hl-category-item strong {
    max-width: 100%;
  }

  #current-cat-select {
    padding-inline: 10px 26px;
    font-size: var(--font-xs);
  }

  .hl-contestant-card {
    min-height: 220px;
  }
}
