/* ============================================================
   ASHENMOOR — stylesheet
   ============================================================ */
:root {
  --bg: #0b0e13;
  --panel: #12161f;
  --panel2: #181d29;
  --line: #2a3140;
  --ink: #d7dbe4;
  --dim: #8d93a3;
  --teal: #3fc9b6;
  --ember: #ff8a3d;
  --void: #a184ff;
  --gold: #d4b06a;
  --bad: #ff5d5d;
  --good: #5fc76a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
img { pointer-events: none; }
button { font-family: inherit; }
.pick, .vpick, .mcard, .hcard {
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 0;
}
.mcard, .hcard { background: none; border: 0; }

/* ---------- buttons ---------- */
.btn {
  background: linear-gradient(180deg, #232a38, #1a202c);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  letter-spacing: 0.4px;
  transition: transform 0.08s, box-shadow 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--teal); transform: translateY(-1px); }
.btn.primary { background: linear-gradient(180deg, #2b6f66, #1e4d47); border-color: var(--teal); }
.btn.danger { border-color: var(--bad); color: #ffb4b4; }
.btn.small { padding: 6px 10px; font-size: 12px; border-radius: 6px; }
.btn.off { opacity: 0.4; pointer-events: none; }
.btn.ability { border-color: var(--gold); color: #ffe9c2; }

/* ---------- menu ---------- */
.menu {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background-size: cover;
  background-position: center;
  padding: 16px;
  overflow-y: auto;
}
.title {
  font-family: var(--serif);
  font-size: clamp(44px, 8vw, 84px);
  letter-spacing: 0.22em;
  margin: 0;
  color: #f0e6d2;
  text-shadow: 0 0 30px rgba(63, 201, 182, 0.35), 0 4px 24px #000;
}
.subtitle { margin: -6px 0 8px; color: var(--dim); font-style: italic; font-family: var(--serif); font-size: 16px; }
.hero-pick { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.pick {
  width: 250px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.pick img { width: 100%; height: 240px; object-fit: cover; object-position: top; display: block; }
.pick:hover { transform: translateY(-4px); }
.pick.picked { border-color: var(--acc, var(--teal)); box-shadow: 0 0 26px rgba(63, 201, 182, 0.25); }
.pick .pick-name { font-family: var(--serif); font-size: 21px; padding: 10px 12px 0; }
.pick .pick-title { color: var(--acc, var(--teal)); font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; padding: 2px 12px 6px; }
.pick .pick-stats { padding: 0 12px 6px; font-size: 15px; letter-spacing: 0.2em; color: #ffd9b0; }
.pick .pick-ab { padding: 0 12px 12px; font-size: 12px; color: var(--dim); line-height: 1.45; }
.f-ember { --acc: var(--ember); }
.f-rift { --acc: var(--teal); }
.diff-row { display: flex; gap: 8px; align-items: center; color: var(--dim); font-size: 14px; }
.seg { background: var(--panel); color: var(--dim); border: 1px solid var(--line); border-radius: 20px; padding: 7px 16px; cursor: pointer; font-size: 13px; }
.seg.on { color: var(--ink); border-color: var(--ember); background: #2a1f16; }
.menu-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.menu-actions { max-width: 920px; }
.selection-summary {
  flex-basis: 100%;
  text-align: center;
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.selection-summary b { color: var(--ink); }
.first-vigil { color: var(--dim); font-size: 12px; text-align: center; max-width: 620px; }
.credits { color: #5a6070; font-size: 11px; margin-top: 4px; }

/* ---------- game layout ---------- */
.game {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 50% -100px, rgba(63, 201, 182, 0.06), transparent),
    radial-gradient(1000px 500px at 50% 110%, rgba(255, 138, 61, 0.05), transparent),
    var(--bg);
  position: relative;
  overflow: hidden;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 18, 0.7);
  z-index: 5;
}
.round-pill { flex: 1; text-align: center; font-size: 14px; color: var(--dim); }
.round-pill b { color: var(--ink); }
.round-pill b.int-attack { color: var(--bad); }
.round-pill b.int-scheme { color: var(--void); }
.top-right { display: flex; gap: 6px; }

.mode-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #22303c, #182430);
  border-bottom: 1px solid var(--teal);
  font-size: 13px;
  z-index: 5;
}
.target-bar { background: linear-gradient(180deg, #3a2430, #241820); border-bottom-color: var(--bad); }

/* ---------- zones ---------- */
.villain-zone {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
  margin: 8px 10px 0;
  padding: 22px 10px 16px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, rgba(32, 24, 56, 0.38), rgba(16, 13, 26, 0.12));
  border: 1px solid #2c2347;
  border-radius: 14px;
  position: relative;
}
.villain-zone::before {
  content: "THE HOLLOW COURT";
  position: absolute; top: 6px; left: 16px;
  font-size: 9px; letter-spacing: 0.24em;
  color: #7a68b8;
  pointer-events: none;
}
.board {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin: 8px 10px 2px;
  padding: 20px 10px 14px;
  min-height: 64px;
  background: linear-gradient(180deg, rgba(18, 32, 30, 0.32), rgba(11, 17, 16, 0.1));
  border: 1px solid #1f3d37;
  border-radius: 14px;
  position: relative;
}
.board::before {
  content: "YOUR ALLIES & UPGRADES";
  position: absolute; top: 6px; left: 16px;
  font-size: 9px; letter-spacing: 0.24em;
  color: #3f8d81;
  pointer-events: none;
}
.upgrades, .chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.chip {
  background: var(--panel2);
  border: 1px solid var(--gold);
  color: #ffe9c2;
  font-size: 11px;
  border-radius: 20px;
  padding: 4px 10px;
  cursor: default;
}
.chip.attach { border-color: var(--void); color: #d9ccff; }
.allies { display: flex; gap: 10px; justify-content: center; }

.hero-zone {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--line);
  background: rgba(10, 13, 18, 0.55);
}
.hero-wrap { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.hero-actions { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.hand {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0;
  overflow-x: auto;
  overflow-y: visible;
  padding: 24px 8px 2px;
  min-height: 210px;
}
.side { display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* ---------- cards ---------- */
.card { position: relative; cursor: pointer; transition: transform 0.12s, box-shadow 0.15s, filter 0.2s; flex: none; }
.cardface {
  width: 100%;
  height: 100%;
  transition: transform 0.16s ease;
  will-change: transform;
  background: linear-gradient(180deg, #1b2130, #141924);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.f-kaelen .cardface, .cardface.f-kaelen { border-color: #7a4326; }
.f-sera .cardface, .cardface.f-sera { border-color: #2a6b62; }
.cardface.f-void { border-color: #4d3d85; }
.cardface.f-neutral { border-color: #6b6350; }
.cardface.f-ember { border-color: #7a4326; }
.cardface.f-rift { border-color: #2a6b62; }
.c-art { height: 47%; flex: none; overflow: hidden; background: #0d1017; }
.c-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-name {
  font-family: var(--serif);
  font-size: 12.5px;
  padding: 4px 8px 1px;
  color: #f0e6d2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c-type { font-size: 8px; letter-spacing: 0.18em; color: var(--dim); padding: 0 8px 3px; }
.t-event .c-type { color: #e8a06a; }
.t-ally .c-type { color: #7fd6c9; }
.t-upgrade .c-type { color: var(--gold); }
.t-resource .c-type { color: #9ae8d8; }
.t-minion .c-type, .t-treachery .c-type, .t-attachment .c-type { color: #b9a4ff; }
.c-text { font-size: 10px; line-height: 1.35; padding: 0 8px; color: #c4c9d4; flex: 1; overflow: hidden; }
.c-stats { display: flex; gap: 5px; padding: 3px 6px 6px; margin-top: auto; }
.stat {
  background: #10141c;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  padding: 2px 6px;
  color: #e8d9be;
}
.stat.hp { color: #ff9d9d; border-color: #5c2f34; }
.c-cost {
  position: absolute;
  top: 5px; left: 5px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe1a8, #b98a3e 70%);
  color: #241a08;
  font-weight: 700;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #6d5322;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
.c-cost.res { background: radial-gradient(circle at 35% 30%, #b8fff1, #2e9a89 70%); border-color: #1c5d53; color: #06231e; }

/* hand (fanned) */
.hcard { width: 142px; aspect-ratio: 5 / 7; margin: 0 -14px; z-index: 1; transform: rotate(var(--fr, 0deg)) translateY(var(--fy, 0px)); }
.hcard:hover { transform: rotate(0deg) translateY(-20px) scale(1.05); z-index: 10; }
.hcard.selected { transform: rotate(0deg) translateY(-18px); z-index: 9; }
.hcard.selected .cardface { box-shadow: 0 0 0 2px var(--teal), 0 10px 24px rgba(0, 0, 0, 0.6); }
.hcard.staged { transform: rotate(0deg) translateY(-24px) scale(1.04); z-index: 11; }
.hcard.staged .cardface { box-shadow: 0 0 0 2px var(--gold), 0 0 30px rgba(212, 176, 106, 0.4); }
.hcard.pay-chosen { transform: rotate(0deg) translateY(-10px); }
.hcard.pay-chosen .cardface { box-shadow: 0 0 0 2px var(--teal), 0 0 22px rgba(63, 201, 182, 0.45); filter: saturate(1.15); }
.pay-badge {
  position: absolute; top: -8px; right: 2px;
  background: var(--teal); color: #04211c;
  width: 24px; height: 24px; border-radius: 50%;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* board cards */
.hero { width: 158px; aspect-ratio: 5 / 7; cursor: default; }
.ally { width: 118px; aspect-ratio: 5 / 7; }
.ally .c-name { font-size: 10.5px; }
.minion { width: 116px; aspect-ratio: 5 / 7; }
.minion .c-name { font-size: 10.5px; }
.villain { width: 172px; aspect-ratio: 5 / 7; cursor: default; }
.scheme { width: 172px; aspect-ratio: 5 / 7; cursor: default; }
.villain .cardface, .scheme .cardface { border-color: #4d3d85; }
.villain, .scheme, .minion, .ally, .hero { display: block; }
.villain > *, .scheme > *, .minion > *, .ally > *, .hero > * { pointer-events: none; }
.villain .mini-btns, .ally .mini-btns { pointer-events: auto; }
.card.villain, .card.scheme, .card.minion, .card.ally, .card.hero {
  background: linear-gradient(180deg, #1b2130, #141924);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: visible;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.card.villain { border-color: #574394; box-shadow: 0 0 26px rgba(120, 90, 220, 0.18), 0 6px 16px rgba(0, 0, 0, 0.5); }
.card.hero.f-ember { border-color: #8a5a2e; }
.card.hero.f-rift { border-color: #2a6b62; }
.card.villain .c-art, .card.scheme .c-art, .card.minion .c-art, .card.ally .c-art, .card.hero .c-art {
  height: 52%; border-radius: 9px 9px 0 0;
}
.card.minion .c-art, .card.ally .c-art { height: 46%; }
.card .c-stats { padding: 3px 6px 7px; }
.kw {
  position: absolute; top: 4px; right: 4px;
  background: #3a2430; border: 1px solid var(--bad);
  color: #ffb4b4; font-size: 8px; letter-spacing: 0.1em;
  padding: 2px 5px; border-radius: 4px;
}
.mini-btns { position: absolute; bottom: -12px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; z-index: 4; }
.mini {
  width: 30px; height: 26px;
  background: linear-gradient(180deg, #2b3547, #1c2330);
  border: 1px solid var(--teal);
  color: var(--ink);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}
.mini:hover { background: #2b4a44; }

.exhausted { filter: grayscale(0.75) brightness(0.65); }
.card.exhausted { transform: rotate(5deg); }

.hpbar {
  position: relative;
  height: 14px;
  margin: 2px 6px 6px;
  background: #0c0f15;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.hpbar i { position: absolute; left: 0; top: 0; bottom: 0; display: block; }
.hpbar i.fill { background: linear-gradient(90deg, #a83232, #ff6a3d); transition: width 0.25s ease; }
.hpbar i.ghost { background: rgba(255, 226, 180, 0.35); transition: width 0.8s ease 0.35s; }
.hpbar.hero-hp i.fill { background: linear-gradient(90deg, #2e8a5f, #5fc76a); }
.hpbar i.notrans { transition: none !important; }
.hpbar b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #fff; text-shadow: 0 1px 2px #000; }
.shield-badge {
  position: absolute; top: -10px; right: -8px;
  background: #14324a; border: 1px solid #58a6ff; color: #bcdcff;
  border-radius: 14px; padding: 3px 8px; font-size: 12px; z-index: 3;
}
.stage-pips { position: absolute; top: 6px; left: 6px; display: flex; gap: 4px; z-index: 2; }
.stage-pips i { width: 10px; height: 10px; border-radius: 50%; background: #232a38; border: 1px solid #574394; }
.stage-pips i.on { background: var(--void); box-shadow: 0 0 8px var(--void); }

.threat-track { padding: 2px 8px 8px; }
.tnum { font-size: 20px; color: var(--void); font-family: var(--serif); }
.tnum span { font-size: 12px; color: var(--dim); }
.pips { display: flex; gap: 3px; margin: 4px 0; flex-wrap: wrap; }
.pips i { width: 12px; height: 12px; transform: rotate(45deg); background: #1a1f2b; border: 1px solid #4d3d85; }
.pips i.on { background: var(--void); box-shadow: 0 0 7px var(--void); }
.s-stage { font-size: 10px; color: var(--dim); letter-spacing: 0.12em; }

/* piles */
.piles { display: flex; flex-direction: column; gap: 8px; }
.pile {
  width: 64px; height: 88px;
  border-radius: 8px;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  background: #10141c;
  cursor: pointer;
}
.pile img { width: 100%; height: 100%; object-fit: cover; opacity: 0.9; }
.pile.flat { background: repeating-linear-gradient(45deg, #141924, #141924 6px, #10141c 6px, #10141c 12px); }
.pile .count {
  position: absolute; bottom: 3px; right: 3px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 11px;
  padding: 1px 7px;
  color: var(--ink);
}
.endturn {
  width: 96px; height: 60px;
  font-size: 14px;
  background: linear-gradient(180deg, #7a4326, #4d2a16);
  border: 1px solid var(--ember);
  border-radius: 10px;
  color: #ffe4cd;
  letter-spacing: 0.06em;
}
.endturn:hover { box-shadow: 0 0 18px rgba(255, 138, 61, 0.35); }

/* targeting */
.targetable { cursor: crosshair !important; }
.targetable::after {
  content: "";
  position: absolute; inset: -4px;
  border: 2px solid var(--bad);
  border-radius: 12px;
  animation: pulse 0.9s infinite;
  z-index: 5;
  pointer-events: none;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- log ---------- */
.logpanel {
  position: absolute;
  top: 46px; right: 0; bottom: 0;
  width: 250px;
  background: rgba(10, 13, 18, 0.92);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s;
  z-index: 20;
}
.game.show-log .logpanel { transform: translateX(0); }
.logpanel h4 { margin: 8px 12px 4px; font-family: var(--serif); color: var(--gold); font-weight: 500; }
.logs { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.l { font-size: 11.5px; line-height: 1.45; padding: 3px 0; border-bottom: 1px dotted #1d2330; color: var(--dim); display: flex; gap: 6px; }
.l span { color: #4d5464; flex: none; font-size: 10px; padding-top: 1px; }
.l.you { color: #bfe8e0; }
.l.bad { color: #f2a3a3; }
.l.good { color: #a8e8ad; }
.l.sys { color: var(--gold); }
@media (min-width: 1280px) {
  .logpanel { transform: none; }
  .game { padding-right: 250px; }
  .log-btn { display: none; }
}

/* ---------- inspector ---------- */
.inspector {
  position: absolute;
  left: 10px; top: 52px;
  width: 218px;
  z-index: 15;
  display: none;
  pointer-events: none;
}
.inspector.open { display: block; pointer-events: auto; }
.inspector .cardface { aspect-ratio: 5 / 7; font-size: 13px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7); }
.inspector .c-name { font-size: 16px; white-space: normal; }
.inspector .c-text { font-size: 12.5px; }
.inspector .c-type { font-size: 10px; }
.inspector .c-art { height: 46%; }
.inspector .c-stats .stat { font-size: 13px; }
.inspector .flavor {
  font-family: var(--serif); font-style: italic;
  color: var(--dim); font-size: 11.5px;
  background: rgba(10, 13, 18, 0.85);
  margin: 6px 0 0; padding: 6px 10px;
  border-left: 2px solid var(--gold);
}
.inspector .insp-actions { margin-top: 8px; pointer-events: auto; display: flex; gap: 8px; }
.inspector .note { font-size: 11px; color: var(--dim); background: rgba(10, 13, 18, 0.85); padding: 4px 8px; border-radius: 6px; }
.inspector-close {
  position: absolute; top: 5px; right: 5px; z-index: 4;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(10, 13, 18, 0.92);
  color: var(--ink); cursor: pointer;
}

/* ---------- modals & overlays ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(5, 7, 10, 0.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  backdrop-filter: blur(3px);
}
.modal-box {
  background: linear-gradient(180deg, #171c28, #10141c);
  border: 1px solid var(--gold);
  border-radius: 14px;
  padding: 20px 24px;
  max-width: min(720px, 94vw);
  max-height: 88dvh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
}
.modal-box.wide { width: min(760px, 94vw); }
.modal-box h3 { margin: 0 0 10px; font-family: var(--serif); color: #f0e6d2; letter-spacing: 0.04em; }
.modal-box h4 { margin: 12px 0 4px; color: var(--gold); font-family: var(--serif); }
.modal-box p { color: #b9bec9; font-size: 13.5px; line-height: 1.55; margin: 4px 0; }
.row { display: flex; gap: 10px; margin-top: 14px; justify-content: center; }
.defense .modal-box { border-color: var(--bad); }
.def-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.dies { color: var(--bad); font-size: 11px; }
.mull-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 10px 0 4px; }
.mcard { width: 128px; aspect-ratio: 5 / 7; cursor: pointer; border-radius: 10px; position: relative; }
.mcard .cardface { pointer-events: none; }
.mcard.on { outline: 2px solid var(--teal); outline-offset: 2px; transform: translateY(-6px); }
.help-body { max-height: 55dvh; overflow-y: auto; padding-right: 6px; }

.end-box { text-align: center; min-width: min(420px, 90vw); }
.end-box h2 { font-family: var(--serif); font-size: 44px; letter-spacing: 0.2em; margin: 4px 0 4px; }
.end-box.won h2 { color: var(--teal); text-shadow: 0 0 30px rgba(63, 201, 182, 0.5); }
.end-box.lost h2 { color: var(--bad); text-shadow: 0 0 30px rgba(255, 93, 93, 0.4); }
.end-reason { font-style: italic; font-family: var(--serif); }
.end-stats { display: flex; gap: 18px; justify-content: center; margin: 16px 0 18px; flex-wrap: wrap; }
.end-stats div { display: flex; flex-direction: column; min-width: 70px; }
.end-stats b { font-size: 26px; color: #f0e6d2; font-family: var(--serif); }
.end-stats span { font-size: 10.5px; color: var(--dim); letter-spacing: 0.06em; }

.toast {
  position: fixed;
  top: 64px; left: 50%;
  transform: translateX(-50%);
  background: rgba(16, 20, 28, 0.95);
  border: 1px solid var(--teal);
  color: var(--ink);
  border-radius: 24px;
  padding: 9px 20px;
  font-size: 13px;
  z-index: 300;
  transition: opacity 0.4s, transform 0.4s;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.toast.out { opacity: 0; transform: translateX(-50%) translateY(-10px); }
.coach-steps { margin: 14px 0 18px; padding-left: 22px; color: #c9ced8; }
.coach-steps li { margin: 9px 0; line-height: 1.45; }
.coach-box { width: min(520px, 92vw); }
.stats-box { width: min(560px, 94vw); }
.stats-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.stats-summary div { display: flex; flex-direction: column; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #0e121a; }
.stats-summary b { color: #f0e6d2; font: 24px var(--serif); }
.stats-summary span { color: var(--dim); font-size: 10px; }
.stat-table { display: grid; gap: 5px; }
.stat-row { display: grid; grid-template-columns: 1fr auto 48px; gap: 10px; padding: 7px 9px; border-bottom: 1px solid var(--line); }
.stat-row em { color: var(--teal); text-align: right; font-style: normal; }
.recent-runs { margin: 6px 0 16px; padding-left: 20px; color: var(--dim); font-size: 12px; line-height: 1.65; }
.recent-runs .win b { color: var(--good); }
.recent-runs .loss b { color: var(--bad); }
.pile-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0; }
.pile-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.pile-filters .btn { text-transform: capitalize; }
.pile-tools input {
  min-height: 38px; width: min(220px, 42vw); padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 7px; background: #0d1118; color: var(--ink);
}
.daily-tag { color: var(--gold); text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; }

.banner {
  position: fixed;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 250;
  pointer-events: none;
  transition: opacity 0.5s;
}
.banner.out { opacity: 0; }
.banner-inner {
  font-family: var(--serif);
  font-size: clamp(20px, 4vw, 34px);
  letter-spacing: 0.12em;
  text-align: center;
  color: #f0e6d2;
  background: linear-gradient(90deg, transparent, rgba(10, 8, 16, 0.92) 18%, rgba(10, 8, 16, 0.92) 82%, transparent);
  border-top: 1px solid var(--void);
  border-bottom: 1px solid var(--void);
  padding: 22px 8vw;
  text-shadow: 0 2px 18px rgba(161, 132, 255, 0.5);
  animation: bannerIn 0.4s ease-out;
}
.banner.stage .banner-inner { border-color: var(--ember); text-shadow: 0 2px 18px rgba(255, 138, 61, 0.55); }
@keyframes bannerIn { from { transform: scale(1.15); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.reveal-flash {
  position: fixed;
  top: 50%; left: 50%;
  width: 190px;
  aspect-ratio: 5 / 7;
  transform: translate(-50%, -54%) scale(1);
  z-index: 240;
  pointer-events: none;
  animation: revealIn 0.28s ease-out;
  transition: opacity 0.4s, transform 0.4s;
  filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.8));
}
.reveal-flash.out { opacity: 0; transform: translate(-50%, -70%) scale(0.9); }
@keyframes revealIn { from { transform: translate(-50%, -54%) scale(0.6) rotate(-4deg); opacity: 0; } to { transform: translate(-50%, -54%) scale(1); opacity: 1; } }

#floats { position: fixed; inset: 0; pointer-events: none; z-index: 400; }
.float {
  position: absolute;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  text-shadow: 0 2px 6px #000;
  animation: floatUp 1.25s ease-out forwards;
}
.float.dmg { color: var(--bad); }
.float.heal { color: var(--good); }
.float.shieldf { color: #58a6ff; }
.float.threat { color: var(--void); }
.float.threatdn { color: var(--teal); }
@keyframes floatUp {
  0% { transform: translateY(0) scale(0.7); opacity: 0; }
  15% { transform: translateY(-8px) scale(1.15); opacity: 1; }
  100% { transform: translateY(-70px) scale(1); opacity: 0; }
}

.shake { animation: shakeA 0.3s; }
.shake-hard { animation: shakeA 0.45s; }
@keyframes shakeA {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 2px); }
  40% { transform: translate(6px, -2px); }
  60% { transform: translate(-4px, 1px); }
  80% { transform: translate(4px, -1px); }
}

.devpanel {
  position: fixed; left: 8px; bottom: 8px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #333;
  padding: 6px;
  font: 11px monospace;
  color: #0f0;
  z-index: 500;
  display: flex; gap: 4px; align-items: center; flex-wrap: wrap;
  max-width: 210px;
}
.devpanel button { font-size: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hcard { width: 118px; margin: 0 -12px; }
  .hero { width: 128px; }
  .villain, .scheme { width: 140px; }
  .minion, .ally { width: 100px; }
  .inspector { display: none; }
  .inspector.open {
    position: fixed;
    display: grid !important;
    grid-template-columns: 136px minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    gap: 8px 12px;
    left: 50%; right: auto; top: auto; bottom: 8px;
    transform: translateX(-50%);
    width: min(430px, calc(100vw - 16px));
    max-height: min(54dvh, 430px);
    overflow-y: auto;
    padding: 10px;
    background: rgba(10, 13, 18, 0.97);
    border: 1px solid var(--gold);
    border-radius: 14px;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.88);
    z-index: 260;
  }
  .inspector.open .cardface { grid-row: 1 / 4; width: 136px; }
  .inspector.open .flavor { margin: 36px 0 0; align-self: start; }
  .inspector.open .insp-actions { align-self: end; }
  .inspector.open .insp-actions .btn { min-height: 44px; width: 100%; }
  .inspector-close { width: 40px; height: 40px; }
  .hand { min-height: 178px; padding-top: 18px; }
  .villain-zone { gap: 8px; }
  .piles { flex-direction: row; order: 3; width: 100%; justify-content: center; }
  .pile { width: 48px; height: 66px; }
  .hero-actions { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .hero-wrap { flex-direction: row; align-items: flex-end; gap: 8px; }
  .hero-zone { flex-wrap: wrap; }
  .side { flex-direction: row; width: 100%; justify-content: center; }
  .endturn { height: 44px; }
  .menu { justify-content: flex-start; }
  .pick img { height: 170px; }
  .minions { order: 4; }
}
@media (max-width: 980px) and (orientation: portrait) {
  body { overflow-y: auto; }
  .game { height: auto; min-height: 100dvh; }
}

/* short viewports (small windows, landscape phones, embedded panes) */
@media (max-height: 760px) {
  .hcard { width: 112px; margin: 0 -11px; }
  .hand { min-height: 160px; padding-top: 16px; }
  .hero { width: 120px; }
  .villain, .scheme { width: 136px; }
  .minion, .ally { width: 92px; }
  .pile { width: 46px; height: 64px; }
  .endturn { width: 86px; height: 46px; font-size: 12px; }
  .hero-actions { gap: 3px; }
  .btn.small { padding: 4px 8px; font-size: 11px; }
  .villain-zone { padding: 18px 8px 12px; gap: 10px; margin: 6px 6px 0; }
  .board { margin: 6px 6px 2px; padding: 16px 8px 10px; }
  .hero-zone { padding: 6px 10px 8px; }
  .board { padding: 2px 8px; min-height: 24px; }
  .inspector { top: 48px; width: 170px; }
  .c-text { font-size: 9px; }
  .c-name { font-size: 11px; }
  .stat { font-size: 9.5px; padding: 1px 5px; }
  .stage-pips i { width: 8px; height: 8px; }
  .tnum { font-size: 16px; }
  .pips i { width: 9px; height: 9px; }
  .hpbar { height: 11px; margin: 2px 5px 5px; }
  .topbar { padding: 5px 10px; }
}
@media (max-width: 560px) {
  .menu { padding: 12px 8px 24px; gap: 9px; }
  .title { font-size: clamp(34px, 13vw, 54px); letter-spacing: 0.14em; }
  .subtitle { text-align: center; font-size: 14px; }
  .menu-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; max-width: 430px; }
  .menu-actions .selection-summary, .menu-actions .primary { grid-column: 1 / -1; }
  .menu-actions .btn { min-height: 44px; padding: 9px 8px; }
  .first-vigil { padding: 0 12px; }
  .hero-pick, .villain-pick {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 5px max(12px, calc((100vw - 280px) / 2));
    scrollbar-width: thin;
  }
  .pick { width: 280px; flex: none; scroll-snap-align: center; }
  .pick img { height: 190px; }
  .vpick { width: min(330px, 84vw); flex: none; scroll-snap-align: center; }
  .diff-row { flex-wrap: wrap; justify-content: center; }
  .btn, .seg, .mini, .dock-btn { min-height: 44px; }
  .stats-summary { grid-template-columns: repeat(2, 1fr); }
  .pile-tools { align-items: stretch; flex-direction: column; }
  .pile-tools input { width: 100%; min-height: 44px; }
  .topbar { flex-wrap: wrap; }
  .round-pill { order: 3; width: 100%; font-size: 12px; }
  .top-right { margin-left: auto; }
}
@media (max-height: 520px) {
  .hcard { width: 92px; margin: 0 -10px; }
  .hand { min-height: 134px; padding-top: 12px; }
  .hero { width: 100px; }
  .villain, .scheme { width: 114px; }
  .minion, .ally { width: 78px; }
  .inspector.open { display: grid !important; max-height: calc(100dvh - 16px); }
  .round-pill { font-size: 11.5px; }
  .c-text { font-size: 8px; }
}

/* ============================================================
   INFERNO update — juice & VFX layers
   ============================================================ */

/* screen-edge pulses */
#vig-hurt, #vig-doom {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 95;
  opacity: 0;
  transition: opacity 0.45s ease;
}
#vig-hurt { background: radial-gradient(ellipse at center, transparent 55%, rgba(200, 30, 30, 0.5) 100%); }
#vig-doom { background: linear-gradient(180deg, rgba(120, 80, 255, 0.28), transparent 30%); }
#vig-hurt.on, #vig-doom.on { opacity: 1; transition: opacity 0.05s; }

/* impact flash on cards */
.card.hit .cardface, .card.hit { animation: hitflash 0.38s ease-out; }
@keyframes hitflash {
  0% { filter: brightness(2.4) saturate(1.6); }
  100% { filter: brightness(1) saturate(1); }
}

/* played-card showcase (Hearthstone-style) */
.showcase {
  position: fixed;
  top: 50%; left: 50%;
  width: min(230px, 40vw);
  aspect-ratio: 5 / 7;
  z-index: 260;
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 24px 60px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 26px rgba(255, 158, 80, 0.35));
  animation: showcase 0.95s ease-out forwards;
}
@keyframes showcase {
  0%   { transform: translate(-50%, -38%) scale(0.55) rotate(-3deg); opacity: 0; }
  16%  { transform: translate(-50%, -52%) scale(1.06) rotate(0.5deg); opacity: 1; }
  26%  { transform: translate(-50%, -50%) scale(1); }
  78%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -58%) scale(0.92); opacity: 0; }
}

/* villain drama */
.card.villain { animation: villGlow 6s ease-in-out infinite alternate; }
@keyframes villGlow {
  from { box-shadow: 0 0 22px rgba(120, 90, 220, 0.16), 0 6px 16px rgba(0, 0, 0, 0.5); }
  to   { box-shadow: 0 0 44px rgba(140, 100, 255, 0.34), 0 6px 18px rgba(0, 0, 0, 0.55); }
}
.card.villain .c-art img { animation: breathe 8s ease-in-out infinite alternate; }
@keyframes breathe { from { transform: scale(1); } to { transform: scale(1.07); } }
.card.villain.looming {
  transform: scale(1.07);
  box-shadow: 0 0 60px rgba(255, 70, 50, 0.55), 0 10px 30px rgba(0, 0, 0, 0.7) !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  z-index: 6;
}

/* intent pulse when an attack is telegraphed */
.round-pill b.int-attack { animation: intentPulse 1.5s ease-in-out infinite; }
@keyframes intentPulse {
  0%, 100% { text-shadow: 0 0 2px rgba(255, 93, 93, 0.2); }
  50% { text-shadow: 0 0 14px rgba(255, 93, 93, 0.95); }
}

/* targeting spotlight: dim everything that cannot be targeted */
.game.targeting .card { transition: filter 0.2s ease; }
.game.targeting .card:not(.targetable) { filter: brightness(0.5) saturate(0.7); }
.game.targeting .card.targetable { filter: brightness(1.12); z-index: 6; }

/* floats: bigger crits */
.float.big { font-size: 40px; letter-spacing: 0.02em; }
.float { text-shadow: 0 2px 6px #000, 0 0 18px currentColor; }

/* your-turn mini banner */
.banner.turn .banner-inner {
  font-size: clamp(15px, 2.4vw, 22px);
  padding: 10px 12vw;
  border-color: var(--teal);
  text-shadow: 0 2px 14px rgba(63, 201, 182, 0.6);
}

/* end screens */
.end-box { position: relative; overflow: hidden; }
.end-box.won::before {
  content: "";
  position: absolute; inset: -60%;
  background: conic-gradient(from 0deg, transparent 0 20deg, rgba(63, 201, 182, 0.08) 30deg 40deg, transparent 50deg 80deg, rgba(255, 138, 61, 0.08) 90deg 100deg, transparent 110deg 360deg);
  animation: rays 14s linear infinite;
  pointer-events: none;
}
@keyframes rays { to { transform: rotate(360deg); } }
.end-box.won h2 { animation: winGlow 2.2s ease-in-out infinite alternate; }
@keyframes winGlow {
  from { text-shadow: 0 0 22px rgba(63, 201, 182, 0.4); }
  to   { text-shadow: 0 0 52px rgba(63, 201, 182, 0.9), 0 0 90px rgba(255, 180, 106, 0.4); }
}
.modal.end { backdrop-filter: blur(5px); }
.end-box.lost { filter: saturate(0.85); }
.end-box.lost h2 { animation: loseFlicker 3.4s ease-in-out infinite; }
@keyframes loseFlicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  95% { opacity: 0.55; }
  97% { opacity: 1; }
}

/* menu drama */
.menu .title { animation: titleGlow 5s ease-in-out infinite alternate; }
@keyframes titleGlow {
  from { text-shadow: 0 0 26px rgba(63, 201, 182, 0.25), 0 4px 24px #000; }
  to   { text-shadow: 0 0 44px rgba(63, 201, 182, 0.55), 0 0 90px rgba(255, 138, 61, 0.25), 0 4px 24px #000; }
}
.pick { will-change: transform; }

/* endturn fiery hover */
.endturn:hover { box-shadow: 0 0 26px rgba(255, 138, 61, 0.55), inset 0 0 16px rgba(255, 138, 61, 0.25); }

/* reveal flash gets a glow */
.reveal-flash { filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 30px rgba(161, 132, 255, 0.5)); }

/* calm mode */
@media (prefers-reduced-motion: reduce) {
  .shake, .shake-hard { animation: none !important; }
  .card.villain, .card.villain .c-art img, .round-pill b.int-attack,
  .menu .title, .end-box.won h2, .end-box.won::before, .end-box.lost h2 { animation: none !important; }
  .showcase { animation: showcaseCalm 0.9s ease-out forwards; }
  @keyframes showcaseCalm { 0% { opacity: 0; } 15% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
  .banner-inner { animation: none; }
}

/* ============================================================
   MAELSTROM update — new faction, villain select, more juice
   ============================================================ */
.f-aegis { --acc: var(--gold); }
.cardface.f-odran, .f-odran .cardface { border-color: #8a7440; }
.card.hero.f-aegis { border-color: #8a7440; }

/* villain select */
.vs-label { color: var(--dim); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; }
.villain-pick { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.vpick {
  display: flex; width: 300px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
  will-change: transform;
}
.vpick img { width: 86px; height: 112px; object-fit: cover; object-position: top; flex: none; display: block; }
.vpick .vp-body { padding: 8px 10px; }
.vpick .pick-name { font-size: 17px; padding: 0; font-family: var(--serif); }
.vpick .pick-title { padding: 1px 0 4px; color: var(--void); font-size: 10px; letter-spacing: 0.13em; text-transform: uppercase; }
.vpick .pick-ab { padding: 0; font-size: 11px; color: var(--dim); line-height: 1.4; }
.vpick.picked { border-color: var(--void); box-shadow: 0 0 24px rgba(161, 132, 255, 0.3); }
.vpick:hover { transform: translateY(-3px); }

/* compact menu so hero + villain rows fit */
.menu { gap: 10px; }
.pick { width: 224px; }
.pick img { height: 178px; }
.pick .pick-name { font-size: 19px; }
.title { font-size: clamp(36px, 6.2vw, 64px); }

/* playable-card glow */
@keyframes canplayPulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(212, 176, 106, 0.4); }
  50% { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 16px 2px rgba(212, 176, 106, 0.45); }
}
.hcard.canplay .cardface { animation: canplayPulse 2.2s ease-in-out infinite; }

/* attack lunge */
.card.lunge { transform: translateY(-10px) scale(1.07) !important; transition: transform 0.12s ease-out; z-index: 7; }

/* enrage (final stage) & low-hp ambience */
.game.enrage::before, .game.lowhp::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 4;
}
.game.enrage::before {
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 60, 40, 0.15), transparent 55%);
  animation: enrageBreathe 2.8s ease-in-out infinite;
}
@keyframes enrageBreathe { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
.game.lowhp::after {
  background: radial-gradient(ellipse at center, transparent 62%, rgba(200, 30, 30, 0.3) 100%);
  animation: lowhpPulse 1.6s ease-in-out infinite;
}
@keyframes lowhpPulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* card-draw flight */
.flycard {
  position: fixed;
  width: 62px;
  aspect-ratio: 5 / 7;
  z-index: 95;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.5s;
  opacity: 0.95;
}
.flycard img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6); }

@media (prefers-reduced-motion: reduce) {
  .hcard.canplay .cardface, .game.enrage::before, .game.lowhp::after { animation: none !important; }
  .card.lunge { transform: none !important; }
}

/* ============================================================
   ABYSS update — side schemes, guard, boost, statuses
   ============================================================ */
.sideschemes { display: flex; gap: 10px; justify-content: center; }
.sscard {
  width: 116px;
  background: linear-gradient(180deg, #221b30, #161222);
  border: 1px solid #6a4d9e;
  border-radius: 10px;
  overflow: visible;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 18px rgba(140, 100, 220, 0.22), 0 4px 14px rgba(0, 0, 0, 0.5);
}
.sscard .c-art { height: 52px; border-radius: 9px 9px 0 0; overflow: hidden; }
.sscard .c-name { font-size: 10px; white-space: normal; line-height: 1.2; padding: 3px 6px 1px; }
.sscard .ss-threat {
  padding: 2px 6px 6px;
  color: var(--void);
  font-family: var(--serif);
  font-size: 14px;
}
.sscard .ss-threat b { font-size: 17px; }

.vchip {
  position: absolute;
  right: 5px;
  border-radius: 12px;
  font-size: 11px;
  padding: 2px 7px;
  z-index: 3;
  border: 1px solid;
}
.vchip.stun { top: 5px; background: #14324a; border-color: #58a6ff; color: #bcdcff; }
.vchip.burn { top: 30px; background: #3a2113; border-color: var(--ember); color: #ffc9a3; }

.bpips {
  position: absolute;
  top: 5px; right: 6px;
  color: var(--void);
  font-size: 9px;
  letter-spacing: 1px;
  z-index: 2;
  text-shadow: 0 1px 3px #000;
}
.kw.guard { top: 22px; border-color: var(--gold); color: #ffe9c2; background: #2e2716; }
.round-pill b.int-stun { color: #58a6ff; }
.boost-note { color: var(--void); font-size: 12px; font-style: italic; }
@media (max-height: 760px) {
  .sscard { width: 96px; }
  .sscard .c-art { height: 40px; }
}

/* ============================================================
   THE LONG VIGIL — campaign hub, drafts, epilogue
   ============================================================ */
.title.small { font-size: clamp(28px, 4.6vw, 46px); }
.title.crowned { text-shadow: 0 0 30px rgba(212, 176, 106, 0.5), 0 4px 24px #000; }
.crown-mark { color: var(--gold); font-style: normal; letter-spacing: 0.08em; }
.vigil-btn { border-color: var(--gold); background: linear-gradient(180deg, #5a4322, #3a2c14); color: #ffe9c2; }
.vigil-btn:hover { box-shadow: 0 0 20px rgba(212, 176, 106, 0.4); }

.acts { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.act-card {
  width: 168px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  text-align: center;
  padding-bottom: 10px;
}
.act-card img { width: 100%; height: 150px; object-fit: cover; object-position: top; display: block; }
.act-card .pick-name { font-size: 18px; padding: 6px 8px 0; }
.act-card .pick-title { font-size: 9.5px; padding: 2px 8px 6px; }
.act-card .act-label {
  position: absolute; top: 6px; left: 8px;
  font-family: var(--serif); font-size: 13px; color: #f0e6d2;
  background: rgba(8, 10, 14, 0.75); border: 1px solid var(--line);
  padding: 2px 8px; border-radius: 10px;
}
.act-state { font-size: 9px; letter-spacing: 0.16em; padding: 3px 6px; }
.act-state.done { color: var(--good); }
.act-state.current { color: var(--gold); animation: intentPulse 1.8s infinite; }
.act-state.locked { color: #4d5464; }
.act-card.done { border-color: #2e5c39; filter: saturate(0.8); }
.act-card.current { border-color: var(--gold); box-shadow: 0 0 26px rgba(212, 176, 106, 0.3); }
.act-card.locked { filter: brightness(0.45) saturate(0.4); }

.camp-hero {
  display: flex; gap: 12px; align-items: center;
  background: rgba(10, 13, 18, 0.7);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 16px;
}
.camp-hero img { width: 56px; height: 72px; object-fit: cover; object-position: top; border-radius: 8px; }
.camp-notes { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.camp-note { font-size: 12px; color: var(--dim); }
.camp-note.bad { color: #f2a3a3; }
.camp-note.good { color: #9be5a3; }

.draft-c { transition: transform 0.15s; }
.draft-c:hover { transform: translateY(-8px) scale(1.04); }
.count-badge {
  position: absolute; top: -8px; right: -6px;
  background: var(--panel2); border: 1px solid var(--gold);
  color: #ffe9c2; border-radius: 12px;
  font-size: 12px; padding: 2px 8px; z-index: 3;
}
.mcard.noclick { pointer-events: none; opacity: 0.55; }
.trim-row { max-height: 46dvh; overflow-y: auto; }
.ep-box { background-size: cover; background-position: center; min-width: min(560px, 92vw); }

/* ============================================================
   TWIN VIGILS — co-op lobby & partner panel
   ============================================================ */
.coop-status { color: var(--dim); font-size: 14px; min-height: 1.4em; }
.coop-link {
  width: min(480px, 90vw);
  background: var(--panel);
  border: 1px solid var(--teal);
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  text-align: center;
}
#partner-panel {
  position: fixed;
  right: 12px;
  bottom: 240px;
  width: 190px;
  background: rgba(10, 13, 18, 0.92);
  border: 1px solid var(--teal);
  border-radius: 12px;
  padding: 10px 12px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
#partner-panel .pp-title { font-family: var(--serif); color: #bfe8e0; font-size: 14px; }
#partner-panel .pp-bar {
  position: relative; height: 12px;
  background: #0c0f15; border: 1px solid var(--line); border-radius: 7px; overflow: hidden;
}
#partner-panel .pp-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #2e8a5f, #5fc76a); }
#partner-panel .pp-bar b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 9px; color: #fff; text-shadow: 0 1px 2px #000; }
#partner-panel .pp-row { font-size: 11px; color: var(--dim); }
body.coop .logpanel { top: 46px; }
@media (min-width: 1280px) { body.coop #partner-panel { right: 262px; } }

/* ============================================================
   CLARITY update — tooltips, villain-phase recap, richer help
   ============================================================ */

/* custom tooltips */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  background: #10141c;
  border: 1px solid var(--gold);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: normal;
  font-family: var(--sans);
  letter-spacing: normal;
  text-transform: none;
  line-height: 1.45;
  padding: 8px 11px;
  border-radius: 8px;
  width: max-content;
  max-width: 240px;
  z-index: 600;
  pointer-events: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65);
  white-space: normal;
  text-align: left;
}
.hero-actions [data-tip]:hover::after { left: 0; transform: none; }
.side [data-tip]:hover::after { left: auto; right: 0; transform: none; }
.piles [data-tip]:hover::after { left: 0; transform: none; }

/* villain-phase step banner */
.banner.vp { align-items: flex-start; padding-top: 64px; }
.banner.vp .banner-inner {
  font-size: clamp(15px, 2.2vw, 21px);
  padding: 12px 8vw;
  border-color: var(--void);
  animation: bannerIn 0.25s ease-out;
}
.banner.vp.bad .banner-inner { border-color: var(--bad); text-shadow: 0 2px 14px rgba(255, 93, 93, 0.5); }
.banner.vp.good .banner-inner { border-color: var(--good); text-shadow: 0 2px 14px rgba(95, 199, 106, 0.5); }
.banner.vp.you .banner-inner { border-color: var(--teal); }

/* villain-phase recap */
.modal.recap .modal-box { min-width: min(480px, 92vw); border-color: var(--void); }
.recap-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 50dvh; overflow-y: auto;
  margin: 10px 0 14px;
  padding: 10px 12px;
  background: rgba(10, 13, 18, 0.65);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.recap-list .l { font-size: 13px; border-bottom: 1px dotted #1d2330; padding: 4px 0; display: block; }

/* help overhaul */
.help-box { width: min(820px, 96vw); }
.help-goal { font-family: var(--serif); font-style: italic; color: #e8dcc2 !important; font-size: 15px !important; }
.help-note { color: var(--teal) !important; font-size: 12.5px !important; font-style: italic; }
.help-body h4 {
  margin: 18px 0 8px;
  font-size: 17px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}
.help-body h5 { margin: 12px 0 2px; color: #e8dcc2; font-family: var(--serif); font-size: 14px; }
.hstep { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0; }
.hstep b {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #2b3547;
  border: 1px solid var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.hstep.vp b { border-color: var(--void); background: #241d38; }
.hstep span { font-size: 13px; color: #c4c9d4; line-height: 1.5; }
.anatomy { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin: 8px 0; }
.anatomy-card { width: 148px; aspect-ratio: 5 / 7; flex: none; }
.anatomy ol { flex: 1; min-width: 240px; margin: 0; padding-left: 20px; }
.anatomy li { font-size: 13px; color: #c4c9d4; line-height: 1.55; margin: 6px 0; }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.leg {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(10, 13, 18, 0.6);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}
.leg i {
  flex: none; font-style: normal; font-size: 16px;
  width: 34px; text-align: center;
  color: var(--gold);
}
.leg b { display: block; font-size: 12.5px; color: #f0e6d2; }
.leg span { font-size: 11.5px; color: var(--dim); line-height: 1.4; }

/* encounter reveal modal */
.modal.reveal-m .modal-box.reveal-box { border-color: var(--void); min-width: min(520px, 94vw); }
.reveal-body { display: flex; gap: 16px; align-items: flex-start; margin: 8px 0 14px; flex-wrap: wrap; }
.reveal-card { width: 172px; aspect-ratio: 5 / 7; flex: none; animation: revealIn 0.3s ease-out; }
.reveal-notes { flex: 1; min-width: 200px; }
.reveal-notes p {
  font-size: 13.5px; line-height: 1.55; color: #d9ccff;
  background: rgba(20, 16, 34, 0.6);
  border-left: 2px solid var(--void);
  padding: 8px 12px; border-radius: 0 8px 8px 0;
  margin: 6px 0;
}

/* ---------- v1.7 The Grand Design: agendas & crisis ---------- */
.scheme.crisis-locked { box-shadow: 0 0 0 2px #c9563f66, 0 0 22px #c9563f33; }
.crisis-lock {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  font-size: 15px; background: #1c0f12ee; border: 1px solid #c9563f;
  border-radius: 8px; padding: 2px 6px; cursor: help;
  animation: crisisPulse 1.6s ease-in-out infinite;
}
@keyframes crisisPulse { 50% { box-shadow: 0 0 10px #c9563f88; } }
.agenda-chips { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-top: 3px; }
.agchip {
  font-size: 9px; letter-spacing: .04em; color: #d8a6ff;
  background: #2a1f4577; border: 1px solid #4a3a75; border-radius: 6px; padding: 1px 5px;
}
.sscard.crisis { border-color: #c9563f; }
.sscard .kw.crisis-kw {
  background: #3a1410; border-color: #c9563f; color: #ff9c86;
  cursor: help;
}
.modal.agenda-m .modal-box.agenda-box { border-color: #7a5cff; box-shadow: 0 0 44px #7a5cff44; }
.modal.agenda-m h3 { color: #d8a6ff; }
.reveal-notes p.dim { opacity: .65; font-size: 12px; }

/* ---------- v1.8 Comfort: action dock, pause menu, settings ---------- */
.action-dock {
  position: fixed; left: 14px; bottom: 300px; z-index: 240;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 22px;
  background: #12101cee; border: 1px solid #3a3357;
  box-shadow: 0 8px 30px #000c, 0 0 22px #7a5cff22;
  animation: dockIn .22s ease-out;
}
@keyframes dockIn { from { transform: translateX(-24px); opacity: 0; } }
.dock-count {
  font-family: "Cinzel", serif; font-size: 17px; font-weight: 700;
  color: #ffb35c; line-height: 1; padding: 2px 0;
}
.dock-count span { font-size: 12px; opacity: .7; }
.dock-count.ok { color: #6fdc8f; }
.dock-btn {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid #4a4370; background: #201c33; color: #cfc7ee;
  font-size: 19px; cursor: pointer; display: grid; place-items: center;
  transition: transform .12s, box-shadow .12s;
}
.dock-btn:hover { transform: scale(1.1); }
.dock-btn.confirm { background: #1d3a2a; border-color: #3fc97a; color: #7dffab; box-shadow: 0 0 14px #3fc97a55; }
.dock-btn.confirm.off { opacity: .35; box-shadow: none; cursor: default; }
.dock-btn.danger { background: #33161b; border-color: #c9563f; color: #ff9c86; }
.dock-btn.confirm:not(.off) { animation: dockPulse 1.4s ease-in-out infinite; }
@keyframes dockPulse { 50% { box-shadow: 0 0 22px #3fc97a88; } }
.dock-label {
  max-width: 120px; text-align: center; font-size: 12px; color: #cfc7ee; line-height: 1.3;
}
.action-dock [data-tip]:hover::after { left: 54px; right: auto; top: 50%; transform: translateY(-50%); bottom: auto; }

.modal.pausemenu .modal-box.pause-box { min-width: min(440px, 92vw); text-align: left; }
.pause-box h3 { font-family: "Cinzel", serif; margin-bottom: 14px; }
.pause-box h4 { margin: 18px 0 8px; color: #a99ecf; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.pause-btns { display: flex; flex-direction: column; gap: 8px; }
.pause-btns .btn { width: 100%; }
.btn.danger { border-color: #c9563f; color: #ff9c86; }
.settings .set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 7px 0; border-bottom: 1px solid #ffffff0d; font-size: 13.5px; color: #d9d2f0;
}
.settings input[type="range"] {
  width: 150px; accent-color: #7a5cff; cursor: pointer;
}
.set-btns { display: flex; gap: 6px; }
.set-keys { margin-top: 10px; font-size: 11px; opacity: .55; line-height: 1.5; }

.no-motion .shake, .no-motion .shake-hard { animation: none !important; }
.no-motion .banner { animation-duration: .01s !important; }
.no-motion .lunge { animation: none !important; }

@media (max-width: 760px) {
  .action-dock { left: 8px; bottom: 250px; padding: 8px 9px; gap: 6px; }
  .dock-btn { width: 40px; height: 40px; font-size: 16px; }
}

/* ---------- v1.9 The Court's Arsenal ---------- */
.dock-row { display: flex; gap: 7px; }
.dock-row .dock-btn { width: 40px; height: 40px; font-size: 16px; }
.action-dock.mana-idle {
  flex-direction: row; gap: 5px; padding: 7px 14px; cursor: help;
  font-family: "Cinzel", serif; font-size: 15px; font-weight: 700; color: #8fe3d2;
  border-color: #2c5a51;
}
.action-dock.mana-idle:hover::after { left: 100%; margin-left: 8px; right: auto; top: 50%; transform: translateY(-50%); bottom: auto; }
.kw.tough { background: #2c2a24; border-color: #9c8f6a; color: #e5d9ae; cursor: help; }
.kw.ret { background: #331419; border-color: #b04a5a; color: #ff9aa8; cursor: help; }
.chip.attach { cursor: help; border-color: #7a5cff66; }
@media (max-width: 760px) {
  .action-dock.mana-idle { display: none; }
  .dock-row .dock-btn { width: 36px; height: 36px; }
}

/* Final responsive overrides live last so update-specific rules cannot undo them. */
@media (max-width: 560px) {
  .menu .hero-pick .pick { width: 280px; }
  .menu .hero-pick .pick img { height: 190px; }
  .menu .villain-pick .vpick { width: min(330px, 84vw); }
  .dock-row .dock-btn { width: 44px; height: 44px; }
}
