@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700;800;900&family=Barlow:wght@400;500;600;700;800;900&display=swap");

:root {
  --paper: #eee9dc;
  --paper-light: #f7f3e8;
  --ink: #151713;
  --muted: #6f7167;
  --danger: #f04424;
  --danger-dark: #951f14;
  --acid: #c7ff2e;
  --acid-dark: #6a8e00;
  --blue: #44a7df;
  --line: rgba(21, 23, 19, 0.18);
  --shadow: 7px 8px 0 rgba(21, 23, 19, 0.9);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #151713;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 0%, rgba(199, 255, 46, 0.13), transparent 28rem),
    linear-gradient(120deg, #1b1e19, #0e100e 68%);
  font-family: "Barlow", system-ui, sans-serif;
}

button,
[tabindex] {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
[tabindex]:focus-visible {
  outline: 4px solid var(--blue);
  outline-offset: 4px;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.26'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  pointer-events: none;
}

.attack-vector {
  --fx-color: #ff7a17;
  --fx-glow: rgba(255, 122, 23, 0.72);
  position: absolute;
  left: var(--fx-x);
  top: var(--fx-y);
  width: var(--fx-distance);
  height: 1px;
  transform: rotate(var(--fx-angle));
  transform-origin: 0 50%;
}

.attack-vector.fx-infection,
.impact-burst.fx-infection {
  --fx-color: #9dff20;
  --fx-glow: rgba(157, 255, 32, 0.78);
}

.attack-vector.fx-metal,
.impact-burst.fx-metal {
  --fx-color: #eaf5ff;
  --fx-glow: rgba(68, 167, 223, 0.9);
}

.attack-vector.fx-heavy,
.impact-burst.fx-heavy {
  --fx-color: #f04424;
  --fx-glow: rgba(240, 68, 36, 0.84);
}

.attack-streak {
  position: absolute;
  left: 0;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--fx-color) 18%, #fff 72%, transparent);
  box-shadow: 0 0 14px var(--fx-glow);
  transform: scaleX(0);
  transform-origin: left;
  animation: attackStreak 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.streak-one { top: -3px; }
.streak-two { top: -15px; animation-delay: 35ms; opacity: 0.72; }
.streak-three { top: 10px; animation-delay: 70ms; opacity: 0.52; }

.attack-projectile {
  position: absolute;
  left: -15px;
  top: -15px;
  width: 30px;
  height: 30px;
  border: 5px solid #fff;
  border-radius: 4px 60% 4px 60%;
  background: var(--fx-color);
  box-shadow: 0 0 26px 9px var(--fx-glow);
  transform: translateX(0) rotate(45deg) scale(0.35);
  animation: attackProjectile 520ms cubic-bezier(0.16, 0.8, 0.3, 1) both;
}

.impact-burst {
  --fx-color: #ff7a17;
  --fx-glow: rgba(255, 122, 23, 0.72);
  position: absolute;
  width: 1px;
  height: 1px;
}

.impact-ring {
  position: absolute;
  left: 0;
  top: 0;
  width: 46px;
  height: 46px;
  border: 6px solid var(--fx-color);
  border-radius: 50%;
  box-shadow: 0 0 24px var(--fx-glow), inset 0 0 20px var(--fx-glow);
  transform: translate(-50%, -50%) scale(0.1);
  animation: impactRing 660ms ease-out both;
}

.ring-two {
  animation-delay: 90ms;
}

.impact-burst > span {
  position: absolute;
  left: 0;
  top: -4px;
  width: clamp(45px, 7vw, 100px);
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fff, var(--fx-color), transparent);
  box-shadow: 0 0 12px var(--fx-glow);
  transform-origin: 0 50%;
  transform: rotate(var(--ray-angle)) scaleX(0);
  animation: impactRay 610ms var(--ray-delay) ease-out both;
}

.impact-word {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  padding: 4px 9px;
  border: 3px solid var(--ink);
  background: var(--fx-color);
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(1.15rem, 3vw, 2rem);
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transform: translate(-50%, -50%) rotate(-8deg) scale(0);
  animation: impactWord 760ms 220ms cubic-bezier(0.17, 0.9, 0.28, 1.35) both;
}

.transform-burst {
  --morph-color: #9dff20;
  --morph-glow: rgba(157, 255, 32, 0.82);
  position: absolute;
  inset: 0;
  z-index: 12;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.96), transparent 8%, var(--morph-glow) 9%, transparent 44%);
  animation: morphFlash 1080ms ease-out both;
}

.transform-orange {
  --morph-color: #ff7a17;
  --morph-glow: rgba(255, 122, 23, 0.82);
}

.transform-burst > span {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 46%;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fff, var(--morph-color), transparent);
  box-shadow: 0 0 13px var(--morph-glow);
  transform-origin: 0 50%;
  transform: rotate(var(--morph-angle)) scaleX(0);
  animation: morphRay 860ms var(--morph-delay) ease-out both;
}

.transform-burst strong {
  position: absolute;
  left: 50%;
  top: 48%;
  padding: 5px 10px;
  border: 3px solid var(--ink);
  background: var(--morph-color);
  box-shadow: 5px 5px 0 var(--ink);
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(1.1rem, 3vw, 2.1rem);
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transform: translate(-50%, -50%) rotate(-7deg) scale(0);
  animation: morphLabel 980ms 210ms cubic-bezier(0.2, 0.8, 0.25, 1.3) both;
}

.morph-ring {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 70px;
  height: 70px;
  border: 7px solid var(--morph-color);
  border-radius: 48% 52% 44% 56%;
  box-shadow: 0 0 25px var(--morph-glow);
  transform: translate(-50%, -50%) scale(0) rotate(0);
  animation: morphRing 970ms ease-out both;
}

.morph-ring-two {
  animation-delay: 110ms;
  animation-direction: reverse;
}

.transforming {
  z-index: 8;
  animation: transformCard 850ms cubic-bezier(0.22, 0.8, 0.2, 1) both;
}

.transforming .character-art img {
  animation: transformImage 900ms cubic-bezier(0.22, 0.8, 0.2, 1) both;
}

.battle-impact {
  animation: battleImpact 470ms ease-out both;
}

.game-shell {
  width: min(1500px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px clamp(16px, 3vw, 44px) 42px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  color: var(--paper-light);
}

.eyebrow,
.zone-kicker {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.brand-lockup h1,
.modal h2 {
  margin: -3px 0 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  font-weight: 900;
  font-style: italic;
  line-height: 0.82;
  letter-spacing: -0.045em;
}

.brand-lockup h1 span,
.modal h2 span {
  color: var(--danger);
}

.run-stats {
  display: flex;
  align-items: stretch;
  gap: 2px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.stat-block {
  min-width: 98px;
  padding: 9px 14px;
  display: flex;
  flex-direction: column;
  background: rgba(10, 11, 9, 0.76);
}

.stat-block span {
  color: #a6a99e;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.stat-block strong {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
}

#energyCounter {
  color: var(--acid);
  letter-spacing: 0.03em;
}

.icon-button {
  width: 48px;
  border: 0;
  background: var(--acid);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  cursor: pointer;
}

.battlefield {
  display: grid;
  grid-template-columns: minmax(270px, 0.82fr) minmax(190px, 0.46fr) minmax(480px, 1.42fr);
  min-height: 520px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.enemy-zone,
.survivor-zone {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 2vw, 30px);
}

.enemy-zone {
  background:
    linear-gradient(rgba(240, 68, 36, 0.08), rgba(240, 68, 36, 0.08)),
    repeating-linear-gradient(135deg, transparent 0 10px, rgba(21, 23, 19, 0.03) 10px 11px);
}

.enemy-zone::before {
  content: "DANGER";
  position: absolute;
  right: -24px;
  bottom: 60px;
  color: rgba(149, 31, 20, 0.07);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 8rem;
  font-weight: 900;
  transform: rotate(-90deg);
}

.survivor-zone {
  background:
    linear-gradient(rgba(199, 255, 46, 0.05), rgba(199, 255, 46, 0.05)),
    radial-gradient(circle at 90% 20%, rgba(68, 167, 223, 0.12), transparent 16rem);
}

.zone-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.zone-kicker {
  color: var(--danger-dark);
}

.zone-heading h2 {
  margin: 2px 0 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(1.6rem, 2.5vw, 2.4rem);
  font-weight: 900;
  line-height: 0.9;
  text-transform: uppercase;
}

.target-intent {
  padding: 8px 10px;
  border: 2px solid var(--danger);
  background: var(--paper-light);
  box-shadow: 3px 3px 0 var(--danger);
  text-align: right;
  transform: rotate(1deg);
}

.target-intent span {
  display: block;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.target-intent strong {
  display: block;
  color: var(--danger);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.05rem;
  text-transform: uppercase;
}

.target-intent em {
  display: block;
  margin-top: 2px;
  color: var(--danger-dark);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.character-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: var(--paper-light);
  box-shadow: 5px 6px 0 var(--ink);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.character-card.selectable {
  cursor: crosshair;
  animation: selectablePulse 900ms ease-in-out infinite alternate;
}

.character-card.selectable:hover {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: 7px 10px 0 var(--acid-dark);
}

.character-card.targeted {
  border-color: var(--danger);
  box-shadow: 5px 6px 0 var(--danger);
}

.character-card.infected {
  border-color: var(--danger-dark);
  background: #d9c3b7;
  filter: saturate(0.78);
}

.character-card.infected::after {
  content: "INFECTED";
  position: absolute;
  inset: auto -32px 40px auto;
  width: 170px;
  padding: 5px;
  color: #fff;
  background: var(--danger-dark);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-align: center;
  transform: rotate(-35deg);
}

.card-corner {
  position: absolute;
  z-index: 3;
  top: 10px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.top-left {
  left: 11px;
}

.top-right {
  right: 11px;
}

.character-art {
  position: relative;
  height: clamp(220px, 30vw, 335px);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(21, 23, 19, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(21, 23, 19, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
}

.enemy-art {
  height: clamp(260px, 31vw, 355px);
}

.character-art img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  user-select: none;
  transition: transform 220ms ease, opacity 160ms ease;
}

.enemy-art img {
  transform: rotate(1deg) scale(1.06);
}

.danger-sun {
  position: absolute;
  z-index: 0;
  width: 220px;
  height: 220px;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  background: var(--danger);
  opacity: 0.72;
  transform: translate(-50%, -50%);
}

.target-ring {
  position: absolute;
  z-index: 1;
  inset: 12% 9%;
  border: 1px dashed rgba(21, 23, 19, 0.52);
  border-radius: 50%;
  animation: spin 16s linear infinite;
}

.target-ring::before,
.target-ring::after {
  content: "";
  position: absolute;
  background: var(--ink);
}

.target-ring::before {
  width: 30px;
  height: 2px;
  left: -15px;
  top: 50%;
}

.target-ring::after {
  width: 2px;
  height: 30px;
  top: -15px;
  left: 50%;
}

.character-info {
  position: relative;
  z-index: 3;
  min-height: 71px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 2px solid var(--ink);
  background: var(--paper-light);
}

.role-label {
  display: block;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.character-info h3 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.health-cluster {
  min-width: 100px;
  text-align: right;
}

.health-cluster span {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 900;
}

.health-track {
  width: 100%;
  height: 8px;
  margin-top: 4px;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: #c9c6b9;
}

.health-track i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--danger);
  transition: width 300ms ease;
}

.survivor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 24px);
}

.yl-card {
  transform: rotate(-0.5deg);
}

.yl-card.powered:not(.infected) {
  border-color: #d8a21b;
  box-shadow: 5px 6px 0 #8b6510, 0 0 24px rgba(216, 162, 27, 0.25);
}

.yl-card.powered:not(.infected)::before {
  position: absolute;
  right: 10px;
  bottom: 84px;
  z-index: 4;
  padding: 5px 8px;
  border: 1px solid #d8a21b;
  color: #f3c94f;
  background: var(--ink);
  content: "2× POWER";
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  transform: rotate(-2deg);
}

.yl-card.powered:not(.infected) .survivor-state {
  border-color: #8b6510;
  background: #f3c94f;
}

.human-card {
  transform: rotate(0.7deg);
}

.xy-card {
  transform: rotate(-0.35deg);
}

.xy-card.scared {
  border-color: var(--danger);
  box-shadow: 5px 6px 0 var(--danger);
  background: #f5dfd6;
}

.survivor-state {
  padding: 4px 7px;
  border: 1px solid var(--ink);
  font-size: 0.62rem;
  font-weight: 800;
  white-space: nowrap;
}

.protection-badge {
  position: absolute;
  z-index: 5;
  top: 32px;
  right: 14px;
  width: 43px;
  height: 43px;
  display: none;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--acid);
  font-weight: 900;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  transform: rotate(8deg);
}

.protected .protection-badge {
  display: grid;
}

.protected {
  box-shadow: 5px 6px 0 var(--acid-dark);
}

.selection-hint {
  max-width: 170px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  text-align: right;
}

.infected-pile {
  position: relative;
  z-index: 3;
  min-height: 39px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px dashed rgba(149, 31, 20, 0.55);
  background: rgba(255, 255, 255, 0.28);
}

.empty-pile {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
}

.infected-token {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.64rem;
  font-weight: 900;
}

.infected-token img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 50%;
  background: var(--paper-light);
  mix-blend-mode: multiply;
}

.infected-token small {
  padding: 2px 5px;
  color: #fff;
  background: var(--danger-dark);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
}

.combat-divider {
  position: relative;
  z-index: 2;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px 16px;
  color: var(--paper-light);
  background:
    linear-gradient(130deg, transparent 0 46%, rgba(255, 255, 255, 0.035) 46% 54%, transparent 54%),
    var(--ink);
  clip-path: polygon(17% 0, 100% 0, 83% 100%, 0 100%);
}

.combat-divider::before {
  content: "VS";
  position: absolute;
  top: 50%;
  left: 50%;
  color: rgba(255, 255, 255, 0.035);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 10rem;
  font-weight: 900;
  transform: translate(-50%, -50%) rotate(-6deg);
}

.turn-message {
  position: relative;
  z-index: 1;
  max-width: 170px;
  min-height: 76px;
  display: grid;
  place-items: center;
  padding: 13px;
  border-top: 2px solid var(--danger);
  border-bottom: 2px solid var(--danger);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.65;
  text-align: center;
}

.end-turn-button {
  position: relative;
  z-index: 1;
  width: 160px;
  padding: 12px 14px;
  border: 0;
  background: var(--danger);
  box-shadow: 4px 5px 0 #fff;
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.end-turn-button:hover {
  transform: translateY(-3px);
  box-shadow: 5px 8px 0 #fff;
}

.end-turn-button:disabled {
  opacity: 0.45;
  cursor: wait;
}

.end-turn-button span {
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.end-turn-button b {
  display: block;
  margin-top: 2px;
  font-size: 0.76rem;
}

.hand-zone {
  margin: 28px 0 0;
  padding: 16px 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(8, 9, 8, 0.58);
  color: var(--paper-light);
}

.hand-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.hand-meta p {
  margin: 3px 0 0;
  color: #96998e;
  font-size: 0.65rem;
}

.deck-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase;
}

.deck-count span {
  color: #96998e;
  font-size: 0.7rem;
}

.deck-count strong {
  color: var(--acid);
  font-size: 1.5rem;
}

.hand {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 1.4vw, 18px);
}

.action-card {
  position: relative;
  min-height: 152px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 13px 13px 12px 58px;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: var(--paper-light);
  box-shadow: 4px 5px 0 rgba(255, 255, 255, 0.22);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.action-card:hover:not(:disabled),
.action-card.selected {
  transform: translateY(-8px) rotate(-0.7deg);
  box-shadow: 5px 10px 0 var(--acid);
}

.action-card.selected {
  border-color: var(--acid-dark);
}

.action-card:disabled {
  opacity: 0.42;
  filter: grayscale(0.8);
  cursor: not-allowed;
}

.action-cost {
  position: absolute;
  inset: 0 auto 0 0;
  width: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2rem;
  font-weight: 900;
}

.action-card.attack .action-cost {
  background: var(--danger);
}

.action-card.defense .action-cost {
  color: var(--ink);
  background: var(--acid);
}

.action-card.tactic .action-cost {
  background: var(--blue);
}

.action-index {
  position: absolute;
  top: 7px;
  left: 16px;
  color: rgba(255, 255, 255, 0.72);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.62rem;
  font-weight: 900;
}

.action-card h3 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.action-card p {
  margin: 8px 0;
  color: #55584f;
  font-size: 0.66rem;
  line-height: 1.45;
}

.action-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.action-symbol {
  color: var(--danger);
  font-size: 1.2rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(7, 8, 7, 0.88);
  backdrop-filter: blur(8px);
}

.modal-backdrop.open {
  display: grid;
}

.modal {
  position: relative;
  width: min(690px, 100%);
  padding: clamp(24px, 5vw, 48px);
  border: 2px solid var(--ink);
  background: var(--paper-light);
  box-shadow: 10px 12px 0 var(--danger);
}

.modal-stripe {
  position: absolute;
  inset: 0 0 auto;
  padding: 6px 12px;
  color: #fff;
  background: var(--ink);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.intro-panel {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(34px, 4vw, 52px);
  background:
    linear-gradient(rgba(18, 19, 17, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 19, 17, 0.035) 1px, transparent 1px),
    var(--paper-light);
  background-size: 28px 28px;
  box-shadow: 12px 14px 0 var(--danger);
  scrollbar-color: var(--danger) var(--paper);
  scrollbar-width: thin;
}

.intro-panel::after {
  position: absolute;
  inset: 32px 0 auto auto;
  width: 7px;
  height: 74px;
  background: var(--danger);
  content: "";
}

.intro-panel .eyebrow {
  margin: 0;
  color: var(--danger-dark);
}

.intro-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 clamp(14px, 2vw, 22px);
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.presented-by {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.presented-by::before {
  width: 8px;
  height: 8px;
  background: var(--danger);
  content: "";
}

.presented-by strong {
  color: #d8a21b;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-shadow: 0 0 10px rgba(216, 162, 27, 0.28);
}

.topbar-credit {
  margin-top: 11px;
  color: rgba(247, 243, 232, 0.68);
}

.topbar-credit::before {
  background: var(--acid);
  box-shadow: 0 0 12px rgba(199, 255, 46, 0.34);
}

.topbar-credit strong {
  color: #d8a21b;
}

.intro-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(190px, 24vw, 248px);
  grid-template-areas:
    "title title"
    "brief brand";
  align-items: stretch;
  gap: clamp(18px, 3vw, 32px);
}

.intro-title-block {
  position: relative;
  grid-area: title;
  padding-right: clamp(0px, 9vw, 100px);
}

.intro-title-block::after {
  position: absolute;
  right: 0;
  bottom: 9px;
  width: clamp(60px, 9vw, 100px);
  height: 10px;
  background: repeating-linear-gradient(
    90deg,
    var(--danger) 0 12px,
    transparent 12px 18px
  );
  content: "";
}

.intro-case-number {
  position: absolute;
  top: 7px;
  right: 0;
  color: var(--muted);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.intro-briefing {
  grid-area: brief;
  align-self: center;
  padding: clamp(18px, 3vw, 28px);
  border-left: 5px solid var(--danger);
  background: rgba(245, 241, 228, 0.88);
}

.intro-label {
  margin: 0 0 8px;
  color: var(--danger-dark);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.intro-brand-card {
  grid-area: brand;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 2px solid var(--ink);
  background: var(--ink);
  box-shadow: 7px 8px 0 var(--danger);
  transform: rotate(1.25deg);
}

.intro-brand-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 3px 10px;
  color: rgba(247, 243, 232, 0.66);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.56rem;
  letter-spacing: 0.1em;
}

.intro-brand-meta b {
  color: #e2b43f;
  font-size: 0.64rem;
}

.intro-brand-card p {
  margin: 10px 3px 1px;
  color: var(--paper-light);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.intro-brand-art {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(226, 180, 63, 0.66);
  border-radius: 15px;
  background: #080603;
  box-shadow: 0 0 24px rgba(216, 162, 27, 0.22);
}

.intro-panel h2 {
  margin: 0;
  font-size: clamp(4.25rem, 10.7vw, 8.6rem);
  line-height: 0.78;
  letter-spacing: -0.045em;
}

.intro-copy {
  max-width: 660px;
  margin: 0;
  color: #55584f;
  font-size: clamp(0.82rem, 1.35vw, 0.96rem);
  line-height: 1.62;
}

.intro-objective {
  display: grid;
  gap: 3px;
  margin-top: 18px;
  padding: 13px 15px;
  border: 1px solid rgba(18, 19, 17, 0.16);
  background: var(--paper-light);
}

.intro-objective span,
.intro-objective small {
  color: var(--muted);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
}

.intro-objective strong {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.08rem;
  text-transform: uppercase;
}

.intro-rules {
  margin-top: clamp(24px, 4vw, 38px);
}

.intro-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
  padding-bottom: 9px;
  border-bottom: 2px solid var(--ink);
}

.intro-section-heading span {
  color: var(--danger-dark);
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.intro-section-heading h3 {
  margin: 2px 0 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.25rem;
  line-height: 1;
}

.intro-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.66rem;
}

.infection-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.rule-flow {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 54px minmax(52px, 1fr) 16px 54px;
  grid-template-rows: 54px 22px;
  align-items: center;
  gap: 5px 8px;
  padding: 12px;
  border: 1px solid rgba(18, 19, 17, 0.22);
  background: rgba(245, 241, 228, 0.92);
  box-shadow: inset 4px 0 0 var(--danger);
}

.rule-flow img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: #fff;
  mix-blend-mode: multiply;
}

.rule-flow span {
  color: var(--muted);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-align: center;
}

.rule-flow b {
  color: var(--danger);
  font-size: 1rem;
}

.rule-flow strong {
  grid-column: 4;
  align-self: end;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.68rem;
  text-align: center;
  text-transform: uppercase;
}

.quick-rules {
  margin: 16px 0 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.quick-rules span {
  min-width: 0;
  display: grid;
  grid-template-columns: 26px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 1px 8px;
  padding: 10px;
  border-top: 2px solid var(--ink);
  background: rgba(245, 241, 228, 0.72);
  font-size: 0.61rem;
  line-height: 1.35;
}

.quick-rules b {
  grid-row: 1 / 3;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: #fff;
  background: var(--danger);
  font-family: "Barlow Condensed", sans-serif;
}

.quick-rules em {
  color: var(--danger-dark);
  font-size: 0.55rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.09em;
}

.intro-panel .primary-button {
  min-height: 56px;
  padding: 15px 20px;
  background: linear-gradient(90deg, var(--acid), #e6ff65);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.intro-panel .primary-button span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(18, 19, 17, 0.32);
  border-radius: 50%;
}

.primary-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border: 2px solid var(--ink);
  background: var(--acid);
  box-shadow: 5px 6px 0 var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.primary-button:hover {
  transform: translateY(-3px);
  box-shadow: 7px 9px 0 var(--ink);
}

.primary-button span {
  font-size: 1.3rem;
}

.result-panel {
  width: min(480px, 100%);
  text-align: center;
}

.result-panel h2 {
  margin: 8px 0 16px;
  font-size: clamp(3rem, 9vw, 5rem);
}

.result-panel > p:not(.eyebrow) {
  color: var(--muted);
}

.result-score {
  margin: 24px 0;
  padding: 16px;
  border-block: 2px solid var(--ink);
}

.result-score span {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.result-score strong {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 3.4rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.08em;
}

.shake {
  animation: shake 380ms ease both;
}

.hit-flash {
  animation: hitFlash 520ms ease both;
}

.attack-pose img {
  animation: attackPose 620ms ease both;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes selectablePulse {
  from { outline: 2px solid rgba(199, 255, 46, 0.2); outline-offset: 1px; }
  to { outline: 4px solid rgba(199, 255, 46, 0.82); outline-offset: 4px; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-8px) rotate(-1deg); }
  40% { transform: translateX(10px) rotate(1deg); }
  60% { transform: translateX(-5px) rotate(-0.5deg); }
  80% { transform: translateX(4px) rotate(0.5deg); }
}

@keyframes hitFlash {
  0%, 100% { filter: none; }
  35% { filter: brightness(1.8) sepia(1) saturate(5) hue-rotate(320deg); }
}

@keyframes attackPose {
  0%, 100% { transform: translateX(0) scale(1); }
  45% { transform: translateX(-12%) scale(1.08) rotate(-2deg); }
}

@keyframes attackStreak {
  0% { opacity: 0; transform: scaleX(0); }
  18% { opacity: 1; }
  70% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1); }
}

@keyframes attackProjectile {
  0% { opacity: 0; transform: translateX(0) rotate(45deg) scale(0.25); }
  12% { opacity: 1; }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translateX(var(--fx-distance)) rotate(315deg) scale(1.15); }
}

@keyframes impactRing {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.08) rotate(0); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(5) rotate(110deg); }
}

@keyframes impactRay {
  0% { opacity: 0; transform: rotate(var(--ray-angle)) scaleX(0); }
  22% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--ray-angle)) scaleX(1); }
}

@keyframes impactWord {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-18deg) scale(0); }
  35% { opacity: 1; transform: translate(-50%, -50%) rotate(5deg) scale(1.35); }
  60% { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -68%) rotate(-4deg) scale(0.82); }
}

@keyframes morphFlash {
  0% { opacity: 0; filter: brightness(1); }
  10% { opacity: 1; filter: brightness(2.4); }
  36% { opacity: 1; filter: brightness(1.2); }
  100% { opacity: 0; filter: brightness(1); }
}

@keyframes morphRay {
  0% { opacity: 0; transform: rotate(var(--morph-angle)) scaleX(0); }
  22% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--morph-angle)) scaleX(1.25); }
}

@keyframes morphRing {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(0); }
  28% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(4.5) rotate(145deg); }
}

@keyframes morphLabel {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-16deg) scale(0); }
  30% { opacity: 1; transform: translate(-50%, -50%) rotate(5deg) scale(1.25); }
  72% { opacity: 1; transform: translate(-50%, -50%) rotate(-7deg) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -72%) rotate(-4deg) scale(0.82); }
}

@keyframes transformCard {
  0%, 100% { filter: none; transform: translate(0, 0) rotate(0) scale(1); }
  12% { filter: brightness(2.2) saturate(2); transform: translate(-7px, 2px) rotate(-2deg) scale(1.03); }
  24% { transform: translate(8px, -3px) rotate(2deg) scale(0.96); }
  38% { filter: hue-rotate(70deg) saturate(3); transform: translate(-5px, -5px) rotate(-1deg) scale(1.06); }
  58% { transform: translate(5px, 2px) rotate(1deg) scale(0.98); }
  76% { filter: brightness(1.35) saturate(1.5); transform: translate(-2px, 0) rotate(0) scale(1.02); }
}

@keyframes transformImage {
  0% { opacity: 0.25; transform: scale(0.72) skew(-8deg, 4deg); filter: blur(8px) brightness(3); }
  22% { opacity: 1; transform: scale(1.12) skew(5deg, -3deg); filter: blur(1px) saturate(4); }
  42% { transform: scale(0.92) skew(-3deg, 2deg); filter: hue-rotate(80deg) saturate(3); }
  68% { transform: scale(1.05) skew(1deg, -1deg); filter: brightness(1.5); }
  100% { opacity: 1; transform: scale(1); filter: none; }
}

@keyframes battleImpact {
  0%, 100% { transform: translate(0, 0); }
  16% { transform: translate(-5px, 2px); }
  32% { transform: translate(6px, -2px); }
  48% { transform: translate(-4px, -1px); }
  64% { transform: translate(3px, 2px); }
  80% { transform: translate(-1px, 0); }
}

@media (max-width: 1050px) {
  .battlefield {
    grid-template-columns: minmax(230px, 0.85fr) 130px minmax(390px, 1.35fr);
  }

  .combat-divider {
    clip-path: polygon(11% 0, 100% 0, 89% 100%, 0 100%);
    padding-inline: 8px;
  }

  .end-turn-button {
    width: 122px;
  }

  .character-art {
    height: 235px;
  }

  .enemy-art {
    height: 298px;
  }
}

@media (max-width: 820px) {
  .game-shell {
    padding-top: 14px;
  }

  .topbar {
    align-items: flex-start;
  }

  .run-stats {
    flex-wrap: wrap;
    justify-content: flex-end;
    background: transparent;
    border: 0;
  }

  .stat-block {
    min-width: 76px;
    padding: 6px 9px;
  }

  .battlefield {
    display: flex;
    flex-direction: column;
  }

  .combat-divider {
    min-height: 150px;
    flex-direction: row;
    clip-path: polygon(0 14%, 100% 0, 100% 86%, 0 100%);
  }

  .turn-message {
    max-width: 310px;
  }

  .enemy-card {
    max-width: 420px;
    margin: 0 auto;
  }

  .character-art,
  .enemy-art {
    height: 300px;
  }

  .infection-rules {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .hand {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 8px 2px 14px;
  }

  .action-card {
    flex: 0 0 245px;
    scroll-snap-align: start;
  }
}

@media (max-width: 700px) {
  .intro-hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "brief"
      "brand";
  }

  .intro-title-block {
    padding-right: 0;
  }

  .intro-title-block::after,
  .intro-case-number {
    display: none;
  }

  .intro-brand-card {
    width: min(100%, 300px);
    justify-self: center;
  }

  .intro-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

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

@media (max-width: 560px) {
  .topbar {
    display: block;
  }

  .intro-heading-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .intro-hero {
    grid-template-columns: 1fr;
  }

  .intro-panel::after {
    display: none;
  }

  .intro-panel h2 {
    font-size: clamp(3.4rem, 20vw, 5.2rem);
  }

  .brand-lockup {
    margin-bottom: 14px;
  }

  .run-stats {
    justify-content: flex-start;
  }

  .survivor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .xy-card {
    grid-column: 1 / -1;
    width: min(100%, 310px);
    justify-self: center;
  }

  .survivor-zone,
  .enemy-zone {
    padding: 16px;
  }

  .character-art {
    height: 220px;
  }

  .enemy-art {
    height: 280px;
  }

  .character-info {
    min-height: 80px;
    align-items: flex-start;
    flex-direction: column;
  }

  .character-info h3 {
    font-size: 1.12rem;
  }

  .health-cluster {
    width: 100%;
  }

  .selection-hint {
    display: none;
  }

  .combat-divider {
    justify-content: space-around;
  }

  .turn-message {
    max-width: 170px;
  }

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

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

  .modal {
    max-height: calc(100vh - 28px);
    overflow-y: auto;
    padding: 28px 20px 22px;
  }
}

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