@charset "UTF-8";
/* Illustrated card layer. Load after game-ui.css; game state remains in app.mjs. */

/* A paper frame, with separate areas for identity, illustration and rules. */
.playing-card,
.playing-card[data-zone],
.hand-dock .playing-card {
  --card-width: 196px;
  --card-art-height: 100px;
  width: var(--card-width);
  min-width: var(--card-width);
  min-height: 326px;
  padding: 10px;
  gap: 0;
  border: 1px solid #a7a486;
  border-radius: 9px;
  background: linear-gradient(120deg, #fff9e8, #ede4cd);
  color: #253326;
  box-shadow: 0 3px 0 #0c170e, 0 7px 15px #0004, inset 0 0 0 3px #faf2dc;
  text-align: left;
  font-weight: 400;
  overflow: hidden;
}
.playing-card > .card-top {
  position: relative;
  display: block;
  min-height: 14px;
  margin: 0 0 2px;
  padding-right: 36px;
  color: #626952;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .06em;
}
.playing-card .card-top .cost {
  position: absolute;
  right: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  border: 1px solid #627d48;
  border-radius: 50%;
  color: #fff1c7;
  background: #294831;
  box-shadow: 0 1px 0 #d4c18b, inset 0 1px 0 #dce3b329;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.playing-card > strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 0 0 8px;
  padding-right: 34px;
  color: #233728;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -.035em;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.playing-card .card-art,
.library-grid .playing-card .card-art {
  position: relative;
  display: block;
  flex: 0 0 var(--card-art-height);
  height: var(--card-art-height);
  min-height: var(--card-art-height);
  margin: 0 0 8px;
  padding: 0;
  border: 1px solid #7c806452;
  border-radius: 4px;
  background: #e8e3d1;
  overflow: hidden;
}
.playing-card .card-art::before,
.playing-card .card-art::after { content: none; }
.card-art > img.card-illustration {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
}
.playing-card .card-art > .card-symbol {
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 2.5rem;
}
.playing-card .card-effect,
.library-grid .playing-card .card-effect {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  min-height: 3em;
  max-height: 6em;
  margin: 0 0 8px;
  padding: 0;
  color: #283b2a;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -.02em;
  text-align: left;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: keep-all;
}
.effect-line { display: block; }
.playing-card .effect-line { margin: 0; }
.effect-keyword {
  color: #65471f;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: #b59d6473;
  text-underline-offset: 2px;
}
.effect-resource {
  padding: 0 2px;
  border-radius: 2px;
  color: #314b2a;
  background: #d7dfbd;
  font-weight: 750;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.playing-card > .card-sub {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid #b4b294;
  color: #515f43;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.015em;
}
.playing-card > .markers {
  margin-top: 5px;
  color: #566348;
  font-size: 11px;
  line-height: 1.4;
}
.playing-card .card-status {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  width: fit-content;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid #7e9667;
  border-radius: 3px;
  background: #e5ebd4;
  color: #3e5732;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}
.playing-card > .card-status { margin-top: 6px; }
.playing-card .card-hint {
  min-height: 23px;
  margin-top: 6px;
  padding: 4px 6px;
  border: 1px solid #507548;
  border-radius: 3px;
  background: #365a37;
  color: #fff5d7;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0;
}
.playing-card .card-hint.locked {
  padding: 4px 5px;
  border: 1px dashed #9b9473;
  background: #e7dfc8;
  color: #655b3e;
  font-size: 10.5px;
  line-height: 1.35;
}

/* Keep rules readable even when a card cannot be used. */
.playing-card.playable {
  border-color: #d2de93;
  background: linear-gradient(120deg, #fffbea, #f0e8cd);
  box-shadow: 0 0 0 1px #a5c16d, 0 0 15px #a5c16d20, 0 3px 0 #0c170e, inset 0 0 0 3px #faf2dc;
}
.playing-card.blocked { opacity: 1; border-color: #9e9e80; }
.playing-card.exhausted {
  opacity: 1;
  border: 1px dashed #868e71;
  background: linear-gradient(120deg, #e6e4d0, #d4d8bd);
  box-shadow: 0 2px 0 #0c170e, 0 5px 10px #0003, inset 0 0 0 3px #e0e3cb;
}
.playing-card.exhausted .card-art { filter: saturate(.4); }
.playing-card.exhausted .card-status {
  border-color: #8c8d6a;
  background: #d4d3b8;
  color: #5e5d3e;
}
.playing-card.exhausted .markers { color: #505e43; }
.playing-card:focus-visible {
  outline: 3px solid #ffce75;
  outline-offset: 4px;
  box-shadow: 0 0 0 1px #554221, 0 4px 0 #0c170e, inset 0 0 0 3px #faf2dc;
}
.playing-card:active,
.playing-card.is-tapped {
  transform: translateY(2px) scale(.99);
  box-shadow: 0 1px 0 #0c170e, inset 0 0 0 3px #faf2dc;
}
.card-row {
  align-items: stretch;
  gap: 12px;
  padding-inline: 5px;
  scroll-padding-inline: 5px;
}
.hand-dock .card-row { padding-top: 8px; padding-bottom: 14px; }
.hand-dock .action-dock {
  position: relative;
  inset: auto;
  margin-top: 3px;
  box-shadow: 0 -1px 0 #687a4e30;
}

/* Installed cards still expose their art and rule text. */
.card-zone[data-zone=board] .playing-card,
.card-zone[data-zone^=enemy-board] .playing-card,
.card-row .playing-card[data-zone=board] {
  --card-width: 180px;
  --card-art-height: 72px;
  width: var(--card-width);
  min-width: var(--card-width);
  min-height: 282px;
  padding: 9px;
}
.card-zone[data-zone=board] .playing-card .card-art,
.card-zone[data-zone^=enemy-board] .playing-card .card-art,
.playing-card[data-zone=board] .card-art {
  height: var(--card-art-height);
  min-height: var(--card-art-height);
  flex-basis: var(--card-art-height);
  margin-bottom: 7px;
}
.card-zone[data-zone=board] .playing-card .card-effect,
.card-zone[data-zone^=enemy-board] .playing-card .card-effect,
.playing-card[data-zone=board] .card-effect {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  min-height: 3em;
  max-height: 4.5em;
  margin-bottom: 7px;
  color: #283b2a;
  font-size: 13px;
  line-height: 1.5;
}
.card-zone[data-zone=board] .playing-card > strong,
.card-zone[data-zone^=enemy-board] .playing-card > strong,
.playing-card[data-zone=board] > strong { font-size: 14px; margin: 0 0 7px; }
.card-zone[data-zone=board] .playing-card .cost,
.card-zone[data-zone^=enemy-board] .playing-card .cost,
.playing-card[data-zone=board] .cost {
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 15px;
}

/* Archive cards use the same readable paper face. */
.library-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px 16px; }
.library-grid .playing-card {
  --card-art-height: 108px;
  width: 100%;
  min-width: 0;
  min-height: 316px;
}
.library-grid .playing-card .card-effect { min-height: 4.5em; }
.journal-content .card-row > div { flex: 0 0 auto; }

/* The full card: illustration beside a properly typeset rules sheet. */
#card-dialog.card-detail-dialog {
  width: min(94vw, 820px);
  max-height: 90dvh;
  padding: 24px;
  background: linear-gradient(125deg, #f8f1de, #e9dfc5);
}
#card-dialog.card-detail-dialog > h2 { padding-right: 64px; font-size: 1.75rem; margin: 10px 0 20px; }
.card-detail-layout {
  clear: both;
  display: grid;
  grid-template-columns: minmax(210px, .8fr) minmax(0, 1.15fr);
  align-items: start;
  gap: 24px;
}
.card-detail-visual {
  position: sticky;
  top: 0;
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid #acaa8b;
  border-radius: 7px;
  background: #f3ecd9;
  box-shadow: 0 3px 0 #a4a080, 0 8px 20px #4c473d1f;
}
.card-detail-visual img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 380px;
  border-radius: 3px;
  object-fit: contain;
  background: #e9e5d6;
}
.card-detail-visual .caption { margin: 8px 1px 0; color: #70705a; font-size: 11px; line-height: 1.5; }
.card-detail-body { min-width: 0; color: #2b3b29; }
.card-detail-body .dialog-meta { margin: 0 0 15px; gap: 12px; }
.card-detail-body .dialog-cost { width: 52px; height: 52px; flex-basis: 52px; }
.card-detail-body .dialog-tags .badge { font-size: 11px; padding: 4px 7px; }
#card-dialog.card-detail-dialog .effect {
  display: block;
  min-height: 0;
  max-height: none;
  margin: 0 0 17px;
  padding: 14px 0 0;
  border-top: 1px solid #bbb28d;
  color: #253c28;
  font-size: 15px;
  line-height: 1.8;
  letter-spacing: -.015em;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: keep-all;
}
.card-detail-body .effect-line + .effect-line { margin-top: 9px; }
.card-detail-body .effect-resource { padding: 1px 3px; background: #dce5c4; }
.card-detail-body .effect-keyword { color: #68491e; text-decoration-color: #ad975b; }
.card-detail-body .caption,
.card-detail-body .dialog-note { color: #5b684c; font-size: 12px; line-height: 1.7; }
.card-detail-body .card-flavor,
.card-detail-body .flavor { padding-left: 11px; border-left: 2px solid #ada475; color: #696650; font-size: 13px; line-height: 1.75; }
.card-detail-body .card-status {
  display: inline-flex;
  margin: 0 0 5px;
  padding: 3px 8px;
  border: 1px solid #89965f;
  border-radius: 3px;
  color: #425b35;
  background: #e1e9cc;
  font-size: 12px;
  font-weight: 700;
}
.card-detail-body .dialog-actions { position: static; margin-top: 18px; padding-top: 16px; border-color: #b6af87; gap: 10px; }
.card-detail-body .dialog-actions button { min-height: 48px; padding: 12px 15px; font-size: 14px; }
.card-detail-body .dialog-action .caption { margin: 6px 0 0; font-size: 12px; }

@media (hover: hover) and (pointer: fine) {
  .playing-card:not(:disabled):hover,
  .library-grid .playing-card:hover {
    background: linear-gradient(120deg, #fffcec, #f3e9d1);
    color: #253326;
    border-color: #dacda1;
    transform: translateY(-3px);
    box-shadow: 0 6px 0 #0c170e, 0 12px 20px #0004, inset 0 0 0 3px #fff8e5;
  }
  .playing-card.playable:hover { border-color: #d7e9a6; box-shadow: 0 0 0 1px #b5cc83, 0 0 18px #a5c16d33, 0 6px 0 #0c170e, inset 0 0 0 3px #fff8e5; }
  .playing-card.exhausted:hover { background: linear-gradient(120deg, #edead7, #dfe3ca); border-color: #9ca582; }
}
@media (max-width: 760px) {
  #card-dialog.card-detail-dialog { width: min(94vw, 610px); padding: 21px; }
  .card-detail-layout { grid-template-columns: minmax(160px, .72fr) minmax(0, 1fr); gap: 18px; }
  .card-detail-visual { padding: 6px; }
  .card-detail-body .dialog-tags { gap: 4px; }
}
@media (max-width: 600px) {
  .playing-card,
  .playing-card[data-zone],
  .hand-dock .playing-card {
    --card-width: 172px;
    --card-art-height: 94px;
    width: var(--card-width);
    min-width: var(--card-width);
    min-height: 318px;
    padding: 9px;
  }
  .playing-card > strong { font-size: 14px; line-height: 1.4; margin-bottom: 7px; padding-right: 32px; }
  .playing-card .card-top .cost { width: 28px; height: 28px; min-width: 28px; font-size: 15px; }
  .playing-card .card-art { height: var(--card-art-height); min-height: var(--card-art-height); margin-bottom: 7px; }
  .playing-card .card-effect,
  .library-grid .playing-card .card-effect { font-size: 13px; line-height: 1.5; margin-bottom: 7px; }
  .playing-card > .card-sub { font-size: 10.5px; padding-top: 5px; }
  .playing-card > .markers { font-size: 10.5px; }
  .playing-card .card-hint { font-size: 11px; min-height: 23px; }
  .playing-card .card-hint.locked { font-size: 10.5px; }
  .playing-card .card-status { font-size: 10.5px; }
  .card-row { gap: 10px; }
  .card-zone[data-zone=board] .playing-card,
  .card-zone[data-zone^=enemy-board] .playing-card,
  .card-row .playing-card[data-zone=board] {
    --card-width: 164px;
    --card-art-height: 70px;
    width: var(--card-width);
    min-width: var(--card-width);
    min-height: 278px;
    padding: 8px;
  }
  .card-zone[data-zone=board] .playing-card > strong,
  .card-zone[data-zone^=enemy-board] .playing-card > strong,
  .playing-card[data-zone=board] > strong { font-size: 13px; }
  .card-zone[data-zone=board] .playing-card .cost,
  .card-zone[data-zone^=enemy-board] .playing-card .cost,
  .playing-card[data-zone=board] .cost { width: 26px; height: 26px; min-width: 26px; font-size: 14px; }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .library-grid .playing-card { --card-art-height: 94px; width: 100%; min-width: 0; min-height: 310px; }
  .library-grid .playing-card .card-effect { min-height: 4.5em; }
  .hand-dock .action-dock { position: relative; bottom: auto; }
  #card-dialog.card-detail-dialog { width: calc(100vw - 24px); max-height: 90dvh; padding: 18px; }
  #card-dialog.card-detail-dialog > h2 { font-size: 1.45rem; margin-bottom: 15px; }
  .card-detail-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .card-detail-visual { position: static; width: 100%; padding: 5px; box-shadow: 0 2px 0 #a4a080; }
  .card-detail-visual img { width: 100%; height: 145px; max-height: 145px; object-fit: contain; }
  .card-detail-visual .caption { font-size: 10.5px; margin-top: 5px; }
  .card-detail-body .dialog-meta { margin-bottom: 12px; }
  .card-detail-body .dialog-cost { width: 46px; height: 46px; flex-basis: 46px; }
  #card-dialog.card-detail-dialog .effect { font-size: 14px; line-height: 1.8; margin-bottom: 14px; padding-top: 12px; }
  .card-detail-body .effect-line + .effect-line { margin-top: 8px; }
  .card-detail-body .dialog-actions { margin-top: 14px; padding-top: 14px; }
  .card-detail-body .dialog-actions button { min-height: 48px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .playing-card:not(:disabled):hover,
  .library-grid .playing-card:hover,
  .playing-card:active,
  .playing-card.is-tapped { transform: none; }
}
