/* Shared card reaction controls. */
.reaction-button {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  border: 1px dashed var(--muted, #a993ac);
  border-radius: 50%;
  background: transparent;
  color: var(--ink, #fff);
  cursor: pointer;
  font: 15px/1 system-ui, sans-serif;
  transition: border-color 140ms ease, background 140ms ease;
  touch-action: manipulation;
}

.reaction-button.has-reaction {
  border-color: transparent;
  border-style: solid;
}

.reaction-button:hover,
.reaction-button[aria-expanded="true"] {
  border-color: var(--ink, #fff);
  background: rgb(255 255 255 / 8%);
}

.reaction-button:focus-visible,
.reaction-choice:focus-visible {
  outline: 2px solid #ff9ecc;
  outline-offset: 3px;
}

/* The scratch cover spans the full face at z-index 12. Keep sharing
   reachable without intercepting scratches elsewhere in the header. */
.card.is-scratchable:not(.is-revealed) .card-header {
  z-index: 13;
  pointer-events: none;
}

.card.is-scratchable:not(.is-revealed) .card-actions { pointer-events: auto; }
.card.is-scratchable:not(.is-revealed) .card-labels,
.card.is-scratchable:not(.is-revealed) .copies { visibility: hidden; }

.reaction-picker {
  position: fixed;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 3px;
  width: max-content;
  padding: 6px;
  border: 1px solid rgb(255 199 227 / 24%);
  border-radius: 999px;
  background: #251d2d;
  color: #fff3fb;
  box-shadow: 0 8px 24px rgb(0 0 0 / 40%), 0 2px 5px rgb(0 0 0 / 30%);
  font-family: system-ui, sans-serif;
}

.reaction-picker[hidden] { display: none; }

.reaction-choice {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: 22px/1 system-ui, sans-serif;
  touch-action: manipulation;
}

.reaction-choice:hover,
.reaction-choice[aria-pressed="true"] {
  border-color: rgb(255 170 209 / 55%);
  background: rgb(255 170 209 / 16%);
}

.reaction-choice.is-clear {
  width: 27px;
  color: #c6b4cb;
  font-size: 21px;
}

@media (pointer: coarse) {
  .reaction-picker { gap: 4px; }
  .reaction-choice { width: 42px; height: 42px; }
  .reaction-choice.is-clear { width: 34px; }
}

/* Equal side columns anchor the reaction to the card's geometric center,
   independently of the rarity badges, copy count, share button and card ID. */
.card .card-header.has-reaction-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
  column-gap: 6px;
}
.card .card-header.has-reaction-control .card-labels {
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 2px 4px;
  overflow: hidden;
}
.card .card-header.has-reaction-control .card-actions {
  min-width: 0;
  justify-content: flex-end;
  gap: 5px;
}
.card .card-header.has-reaction-control .share-card { flex: 0 0 24px; }
.card .card-header.has-reaction-control .card-id {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card .card-header.has-reaction-control .reaction-button {
  justify-self: center;
  pointer-events: auto;
}

/* The body-portal picker keeps the card's current lighting while it is open. */
.card.is-reaction-held .card-flipper::before {
  opacity: var(--reaction-glare-opacity, 0) !important;
  transition: none !important;
}
