@font-face {
  font-family: 'Cinzel';
  font-weight: 700;
  font-display: swap;
  src: url('fonts/cinzel-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Alegreya Sans';
  font-weight: 500;
  font-display: swap;
  src: url('fonts/alegreya-sans-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Alegreya Sans';
  font-weight: 700;
  font-display: swap;
  src: url('fonts/alegreya-sans-latin-700-normal.woff2') format('woff2');
}

:root {
  color-scheme: dark;
  --ink: #15111a;
  --bone: #efe4cb;
  --parchment: #ead9b4;
  --attack: #8f2d26;
  --skill: #2b6670;
  --power: #a2731f;
  --energy: #5fe3f5;
  --hp: #c8423a;
  --block: #6fb2df;
  --display: 'Cinzel', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  --text: 'Alegreya Sans', 'Trebuchet MS', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #040607;
  font-family: var(--text);
  color: var(--bone);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

button {
  font: inherit;
  color: inherit;
}

/* The game is laid out on a fixed 1280×720 stage, scaled to fit the window. */
#stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1280px;
  height: 720px;
  overflow: hidden;
  transform: translate(-50%, -50%) scale(var(--scale, 1));
  touch-action: none;
  background: #070b0d;
}

.scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.flame {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: flicker 1.6s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 8px #6ff3ff);
}
.sconce:nth-of-type(2) .flame {
  animation-delay: -0.7s;
}
.soul-glow {
  animation: glow 3s ease-in-out infinite alternate;
}
.beam {
  mix-blend-mode: screen;
  animation: glow 7s ease-in-out infinite alternate;
}

@keyframes flicker {
  0% { transform: scale(1, 1) skewX(0deg); }
  30% { transform: scale(0.92, 1.08) skewX(-3deg); }
  60% { transform: scale(1.05, 0.94) skewX(2deg); }
  100% { transform: scale(0.96, 1.1) skewX(-1deg); }
}
@keyframes glow {
  from { opacity: 0.75; }
  to { opacity: 1; }
}

.fog {
  position: absolute;
  inset: auto 0 0 0;
  height: 300px;
  pointer-events: none;
  overflow: hidden;
}
.fog i {
  position: absolute;
  bottom: -60px;
  width: 1600px;
  height: 260px;
  background:
    radial-gradient(40% 50% at 25% 60%, rgb(150 200 200 / 0.09), transparent 70%),
    radial-gradient(35% 45% at 70% 55%, rgb(150 200 200 / 0.08), transparent 70%);
  animation: fog 38s linear infinite alternate;
}
.fog i + i {
  bottom: -100px;
  animation-duration: 52s;
  animation-direction: alternate-reverse;
  opacity: 0.8;
}
@keyframes fog {
  from { transform: translateX(-280px); }
  to { transform: translateX(0); }
}

.motes i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #cff6ff;
  opacity: 0;
  animation: mote linear infinite;
}
@keyframes mote {
  0% { transform: translate(0, 0); opacity: 0; }
  20% { opacity: 0.55; }
  80% { opacity: 0.4; }
  100% { transform: translate(var(--dx), -160px); opacity: 0; }
}

/* ---------- Units ---------- */
.unit {
  position: absolute;
  pointer-events: none;
}
.unit .art {
  position: relative;
  width: 100%;
  height: 100%;
}
.unit .art svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.unit .body {
  width: 100%;
  height: 100%;
  transform-origin: 50% 100%;
  animation: breathe 3.2s ease-in-out infinite;
}
.unit.enemy .body {
  animation-duration: 2.6s;
}
.unit.flying .body {
  animation: hover 2.4s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.012, 0.985); }
}
@keyframes hover {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

.unit.hit .art {
  animation: hit 0.32s ease-out;
}
@keyframes hit {
  0% { filter: brightness(3) saturate(0); transform: translateX(0); }
  25% { transform: translateX(10px); }
  50% { filter: brightness(1.4); transform: translateX(-8px); }
  75% { transform: translateX(4px); }
  100% { filter: none; transform: translateX(0); }
}

.unit.dead {
  transition: opacity 0.8s ease, transform 0.8s ease, filter 0.8s ease;
  opacity: 0;
  transform: translateY(16px);
  filter: brightness(0.3) blur(2px);
}

.unit.aimed .art::before {
  content: '';
  position: absolute;
  inset: -10px;
  border: 3px solid transparent;
  border-radius: 12px;
  background:
    linear-gradient(#ff6b55, #ff6b55) top left / 26px 3px no-repeat,
    linear-gradient(#ff6b55, #ff6b55) top left / 3px 26px no-repeat,
    linear-gradient(#ff6b55, #ff6b55) top right / 26px 3px no-repeat,
    linear-gradient(#ff6b55, #ff6b55) top right / 3px 26px no-repeat,
    linear-gradient(#ff6b55, #ff6b55) bottom left / 26px 3px no-repeat,
    linear-gradient(#ff6b55, #ff6b55) bottom left / 3px 26px no-repeat,
    linear-gradient(#ff6b55, #ff6b55) bottom right / 26px 3px no-repeat,
    linear-gradient(#ff6b55, #ff6b55) bottom right / 3px 26px no-repeat;
  animation: aim 0.9s ease-in-out infinite alternate;
}
.unit.aimed svg {
  filter: drop-shadow(0 0 12px rgb(255 90 70 / 0.65));
}
@keyframes aim {
  from { transform: scale(1); }
  to { transform: scale(1.04); }
}

.bar {
  position: absolute;
  left: 50%;
  width: 170px;
  margin-left: -85px;
  height: 18px;
  pointer-events: auto;
}
.hp {
  position: absolute;
  inset: 0;
  border-radius: 9px;
  background: #1a0d0e;
  border: 2px solid var(--ink);
  box-shadow: 0 2px 0 rgb(0 0 0 / 0.4);
  overflow: hidden;
}
.hp i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(#e65a4f, #a32d27);
  transition: width 0.35s ease;
}
.hp i.lag {
  background: #f3d9a4;
  transition: width 0.8s ease 0.25s;
}
.bar.blocking .hp {
  border-color: #9bd2f5;
}
.bar.blocking .hp i:not(.lag) {
  background: linear-gradient(#7fb6d8, #3f6f93);
}
.hp span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 13px/1 var(--text);
  color: #fff;
  text-shadow: 0 1px 0 #000, 0 0 3px #000;
}
.block-badge {
  position: absolute;
  left: -22px;
  top: 50%;
  width: 34px;
  height: 38px;
  margin-top: -20px;
  display: grid;
  place-items: center;
  font: 700 15px/1 var(--display);
  color: #fff;
  text-shadow: 0 1px 0 #000, 0 0 4px #000;
  transform: scale(0);
  transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
  z-index: 1;
}
.block-badge svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.block-badge span {
  position: relative;
  margin-top: -2px;
}
.bar.blocking .block-badge {
  transform: scale(1);
}

.statuses {
  position: absolute;
  left: 50%;
  width: 170px;
  margin-left: -85px;
  display: flex;
  gap: 4px;
  pointer-events: auto;
}
.status {
  position: relative;
  width: 26px;
  height: 26px;
  animation: pop 0.3s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.status svg {
  width: 100%;
  height: 100%;
}
.status b {
  position: absolute;
  right: -3px;
  bottom: -4px;
  font: 700 12px/1 var(--text);
  color: #fff;
  text-shadow: 0 1px 0 #000, 0 0 3px #000, 0 0 3px #000;
}
@keyframes pop {
  from { transform: scale(0.2); }
}

.intent {
  position: absolute;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 2px;
  transform: translateX(-50%);
  pointer-events: auto;
  animation: bob 1.8s ease-in-out infinite;
  transition: opacity 0.25s;
}
.intent svg {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 2px 2px rgb(0 0 0 / 0.6));
}
.intent b {
  font: 700 22px/1 var(--display);
  color: #fff;
  text-shadow: 0 2px 0 #000, 0 0 4px #000;
}
.intent.hidden {
  opacity: 0;
}
@keyframes bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -5px; }
}

/* ---------- Cards ---------- */
#hand {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.card {
  position: absolute;
  left: 0;
  top: 0;
  width: 150px;
  height: 212px;
  transform-origin: 50% 50%;
  transition:
    transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.24s ease;
  will-change: transform;
}
.card.dragging {
  transition: none;
}
.card .face {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background:
    radial-gradient(120% 70% at 50% 100%, rgb(150 110 60 / 0.25), transparent 60%),
    linear-gradient(#f1e3c3, #dcc79c);
  border: 3px solid #2b2119;
  box-shadow:
    0 12px 22px rgb(0 0 0 / 0.5),
    inset 0 0 0 2px rgb(255 255 255 / 0.35);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.card.playable .face {
  box-shadow:
    0 0 0 2px #8ff3ff,
    0 0 18px 2px rgb(95 227 245 / 0.75),
    0 12px 22px rgb(0 0 0 / 0.5),
    inset 0 0 0 2px rgb(255 255 255 / 0.35);
}
.card.ready .face {
  box-shadow:
    0 0 0 3px #fff4c8,
    0 0 30px 6px rgb(255 230 150 / 0.8),
    0 12px 22px rgb(0 0 0 / 0.5);
}
.card .banner {
  margin: 20px 9px 0;
  height: 26px;
  border-radius: 4px;
  background: var(--type);
  box-shadow:
    inset 0 -3px rgb(0 0 0 / 0.3),
    inset 0 1px rgb(255 255 255 / 0.2),
    0 0 0 2px #2b2119;
  display: grid;
  place-items: center;
  font: 700 13px/1 var(--display);
  letter-spacing: 0.02em;
  color: #fbf1da;
  text-shadow: 0 1px 0 rgb(0 0 0 / 0.5);
  white-space: nowrap;
}
.card .pic {
  margin: 7px 10px 0;
  height: 68px;
  border-radius: 6px;
  border: 2px solid #2b2119;
  background: radial-gradient(90% 90% at 50% 40%, var(--pic-hi), var(--pic-lo));
  overflow: hidden;
}
.card .pic svg {
  width: 100%;
  height: 100%;
}
.card .kind {
  margin-top: 3px;
  font: 700 10px/1 var(--text);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  color: #6f5a43;
}
.card .desc {
  height: 66px;
  padding: 0 11px;
  display: grid;
  place-items: center;
  text-align: center;
  font: 700 15px/1.15 var(--text);
  color: #2a1d14;
}
.card .desc b {
  color: #2a1d14;
}
.card .desc .up {
  color: #24812f;
}
.card .desc .down {
  color: #b02a22;
}
.card .desc .kw {
  color: #9a5a12;
}
.card .cost {
  position: absolute;
  left: -11px;
  top: -11px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid #0f2128;
  background: radial-gradient(circle at 35% 30%, #d6fcff, #3cb9d2 45%, #0e4b5e);
  display: grid;
  place-items: center;
  font: 700 21px/1 var(--display);
  color: #fff;
  text-shadow: 0 2px 0 #0a2a35;
  z-index: 2;
}
.card.too-costly .cost {
  background: radial-gradient(circle at 35% 30%, #ffd0c8, #d24b3c 45%, #5e1510);
}
.card.attack {
  --type: var(--attack);
  --pic-hi: #5a2a22;
  --pic-lo: #1d0f0d;
}
.card.skill {
  --type: var(--skill);
  --pic-hi: #20484f;
  --pic-lo: #0b1a1d;
}
.card.power {
  --type: var(--power);
  --pic-hi: #5e4417;
  --pic-lo: #1f1608;
}
.card.power .face {
  border-radius: 12px 12px 40px 40px / 12px 12px 22px 22px;
}
.card.shake {
  animation: shake 0.35s;
}
@keyframes shake {
  25% { translate: -8px 0; }
  50% { translate: 7px 0; }
  75% { translate: -4px 0; }
}

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#hud button {
  pointer-events: auto;
}
.topbar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 46px;
  padding: 0 20px 0 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(rgb(0 0 0 / 0.7), transparent);
}
.brand {
  font: 700 18px/1 var(--display);
  letter-spacing: 0.08em;
  color: #d8e9e6;
}
.brand span {
  margin-left: 14px;
  font: 500 15px/1 var(--text);
  letter-spacing: 0.04em;
  color: #8fa7a4;
}
.top-actions {
  display: flex;
  gap: 8px;
  margin-right: 76px;
}
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #3b4a48;
  background: rgb(10 16 18 / 0.8);
  font: 700 16px/1 var(--text);
  color: #cfe0dd;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.icon-btn:hover {
  transform: translateY(-2px);
  border-color: #8ff3ff;
}
.icon-btn.off {
  opacity: 0.5;
  text-decoration: line-through;
}

.energy {
  position: absolute;
  left: 64px;
  top: 498px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 38% 32%, #e6feff 0, #6ae6f7 22%, #1a8aa3 55%, #0a3240 80%),
    #0a3240;
  border: 4px solid #0d1d22;
  box-shadow:
    0 0 0 3px #3e5654,
    0 0 34px 6px rgb(95 227 245 / 0.45),
    inset 0 -8px 16px rgb(0 0 0 / 0.45);
  font: 700 26px/1 var(--display);
  color: #fff;
  text-shadow: 0 2px 0 #06303c, 0 0 6px #06303c;
  pointer-events: auto;
  transition: filter 0.3s, box-shadow 0.3s;
}
.energy::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px dashed rgb(143 243 255 / 0.35);
  animation: spin 18s linear infinite;
}
.energy.empty {
  filter: saturate(0.2) brightness(0.6);
  box-shadow: 0 0 0 3px #3e5654;
}
.energy.bump {
  animation: bump 0.35s;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes bump {
  50% { transform: scale(1.18); }
}

.pile {
  position: absolute;
  width: 74px;
  height: 74px;
  padding: 0;
  border: 0;
  background: none;
  cursor: default;
}
.draw-pile {
  left: 26px;
  top: 616px;
}
.discard-pile {
  left: 1176px;
  top: 586px;
}
.pile-cards,
.pile-cards::before,
.pile-cards::after {
  position: absolute;
  left: 18px;
  top: 10px;
  width: 38px;
  height: 52px;
  border-radius: 5px;
  border: 2px solid #1c1510;
  background: linear-gradient(135deg, #4b3a28, #2a2016);
  box-shadow: 0 3px 6px rgb(0 0 0 / 0.5);
}
.pile-cards::before,
.pile-cards::after {
  content: '';
  left: -2px;
  top: -2px;
}
.pile-cards::before {
  transform: rotate(-8deg);
}
.pile-cards::after {
  transform: rotate(7deg);
  background:
    radial-gradient(circle at 50% 50%, #8ff3ff 0 3px, transparent 4px),
    linear-gradient(135deg, #5b4630, #2f2419);
}
.discard-pile .pile-cards::after {
  background:
    radial-gradient(circle at 50% 50%, #c7a77a 0 3px, transparent 4px),
    linear-gradient(135deg, #3f3a36, #24201d);
}
.pile b {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 14px;
  border: 2px solid #1c1510;
  background: #efe4cb;
  font: 700 15px/24px var(--text);
  color: #2a1d14;
}
.pile.pulse b {
  animation: bump 0.3s;
}

.end-turn {
  position: absolute;
  left: 1066px;
  top: 518px;
  width: 168px;
  height: 52px;
  border-radius: 26px;
  border: 3px solid #12201f;
  background: linear-gradient(#3c8a7f, #1f544e);
  box-shadow:
    0 0 0 2px #6fae9f,
    0 6px 12px rgb(0 0 0 / 0.5),
    inset 0 2px rgb(255 255 255 / 0.25);
  font: 700 17px/1 var(--display);
  letter-spacing: 0.05em;
  color: #f1fbf7;
  text-shadow: 0 2px 0 rgb(0 0 0 / 0.4);
  cursor: pointer;
  transition: transform 0.15s, filter 0.2s, box-shadow 0.2s;
}
.end-turn:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.12);
}
.end-turn:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}
.end-turn.nudge {
  box-shadow:
    0 0 0 2px #c9fff1,
    0 0 26px 6px rgb(130 255 220 / 0.55),
    0 6px 12px rgb(0 0 0 / 0.5);
  animation: nudge 1.4s ease-in-out infinite;
}
.end-turn:disabled {
  filter: grayscale(1) brightness(0.55);
  cursor: default;
}
@keyframes nudge {
  50% { transform: translateY(-3px); }
}

/* ---------- Arrow, effects, tooltips ---------- */
#arrow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
#arrow circle,
#arrow path {
  fill: var(--bone);
  stroke: var(--ink);
  stroke-width: 3;
  transition: fill 0.12s;
}
#arrow.locked circle,
#arrow.locked path {
  fill: #ff6b55;
}

#fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.num {
  position: absolute;
  font: 700 46px/1 var(--display);
  color: #fff;
  -webkit-text-stroke: 6px var(--ink);
  paint-order: stroke fill;
  white-space: nowrap;
}
.num.small {
  font-size: 26px;
  -webkit-text-stroke-width: 5px;
}
.num.block {
  color: #bfe3fb;
}
.num.heal {
  color: #9ef0a0;
}
.num.debuff {
  color: #d7b6ff;
}
.num.buff {
  color: #ffb3a1;
}
.slash {
  position: absolute;
  width: 220px;
  height: 220px;
  margin: -110px 0 0 -110px;
}

#tips {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.tip {
  position: absolute;
  width: 210px;
  padding: 9px 12px 10px;
  border-radius: 8px;
  border: 2px solid #3c4d4a;
  background: rgb(9 14 15 / 0.94);
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.5);
  font: 500 14px/1.3 var(--text);
  color: #d6e4e1;
}
.tip + .tip {
  margin-top: 6px;
}
.tip strong {
  display: block;
  margin-bottom: 3px;
  font: 700 13px/1.2 var(--display);
  color: #f3e3bc;
}

#banner {
  position: absolute;
  left: 0;
  right: 0;
  top: 250px;
  height: 100px;
  display: grid;
  place-items: center;
  font: 700 54px/1 var(--display);
  letter-spacing: 0.06em;
  color: #f3ead2;
  text-shadow: 0 4px 0 rgb(0 0 0 / 0.6), 0 0 30px rgb(0 0 0 / 0.9);
  background: linear-gradient(90deg, transparent, rgb(0 0 0 / 0.65) 30%, rgb(0 0 0 / 0.65) 70%, transparent);
  opacity: 0;
  pointer-events: none;
}
#banner.enemy {
  color: #ffc4b8;
}

#toast {
  position: absolute;
  left: 50%;
  top: 420px;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 8px;
  background: rgb(0 0 0 / 0.75);
  font: 700 20px/1 var(--text);
  color: #ffd9cf;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
#toast.show {
  opacity: 1;
}

/* ---------- Overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 45%, rgb(4 8 10 / 0.55), rgb(2 4 5 / 0.9));
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.35s,
    visibility 0.35s;
}
.overlay.show {
  opacity: 1;
  visibility: visible;
}
.panel {
  width: 560px;
  padding: 34px 44px 36px;
  border-radius: 14px;
  border: 2px solid #3c4d4a;
  background: linear-gradient(rgb(14 22 23 / 0.96), rgb(8 12 13 / 0.96));
  box-shadow:
    0 30px 80px rgb(0 0 0 / 0.7),
    inset 0 1px rgb(255 255 255 / 0.06);
  text-align: center;
}
.panel h1 {
  margin: 0;
  font: 700 58px/1 var(--display);
  letter-spacing: 0.08em;
  color: #eaf6f3;
  text-shadow: 0 0 30px rgb(110 230 240 / 0.35);
}
.panel h2 {
  margin: 0;
  font: 700 46px/1 var(--display);
  letter-spacing: 0.06em;
}
.panel .sub {
  margin: 12px 0 0;
  font: 500 18px/1.4 var(--text);
  color: #9fb5b1;
}
.panel ul {
  margin: 22px auto 0;
  padding: 0;
  max-width: 420px;
  list-style: none;
  text-align: left;
  font: 500 16px/1.4 var(--text);
  color: #c9d8d5;
}
.panel li {
  position: relative;
  padding-left: 22px;
}
.panel li + li {
  margin-top: 6px;
}
.panel li::before {
  content: '◆';
  position: absolute;
  left: 0;
  top: 1px;
  font-size: 11px;
  color: var(--energy);
}
.panel .keys {
  margin-top: 16px;
  font: 500 14px/1.4 var(--text);
  color: #7f9692;
}
.panel kbd {
  display: inline-block;
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid #3c4d4a;
  font: 700 12px/1.4 var(--text);
  color: #c9d8d5;
}
.panel .big-btn {
  margin-top: 26px;
  padding: 14px 40px;
  border-radius: 30px;
  border: 3px solid #12201f;
  background: linear-gradient(#3c8a7f, #1f544e);
  box-shadow:
    0 0 0 2px #6fae9f,
    0 8px 20px rgb(0 0 0 / 0.5);
  font: 700 20px/1 var(--display);
  letter-spacing: 0.06em;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}
.panel .big-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}
.panel .win {
  color: #f5dfa0;
}
.panel .lose {
  color: #ff9d8c;
}
.panel .stats {
  display: flex;
  justify-content: center;
  gap: 36px;
  margin-top: 20px;
}
.panel .stats div {
  font: 500 14px/1.2 var(--text);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7f9692;
}
.panel .stats b {
  display: block;
  margin-top: 6px;
  font: 700 28px/1 var(--display);
  letter-spacing: 0;
  color: #eaf6f3;
}

@media (prefers-reduced-motion: reduce) {
  .fog i,
  .motes i,
  .energy::before,
  .unit .body {
    animation: none;
  }
}

/* ---------- Layers and small effects ---------- */
#units { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
#hand { z-index: 2; }
#hud { z-index: 3; }
#arrow { z-index: 4; }
#fx { z-index: 5; }
#tips { z-index: 6; }
#banner { z-index: 7; }
#toast { z-index: 8; }
.overlay { z-index: 10; }

.bar,
.statuses,
.intent,
.energy {
  pointer-events: auto;
}

.wing {
  transform-box: view-box;
  transform-origin: 100px 92px;
  animation: flap 0.3s ease-in-out infinite alternate;
}
.wing + .wing {
  animation-delay: -0.02s;
}
@keyframes flap {
  from { transform: scaleX(1); }
  to { transform: scaleX(0.68); }
}
.spot {
  filter: drop-shadow(0 0 4px #8ff0ff);
}

.shadow {
  position: absolute;
  width: 140px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(0 0 0 / 0.55), transparent);
  animation: shadow 2.4s ease-in-out infinite;
  transition: opacity 0.6s;
}
@keyframes shadow {
  50% { transform: scale(0.8); opacity: 0.7; }
}

.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 38px;
  height: 52px;
  border-radius: 5px;
  border: 2px solid #1c1510;
  background: linear-gradient(135deg, #5b4630, #2f2419);
}

.hurt {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 180px 40px rgb(190 20 10 / 0.55);
}

.dust {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: radial-gradient(circle, #efe2ff, rgb(154 106 214 / 0.6) 50%, transparent 70%);
}

@media (prefers-reduced-motion: reduce) {
  .wing,
  .shadow {
    animation: none;
  }
}
.card .desc p {
  margin: 0;
}
