.peaks-game { --columns: 7; --board-rows: 7; }
.peaks-game[data-game="tripeaks"] { --columns: 10; --board-rows: 4; }
.peaks-game .top { padding-block: 2px; }
.peaks-game main { max-width: 1040px; }
.peaks-game .table {
  --step: min(72px, calc((100vw - 46px) / var(--columns)));
  --card-width: calc(var(--step) - 3px);
  --card-height: calc(var(--card-width) * 1.32);
  --row-step: clamp(24px, 4.5vw, 49px);
  --board-height: calc((var(--board-rows) - 1) * var(--row-step) + var(--card-height));
  padding: clamp(7px, 2vw, 26px);
  border: 2px solid #bb9657;
  border-radius: 20px;
  background: radial-gradient(ellipse at 50% 28%, #185842, #0c392b 80%);
}
.peaks-board {
  position: relative;
  width: calc(var(--step) * var(--columns));
  height: var(--board-height);
  margin-inline: auto;
}
.peak-card {
  display: inline-flex;
  align-items: center;
  flex-direction: column;
  justify-content: flex-start;
  width: var(--card-width);
  height: var(--card-height);
  border: 1px solid #d7c7a3;
  border-radius: clamp(4px, 1vw, 8px);
  background: #fcf5e5;
  color: var(--rank-ink);
  padding: 3px 0;
  font: 760 clamp(13px, 3.25vw, 22px)/1 system-ui, sans-serif;
  box-shadow: 0 2px 4px #042419a0;
  touch-action: manipulation;
}
.peaks-board .peak-card {
  position: absolute;
  left: calc(var(--col) * var(--step));
  top: calc(var(--row) * var(--row-step));
}
.peak-card[data-red] { color: var(--rank-red); }
.peak-card[data-covered]:not([data-back]) { background: #ced7c3; }
.peak-card[data-covered] { pointer-events: none; }
.peak-card[data-back] {
  background: repeating-linear-gradient(135deg, #184735 0 3px, #2b5848 3px 4px);
  color: var(--gold);
}
button.peak-card:not(:disabled) { cursor: pointer; }
.peak-card[aria-pressed="true"] { outline: 3px solid var(--gold); outline-offset: 1px; z-index: 1; }
.peak-card:focus-visible { outline-offset: 1px; z-index: 1; }
.peak-pip { margin-block-start: clamp(2px, .8vw, 8px); font-size: 1.1em; }
.peaks-piles {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 14px;
  margin-block-start: 10px;
}
.peaks-piles > div { min-width: var(--card-width); text-align: center; }
.peaks-piles p { margin: 0 0 4px; color: var(--room-soft); font-size: 12px; font-weight: 700; }
.peaks-piles #progress { align-self: center; margin: 0; }
.peaks-piles #draw { justify-content: center; }
.peaks-piles #draw:disabled { opacity: .65; }
#waste:empty { height: var(--card-height); border: 1px dashed #81a88e; border-radius: 5px; }
.peaks-game #status { margin: 8px 0; text-align: center; font-size: 13px; }
.peaks-game .actions { justify-content: center; }
.peaks-game .actions button {
  min-height: 38px;
  border-color: #85a892;
  background: #123e30;
  color: var(--room-ink);
}
.peaks-game #new-deal { color: #241c0e; background: var(--gold); border-color: var(--gold); }
.peaks-game .rules-guide { margin: 12px auto 0; max-width: 600px; font-size: 13px; color: var(--room-soft); }
.peaks-game .rules-guide summary { cursor: pointer; }
@media (max-width: 480px) {
  .peaks-game .game-title { gap: 7px; }
  .peaks-game .game-title .brand { font-size: 13px; }
  .peaks-game .game-title .brand img { display: none; }
  .peaks-game .game-title h1 { padding-inline-start: 7px; font-size: 17px; }
  .peaks-game #back { font-size: 12px; }
}
@media (max-height: 470px) and (orientation: landscape) {
  .peaks-game .top { min-height: 38px; }
  .peaks-game .top a { min-height: 38px; }
  .peaks-game main { padding-block-start: 5px; }
  .peaks-game .table {
    --step: min(48px, calc((100vw - 50px) / var(--columns)));
    --row-step: clamp(19px, 7vh, 28px);
    padding-block: 8px;
    display: grid;
    grid-template-columns: 1fr max-content;
    align-items: center;
    gap: 5px;
  }
  .peaks-piles { margin: 0; flex-wrap: wrap; gap: 7px; }
  .peaks-piles #progress { flex-basis: 100%; text-align: center; }
  .peaks-game #status, .peaks-game .actions { grid-column: 1 / -1; margin: 0; }
}
@media (max-height: 380px) and (orientation: landscape) {
  .peaks-game .table { --step: min(38px, calc((100vw - 105px) / var(--columns))); }
}
.peaks-game .table[data-won] { display: block; padding-block: clamp(30px, 8vh, 68px); }
.peaks-game .table[data-won] :is(.peaks-board,.peaks-piles) { display: none; }
.peaks-game .table[data-won] #status {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: clamp(17px, 3vw, 26px);
  font-weight: 750;
}
