/* Readable card text and a single, size-independent cost component. */
:root { --reading-font: 'M PLUS Rounded 1c', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif; }
.modal { font-family: var(--reading-font); }
.modal h2, .modal h3, .modal .btn { font-family: var(--reading-font); font-weight: 700; }
.modal-body p { font-family: var(--reading-font); }
.game-card { font-family: var(--reading-font); color: #273b40; }
.game-card .card-title strong { font-size: 16px; line-height: 1.45; color: #243b40; }
.game-card .card-title small { font-size: 10px; letter-spacing: .03em; color: #44534b; }
.game-card .card-title { min-height: 51px; height: auto; padding: 6px 0; }
.game-card .card-region { color: #125265; }
.game-card .card-place { font-size: 11px; color: #355256; }
.game-card .card-place > span { font-size: 10px; color: #274a4e; }
.game-card .card-edition { font-size: 11px; color: #574320; }
.rarity-rare .game-card .card-edition { color: #284d62; }
.game-card p.card-fact {
  display: block; -webkit-line-clamp: unset; overflow: visible;
  height: auto; min-height: 0; margin: 8px 0;
  padding: 9px 10px; border: 1px solid #c5b78f; border-radius: 5px;
  background: #fff9e8; color: #243c43;
  font-size: 14px; line-height: 1.8; font-weight: 700; text-align: left;
  word-break: normal; overflow-wrap: anywhere;
  text-shadow: none; letter-spacing: .01em;
}
.game-card .card-effect { font-size: 12px; line-height: 1.6; color: #1e4657; background: #f7fbf7; }
.game-card .card-stats span { font-size: 10px; line-height: 1.2; }
.game-card .card-stats > div { grid-template-rows: 15px 32px; }
.game-card .card-stats b { font-family: Arial, sans-serif; font-weight: 800; font-variant-numeric: tabular-nums; }
.game-card.large .card-title strong { font-size: 21px; }
.game-card.large .card-title small { font-size: 11px; }
.game-card.large p.card-fact { font-size: 15px; line-height: 1.8; padding: 10px 12px; }
.game-card.large .card-stats > div { grid-template-rows: 17px 36px; }
.game-card.large .card-stats span { font-size: 11px; }
.game-card.large .card-stats b { font-size: 36px; }
.game-card.large .card-region { font-size: 18px; }
.game-card.large .card-place { font-size: 12px; }
.game-card.large .card-place > span { font-size: 11px; }
.encounter-layout { grid-template-columns: minmax(0,310px) minmax(0,1fr); }
.encounter-layout > .card-wrap, .detail-layout > .card-wrap { width: min(100%,310px); }

/* One square defines both the jewel and the numeral; no inherited SVG sizing. */
.cost-badge {
  --badge-size: 56px;
  position: absolute; top: -15px; left: -17px; z-index: 7;
  width: var(--badge-size); height: var(--badge-size);
  display: grid; place-items: center; isolation: isolate;
  pointer-events: none; transform: none;
}
.cost-badge::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  /* Keep the white cost legible while the decorative jewel loads or if it is unavailable. */
  background: url("./assets/energy-medallion-v2.png") center / contain no-repeat,
    radial-gradient(circle closest-side, #07536a 80%, #dda955 82% 88%, transparent 90%);
  filter: drop-shadow(0 2px 2px #142e3b55);
}
.cost-badge > b {
  position: static; display: block; margin: 0; padding: 0; transform: none;
  color: #fffdf2; font-family: Arial, Helvetica, sans-serif;
  font-weight: 800; font-size: calc(var(--badge-size) * .5); line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: 0; text-indent: 0;
  text-align: center; text-shadow: 0 1px 2px #002f41;
}
.large .cost-badge { --badge-size: 66px; top: -18px; left: -20px; }
.hand .cost-badge { --badge-size: 46px; top: -12px; left: -13px; }
.hand .game-card p.card-fact { display: none; }
.hand .game-card .card-title { min-height: 0; height: 35px; padding: 0; }
.hand .game-card .card-title strong { font-size: 13px; }
.hand .game-card .card-title small { font-size: 8px; }
.hand .game-card .card-place, .hand .game-card .card-place > span { font-size: 8px; }
.hand .game-card .card-edition { font-size: 8px; }
.hand .game-card .card-effect { font-size: 10px; line-height: 1.45; }
.hand .game-card .card-stats > div { grid-template-rows: 12px 26px; }
.hand .game-card .card-stats span { font-size: 9px; }

@media (max-width: 760px) {
  .modal > header { padding: 15px 17px; }
  .modal h2 { font-size: 19px; line-height: 1.5; }
  .modal-body, .modal-encounter .modal-body { padding: 24px 18px 20px; }
  .encounter-layout { gap: 24px; }
  .encounter-layout > .card-wrap, .detail-layout > .card-wrap { width: min(100%,310px); }
  .encounter-layout h3 { font-size: 20px; line-height: 1.6; }
  .encounter-layout > div > p, .detail-layout > div > p { font-size: 16px; line-height: 1.85; }
  .encounter-layout .btn { font-size: 15px; line-height: 1.6; }
  .game-card.large { padding: 8px; }
  .large .cost-badge { --badge-size: 64px; top: -17px; left: -18px; }
  .game-card.large .card-title { padding: 7px 0; min-height: 59px; }
  .game-card.large .card-art { height: auto; aspect-ratio: 4 / 3; }
  .catalog-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px 14px; }
  .catalog-grid .game-card .card-title strong, .reward-cards .game-card .card-title strong { font-size: 13px; }
  .catalog-grid .game-card p.card-fact, .reward-cards .game-card p.card-fact { font-size: 12px; padding: 7px; line-height: 1.75; }
  .catalog-grid .cost-badge, .reward-cards .cost-badge { --badge-size: 45px; top: -12px; left: -13px; }
}
@media(min-width:761px) and (max-height:800px) {
  .hand .game-card .card-title { height: 28px; }
}

.game-card:hover:not(:disabled) { border-color: var(--frame); }

/* Stat labels use the full tile width, including on two-column phone lists. */
.game-card .card-stats span { grid-column: 1 / -1; grid-row: 1; white-space: nowrap; }
.game-card .card-stats .icon { grid-column: 1; grid-row: 2; }
.game-card .card-stats b { grid-column: 2; grid-row: 2; }
