/* cards.css — card faces, character stats, states, preview */

.card {
  position: relative;
  border-radius: var(--card-radius);
  flex: 0 0 auto;
  user-select: none;
}
.card.face {
  border: 1px solid rgba(233, 196, 106, 0.5);   /* thin gold edge to separate cards */
}
.card.face img {
  display: block; width: 100%; height: 100%;
  border-radius: calc(var(--card-radius) - 1px); object-fit: cover;
}

/* Hand cards (portrait) */
.hand-card {
  width: 120px; height: 168px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: default;
}
.hand-card img { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5); }
.hand-card.playable { cursor: pointer; }
.hand-card:hover {
  transform: translateY(-16px) scale(1.06);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.6);
  border-color: var(--gold-bright);
  z-index: 5;
}

/* Cost badge */
.cost {
  position: absolute; top: -8px; left: -8px;
  width: 32px; height: 32px; border-radius: 50%;
  background: #14306b; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.05rem;
  border: 2px solid #0a1538; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); z-index: 3;
}
.cost.inkable { background: radial-gradient(circle at 35% 30%, #ffe9a8, var(--gold)); color: #2a1c00; border-color: #8a6a18; }
.type-tag {
  position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  background: rgba(0, 0, 0, 0.7); color: var(--gold-bright); padding: 2px 9px; border-radius: 8px;
}

/* Character cards in play — shown as full portrait cards (whole card visible) */
.char {
  width: 140px; height: 195px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}
.char img { object-position: center; }
.char.actionable { cursor: pointer; outline: 2px solid transparent; }
/* Any in-play card lifts and grows a little on hover, for a closer look. */
.char:hover { transform: translateY(-12px) scale(1.07); box-shadow: 0 14px 24px rgba(0,0,0,.6); border-color: var(--gold-bright); z-index: 6; }
.char.actionable { box-shadow: 0 0 0 2px rgba(111, 220, 140, 0.6), var(--shadow); }
.char.exerted { transform: rotate(7deg); filter: saturate(0.55) brightness(0.8); }
.char.drying { filter: brightness(0.75); }
.char.drying::after {
  content: '💧'; position: absolute; top: 2px; right: 2px; font-size: 0.8rem;
  filter: drop-shadow(0 0 2px #000);
}
.char.targetable {
  cursor: pointer;
  outline: 3px solid var(--bad);
  box-shadow: 0 0 16px var(--bad); animation: tpulse 0.9s infinite alternate;
}
@keyframes tpulse { from { box-shadow: 0 0 8px var(--bad); } to { box-shadow: 0 0 20px var(--bad); } }

/* Combat / event pulses */
.char.attacking { outline: 3px solid var(--gold-bright); }
.char.hit { animation: shake 0.3s; outline: 3px solid var(--bad); }
.char.banishing { animation: fadeout 0.4s forwards; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes fadeout { to { opacity: 0; transform: scale(0.7) rotate(12deg); } }

/* Stat strip across the bottom of a character card */
.stat-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; gap: 5px; justify-content: center; align-items: flex-end;
  padding: 6px 0 5px; z-index: 4;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7) 55%);
  border-radius: 0 0 var(--card-radius) var(--card-radius);
}
.st {
  font-size: 1.02rem; font-weight: 700; color: #fff;
  padding: 2px 9px; border-radius: 9px; text-shadow: 0 1px 1px #000;
  border: 1px solid rgba(0, 0, 0, 0.6);
}
.st.str { background: #b8402f; }
.st.str.buffed { background: #ff7a45; box-shadow: 0 0 6px #ff9a45; }
.st.str.debuffed { background: #5a6070; box-shadow: 0 0 6px #2b6; }
.st.wil { background: #2f6db8; }
.st.lore { background: #6a4fb8; }

/* Status badges (Reckless / can't quest / can't challenge) */
.status-row {
  position: absolute; top: -10px; right: -10px; z-index: 5;
  display: flex; flex-direction: column; gap: 3px; align-items: flex-end;
}
.status-badge {
  min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px;
  background: rgba(10, 16, 40, 0.9); border: 1px solid var(--gold);
  color: var(--gold-bright); font-size: 0.72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.status-badge.reckless { background: #7a1f1f; border-color: #ff9a9a; color: #ffd9d9; }

/* Items in play — full portrait card faces, shown like characters (in the items zone) */
.item-card {
  width: 112px; height: 156px; box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.item-card img { object-position: center; }
.item-card:hover { transform: translateY(-10px) scale(1.07); z-index: 6; border-color: var(--gold-bright); }
.item-card.exerted { transform: rotate(6deg); filter: saturate(0.5) brightness(0.78); }
.item-card.actionable { cursor: pointer; box-shadow: 0 0 0 2px rgba(111, 220, 140, 0.7), var(--shadow); }
.card.targetable { cursor: pointer; outline: 3px solid var(--bad); box-shadow: 0 0 16px var(--bad); }

/* Card-picker modal items */
.choose-card { width: 110px; height: 154px; cursor: pointer; }
.choose-card.unpickable { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.5); }
.choose-card.mull-selected { outline: 3px solid var(--gold-bright); box-shadow: 0 0 14px var(--gold); }

.dmg-badge {
  position: absolute; top: -10px; right: -10px; z-index: 5;
  min-width: 30px; height: 30px; padding: 0 5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff9a9a, #c0392b); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.05rem; border: 2px solid #5a1410;
}
.frozen-badge {
  position: absolute; top: -10px; left: -10px; z-index: 5; font-size: 1.25rem;
  filter: drop-shadow(0 0 3px #4aa3e8);
}
.kw-row {
  position: absolute; top: 3px; left: 3px; display: flex; gap: 3px; z-index: 4;
}
.kw {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(10, 16, 40, 0.85); border: 1px solid var(--gold);
  color: var(--gold-bright); font-size: 0.78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* Hover preview — large, image only. Always shown in the SAME spot (right-center)
   whether hovering a card on the board or inside a dialog, so the player always
   knows where to look. z-index sits above modal overlays (100) so it shows over a
   dialog's backdrop; the card-selection dialogs dock left to keep this area clear. */
#card-preview {
  position: fixed; right: 320px; top: 50%; transform: translateY(-50%);
  display: none; width: 360px; z-index: 120; pointer-events: none;
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.6));
}
#card-preview img {
  width: 100%; display: block; border-radius: 16px;
  border: 2px solid var(--gold); box-sizing: border-box;
}
