/*
 * Cascadia score calculator (/tools/cascadia-score-calculator).
 * The score grid, steppers, tabs and ranking come from board-game-scores.css; this file adds
 * the wildlife scoring card picker (A-D letters per animal) and the habitat bonus rule line.
 */

/* ---- Wildlife scoring card picker ---- */
/* Collapsible wrapper: a summary line with the cards in play and a Change / Hide pill. */
.csc-picker {
  border-top: 1px solid #e5ddd2;
  padding-top: 14px;
}
.csc-picker__sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  border-radius: 14px;
}
.csc-picker__sum::-webkit-details-marker {
  display: none;
}
.csc-picker__sum:focus-visible {
  outline: 2px solid #8b5e3c;
  outline-offset: 4px;
}
.csc-picker__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.csc-picker__title {
  font-size: 17px;
  font-weight: 700;
  color: #2e2018;
}
.csc-picker__list {
  font-size: 14px;
  line-height: 1.45;
  color: #7a6a5c;
}
.csc-picker__btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1.5px solid #3b302b;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3b302b;
}
.csc-picker__btn::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.csc-picker[open] .csc-picker__btn::after {
  transform: translateY(2px) rotate(-135deg);
}
.csc-picker__hide,
.csc-picker[open] .csc-picker__change {
  display: none;
}
.csc-picker[open] .csc-picker__hide {
  display: inline;
}
.csc-picker[open] .csc-picker__list {
  display: none;
}
.csc-picker__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
}
.csc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 12px;
}
.csc-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #f7f1e8;
  min-width: 0;
}
.csc-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.csc-card__animal {
  font-size: 16px;
  font-weight: 700;
  color: #2e2018;
}
.csc-card__letters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.csc-letter {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}
.csc-letter input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.csc-letter span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid #ddd5c8;
  border-radius: 50%;
  background: #fffdf9;
  font-size: 16px;
  font-weight: 700;
  color: #7a6a5c;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}
.csc-letter input:checked + span {
  background: #ffb900;
  border-color: #ffb900;
  color: #2e2018;
}
.csc-letter input:focus-visible + span {
  outline: 2px solid #8b5e3c;
  outline-offset: 2px;
}
.csc-card__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #7a6a5c;
}

/* ---- Habitat bonus rule under the group heading ---- */
.csc-rule {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.45;
  color: #7a6a5c;
}

/* ---- Content tables (card reference, bonus rules) ---- */
.csc-ref th[scope='row'] {
  text-align: left;
  padding-left: 0;
  font-weight: 700;
  color: #2e2018;
  white-space: nowrap;
  vertical-align: top;
}
.csc-ref td {
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}

@media (min-width: 900px) {
  .csc-letter span {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .csc-letter span {
    transition: none;
  }
}

/* ---- Expansion switch (Landmarks): label, toggle and what it changes ---- */
.csc-exp {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  max-width: 420px;
}
.csc-exp__label {
  margin-right: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #7a6a5c;
}
.csc-exp__hint {
  flex-basis: 100%;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #7a6a5c;
}
