﻿/* ============================================================
   SENDA DE HIERRO — un descenso en 8 bits
   ============================================================ */

@font-face {
  font-family: "Press Start 2P";
  src: url("assets/fonts/press-start-2p.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "VT323";
  src: url("assets/fonts/vt323.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #070605;
  --ink-soft: #0b0908;
  --ink-raised: #110e0b;
  --panel: #100d0a;
  --panel-warm: #17110d;
  --bone: #e9dec4;
  --bone-bright: #fff3d6;
  --bone-dim: #a89a81;
  --bone-faint: #6f6455;
  --blood: #a22722;
  --blood-dark: #53110f;
  --blood-bright: #e14835;
  --ember: #e9a34d;
  --gold: #cda85c;
  --gold-bright: #f2cf82;
  --steel: #879ca7;
  --line: #332b22;
  --line-soft: #221c16;
  --accent: var(--gold);
  --font-display: "Press Start 2P", "Courier New", monospace;
  --font-body: "VT323", "Lucida Console", monospace;
  --topbar-h: 64px;
  --shadow-hard: 5px 5px 0 #030202;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 50% -20%, #24110d 0%, transparent 55%),
    var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.2;
  -webkit-font-smoothing: none;
  text-rendering: optimizeSpeed;
}

body::selection,
::selection {
  background: var(--blood);
  color: var(--bone-bright);
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
}

button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px dashed var(--gold);
  outline-offset: 4px;
}

img,
canvas,
svg {
  display: block;
}

.hidden {
  display: none !important;
}

.app {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

.backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: saturate(1.05) contrast(1.12) brightness(1.05);
}

/* ============================================================
   CRT / ATMOSPHERE
   ============================================================ */

.fx-scanlines,
.fx-vignette,
.fx-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
}

.fx-scanlines {
  opacity: 0.12;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.34) 0,
    rgba(0, 0, 0, 0.34) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}

.fx-vignette {
  z-index: 8999;
  background:
    radial-gradient(ellipse at center, transparent 54%, rgba(0, 0, 0, 0.36) 84%, rgba(0, 0, 0, 0.74) 100%);
}

.fx-grain {
  z-index: 8998;
  opacity: 0.09;
  background-image:
    radial-gradient(circle at 23% 41%, rgba(255, 236, 200, 0.22) 0 1px, transparent 1px),
    radial-gradient(circle at 71% 22%, rgba(255, 236, 200, 0.16) 0 1px, transparent 1px),
    radial-gradient(circle at 44% 77%, rgba(255, 236, 200, 0.15) 0 1px, transparent 1px);
  background-size: 7px 7px, 11px 11px, 13px 13px;
  mix-blend-mode: overlay;
  animation: grain-drift 8s steps(4) infinite;
}

@keyframes grain-drift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(1px, -1px); }
  50% { transform: translate(-1px, 1px); }
  75% { transform: translate(1px, 1px); }
  100% { transform: translate(0, 0); }
}

/* ============================================================
   TYPOGRAPHY / UTILITIES
   ============================================================ */

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 8px;
  line-height: 1.7;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.eyebrow b,
.eyebrow strong {
  color: var(--bone);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  padding: 12px 18px;
  border: 2px solid var(--bone-faint);
  border-radius: 0;
  background: transparent;
  color: var(--bone);
  font-family: var(--font-display);
  font-size: 8px;
  line-height: 1.6;
  letter-spacing: 1px;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(0 5px, 5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%);
  transition: background 140ms linear, color 140ms linear, border-color 140ms linear, transform 140ms ease;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(233, 222, 196, 0.12);
  pointer-events: none;
}

.btn:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  border-color: var(--gold);
  background: var(--bone);
  color: #140f0a;
}

.btn-primary:hover {
  border-color: var(--bone-bright);
  background: var(--gold-bright);
  color: #120c08;
}

.btn-primary::after {
  border-color: rgba(25, 17, 10, 0.2);
}

.btn-ghost {
  border-color: var(--line);
  background: rgba(8, 6, 5, 0.62);
  color: var(--bone-dim);
}

.btn-ghost:hover {
  border-color: var(--bone-faint);
  background: rgba(28, 20, 15, 0.8);
  color: var(--bone);
}

.btn-danger {
  border-color: var(--blood-bright);
  background: var(--blood);
  color: var(--bone-bright);
  box-shadow: var(--shadow-hard);
}

.btn-danger:hover {
  border-color: var(--ember);
  background: #c0332a;
  color: #fff5df;
}

.btn-caret,
.btn-arrow {
  color: currentColor;
  font-size: 0.9em;
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: currentColor;
}

.muted {
  color: var(--bone-dim);
}

/* ============================================================
   TOP BAR
   ============================================================ */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto minmax(170px, 1fr);
  align-items: center;
  gap: 20px;
  height: var(--topbar-h);
  padding: 0 clamp(14px, 3vw, 34px);
  border-bottom: 1px solid rgba(121, 93, 57, 0.22);
  background:
    linear-gradient(180deg, rgba(8, 6, 5, 0.98), rgba(8, 6, 5, 0.9)),
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(255, 255, 255, 0.015) 10px 11px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 2px;
  opacity: 0.42;
  background: repeating-linear-gradient(90deg, transparent 0 22px, var(--blood) 22px 24px);
}

.brand-mini {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  background: none;
  color: var(--bone);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.6px;
  cursor: pointer;
}

.brand-mini em {
  color: var(--blood-bright);
  font-style: normal;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid var(--line);
  color: var(--blood-bright);
  font-size: 16px;
  text-shadow: 0 0 10px rgba(225, 72, 53, 0.55);
}

.brand-mini:hover {
  color: var(--gold-bright);
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: center;
}

.progress-caption {
  color: var(--bone-faint);
  font-family: var(--font-display);
  font-size: 6px;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

.progress {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress li {
  position: relative;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid #2c241d;
  background: #0b0907;
  color: #51483d;
  font-family: var(--font-display);
  font-size: 6px;
  transition: color 200ms, border-color 200ms, background 200ms;
}

.progress li::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid transparent;
}

.progress li.is-done {
  border-color: currentColor;
  background: rgba(29, 22, 16, 0.8);
}

.progress li.is-done.type-acero { color: var(--gold); }
.progress li.is-done.type-hierro { color: var(--steel); }
.progress li.is-done.type-sangre { color: var(--blood-bright); }

.progress li.is-current {
  border-color: var(--bone);
  color: var(--bone);
  box-shadow: 0 0 0 1px #000, 0 0 16px rgba(205, 168, 92, 0.2);
}

.progress li.is-current::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--blood-bright);
  transform: translateX(-50%);
  animation: blink-soft 1.4s steps(2) infinite;
}

.top-actions {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 7px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #332a21;
  background: #0c0a08;
  color: var(--bone-dim);
  font-family: var(--font-display);
  font-size: 11px;
  cursor: pointer;
  transition: color 140ms, border-color 140ms, background 140ms;
}

.icon-btn:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: #17110c;
}

.sound-off {
  display: none;
}

.sound-btn.is-muted .sound-on {
  display: none;
}

.sound-btn.is-muted .sound-off {
  display: inline;
  color: var(--blood-bright);
}

/* ============================================================
   TITLE
   ============================================================ */

.title-screen {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 92px 22px 96px;
  overflow: hidden;
  isolation: isolate;
}

#titleCanvas {
  filter: saturate(1.02) contrast(1.14) brightness(1.05);
}

.title-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 51% 43%, rgba(95, 21, 16, 0.13) 0, transparent 36%),
    linear-gradient(90deg, rgba(4, 3, 3, 0.86) 0%, rgba(4, 3, 3, 0.3) 42%, rgba(4, 3, 3, 0.64) 100%),
    linear-gradient(180deg, rgba(4, 3, 3, 0.7) 0%, transparent 32%, rgba(4, 3, 3, 0.2) 60%, rgba(4, 3, 3, 0.92) 100%);
}

.title-shade::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.23;
  background: repeating-linear-gradient(90deg, transparent 0 119px, rgba(255, 231, 189, 0.06) 119px 120px);
}

.title-content {
  position: relative;
  z-index: 2;
  width: min(880px, 100%);
  text-align: center;
  animation: title-in 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.title-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
  color: var(--bone-dim);
  font-size: 8px;
  letter-spacing: 2px;
}

.title-eyebrow::before,
.title-eyebrow::after {
  content: "";
  width: clamp(24px, 8vw, 94px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--bone-faint));
}

.title-eyebrow::after {
  background: linear-gradient(90deg, var(--bone-faint), transparent);
}

.game-title {
  margin: 0;
  color: var(--bone);
  font-family: var(--font-display);
  font-size: clamp(38px, 8.2vw, 92px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.055em;
  text-transform: uppercase;
  text-shadow:
    4px 4px 0 #1b0d0a,
    8px 8px 0 rgba(0, 0, 0, 0.62),
    0 0 42px rgba(147, 33, 28, 0.2);
}

.game-title span {
  display: block;
}

.game-title span:last-child {
  color: #d54a39;
  text-shadow:
    4px 4px 0 #2b0d0a,
    8px 8px 0 rgba(0, 0, 0, 0.66),
    0 0 26px rgba(190, 49, 38, 0.34);
}

.title-subtitle {
  margin: 22px 0 0;
  color: var(--bone-dim);
  font-family: var(--font-display);
  font-size: clamp(8px, 1.2vw, 12px);
  line-height: 1.8;
  letter-spacing: 0.42em;
}

.title-hook {
  margin: 28px auto 0;
  color: var(--bone-dim);
  font-family: var(--font-body);
  font-size: clamp(20px, 2.4vw, 27px);
  letter-spacing: 0.03em;
}

.title-hook strong {
  color: var(--bone-bright);
  font-weight: 400;
}

.title-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 38px;
}

.btn-start {
  min-width: 270px;
}

.title-run-info {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin-top: 26px;
  color: var(--bone-faint);
  font-family: var(--font-display);
  font-size: 6px;
  line-height: 1.8;
  letter-spacing: 1px;
}

.title-run-info b {
  margin-left: 5px;
  color: var(--gold);
  font-weight: 400;
}

.title-footer {
  position: absolute;
  z-index: 2;
  left: clamp(18px, 4vw, 58px);
  right: clamp(18px, 4vw, 58px);
  bottom: 26px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(139, 108, 63, 0.22);
  color: var(--bone-faint);
  font-family: var(--font-display);
  font-size: 7px;
  letter-spacing: 1px;
}

.content-note {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 7px;
  margin: 0;
  color: #4c4236;
  font-family: var(--font-display);
  font-size: 5px;
  letter-spacing: 0.8px;
  transform: translateX(-50%);
  white-space: nowrap;
}

@keyframes title-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   INTRO
   ============================================================ */

.intro-screen {
  position: relative;
  min-height: 100svh;
  padding: calc(var(--topbar-h) + 34px) clamp(16px, 4vw, 56px) 48px;
  overflow: hidden;
  isolation: isolate;
}

#introCanvas {
  position: fixed;
  opacity: 0.5;
  filter: saturate(0.85) contrast(1.1) brightness(1.04);
}

.intro-wash {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at 63% 38%, rgba(68, 51, 33, 0.25), transparent 42%),
    linear-gradient(180deg, rgba(6, 5, 4, 0.64), rgba(6, 5, 4, 0.92) 64%, #070605 100%);
}

.intro-frame {
  position: relative;
  z-index: 2;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px);
  border: 1px solid rgba(135, 106, 63, 0.3);
  background:
    linear-gradient(135deg, rgba(23, 17, 12, 0.95), rgba(10, 8, 6, 0.96)),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.012) 3px 4px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62);
}

.intro-frame::before,
.intro-frame::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.intro-frame::before {
  inset: 8px;
  border: 1px solid rgba(120, 91, 51, 0.14);
}

.intro-frame::after {
  top: 0;
  left: 0;
  width: 80px;
  height: 4px;
  background: var(--blood);
}

.intro-heading {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
}

.intro-heading h2 {
  margin: 10px 0 0;
  color: var(--bone);
  font-family: var(--font-display);
  font-size: clamp(22px, 3.4vw, 38px);
  line-height: 1.38;
  letter-spacing: -0.04em;
}

.intro-heading::after {
  content: "VII";
  color: rgba(205, 168, 92, 0.12);
  font-family: var(--font-display);
  font-size: clamp(50px, 9vw, 106px);
  line-height: 0.7;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 0.8fr);
  gap: clamp(22px, 4vw, 52px);
  padding: clamp(24px, 3.5vw, 40px) 0;
}

.lore-panel {
  padding-right: clamp(0px, 2vw, 24px);
}

.lore-lead {
  margin: 0;
  color: var(--bone-bright);
  font-family: var(--font-body);
  font-size: clamp(25px, 2.7vw, 34px);
  line-height: 1.12;
}

.lore-body {
  margin: 20px 0 0;
  max-width: 64ch;
  color: var(--bone-dim);
  font-size: clamp(19px, 1.8vw, 23px);
  line-height: 1.38;
}

.lore-panel blockquote {
  margin: 26px 0 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--blood);
  color: var(--gold);
  font-size: clamp(21px, 2vw, 26px);
  font-style: italic;
  line-height: 1.2;
}

.lore-attribution {
  margin: 8px 0 0 23px;
  color: var(--bone-faint);
  font-family: var(--font-display);
  font-size: 6px;
  line-height: 1.8;
  letter-spacing: 0.6px;
}

.threat-panel {
  position: relative;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 250px;
  padding: 22px;
  border: 1px solid #3f2a21;
  background:
    radial-gradient(ellipse at 50% 13%, rgba(114, 21, 17, 0.36), transparent 58%),
    linear-gradient(180deg, rgba(21, 15, 12, 0.96), rgba(8, 6, 5, 0.98));
  overflow: hidden;
}

.threat-panel::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(135, 51, 35, 0.16);
  pointer-events: none;
}

.threat-sigil {
  position: absolute;
  top: 12px;
  left: 50%;
  width: 120px;
  height: 98px;
  opacity: 0.7;
  transform: translateX(-50%);
}

.sigil-eye {
  position: absolute;
  top: 32px;
  left: 50%;
  width: 74px;
  height: 40px;
  background:
    radial-gradient(circle at 50% 50%, #e9a34d 0 7%, #a22722 8% 19%, #270a08 20% 31%, transparent 32%);
  clip-path: polygon(0 50%, 22% 28%, 50% 18%, 78% 28%, 100% 50%, 78% 72%, 50% 82%, 22% 72%);
  transform: translateX(-50%);
  animation: threat-pulse 3s ease-in-out infinite;
}

.sigil-crown {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 86px;
  height: 26px;
  border-top: 4px solid #cda85c;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  transform: translateX(-50%);
  clip-path: polygon(0 100%, 0 40%, 18% 70%, 32% 0, 50% 55%, 68% 0, 82% 70%, 100% 40%, 100% 100%);
  background: #a88647;
}

@keyframes threat-pulse {
  0%, 100% { filter: brightness(0.8); transform: translateX(-50%) scale(0.98); }
  50% { filter: brightness(1.2); transform: translateX(-50%) scale(1.02); }
}

.threat-panel h3 {
  position: relative;
  margin: 8px 0 16px;
  color: var(--blood-bright);
  font-family: var(--font-display);
  font-size: clamp(13px, 1.6vw, 18px);
  line-height: 1.5;
}

.threat-stats {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border: 1px solid #39271e;
  background: #39271e;
}

.threat-stats div {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px 12px;
  background: #0c0907;
}

.threat-stats span {
  color: var(--bone-faint);
  font-family: var(--font-display);
  font-size: 6px;
  letter-spacing: 0.6px;
}

.threat-stats strong {
  color: var(--bone);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
}

.threat-text {
  position: relative;
  margin: 14px 0 0;
  color: var(--bone-dim);
  font-size: 18px;
  line-height: 1.2;
}

.rules-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: var(--line-soft);
}

.rule-card {
  padding: 18px 16px;
  background: #0c0a08;
}

.rule-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.rule-card svg {
  width: 18px;
  height: 18px;
  color: var(--gold);
}

.rule-card h3 {
  margin: 0;
  color: var(--bone);
  font-family: var(--font-display);
  font-size: 7px;
  line-height: 1.6;
  letter-spacing: 0.6px;
}

.rule-card p {
  margin: 0;
  color: var(--bone-dim);
  font-size: 17px;
  line-height: 1.2;
}

.intro-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 22px;
}

.intro-hint {
  margin: 0;
  color: var(--bone-faint);
  font-size: 18px;
}

.intro-hint em {
  color: var(--gold);
  font-style: normal;
}

/* ============================================================
   HUD
   ============================================================ */

.game-screen {
  position: relative;
  padding: calc(var(--topbar-h) + 16px) 0 46px;
  min-height: 100svh;
}

.hud {
  display: grid;
  grid-template-columns: 1.2fr 0.82fr 0.82fr 1.48fr 1.7fr;
  gap: 8px;
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto 12px;
}

.hero-block,
.stat-chip,
.fate-chip {
  position: relative;
  min-height: 66px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(20, 16, 12, 0.95), rgba(10, 8, 6, 0.96)),
    repeating-linear-gradient(90deg, transparent 0 7px, rgba(255, 255, 255, 0.015) 7px 8px);
  clip-path: polygon(0 4px, 4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%);
}

.hero-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
}

.hero-sigil {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border: 1px solid #443525;
  background:
    radial-gradient(circle at 50% 35%, rgba(151, 52, 39, 0.32), transparent 60%),
    #0b0806;
}

.hero-sigil canvas {
  width: 42px;
  height: 42px;
  image-rendering: pixelated;
}

.hero-sigil-line {
  position: absolute;
  right: -5px;
  bottom: 4px;
  width: 9px;
  height: 1px;
  background: var(--blood);
}

.hero-id {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.hud-label {
  color: var(--bone-faint);
  font-family: var(--font-display);
  font-size: 6px;
  line-height: 1.5;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

.hud-level {
  color: var(--bone);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  overflow: hidden;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  color: var(--bone-dim);
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stat-chip strong {
  color: var(--bone-bright);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.15;
}

.stat-arm strong {
  color: #c6d4db;
}

.stat-atk .stat-icon {
  color: var(--gold);
}

.stat-arm .stat-icon {
  color: var(--steel);
}

.stat-hp {
  gap: 9px;
}

.stat-hp .stat-icon {
  color: var(--blood-bright);
}

.hp-copy {
  flex: 1;
  min-width: 0;
}

.hp-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.hp-line strong {
  font-size: 14px;
  white-space: nowrap;
}

.hp-line small {
  color: var(--bone-faint);
  font-family: var(--font-display);
  font-size: 7px;
}

.hp-bar {
  position: relative;
  height: 10px;
  margin-top: 7px;
  border: 1px solid #3b1a16;
  background: #190908;
  overflow: hidden;
}

.hp-bar > span {
  display: block;
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(90deg, transparent 0 11px, rgba(28, 5, 4, 0.7) 11px 13px),
    linear-gradient(90deg, #6d1411, #c02d23 65%, #e45a3c);
  transition: width 420ms steps(12);
}

.hp-bar.is-low > span {
  background:
    repeating-linear-gradient(90deg, transparent 0 11px, rgba(28, 5, 4, 0.7) 11px 13px),
    linear-gradient(90deg, #42100e, #8f1b15);
  animation: low-hp 1.2s steps(2) infinite;
}

.hp-shine {
  position: absolute;
  top: 1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(255, 205, 177, 0.22);
}

@keyframes low-hp {
  50% { filter: brightness(1.45); }
}

.stat-delta {
  position: absolute;
  top: 5px;
  right: 7px;
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 7px;
  pointer-events: none;
  opacity: 0;
}

.stat-delta.show {
  animation: delta-float 1.4s ease-out both;
}

@keyframes delta-float {
  0% { opacity: 0; transform: translateY(8px); }
  22% { opacity: 1; transform: translateY(0); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-7px); }
}

.fate-chip {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 13px;
  border-color: #412720;
  background:
    radial-gradient(ellipse at 17% 55%, rgba(114, 26, 21, 0.22), transparent 62%),
    linear-gradient(180deg, rgba(20, 13, 10, 0.96), rgba(9, 7, 5, 0.98));
}

.fate-chip .stat-icon {
  color: var(--blood-bright);
}

.fate-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fate-copy strong {
  color: #d9c9aa;
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fate-stats {
  color: var(--bone-faint);
  font-family: var(--font-display);
  font-size: 6px;
  line-height: 1.5;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.fate-stats b {
  color: var(--blood-bright);
  font-weight: 400;
}

/* ============================================================
   SCENE
   ============================================================ */

.scene-panel {
  position: relative;
  width: min(1320px, calc(100% - 48px));
  height: clamp(270px, 34vh, 368px);
  margin: 0 auto;
  border: 1px solid #2e251d;
  background: #070605;
  overflow: hidden;
  isolation: isolate;
}

#sceneCanvas {
  z-index: 0;
  filter: saturate(1.06) contrast(1.14) brightness(1.05);
}

.scene-fade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(4, 3, 3, 0.72) 0%, transparent 38%, rgba(4, 3, 3, 0.08) 63%, rgba(4, 3, 3, 0.58) 100%),
    linear-gradient(180deg, rgba(4, 3, 3, 0.42) 0%, transparent 24%, transparent 52%, rgba(4, 3, 3, 0.94) 100%);
  pointer-events: none;
}

.scene-chapter {
  position: absolute;
  top: 17px;
  left: 20px;
  right: 20px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(229, 212, 181, 0.7);
  font-family: var(--font-display);
  font-size: 6px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}

.chapter-rule {
  width: 32px;
  height: 1px;
  background: rgba(205, 168, 92, 0.52);
}

.scene-caption {
  position: absolute;
  z-index: 2;
  left: clamp(20px, 4vw, 52px);
  right: clamp(20px, 23vw, 330px);
  bottom: clamp(17px, 3.3vh, 34px);
}

.scene-caption .eyebrow {
  color: var(--gold);
}

.scene-caption h2 {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 9px 0 7px;
  color: var(--bone-bright);
  font-family: var(--font-display);
  font-size: clamp(18px, 2.6vw, 34px);
  line-height: 1.25;
  letter-spacing: -0.03em;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.8);
}

.stage-numeral {
  color: transparent;
  font-size: 1.35em;
  line-height: 1;
  -webkit-text-stroke: 1px rgba(205, 168, 92, 0.56);
  text-shadow: none;
}

.scene-omen {
  max-width: 68ch;
  margin: 0;
  color: rgba(214, 199, 172, 0.8);
  font-size: clamp(18px, 1.9vw, 23px);
  line-height: 1.16;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.54);
}

.scene-corner {
  position: absolute;
  z-index: 2;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.scene-corner-tl {
  top: 9px;
  left: 9px;
  border-top: 1px solid var(--gold);
  border-left: 1px solid var(--gold);
  opacity: 0.6;
}

.scene-corner-br {
  right: 9px;
  bottom: 9px;
  border-right: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  opacity: 0.6;
}

/* ============================================================
   CHOICES
   ============================================================ */

.choices-panel {
  width: min(1320px, calc(100% - 48px));
  margin: 25px auto 0;
}

.choice-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.choice-head h2 {
  margin: 8px 0 0;
  color: var(--bone);
  font-family: var(--font-display);
  font-size: clamp(14px, 1.8vw, 20px);
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.choice-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--bone-faint);
  font-size: 17px;
  text-align: right;
}

.choice-note em {
  color: var(--gold);
  font-style: normal;
}

.note-mark {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 7px;
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 13px;
}

.path-card {
  --accent: var(--gold);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  padding: 13px 14px 0;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(24, 19, 14, 0.96), rgba(9, 8, 6, 0.98) 68%),
    repeating-linear-gradient(90deg, transparent 0 9px, rgba(255, 255, 255, 0.012) 9px 10px);
  color: var(--bone);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  clip-path: polygon(0 7px, 7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
  transition: border-color 180ms, background 180ms, transform 180ms, box-shadow 180ms;
}

.path-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  opacity: 0.74;
}

.path-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 58px;
  height: 58px;
  border-top: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  opacity: 0.16;
  clip-path: polygon(100% 0, 100% 100%, 92% 100%, 92% 10%, 0 10%, 0 0);
  pointer-events: none;
}

.path-card:hover,
.path-card:focus-visible {
  z-index: 2;
  border-color: var(--accent);
  background:
    linear-gradient(160deg, rgba(37, 28, 19, 0.98), rgba(13, 10, 8, 0.99) 72%),
    repeating-linear-gradient(90deg, transparent 0 9px, rgba(255, 255, 255, 0.018) 9px 10px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8), 0 14px 40px rgba(0, 0, 0, 0.36);
  transform: translateY(-3px);
}

.path-card:focus-visible {
  outline-offset: -4px;
}

.path-card.is-picking {
  animation: card-picked 520ms steps(6) forwards;
  pointer-events: none;
}

.path-card.is-dimmed {
  opacity: 0.28;
  filter: saturate(0.3);
  pointer-events: none;
  transition: opacity 300ms, filter 300ms;
}

@keyframes card-picked {
  0% { transform: translateY(-3px); filter: brightness(1); }
  28% { transform: translateY(0) scale(0.994); filter: brightness(1.6) saturate(0.7); }
  100% { transform: scale(1.015); filter: brightness(1); border-color: var(--accent); }
}

.path-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.path-glyph {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, #322a21);
  background: rgba(5, 4, 3, 0.48);
  color: var(--accent);
}

.path-glyph svg {
  width: 20px;
  height: 20px;
}

.path-tag {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 6px;
  letter-spacing: 1.3px;
}

.path-index {
  margin-left: auto;
  color: #3e352b;
  font-family: var(--font-display);
  font-size: 9px;
}

.path-card h3 {
  margin: 10px 0 4px;
  color: var(--bone-bright);
  font-family: var(--font-display);
  font-size: clamp(8px, 1vw, 11px);
  line-height: 1.55;
  letter-spacing: -0.03em;
}

.path-flavor {
  min-height: 30px;
  margin: 0;
  color: var(--bone-faint);
  font-size: 16px;
  line-height: 1.1;
}

.path-loot {
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1px dotted #332a20;
}

.loot-label {
  display: block;
  margin-bottom: 7px;
  color: var(--bone-faint);
  font-family: var(--font-display);
  font-size: 6px;
  letter-spacing: 1.3px;
}

.loot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.loot-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, #252019);
  background: rgba(6, 5, 4, 0.55);
  color: var(--bone);
  font-family: var(--font-display);
  font-size: 7px;
  line-height: 1.4;
  white-space: nowrap;
}

.loot-chip b {
  color: var(--accent);
  font-size: 8px;
  font-weight: 400;
}

.loot-chip small {
  color: var(--bone-faint);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 0.7;
}

.path-foe {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 12px;
  padding: 9px 10px;
  border: 1px solid #39231d;
  background:
    linear-gradient(90deg, rgba(66, 18, 14, 0.26), transparent 82%),
    rgba(8, 6, 5, 0.62);
}

.foe-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  color: var(--blood-bright);
  font-family: var(--font-display);
  font-size: 6px;
  letter-spacing: 0.7px;
}

.foe-def {
  color: var(--bone);
}

.path-foe strong {
  flex: 1;
  color: #ccbda3;
  font-family: var(--font-display);
  font-size: 7px;
  font-weight: 400;
  line-height: 1.5;
}

.foe-embate {
  color: var(--blood-bright);
  font-family: var(--font-display);
  font-size: 6px;
  white-space: nowrap;
}

.path-choose {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  margin: auto -14px 0;
  padding: 0 14px;
  border-top: 1px solid #2a231b;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 6px;
  letter-spacing: 1px;
  transition: background 160ms, color 160ms;
}

.path-choose .arrow {
  font-size: 12px;
}

.path-card:hover .path-choose {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--bone-bright);
}

.route-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  margin-top: 13px;
  padding: 8px 12px;
  border: 1px solid var(--line-soft);
  background: rgba(9, 7, 6, 0.66);
}

.route-label,
.route-count {
  color: var(--bone-faint);
  font-family: var(--font-display);
  font-size: 6px;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

.route-count {
  margin-left: auto;
  color: var(--gold);
}

.route-log {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.route-pip {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 32px;
  height: 21px;
  padding: 0 6px;
  border: 1px solid #2c241c;
  color: #4e4438;
  font-family: var(--font-display);
  font-size: 5px;
  letter-spacing: 0.2px;
}

.route-pip b {
  font-weight: 400;
}

.route-pip.is-done {
  border-color: #3f3428;
  color: var(--bone-dim);
}

.route-pip.is-done.type-acero { color: var(--gold); }
.route-pip.is-done.type-hierro { color: var(--steel); }
.route-pip.is-done.type-sangre { color: var(--blood-bright); }

.route-pip.is-current {
  color: var(--bone);
  border-color: var(--bone-faint);
}

.route-pip.is-current::after {
  content: "·";
  color: var(--blood-bright);
  animation: blink-soft 1.2s steps(2) infinite;
}

/* ============================================================
   BATTLE OVERLAY
   ============================================================ */

.battle-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vw, 28px);
}

.battle-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 32% 56%, rgba(99, 27, 20, 0.24), transparent 38%),
    radial-gradient(ellipse at 50% 50%, rgba(4, 3, 3, 0.65), rgba(3, 2, 2, 0.94));
  backdrop-filter: blur(5px);
  animation: fade-in 250ms ease both;
}

.battle-frame {
  position: relative;
  z-index: 1;
  width: min(1020px, 100%);
  max-height: min(860px, 94svh);
  border: 1px solid #5a4030;
  background:
    linear-gradient(145deg, rgba(26, 19, 14, 0.99), rgba(7, 6, 5, 0.99)),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.015) 3px 4px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8), 0 30px 100px rgba(0, 0, 0, 0.72);
  overflow: auto;
  animation: battle-in 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.battle-frame::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 7px;
  border: 1px solid rgba(201, 164, 92, 0.12);
  pointer-events: none;
}

.battle-frame::after {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 0;
  opacity: 0;
  background:
    linear-gradient(105deg, transparent 0 46%, rgba(255, 236, 200, 0.92) 47% 48%, rgba(180, 33, 25, 0.8) 49% 53%, transparent 54%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.battle-frame.is-striking::after {
  animation: slash-flash 440ms steps(5) both;
}

.battle-frame.is-hit {
  animation: frame-impact 440ms steps(5) both;
}

.battle-frame.is-death {
  animation: death-impact 800ms steps(8) both;
}

@keyframes battle-in {
  from { opacity: 0; transform: translateY(20px) scale(0.984); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slash-flash {
  0% { opacity: 0; transform: translateX(-30%); }
  12% { opacity: 0.9; }
  36% { opacity: 0.75; }
  100% { opacity: 0; transform: translateX(30%); }
}

@keyframes frame-impact {
  0%, 100% { transform: translate(0, 0); filter: brightness(1); }
  12% { transform: translate(-5px, 2px); filter: brightness(1.6); }
  28% { transform: translate(4px, -2px); filter: brightness(1.2); }
  48% { transform: translate(-3px, 1px); }
  68% { transform: translate(2px, 0); }
}

@keyframes death-impact {
  0% { filter: brightness(1); transform: translate(0); }
  16% { filter: brightness(2) saturate(0.4); transform: translate(-7px, 2px); }
  32% { filter: brightness(0.5) saturate(1.3); transform: translate(6px, -2px); }
  52% { filter: brightness(1.15); transform: translate(-4px, 1px); }
  70% { filter: brightness(0.42); transform: translate(3px, 0); }
  100% { filter: brightness(0.25); transform: scale(1.008); }
}

.battle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 23px;
  border-bottom: 1px solid #332820;
  background: rgba(8, 6, 5, 0.72);
}

.battle-kicker,
.battle-stage {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 7px;
  line-height: 1.6;
  letter-spacing: 1px;
}

.battle-stage {
  color: var(--bone-faint);
}

.battle-main {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(360px, 1.28fr);
}

.monster-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 490px;
  padding: 25px clamp(16px, 3vw, 32px);
  border-right: 1px solid #31261d;
  background:
    radial-gradient(ellipse at 50% 47%, rgba(116, 35, 25, 0.25), transparent 50%),
    linear-gradient(180deg, rgba(19, 13, 10, 0.6), rgba(7, 6, 5, 0.8));
  overflow: hidden;
}

.monster-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 49.7%, rgba(205, 168, 92, 0.035) 49.8% 50.2%, transparent 50.3%),
    linear-gradient(0deg, transparent 73%, rgba(205, 168, 92, 0.07) 73.2% 73.5%, transparent 73.7%);
  pointer-events: none;
}

.monster-stage {
  position: relative;
  width: min(310px, 86%);
  aspect-ratio: 1;
  margin: 12px auto 0;
}

.monster-stage::before,
.monster-stage::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(205, 168, 92, 0.11);
  pointer-events: none;
  transform: rotate(45deg);
}

.monster-stage::before {
  inset: 10%;
}

.monster-stage::after {
  inset: 18%;
  border-color: rgba(205, 168, 92, 0.06);
}

.monster-aura {
  position: absolute;
  inset: 5%;
  opacity: 0.6;
  background:
    radial-gradient(circle, rgba(161, 45, 33, 0.34) 0 4%, transparent 4.5% 100%),
    radial-gradient(circle, rgba(205, 168, 92, 0.12) 0 1px, transparent 1.5px);
  background-size: auto, 9px 9px;
  
  animation: aura-breathe 4s ease-in-out infinite;
}

@keyframes aura-breathe {
  0%, 100% { transform: scale(0.97); opacity: 0.45; }
  50% { transform: scale(1.03); opacity: 0.72; }
}

#monsterCanvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 0 18px rgba(95, 22, 17, 0.5));
}

.monster-floor {
  position: absolute;
  z-index: 1;
  left: 18%;
  right: 18%;
  bottom: -6%;
  height: 9%;
  opacity: 0.7;
  background:
    linear-gradient(90deg, transparent, rgba(196, 52, 38, 0.5), transparent);
  clip-path: polygon(4% 40%, 22% 20%, 50% 9%, 78% 20%, 96% 40%, 82% 67%, 50% 82%, 18% 67%);
  filter: blur(1px);
}

.monster-line {
  position: relative;
  z-index: 2;
  margin: 8px auto 0;
  max-width: 31ch;
  color: var(--bone-dim);
  font-size: clamp(18px, 1.9vw, 23px);
  line-height: 1.15;
  text-align: center;
  font-style: italic;
}

.battle-info {
  position: relative;
  z-index: 2;
  padding: clamp(22px, 3.2vw, 38px);
}

.battle-info h2 {
  margin: 8px 0 0;
  color: var(--bone-bright);
  font-family: var(--font-display);
  font-size: clamp(15px, 2.1vw, 23px);
  line-height: 1.55;
  letter-spacing: -0.05em;
}

.loot-applied {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 19px;
  padding: 10px 12px;
  border: 1px solid #3a2d21;
  background: rgba(6, 5, 4, 0.55);
}

.loot-title {
  color: var(--bone-faint);
  font-family: var(--font-display);
  font-size: 5px;
  letter-spacing: 0.7px;
  white-space: nowrap;
}

.loot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.loot-tag {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 6px;
  line-height: 1.6;
  white-space: nowrap;
}

.loot-tag + .loot-tag::before {
  content: "·";
  margin-right: 5px;
  color: var(--bone-faint);
}

.duel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 18px;
  border: 1px solid #31261e;
  background: #31261e;
}

.duel-col {
  padding: 13px 14px;
  background: rgba(9, 7, 6, 0.78);
}

.duel-col h3 {
  margin: 0 0 9px;
  color: var(--bone-faint);
  font-family: var(--font-display);
  font-size: 6px;
  line-height: 1.5;
  letter-spacing: 0.8px;
}

.duel-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0;
  color: var(--bone-dim);
  font-size: 18px;
}

.duel-row strong {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 400;
}

.duel-row .good { color: var(--bone-bright); }
.duel-row .bad { color: var(--blood-bright); }

.duel-formula {
  margin: 9px 0 0;
  padding-top: 7px;
  border-top: 1px dotted #352a20;
  color: var(--bone-faint);
  font-size: 16px;
  line-height: 1.1;
}

.battle-warning {
  margin: 18px 0 0;
  color: #9f8c70;
  font-size: 18px;
  font-style: italic;
  line-height: 1.2;
}

.battle-actions {
  margin-top: 23px;
}

.battle-actions .btn {
  width: 100%;
}

.battle-result {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 64px);
  background:
    radial-gradient(ellipse at 50% 36%, rgba(86, 22, 16, 0.34), transparent 45%),
    rgba(6, 5, 4, 0.975);
  text-align: center;
  animation: result-in 500ms steps(7) both;
}

.battle-result::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(205, 168, 92, 0.18);
  pointer-events: none;
}

@keyframes result-in {
  from { opacity: 0; transform: scale(1.02); }
  to { opacity: 1; transform: scale(1); }
}

.result-kicker {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 7px;
  letter-spacing: 1.4px;
}

.result-title {
  margin: 15px 0 0;
  color: var(--bone-bright);
  font-family: var(--font-display);
  font-size: clamp(24px, 4.4vw, 46px);
  line-height: 1.4;
  text-shadow: 4px 4px 0 #130b08;
}

.result-flavor {
  max-width: 56ch;
  margin: 16px 0 0;
  color: var(--bone-dim);
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.2;
}

.result-ledger {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: min(580px, 100%);
  margin-top: 23px;
}

.result-stat {
  flex: 1 1 130px;
  padding: 10px 12px;
  border: 1px solid #342820;
  background: rgba(14, 10, 8, 0.8);
}

.result-stat span {
  display: block;
  color: var(--bone-faint);
  font-family: var(--font-display);
  font-size: 5px;
  letter-spacing: 0.6px;
}

.result-stat strong {
  display: block;
  margin-top: 5px;
  color: var(--bone);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 400;
}

.result-stat strong.hurt { color: var(--blood-bright); }

.battle-result .btn {
  margin-top: 28px;
  min-width: 230px;
}

/* ============================================================
   END SCREENS
   ============================================================ */

.end-screen {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: calc(var(--topbar-h) + 48px) clamp(16px, 4vw, 48px) 48px;
  overflow: hidden;
  isolation: isolate;
}

.end-wash {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.death-wash {
  background:
    radial-gradient(ellipse at 50% 46%, rgba(108, 24, 18, 0.32), transparent 52%),
    linear-gradient(180deg, rgba(5, 3, 3, 0.55), rgba(5, 3, 3, 0.82) 46%, #060404);
}

.victory-wash {
  background:
    radial-gradient(ellipse at 50% 34%, rgba(163, 144, 94, 0.16), transparent 43%),
    linear-gradient(180deg, rgba(6, 5, 4, 0.46), rgba(6, 5, 4, 0.85) 52%, #070605);
}

.end-content {
  position: relative;
  z-index: 2;
  width: min(960px, 100%);
  text-align: center;
  animation: end-in 750ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes end-in {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

.end-kicker {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 7px;
  letter-spacing: 1.6px;
}

.end-title {
  margin: 20px 0 0;
  color: #d84c3b;
  font-family: var(--font-display);
  font-size: clamp(34px, 7.5vw, 72px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.065em;
  text-shadow:
    4px 4px 0 #2b0a07,
    8px 8px 0 rgba(0, 0, 0, 0.72),
    0 0 40px rgba(148, 33, 24, 0.3);
}

.end-cause {
  max-width: 64ch;
  margin: 22px auto 0;
  color: var(--bone-dim);
  font-size: clamp(20px, 2.4vw, 27px);
  line-height: 1.18;
}

.end-ledger {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 1px;
  max-width: 780px;
  margin: 28px auto 0;
  border: 1px solid #382a22;
  background: #382a22;
}

.death-math,
.death-stats {
  padding: 16px 18px;
  background: rgba(9, 7, 6, 0.88);
  text-align: left;
}

.death-math {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.math-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--bone-dim);
  font-size: 19px;
}

.math-row strong {
  color: var(--bone);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 400;
}

.math-row strong.bad {
  color: var(--blood-bright);
}

.math-formula {
  margin-top: 6px;
  padding-top: 9px;
  border-top: 1px dotted #3d2a20;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 7px;
  line-height: 1.7;
  letter-spacing: 0.2px;
}

.death-stats,
.victory-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 14px;
}

.mini-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mini-stat span {
  color: var(--bone-faint);
  font-family: var(--font-display);
  font-size: 5px;
  letter-spacing: 0.5px;
}

.mini-stat strong {
  color: var(--bone);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 400;
}

.death-recap,
.victory-recap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin: 16px auto 0;
}

.recap-pip {
  padding: 4px 7px;
  border: 1px solid #332a21;
  color: var(--bone-faint);
  font-family: var(--font-display);
  font-size: 5px;
  line-height: 1.6;
  letter-spacing: 0.2px;
}

.recap-pip.type-acero { color: var(--gold); border-color: #4a3d27; }
.recap-pip.type-hierro { color: var(--steel); border-color: #32434c; }
.recap-pip.type-sangre { color: var(--blood-bright); border-color: #4a2722; }

.end-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 11px;
  margin-top: 30px;
}

.end-actions .btn {
  min-width: 220px;
}

.death-counter,
.victory-counter {
  margin: 18px 0 0;
  color: var(--bone-faint);
  font-family: var(--font-display);
  font-size: 5px;
  line-height: 1.9;
  letter-spacing: 0.5px;
}

/* victory specifics */

.victory-title {
  color: var(--bone-bright);
  font-size: clamp(28px, 6vw, 58px);
  text-shadow:
    4px 4px 0 #2d2112,
    8px 8px 0 rgba(0, 0, 0, 0.72),
    0 0 50px rgba(200, 164, 91, 0.18);
}

.victory-layout {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  align-items: stretch;
  gap: 1px;
  max-width: 800px;
  margin: 30px auto 0;
  border: 1px solid #3c3224;
  background: #3c3224;
}

.rank-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(150, 121, 69, 0.18), transparent 58%),
    rgba(9, 8, 6, 0.88);
}

.rank-label {
  color: var(--bone-faint);
  font-family: var(--font-display);
  font-size: 6px;
  letter-spacing: 1px;
}

.rank-letter {
  margin: 9px 0 7px;
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: clamp(54px, 8vw, 88px);
  line-height: 0.9;
  text-shadow: 4px 4px 0 #21180f, 0 0 32px rgba(205, 168, 92, 0.18);
}

.rank-caption {
  max-width: 24ch;
  color: var(--bone-faint);
  font-family: var(--font-display);
  font-size: 5px;
  line-height: 1.9;
  letter-spacing: 0.4px;
  text-align: center;
}

.victory-ledger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 17px;
  padding: 21px 24px;
  background: rgba(9, 8, 6, 0.88);
  text-align: left;
}

.victory-stats {
  grid-template-columns: repeat(3, 1fr);
}

.victory-epilogue {
  margin: 0;
  padding-top: 15px;
  border-top: 1px solid #32291e;
  color: var(--bone-dim);
  font-size: 19px;
  line-height: 1.18;
}

/* ============================================================
   MODAL
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-shade {
  position: absolute;
  inset: 0;
  background: rgba(3, 2, 2, 0.86);
  backdrop-filter: blur(3px);
  animation: fade-in 200ms ease both;
}

.modal-panel {
  position: relative;
  width: min(760px, 100%);
  max-height: 88svh;
  overflow: auto;
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid #5a4530;
  background:
    linear-gradient(135deg, rgba(24, 18, 13, 0.99), rgba(8, 7, 5, 0.99)),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.015) 3px 4px);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.8);
  animation: modal-in 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.988); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: #0b0907;
  color: var(--bone-dim);
  font-family: var(--font-display);
  font-size: 13px;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--blood-bright);
  border-color: var(--blood);
}

.modal-panel h2 {
  margin: 10px 0 22px;
  color: var(--bone-bright);
  font-family: var(--font-display);
  font-size: clamp(17px, 2.4vw, 24px);
  line-height: 1.4;
}

.help-rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border: 1px solid #32281e;
  background: #32281e;
}

.help-rule {
  padding: 15px;
  background: #0b0907;
}

.help-rule .rule-card-top {
  margin-bottom: 7px;
}

.help-rule h3 {
  margin: 0;
  color: var(--bone);
  font-family: var(--font-display);
  font-size: 7px;
  letter-spacing: 0.4px;
}

.help-rule p {
  margin: 0;
  color: var(--bone-dim);
  font-size: 18px;
  line-height: 1.16;
}

.help-rule svg {
  width: 17px;
  height: 17px;
  color: var(--gold);
}

.help-example {
  margin-top: 18px;
  padding: 15px 16px;
  border-left: 3px solid var(--blood);
  background: rgba(37, 22, 16, 0.46);
}

.example-label {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 6px;
  letter-spacing: 0.8px;
}

.help-example p {
  margin: 0;
  color: var(--bone-dim);
  font-size: 19px;
  line-height: 1.18;
}

.help-example b {
  color: var(--bone);
  font-weight: 400;
}

.help-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--line-soft);
}

.help-footer p {
  margin: 0;
  color: var(--bone-faint);
  font-size: 17px;
}

.help-keys {
  font-family: var(--font-display);
  font-size: 5px !important;
  line-height: 2.2;
  text-align: right;
}

.help-keys span {
  display: inline-block;
  margin: 0 2px;
  padding: 3px 5px;
  border: 1px solid #3c3024;
  color: var(--bone-dim);
}

/* ============================================================
   TOASTS
   ============================================================ */

.toast-layer {
  position: fixed;
  z-index: 5000;
  left: 50%;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: min(420px, calc(100% - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  max-width: 100%;
  padding: 9px 13px;
  border: 1px solid #5a452b;
  background: rgba(13, 10, 8, 0.97);
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 6px;
  line-height: 1.8;
  letter-spacing: 0.4px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  animation: toast-in 1.9s steps(8) both;
}

.toast.toast-blood {
  border-color: #61221a;
  color: var(--blood-bright);
}

@keyframes toast-in {
  0% { opacity: 0; transform: translateY(9px); }
  12%, 78% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-4px); }
}

/* ============================================================
   MISC ANIMATIONS
   ============================================================ */

@keyframes blink-soft {
  0%, 44% { opacity: 1; }
  45%, 100% { opacity: 0.25; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* hide sound glyph correctly */
.sound-btn .sound-off {
  display: none;
}
.sound-btn.is-muted .sound-on {
  display: none;
}
.sound-btn.is-muted .sound-off {
  display: inline;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1180px) {
  .hud {
    grid-template-columns: 1.15fr 0.8fr 0.8fr 1.3fr;
  }

  .fate-chip {
    grid-column: span 4;
    min-height: 48px;
  }

  .fate-copy {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 3px 9px;
  }

  .fate-copy .hud-label {
    flex: 0 0 100%;
  }

  .intro-grid {
    grid-template-columns: 1.4fr 0.8fr;
  }

  .rules-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 980px) {
  :root {
    --topbar-h: 58px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .progress-wrap {
    display: none;
  }

  .hud {
    grid-template-columns: repeat(2, 1fr);
    width: calc(100% - 28px);
  }

  .hero-block {
    grid-column: span 2;
    min-height: 58px;
  }

  .hero-sigil {
    width: 38px;
    height: 38px;
  }

  .hero-sigil canvas {
    width: 30px;
    height: 30px;
  }

  .fate-chip {
    grid-column: span 2;
  }

  .scene-panel,
  .choices-panel {
    width: calc(100% - 28px);
  }

  .scene-panel {
    height: 300px;
  }

  .scene-omen {
    max-width: 58ch;
  }

  .choice-note {
    display: none;
  }

  .path-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .path-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    min-height: 290px;
  }

  .path-card:last-child:nth-child(odd) .path-flavor {
    min-height: auto;
  }

  .battle-main {
    grid-template-columns: 0.75fr 1.25fr;
  }

  .intro-frame {
    padding: 22px;
  }

  .intro-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .threat-panel {
    min-height: 205px;
  }

  .intro-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .death-ledger {
    grid-template-columns: 1fr;
  }

  .end-ledger {
    grid-template-columns: 1fr;
  }

  .death-stats,
  .victory-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 720px) {
  body {
    font-size: 19px;
  }

  .title-screen {
    padding: 84px 16px 96px;
  }

  .game-title {
    font-size: clamp(34px, 11vw, 58px);
    letter-spacing: -0.06em;
  }

  .title-subtitle {
    margin-top: 17px;
    font-size: 7px;
    letter-spacing: 0.3em;
  }

  .title-hook {
    font-size: 22px;
  }

  .title-menu {
    flex-direction: column;
    align-items: stretch;
    margin-top: 28px;
  }

  .title-menu .btn {
    width: 100%;
  }

  .btn-start {
    min-width: 0;
  }

  .title-run-info {
    gap: 16px;
    font-size: 5px;
  }

  .title-footer {
    font-size: 5px;
  }

  .content-note {
    font-size: 4px;
  }

  .topbar {
    padding: 0 13px;
  }

  .brand-mini {
    font-size: 7px;
  }

  .brand-mark {
    width: 22px;
    height: 22px;
    font-size: 13px;
  }

  .intro-screen {
    padding: calc(var(--topbar-h) + 16px) 10px 20px;
  }

  .intro-frame {
    padding: 18px 15px;
  }

  .intro-frame::before {
    inset: 5px;
  }

  .intro-heading h2 {
    font-size: 22px;
  }

  .intro-heading::after {
    font-size: 58px;
  }

  .lore-lead {
    font-size: 25px;
  }

  .lore-body {
    font-size: 19px;
  }

  .rules-strip {
    grid-template-columns: 1fr;
  }

  .rule-card {
    padding: 13px 14px;
  }

  .intro-actions .btn {
    width: 100%;
  }

  .game-screen {
    padding-top: calc(var(--topbar-h) + 9px);
  }

  .hud {
    gap: 6px;
    width: calc(100% - 20px);
    margin-bottom: 9px;
  }

  .hero-block {
    min-height: 50px;
  }

  .stat-chip,
  .hero-block,
  .fate-chip {
    min-height: 56px;
  }

  .stat-chip {
    padding: 7px 9px;
    gap: 7px;
  }

  .stat-icon {
    width: 19px;
    height: 19px;
  }

  .stat-icon svg {
    width: 18px;
    height: 18px;
  }

  .stat-chip strong {
    font-size: 15px;
  }

  .hud-level {
    font-size: 9px;
  }

  .hud-label {
    font-size: 5px;
  }

  .stat-hp {
    grid-column: span 2;
  }

  .hp-line strong {
    font-size: 13px;
  }

  .fate-chip {
    padding: 8px 10px;
  }

  .fate-copy strong {
    font-size: 7px;
  }

  .scene-panel {
    width: calc(100% - 20px);
    height: 238px;
  }

  .scene-chapter {
    top: 11px;
    left: 13px;
    right: 13px;
    font-size: 5px;
  }

  .scene-caption {
    left: 15px;
    right: 15px;
    bottom: 14px;
  }

  .scene-caption h2 {
    gap: 10px;
    font-size: clamp(15px, 4vw, 21px);
    line-height: 1.45;
    margin: 6px 0;
  }

  .stage-numeral {
    font-size: 1.1em;
  }

  .scene-omen {
    font-size: 17px;
    line-height: 1.1;
  }

  .scene-caption .eyebrow {
    font-size: 5px;
  }

  .choices-panel {
    width: calc(100% - 20px);
    margin-top: 18px;
  }

  .choice-head {
    padding-bottom: 10px;
  }

  .choice-head h2 {
    font-size: 12px;
  }

  .path-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .path-card {
    min-height: 0 !important;
    padding: 13px 14px 0;
    grid-column: auto !important;
  }

  .path-card h3 {
    font-size: 10px;
    margin-top: 11px;
  }

  .path-flavor {
    min-height: 0;
    font-size: 17px;
    line-height: 1.08;
  }

  .path-loot {
    margin-top: 10px;
    padding-top: 8px;
  }

  .path-foe {
    margin-top: 9px;
    padding: 8px;
  }

  .path-choose {
    margin-left: -14px;
    margin-right: -14px;
    padding: 0 14px;
    min-height: 37px;
  }

  .route-strip {
    margin-top: 9px;
    gap: 8px;
    padding: 7px 8px;
  }

  .route-pip {
    min-width: 24px;
    padding: 0 4px;
    font-size: 4px;
  }

  .battle-overlay {
    padding: 0;
  }

  .battle-frame {
    width: 100%;
    max-height: 100svh;
    min-height: 100svh;
    border: 0;
    clip-path: none;
  }

  .battle-main {
    display: block;
  }

  .monster-panel {
    min-height: 0;
    padding: 15px 20px 9px;
    border-right: 0;
    border-bottom: 1px solid #31261d;
  }

  .monster-stage {
    width: min(210px, 64vw);
    margin-top: 2px;
  }

  .monster-line {
    margin-top: 2px;
    font-size: 18px;
  }

  .battle-info {
    padding: 17px 16px 22px;
  }

  .battle-info h2 {
    margin-top: 4px;
    font-size: 15px;
  }

  .loot-applied {
    margin-top: 12px;
    padding: 8px 9px;
    gap: 8px;
  }

  .loot-tag {
    font-size: 5px;
  }

  .duel-grid {
    margin-top: 12px;
  }

  .duel-col {
    padding: 10px;
  }

  .duel-row {
    font-size: 16px;
  }

  .duel-row strong {
    font-size: 10px;
  }

  .battle-warning {
    margin-top: 12px;
    font-size: 16px;
  }

  .battle-actions {
    margin-top: 16px;
  }

  .battle-head {
    padding: 11px 15px;
  }

  .battle-kicker,
  .battle-stage {
    font-size: 5px;
  }

  .battle-result {
    padding: 28px 18px;
  }

  .result-title {
    font-size: 24px;
  }

  .battle-result .btn {
    width: 100%;
    min-width: 0;
  }

  .end-screen {
    align-items: flex-start;
    padding: calc(var(--topbar-h) + 40px) 12px 30px;
  }

  .end-title {
    font-size: clamp(30px, 10vw, 48px);
    margin-top: 15px;
  }

  .end-cause {
    font-size: 21px;
    margin-top: 15px;
  }

  .end-ledger {
    margin-top: 19px;
  }

  .death-stats,
  .victory-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .end-actions {
    flex-direction: column;
    margin-top: 20px;
  }

  .end-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .victory-layout {
    grid-template-columns: 1fr;
    margin-top: 20px;
  }

  .rank-panel {
    padding: 16px;
  }

  .rank-letter {
    font-size: 62px;
    margin: 5px 0;
  }

  .victory-ledger {
    padding: 16px;
  }

  .victory-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .victory-epilogue {
    font-size: 18px;
  }

  .help-rules {
    grid-template-columns: 1fr;
  }

  .modal-panel {
    padding: 22px 17px;
  }

  .help-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .help-keys {
    text-align: left;
  }

  .toast-layer {
    bottom: 12px;
  }
}

@media (max-width: 420px) {
  .title-run-info {
    flex-direction: column;
    gap: 6px;
  }

  .title-footer span:nth-child(2) {
    display: none;
  }

  .fate-stats {
    font-size: 5px;
  }

  .path-card {
    padding-left: 12px;
    padding-right: 12px;
  }

  .path-choose {
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .route-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .fx-grain {
    animation: none;
  }
}

/* ============================================================
   COMBAT ANIMATIONS (added)
   ============================================================ */
.battle-arena {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}
.battle-arena.hidden { display: none !important; }
.monster-stage.is-fighting #monsterCanvas { opacity: 0; transform: scale(0.92); transition: opacity 120ms steps(3), transform 120ms steps(3); }
.monster-stage.is-fighting .monster-aura { opacity: 0.2; }
.monster-stage.is-hit #monsterCanvas { animation: monsterHit 360ms steps(5) both; }
.monster-stage.is-dead #monsterCanvas { animation: monsterDead 700ms steps(6) forwards; }
@keyframes monsterHit {
  0% { transform: translate(0,0); filter: drop-shadow(0 0 18px rgba(95,22,17,.5)); }
  20% { transform: translate(-10px,2px); filter: brightness(2) sepia(1) saturate(3) hue-rotate(-30deg); }
  40% { transform: translate(8px,-2px); }
  60% { transform: translate(-4px,1px); }
  100% { transform: translate(0,0); filter: drop-shadow(0 0 18px rgba(95,22,17,.5)); }
}
@keyframes monsterDead {
  0% { transform: translate(0,0) scale(1); opacity: 1; filter: brightness(1); }
  20% { transform: translate(-8px,0) scale(1.02); filter: brightness(2.2) saturate(0.2); }
  45% { transform: translate(6px,8px) scale(0.96); filter: brightness(0.5) sepia(1) hue-rotate(-40deg); opacity: .9; }
  100% { transform: translate(4px,28px) scale(0.8); opacity: 0; filter: brightness(0.2); }
}
.slash-fx {
  position: absolute;
  inset: -10%;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(115deg, transparent 0 44%, rgba(255,245,220,.95) 45% 46%, rgba(225,72,53,.85) 47% 50%, transparent 51% 100%);
  mix-blend-mode: screen;
}
.slash-fx.play { animation: slashFx 320ms steps(5) both; }
@keyframes slashFx {
  0% { opacity: 0; transform: translateX(-35%) scaleY(.6); }
  15% { opacity: 1; transform: translateX(-10%) scaleY(1); }
  60% { opacity: .9; transform: translateX(10%) scaleY(1); }
  100% { opacity: 0; transform: translateX(35%) scaleY(.4); }
}

/* Selection action overlay */
.action-slash {
  position: fixed;
  inset: 0;
  z-index: 850;
  pointer-events: none;
  opacity: 0;
}
.action-slash.play {
  animation: actionSlash 520ms steps(6) both;
}
.action-slash::before {
  content: '';
  position: absolute;
  top: 0; left: -20%; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent 0 42%, rgba(255,240,210,.8) 44% 45%, rgba(180,40,30,.65) 46% 52%, transparent 54%);
  transform: skewX(-18deg);
}
.action-slash::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 55%, rgba(160,40,30,.28), transparent 55%);
}
@keyframes actionSlash {
  0% { opacity: 0; }
  10% { opacity: 1; transform: translateX(-10%); }
  45% { opacity: 1; transform: translateX(18%); }
  100% { opacity: 0; transform: translateX(35%); }
}

/* Damage numbers in battle */
.damage-pop {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  color: #ffe7c2;
  font-family: var(--font-display);
  font-size: 18px;
  text-shadow: 3px 3px 0 #2a0a07, 0 0 18px rgba(225,72,53,.6);
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
}
.damage-pop.play { animation: damagePop 900ms steps(8) both; }
.damage-pop.crit { color: #ff6a52; font-size: 22px; }
@keyframes damagePop {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); }
  15% { opacity: 1; transform: translate(-50%, -6px) scale(1.2); }
  30% { transform: translate(-50%, 0) scale(1); }
  75% { opacity: 1; transform: translate(-50%, -10px); }
  100% { opacity: 0; transform: translate(-50%, -24px); }
}

/* HUD shake when taking damage */
.game-screen.screen-shake { animation: screenShake 420ms steps(5) both; }
@keyframes screenShake {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-6px, 2px); }
  40% { transform: translate(5px, -2px); }
  60% { transform: translate(-3px, 1px); }
  80% { transform: translate(2px, 0); }
}
/* ============================================================
   JOURNEY MAP
   ============================================================ */
.journey-panel {
  width: min(1320px, calc(100% - 48px));
  margin: 14px auto 0;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(18,14,11,.92), rgba(8,7,6,.96));
  padding: 10px 14px 12px;
}
.journey-head { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:8px; }
.journey-hint { color: var(--bone-faint); font-size: 16px; }
.journey-map { width:100%; overflow:hidden; border:1px solid #2a221b; background:#0a0807; }
#journeyCanvas { width:100%; height:128px; display:block; image-rendering:pixelated; image-rendering:crisp-edges; }
@media (max-width: 720px) {
  .journey-panel { width: calc(100% - 20px); padding: 8px 10px 10px; margin-top:10px; }
  #journeyCanvas { height: 104px; }
  .journey-hint { font-size: 14px; }
}
/* ============================================================
   PICKUP OVERLAY (prominent)
   ============================================================ */
.pickup-overlay {
  position: fixed;
  inset: 0;
  z-index: 860;
  display: grid;
  place-items: center;
  padding: 18px;
}
.pickup-overlay.hidden { display: none !important; }
.pickup-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(120,70,25,.18), transparent 45%),
    rgba(5,4,3,.82);
  backdrop-filter: blur(2px);
}
.pickup-frame {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
  padding: 20px 20px 18px;
  border: 1px solid #6a5432;
  background:
    linear-gradient(180deg, rgba(26,20,14,.98), rgba(10,8,6,.98)),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.015) 3px 4px);
  box-shadow: 0 0 0 1px #000, 0 24px 90px rgba(0,0,0,.75);
  text-align: center;
}
.pickup-frame::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(201,164,92,.14);
  pointer-events: none;
}
.pickup-kicker {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 7px;
  letter-spacing: 1.5px;
}
.pickup-title {
  margin: 10px 0 14px;
  color: var(--bone-bright);
  font-family: var(--font-display);
  font-size: clamp(16px, 2.8vw, 28px);
  line-height: 1.4;
  text-shadow: 3px 3px 0 #1a100a;
}
.pickup-canvas {
  width: 100%;
  max-width: 720px;
  height: auto;
  aspect-ratio: 480 / 220;
  display: block;
  margin: 0 auto;
  border: 1px solid #3a2d1f;
  background: #090806;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.pickup-loot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  min-height: 28px;
}
.pickup-pill {
  padding: 6px 10px;
  border: 1px solid #5a4528;
  background: rgba(15,12,9,.9);
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 7px;
  line-height: 1.4;
}
.pickup-pill b { color: #fff0c8; margin-right: 4px; }
.pickup-sub {
  margin: 10px 0 0;
  color: var(--bone-dim);
  font-size: 18px;
}
@media (max-width: 720px) {
  .pickup-frame { padding: 14px 12px; }
  .pickup-title { font-size: 16px; margin-bottom: 10px; }
}


/* image loot icons (e.g. HACHA DEL VERDUGO) */
.icon-img { width:30px; height:30px; object-fit:contain; image-rendering:pixelated; image-rendering:crisp-edges; }
.path-glyph img { width:30px; height:30px; object-fit:contain; image-rendering:pixelated; image-rendering:crisp-edges; }
