.deck-tools {
  position: relative;
  margin-bottom: clamp(24px, 3vw, 36px);
}

.deck-back,
.deck-switch summary {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  font: 550 16px/1.2 var(--sans);
}

.deck-back {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  color: var(--gold);
}

.deck-back:hover {
  color: var(--bright);
}

.deck-tools .icon {
  width: 17px;
  height: 17px;
  flex: none;
}

.deck-switch summary {
  width: max-content;
  margin-inline-start: auto;
  padding-inline: 11px;
  border: 1px solid #675635;
  border-radius: 7px;
  color: var(--paper);
  background: #141a26;
  cursor: pointer;
  list-style: none;
}

.deck-switch summary::-webkit-details-marker {
  display: none;
}

.deck-switch summary:hover,
.deck-switch[open] summary {
  color: var(--bright);
  border-color: var(--gold);
}

.deck-switch summary .icon:last-child {
  width: 14px;
  rotate: 90deg;
}

.deck-switch[open] summary .icon:last-child {
  rotate: -90deg;
}

.deck-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  max-height: min(54svh, 430px);
  overflow: auto;
  margin: 12px 0 0;
  padding: 8px;
  color: var(--paper);
  background: #101724;
  border: 1px solid var(--line);
  border-radius: 8px;
  list-style: none;
}

.deck-options a {
  display: flex;
  align-items: center;
  min-height: 44px;
  height: 100%;
  padding: 8px 12px;
  border-radius: 4px;
  line-height: 1.25;
}

.deck-options a:hover,
.deck-options [aria-current="page"] {
  color: var(--bright);
  background: #292521;
}

.deck-options [aria-current="page"] {
  box-shadow: inset 2px 0 var(--gold);
}

@media (max-width: 950px) {
  .deck-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .deck-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 370px) {
  .deck-switch summary .icon:first-child {
    display: none;
  }

  .deck-switch summary {
    padding-inline: 9px;
  }
}
