/* One printed stock for the hand, kiosk, stage and full-size reading copy. */
.playing-card {
  --stock: #f2e9d6;
  --print-ink: #242e29;
  --face-art-aspect: 220 / 112;
  color: var(--print-ink);
  background: var(--stock);
  border: 1px solid #b9aa89;
  border-radius: 5px;
  box-shadow: 0 1px 0 #fff4dd inset, 1px 3px 2px #32202060, 2px 8px 12px #201a2461;
}
.playing-card .card-top {
  background: var(--district);
  color: #14211b;
  padding-inline: 8px;
  font: 600 9px/1.15 system-ui,sans-serif;
  letter-spacing: .065em;
  text-transform: uppercase;
}
.playing-card .card-top .card-markers { color: inherit; }
.playing-card .card-art { overflow: hidden; }
.playing-card .card-art::before,
.playing-card .card-art::after { content: none; }
.print-window {
  position: absolute;
  inset: 0;
  overflow: hidden;
  container-type: size;
  background: color-mix(in srgb, var(--district) 7%, #202923);
  pointer-events: none;
}
.print-window > img {
  position: absolute;
  /* Fill the entire art window while panning toward the subject. */
  --cover-width: max(100cqw, calc(100cqh * var(--print-aspect)));
  --subject-limit: min(calc(100cqw / var(--subject-width)), calc(100cqh * var(--print-aspect) / var(--subject-height)));
  --print-width: var(--cover-width);
  --print-height: calc(var(--print-width) / var(--print-aspect));
  width: var(--print-width);
  height: var(--print-height);
  /* Center the subject, then stop panning at the edge of the original print. */
  --travel-x: calc(100cqw - var(--print-width));
  --travel-y: calc(100cqh - var(--print-height));
  left: clamp(min(0px, var(--travel-x)), calc(50cqw - var(--print-width) * var(--subject-x)), max(0px, var(--travel-x)));
  top: clamp(min(0px, var(--travel-y)), calc(50cqh - var(--print-height) * var(--subject-y)), max(0px, var(--travel-y)));
}
.print-closeup > img {
  --print-width: min(var(--subject-limit), max(var(--cover-width), calc(.85 * var(--subject-limit))));
}
.playing-card .card-art > svg[data-scene],
.game-v2 .hand-card-wrap .card-art > svg[data-scene] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: none;
}
.playing-card .card-body {
  background: linear-gradient(115deg, #f8f1df 5%, var(--stock) 60%, #e8ddc7);
  color: var(--print-ink);
}
.playing-card .card-body h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.08;
  text-wrap: balance;
  overflow-wrap: anywhere;
  color: #192a25;
}
.playing-card .card-rules, .playing-card .card-body .card-rules {
  color: #28362f;
  font-family: system-ui,sans-serif;
}
.playing-card .card-price {
  z-index: 3;
  top: 22px;
  right: 5px;
  border-color: #b39b64;
  background: #efdfb8;
  color: #34372b;
  text-shadow: none;
  box-shadow: 0 1px 2px #1e261e66;
}
.playing-card .card-number {
  z-index: 1;
  padding-inline: 2px;
  background: #28352e;
  color: #fff3d6;
  font-variant-numeric: tabular-nums;
}
.playing-card .card-bottom {
  color: #494b3c;
  font-weight: 600;
  letter-spacing: .035em;
}
:is(.raised-card-preview,.card-inspector,.choice-card,.catalog-grid) .card-body h3 {
  font-size: clamp(16px,1.25vw,21px);
}
#catalog-grid .playing-card {
  width: 100%;
  min-width: 0;
  min-height: 248px;
  aspect-ratio: 5 / 7;
  align-self: start;
  contain: size;
}
#catalog-grid .card-rules {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#catalog-grid :is(h3,.card-bottom,.card-keywords) { flex: none; }
#catalog-grid .card-art,
:is(.raised-card-preview,.relic-gallery-grid) .playing-card .card-art {
  flex: none;
  height: auto;
  min-height: 0;
  aspect-ratio: var(--face-art-aspect);
}

/* Read at native type size. Independent shifts leave both sides of the fan reachable. */
.game-v2 .hand { position: relative; --face-growth: 0px; }
.game-v2 .hand-card-wrap { translate: var(--fan-shift, 0px) 0; }
.game-v2 .hand.is-spread .hand-card-wrap {
  z-index: var(--spread-order);
  transform: translateY(calc(var(--fan-rise) * .45)) rotate(calc(var(--fan-angle) * .3));
}
.game-v2 .hand.is-spread .hand-card-wrap.is-reading { z-index: 55; transform: none; }
@media (min-width: 601px) {
  .game-v2 .hand { --face-growth: 32px; }
  .game-v2 .hand-card-wrap.is-reading .hand-playing-card {
    position: absolute;
    bottom: 0;
    left: 0;
    width: calc(100% + var(--face-growth));
    height: calc(100% + var(--face-growth));
    min-height: 0;
  }
  .game-v2 .hand-card-wrap.is-reading .card-body {
    flex: 1 1 auto;
    gap: 5px;
    padding: 8px 10px;
  }
  .game-v2 .hand-card-wrap.is-reading .card-body h3 {
    font-size: 16px;
  }
  .game-v2 .hand-card-wrap.is-reading .card-rules {
    display: block;
    font-size: 13px;
    line-height: 1.34;
  }
  .game-v2 .hand-card-wrap.is-reading .hand-card-key {
    opacity: 0;
  }
}
.game-v2:has(.selection-buttons) .hand { --face-growth: 0px; }
.shop-reading-copy { width: min(240px, calc(100vw - 16px)); }
.shop-reading-copy .playing-card {
  width: 100%;
  min-height: min(336px, calc(100dvh - 16px));
  max-height: calc(100dvh - 16px);
}
.last-play-rest {
  grid-column: 3;
  grid-row: 2;
  align-self: center;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  width: 100%;
  max-width: 184px;
  max-height: 100%;
  min-height: 0;
  min-width: 0;
  margin: 0;
}
.last-play-rest figcaption {
  color: #ddd2b9;
  font: 600 11px/1.15 system-ui,sans-serif;
  text-align: center;
}
.last-play-rest .resting-card {
  min-width: 0;
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.last-play-rest .playing-card {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  max-height: 100%;
}
.last-play-rest .card-top { flex: none; }
.last-play-rest .card-art { min-height: 0; height: auto; flex: 0 1 48px; }
.last-play-rest .card-body { flex: 1 0 auto; gap: 2px; padding: 7px 8px 8px; }
.last-play-rest .card-rules { font-size: 12px; line-height: 1.3; }
.last-play-rest .card-body h3 { font-size: 15px; }
.last-play-rest :is(.card-number,.card-price,.card-bottom,.card-keywords) { display: none; }
@media (max-width: 600px) {
  .last-play-rest { gap: 3px; max-width: 110px; }
  .last-play-rest figcaption { font-size: 10px; }
  .last-play-rest .card-top { height: 12px; min-height: 12px; flex-basis: 12px; font-size: 7px; padding-inline: 3px; }
  .last-play-rest .card-art { flex: 0 0 auto; height: auto; aspect-ratio: 2.5; }
  .last-play-rest .card-body { padding: 4px; }
  .last-play-rest .card-body h3 { font-size: 11px; }
  .last-play-rest .card-rules { display: none; }
  .battlefield:has(.latest-play.is-empty) .last-play-rest { max-width: 145px; }
  .battlefield:has(.latest-play.is-empty) .last-play-rest .card-rules {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.3;
  }
}

/* Table copies share an excerpt. The inspector and choices show the whole rule. */
.game-v2 :is(.hand-card-wrap,.arena-card-wrap,.last-play-rest,.relic-face) .card-continuation { display: none; }
.game-v2 :is(.hand-card-wrap,.arena-card-wrap,.last-play-rest,.relic-face) .card-rules:has(.card-continuation)::after { content: ' …'; }
.game-v2 :is(.arena-card-wrap,.last-play-rest) { overflow: hidden; }
.game-v2 .last-play-rest .resting-card { overflow: hidden; }
.game-v2 .last-play-rest .card-body { flex: 1 1 auto; overflow: hidden; }
.game-v2 .hand-playing-card .card-body { overflow: hidden; }
/* Fit the printed face to both dimensions of its table slot. */
.game-v2 .latest-play:not(.is-empty) .arena-card-wrap,
.game-v2 .battlefield > .last-play-rest {
  container-type: size;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  justify-content: center;
  align-items: center;
}
.game-v2 .latest-play:not(.is-empty) .arena-card-wrap { display: flex; }
.game-v2 .arena-card-wrap .playing-card,
.game-v2 .last-play-rest .resting-card {
  width: min(100cqw, 71.4cqh, 158px);
  height: auto;
  min-height: 0;
  max-height: 100%;
  aspect-ratio: 5 / 7;
}
.game-v2 .last-play-rest .resting-card { flex: none; width: min(100cqw, calc(71.4cqh - 24px), 156px); }
.game-v2 .last-play-rest .playing-card { height: 100%; }
.game-v2 :is(.arena-card-wrap,.last-play-rest) .playing-card { container-type: inline-size; display: flex; flex-direction: column; }
.game-v2 :is(.arena-card-wrap,.last-play-rest) .card-art {
  display: grid;
  height: auto;
  min-height: 0;
  flex: 0 0 24%;
}
.game-v2 :is(.arena-card-wrap,.last-play-rest) .card-body { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.game-v2 :is(.arena-card-wrap,.last-play-rest) .card-body h3 { font-size: clamp(11px, 10cqw, 15px); }
.game-v2 :is(.arena-card-wrap,.last-play-rest) .card-body .card-rules { font-size: clamp(10px, 8.3cqw, 12px); overflow: hidden; }
@media (min-width: 1171px) and (max-height: 800px) {
  .game-v2 .arena-action-area .play-preview { display: flex; gap: 4px 8px; }
  .game-v2 .arena-action-area .preview-badge b { font-size: 16px; }
}
