/*
 * Harmonies score calculator (/tools/harmonies-score-calculator).
 * Extras on top of board-game-scores.css (bg-*): the board side switch, the solo sun rating and
 * the small point tables of the "How scoring works" cards.
 */

/* ---- Segmented radio switch (board side, solo spirit bonus) ---- */
.hm-seg {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.hm-seg__label {
  margin-right: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #7a6a5c;
}
.hm-seg label {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}
.hm-seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.hm-seg input + span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #e5ddd2;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: #7a6a5c;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
.hm-seg input:checked + span {
  background: #3b302b;
  border-color: #3b302b;
  color: #fffdf9;
}
.hm-seg input:focus-visible + span {
  outline: 2px solid #8b5e3c;
  outline-offset: 2px;
}

/* ---- Solo sun rating ---- */
.hm-solo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px;
  border-radius: 18px;
  background: #fbf3df;
  box-shadow: inset 0 0 0 1.5px #ffb900;
}
.hm-solo[hidden],
[data-hm-sb][hidden] {
  display: none !important;
}
.hm-solo__suns {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #2e2018;
}
.hm-sun {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: #ffb900;
  box-shadow: 0 0 0 5px rgba(255, 185, 0, 0.25);
}
.hm-solo__list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 15px;
}
.hm-solo__list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.hm-solo__list dt {
  color: #7a6a5c;
}
.hm-solo__list dd {
  margin: 0;
  font-weight: 700;
  color: #2e2018;
  font-variant-numeric: tabular-nums;
}

/* ---- Small point tables in the cards ---- */
.hm-mini th[scope='row'] {
  font-weight: 500;
  color: #3b302b;
}
.hm-mini td {
  font-weight: 700;
  white-space: nowrap;
}
.hm-suns th,
.hm-suns td {
  padding: 8px 6px;
  text-align: center;
}
.hm-suns th[scope='row'] {
  text-align: left;
  font-weight: 600;
  color: #2e2018;
}

/* Hints of the grid wrap more on Harmonies (rule reminders), keep them readable. */
.hm-grid .bg-cat__hint {
  max-width: 34ch;
}

@media (prefers-reduced-motion: reduce) {
  .hm-seg input + span {
    transition: none;
  }
}

/* ---- Setup row: board side and Nature's Spirit with their labels and a hint line ---- */
.hm-setup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  max-width: 640px;
}
.hm-setup__hint {
  flex-basis: 100%;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #7a6a5c;
}
/* Phones: each label on its own line, so both board sides fit on one row under it. */
@media (max-width: 520px) {
  .hm-setup .hm-seg__label {
    flex-basis: 100%;
  }
}
