@font-face {
  font-family: "Archivo Black";
  src: url("./fonts/archivo-black.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Plex Mono";
  src: url("./fonts/ibm-plex-mono-regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Press Start 2P";
  src: url("./fonts/press-start-2p.ttf") format("truetype");
  font-display: swap;
}

:root {
  --purple: #b863fc;
  --raspberry: #e40243;
  --yellow: #f6e002;
  --arctic: #56f9ff;
  --green: #6be176;
  --blue: #0323f2;
  --orange: #eb7828;
  --pink: #fbb3b0;
  --red: #b70505;
  --black: #20201f;
  --white: #dbf0f0;
  --cream: var(--white);
  --line: rgba(219, 240, 240, .24);
  --screen: var(--white);
  --screen-2: rgba(219, 240, 240, .82);
  --ink: var(--black);
  --muted: rgba(32, 32, 31, .58);
  --pixel: "Press Start 2P", "Courier New", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--black); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  background:
    linear-gradient(90deg, transparent 49.9%, rgba(255,255,255,.035) 50%, transparent 50.1%),
    var(--black);
  font-family: "Plex Mono", monospace;
}

button, a { font: inherit; }
button { color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.exp-topbar {
  display: grid;
  grid-template-columns: 215px 1fr 238px;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
}

.exp-wordmark,
.console-link {
  display: flex;
  align-items: center;
  padding: 0 26px;
}

.exp-wordmark {
  border-right: 1px solid var(--line);
  font-family: "Archivo Black", sans-serif;
  font-size: 25px;
  letter-spacing: -1.6px;
}

.exp-wordmark span:last-child,
.exp-heading h1 span,
.exp-console-head > strong span,
.title-view h2 span { color: var(--blue); }

.exp-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
}

.exp-status i,
.exp-console-head em i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.exp-status i {
  background: var(--raspberry);
}

.exp-console-head em i {
  background: var(--red);
  box-shadow: 0 0 9px rgba(183, 5, 5, .8);
}

.console-link {
  justify-content: space-between;
  border-left: 1px solid var(--line);
  color: var(--black);
  background: var(--cream);
  font-size: 10px;
  font-weight: 700;
}

.exp-shell {
  position: relative;
  min-height: calc(100vh - 72px);
  padding: 58px 5vw 70px;
  overflow: hidden;
}

.exp-shell::before {
  content: "";
  position: absolute;
  inset: 28px 2.5vw;
  border: 1px solid var(--line);
  pointer-events: none;
}

.exp-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  width: min(1120px, 94vw);
  margin: 0 auto 34px;
}

.exp-heading p {
  margin: 0 0 12px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.exp-heading p::before { content: "●"; margin-right: 9px; color: var(--raspberry); }

.exp-heading h1 {
  margin: 0;
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(46px, 5.3vw, 76px);
  line-height: .87;
  letter-spacing: -4px;
}

.meta-summary {
  display: grid;
  min-width: 180px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  text-align: right;
}

.meta-summary span,
.meta-summary small { font-size: 7px; font-weight: 700; letter-spacing: 1px; }
.meta-summary strong { font-family: "Archivo Black", sans-serif; font-size: 28px; }
.meta-summary small { color: rgba(219, 240, 240, .72); }

.exp-console {
  position: relative;
  z-index: 1;
  width: min(920px, 76vw);
  margin: auto;
  padding: 42px 52px 34px;
  border: 1px solid #565656;
  border-radius: 36px 36px 104px 36px;
  color: var(--white);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .035), transparent 26%),
    #111;
  box-shadow: 0 36px 90px rgba(0, 0, 0, .65);
}

.exp-console::before,
.exp-console::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: inherit;
}

.exp-console::before { inset: 9px; }
.exp-console::after { inset: 18px; border-color: rgba(255, 255, 255, .07); }

.exp-console-head {
  display: grid;
  grid-template-columns: 170px 1fr 80px;
  align-items: center;
  min-height: 40px;
  padding: 0 7px 12px;
}

.exp-console-head > strong {
  font-family: "Archivo Black", sans-serif;
  font-size: 16px;
}

.exp-console-head em {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  font-size: 7px;
  font-style: normal;
  font-weight: 700;
}

.cartridge-label {
  justify-self: center;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 1px;
}

.exp-screen {
  --hud-height: 64px;
  --biome-color: var(--white);
  position: relative;
  min-height: 674px;
  overflow: hidden;
  border: solid #090909;
  border-width: 22px 34px 34px;
  border-radius: 16px 16px 55px 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--biome-color) 24%, var(--screen)), var(--screen) 62%),
    var(--screen);
  box-shadow: 0 0 0 1px #464646;
  font-family: var(--pixel);
}

.screen-hud {
  position: absolute;
  z-index: 25;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 1.35fr .9fr 1.15fr .95fr;
  height: var(--hud-height);
  color: var(--white);
  background: var(--black);
  border-bottom: 3px solid var(--black);
}

.squad-access {
  position: absolute;
  z-index: 26;
  top: calc(var(--hud-height) + 8px);
  right: 10px;
  min-height: 30px;
  padding: 7px 9px;
  border: 2px solid var(--ink);
  color: var(--white);
  background: var(--blue);
  font-family: var(--pixel);
  font-size: 6px;
}

.hud-stat {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 10px;
  border-right: 1px solid rgba(219, 240, 240, .25);
}

.hud-stat:last-child { border-right: 0; }
.hud-stat span { font-size: 6px; font-weight: 700; letter-spacing: 1.2px; }
.hud-stat strong { overflow: hidden; font-size: 10px; line-height: 1.2; white-space: nowrap; }

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

.gold-stat span { color: var(--white); font-size: 7px; }
.gold-stat strong {
  font-family: var(--pixel);
  font-size: 17px;
}

.scanlines {
  position: absolute;
  z-index: 20;
  inset: var(--hud-height) 0 0;
  opacity: .1;
  background: repeating-linear-gradient(0deg, transparent 0 3px, var(--ink) 4px);
  pointer-events: none;
}

.view {
  position: absolute;
  z-index: 1;
  inset: var(--hud-height) 0 0;
  display: none;
  padding: 26px;
  color: var(--ink);
}

.view.is-active { display: block; animation: screen-in .22s steps(3); }

.title-view {
  place-items: center;
  align-content: center;
  text-align: center;
}

.title-view.is-active { display: grid; }

.title-view > p,
.title-view > small {
  margin: 0;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 1.3px;
}

.title-view h2 {
  position: relative;
  z-index: 2;
  margin: 16px 0 24px;
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(42px, 7vw, 82px);
  line-height: .82;
  letter-spacing: -4px;
  text-shadow: 4px 4px 0 rgba(23,32,29,.14);
}

.title-signal {
  position: absolute;
  inset: 0;
  opacity: .15;
}

.title-signal i {
  position: absolute;
  width: 220px;
  height: 4px;
  left: calc(50% - 110px);
  top: 50%;
  background: var(--ink);
}
.title-signal i:first-child { transform: rotate(18deg) scaleX(2.5); }
.title-signal i:nth-child(2) { transform: rotate(-25deg) scaleX(2.4); }
.title-signal i:nth-child(3) { transform: rotate(63deg) scaleX(2.2); }
.title-signal i:nth-child(4) { transform: rotate(-67deg) scaleX(2); }
.title-signal i:last-child { transform: rotate(2deg) scaleX(2.8); }

.title-actions {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.title-actions button,
.primary-button,
.event-actions button {
  min-height: 42px;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: transparent;
  font-size: 8px;
  font-weight: 700;
}

.title-actions button:hover,
.event-actions button:hover { background: rgba(23,32,29,.09); }

.primary-button {
  color: var(--cream) !important;
  background: var(--blue) !important;
  box-shadow: 4px 4px 0 var(--ink);
}

.primary-button:active { transform: translate(3px,3px); box-shadow: 1px 1px 0 var(--ink); }

.view-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
}

.view-head div { display: grid; gap: 4px; }
.view-head span,
.view-head p,
.panel-title,
.board-label { font-size: 7px; font-weight: 700; }
.view-head strong { font-size: 17px; }
.view-head p { margin: 0; text-align: right; }

.route-progress {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  margin: 22px 0 28px;
}

.progress-step {
  position: relative;
  padding-top: 15px;
  border-top: 3px solid var(--muted);
  font-size: 7px;
  font-weight: 700;
  text-align: center;
}

.progress-step::before {
  content: "";
  position: absolute;
  top: -8px;
  left: calc(50% - 6px);
  width: 12px;
  height: 12px;
  border: 2px solid var(--screen);
  border-radius: 50%;
  background: var(--muted);
}

.progress-step.is-cleared { border-color: var(--blue); color: var(--blue); }
.progress-step.is-cleared::before { background: var(--blue); }
.progress-step.is-current { border-color: var(--raspberry); color: var(--raspberry); }
.progress-step.is-current::before { background: var(--raspberry); box-shadow: 0 0 0 4px rgba(228,2,67,.18); }

.node-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.route-node {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 300px;
  padding: 0;
  overflow: hidden;
  border: 3px solid var(--ink);
  color: var(--ink);
  background: rgba(219, 240, 240, .45);
  text-align: left;
  transition: transform .15s ease, box-shadow .15s ease;
}

.route-node:hover,
.route-node:focus-visible { outline: 0; transform: translateY(-5px); box-shadow: 6px 6px 0 var(--ink); }
.node-number { display: flex; justify-content: space-between; padding: 9px 11px; border-bottom: 2px solid var(--ink); font-size: 7px; font-weight: 700; }
.node-icon { display: grid; place-items: center; min-height: 128px; font-family: "Archivo Black", sans-serif; font-size: 64px; color: var(--cream); background: var(--blue); text-shadow: 5px 5px 0 var(--ink); }
.route-node[data-type="elite"] .node-icon,
.route-node[data-type="midboss"] .node-icon,
.route-node[data-type="boss"] .node-icon { background: var(--red); }
.route-node[data-type="chaos"] .node-icon { background: var(--raspberry); }
.route-node[data-type="treasure"] .node-icon,
.route-node[data-type="merchant"] .node-icon { color: var(--ink); background: var(--yellow); }
.route-node[data-type="shrine"] .node-icon { background: var(--purple); }
.route-node[data-type="event"] .node-icon { background: var(--black); }
.route-node[data-type="capture"] .node-icon { color: var(--black); background: var(--green); text-shadow: none; }
.node-copy { padding: 13px; }
.node-copy strong { display: block; font-size: 14px; }
.node-copy small { display: block; margin-top: 8px; font-size: 7px; line-height: 1.5; }

.prep-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 20px;
  margin-top: 18px;
}

.board-label { display: flex; justify-content: space-between; margin-bottom: 8px; }
.board-label em { color: var(--blue); font-style: normal; }

.unit-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, minmax(150px, 1fr));
  gap: 8px;
}

.unit-slot {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: rgba(219, 240, 240, .32);
}

button.unit-slot { width: 100%; padding: 0; text-align: left; }
button.unit-slot:hover { background: rgba(219, 240, 240, .62); }
.unit-slot.is-selected { outline: 4px solid var(--blue); outline-offset: -5px; }
.unit-slot.is-empty { display: grid; place-items: center; color: var(--muted); font-size: 7px; font-weight: 700; }
.unit-slot.front::after {
  content: "FRONT";
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 3px 4px;
  color: var(--cream);
  background: var(--raspberry);
  font-size: 5px;
  font-weight: 700;
}

.unit-portrait {
  position: relative;
  height: 108px;
  overflow: hidden;
  border-bottom: 2px solid var(--ink);
  background: var(--unit-color, var(--white));
}

.unit-portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.unit-rarity {
  position: absolute;
  top: 5px;
  left: 5px;
  padding: 3px 5px;
  color: var(--cream);
  background: var(--ink);
  font-size: 5px;
  font-weight: 700;
}
.unit-rarity.rare { background: var(--blue); }
.unit-rarity.epic { color: var(--black); background: var(--purple); }
.unit-rarity.legendary { color: var(--ink); background: var(--yellow); }

.unit-info { padding: 7px; }
.unit-info strong { display: block; overflow: hidden; font-size: 8px; white-space: nowrap; text-overflow: ellipsis; }
.unit-info span { display: block; margin-top: 3px; overflow: hidden; font-size: 5px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }

.hp-meter {
  height: 5px;
  margin-top: 5px;
  border: 1px solid var(--ink);
  background: transparent;
}
.hp-meter i { display: block; height: 100%; background: var(--green); transition: width .2s steps(4); }
.hp-meter i.is-low { background: var(--red); }

.synergy-panel {
  min-height: 330px;
  max-height: 405px;
  overflow-y: auto;
  border: 2px solid var(--ink);
  background: rgba(219, 240, 240, .3);
}
.panel-title {
  position: sticky;
  z-index: 2;
  top: 0;
  padding: 10px;
  border-bottom: 2px solid var(--ink);
  background: var(--screen);
}
.synergy-row { display: grid; grid-template-columns: 35px 1fr auto; align-items: center; gap: 8px; padding: 9px 10px; border-bottom: 1px solid var(--muted); }
.synergy-row i { width: 27px; height: 12px; border: 2px solid var(--ink); background: var(--signal-color); }
.synergy-row strong { display: block; font-size: 7px; }
.synergy-row span { display: block; margin-top: 3px; font-size: 5px; }
.synergy-row b { color: var(--blue); font-size: 9px; }
.empty-signals { padding: 18px 10px; color: var(--muted); font-size: 7px; line-height: 1.6; }

.unit-inspector { background: rgba(219, 240, 240, .34); }

.inspector-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 118px;
  overflow: hidden;
  border-bottom: 2px solid var(--ink);
  background: var(--inspector-color);
}

.inspector-hero img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  image-rendering: pixelated;
  transform: translateY(1px);
}

.inspector-hero > span {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 4px 6px;
  color: var(--white);
  background: var(--black);
  font-size: 5px;
  font-weight: 700;
}

.inspector-name { padding: 10px; border-bottom: 1px solid var(--muted); }
.inspector-name strong { display: block; font-size: 10px; }
.inspector-name span { display: block; margin-top: 4px; font-size: 5px; font-weight: 700; }

.inspector-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--muted);
}

.inspector-stats span {
  display: grid;
  gap: 3px;
  padding: 7px 5px;
  border-right: 1px solid var(--muted);
  font-size: 5px;
  font-weight: 700;
}

.inspector-stats span:last-child { border-right: 0; }
.inspector-stats b { color: var(--blue); font-size: 8px; }

.inspector-trait { padding: 8px 10px; border-bottom: 1px solid var(--muted); }
.inspector-trait strong { display: block; font-size: 6px; }
.inspector-trait span { display: block; margin-top: 4px; font-size: 5px; line-height: 1.5; }

.inspector-help {
  margin: 0;
  padding: 9px 10px;
  color: var(--blue);
  font-size: 5px;
  font-weight: 700;
  line-height: 1.5;
}

.prep-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
}

#enemy-preview { font-size: 7px; font-weight: 700; }
#enemy-preview strong { color: var(--raspberry); }

.combat-view { padding: 18px 22px; }
.combat-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.combat-header > div:first-child { display: grid; gap: 3px; }
.combat-header span { font-size: 6px; font-weight: 700; }
.combat-header strong { font-size: 14px; }
.combat-controls button { padding: 7px 10px; border: 2px solid var(--ink); color: var(--ink); background: transparent; font-size: 7px; font-weight: 700; }

.combat-board-wrap {
  display: grid;
  grid-template-rows: 1fr 26px 1fr;
  height: 485px;
  padding: 10px 5vw 4px;
}

.combat-side { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 10px; }
.combat-side > span { font-size: 6px; font-weight: 700; writing-mode: vertical-rl; transform: rotate(180deg); }
.enemy-side { transform: rotate(180deg); }
.enemy-side .unit-slot,
.enemy-side > span { transform: rotate(180deg); }
.combat-board { grid-template-rows: repeat(2, 98px); width: 100%; }
.combat-board.is-boss-combat {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  place-items: center;
}
.combat-board .unit-portrait { height: 66px; }
.combat-board .unit-info { padding: 4px 6px; }
.combat-board .unit-info strong { font-size: 6px; }
.combat-board .unit-info span { display: none; }
.combat-board .unit-slot { transition: transform .13s steps(2), filter .13s; }
.combat-board .unit-slot:not(.is-dead) { animation: idle-bob 1.35s steps(2) infinite; }
.unit-slot.is-attacking { transform: translateY(-8px); filter: brightness(1.3); }
.enemy-side .unit-slot.is-attacking { transform: rotate(180deg) translateY(-8px); }
.unit-slot.is-hit { animation: unit-hit .25s steps(2); }
.enemy-side .unit-slot.is-hit { animation: enemy-hit .25s steps(2); }
.unit-slot.is-dead { opacity: .25; filter: grayscale(1); }
.unit-slot.is-healed { box-shadow: 0 0 0 5px var(--green) inset; }
.unit-slot.is-critical { box-shadow: 0 0 0 6px var(--yellow) inset; }
.boss-combat-card {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(130px, 1fr);
  align-items: center;
  gap: 13px;
  width: min(100%, 520px);
  min-height: 205px;
  padding: 12px;
  color: var(--ink);
  background: rgba(219, 240, 240, .56);
}
.boss-portrait {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 3px solid var(--ink);
  background: rgba(32, 32, 31, .08);
}
.boss-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  image-rendering: pixelated;
}
.boss-info {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.boss-info strong {
  font-size: 13px;
  line-height: 1.35;
}
.boss-info span {
  font-size: 7px;
  line-height: 1.45;
}
.damage-float {
  position: absolute;
  z-index: 9;
  left: 50%;
  top: 18px;
  padding: 4px 5px;
  border: 2px solid var(--ink);
  color: var(--white);
  background: var(--raspberry);
  font-size: 7px;
  pointer-events: none;
  transform: translateX(-50%);
  animation: damage-rise .72s steps(5) forwards;
}
.damage-float.is-crit { color: var(--ink); background: var(--yellow); transform: translateX(-50%) scale(1.15); }
.damage-float.is-heal { color: var(--ink); background: var(--green); }
.damage-float.is-status { color: var(--ink); background: var(--arctic); }
.damage-float.is-ko { color: var(--white); background: var(--black); }
.exp-screen.screen-shake { animation: screen-shake .2s steps(2); }
.exp-screen.screen-flash::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 14;
  background: rgba(246, 224, 2, .22);
  pointer-events: none;
  animation: screen-flash .22s steps(2) forwards;
}
.versus-signal { display: grid; place-items: center; font-family: "Archivo Black", sans-serif; font-size: 17px; }
.combat-log { height: 46px; padding: 10px 13px; border: 2px solid var(--ink); background: rgba(219, 240, 240, .45); font-size: 7px; font-weight: 700; line-height: 1.6; }

.reward-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 20px;
  margin-top: 20px;
}

.capture-card { min-height: 430px; overflow: hidden; border: 3px solid var(--ink); background: rgba(219, 240, 240, .4); }
.capture-image { position: relative; display: grid; place-items: center; height: 245px; border-bottom: 3px solid var(--ink); background: var(--unit-color); }
.capture-image img { width: 90%; height: 90%; object-fit: contain; image-rendering: pixelated; }
.capture-details { padding: 15px; }
.capture-details > span { font-size: 6px; font-weight: 700; }
.capture-details h2 { margin: 5px 0 12px; font-family: "Archivo Black", sans-serif; font-size: 28px; letter-spacing: -1px; }
.trait-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.trait-chips i { padding: 5px 6px; border: 1px solid var(--ink); font-size: 6px; font-style: normal; font-weight: 700; }
.capture-details p { margin: 13px 0 0; font-size: 7px; line-height: 1.6; }

.reward-options { display: grid; gap: 10px; }
.reward-options button { display: grid; align-content: center; min-height: 130px; padding: 16px 18px; border: 3px solid var(--ink); color: var(--ink); background: transparent; text-align: left; }
.reward-options button:hover { color: var(--cream); background: var(--blue); }
.reward-options span { font-size: 6px; font-weight: 700; }
.reward-options strong { margin: 6px 0; font-size: 15px; }
.reward-options small { max-width: 450px; font-size: 7px; line-height: 1.5; }

.event-view { align-items: center; grid-template-columns: 220px 1fr; gap: 28px; }
.event-view.is-active { display: grid; }
.event-mark { display: grid; place-items: center; width: 210px; height: 280px; border: 4px solid var(--ink); color: var(--cream); background: var(--blue); font-family: "Archivo Black", sans-serif; font-size: 120px; text-shadow: 8px 8px 0 var(--ink); }
.event-copy > span { font-size: 7px; font-weight: 700; }
.event-copy h2 { margin: 8px 0 14px; font-family: "Archivo Black", sans-serif; font-size: 45px; line-height: .9; letter-spacing: -2px; }
.event-copy p { max-width: 560px; font-size: 9px; line-height: 1.7; }
.event-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }

.event-view.is-monster-choice {
  grid-template-columns: 1fr;
  align-content: start;
  gap: 12px;
  overflow-y: auto;
}

.event-view.is-monster-choice .event-mark { display: none; }
.event-view.is-monster-choice .event-copy { text-align: center; }
.event-view.is-monster-choice .event-copy h2 { margin-bottom: 7px; font-size: 34px; }
.event-view.is-monster-choice .event-copy p { max-width: 760px; margin: 0 auto; font-size: 7px; }

.event-actions.monster-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.starter-archive-button {
  grid-column: 1 / -1;
  min-height: 58px !important;
}

.starter-archive-button strong,
.starter-archive-button small { display: block; }
.starter-archive-button small { margin-top: 7px; }
.starter-cost {
  display: block;
  padding: 7px 10px;
  border-top: 2px solid var(--ink);
  color: var(--white);
  background: var(--blue);
  font-size: 6px;
  text-align: center;
}

.event-actions .monster-choice {
  display: grid;
  grid-template-rows: minmax(180px, 1fr) auto;
  min-width: 0;
  min-height: 335px;
  padding: 0;
  overflow: hidden;
  border: 3px solid var(--ink);
  color: var(--ink);
  background: rgba(219, 240, 240, .62);
  text-align: left;
}

.event-actions .monster-choice:hover,
.event-actions .monster-choice:focus-visible {
  outline: 0;
  color: var(--ink);
  background: var(--white);
  box-shadow: 6px 6px 0 var(--ink);
  transform: translateY(-4px);
}

.monster-choice-image {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 180px;
  overflow: hidden;
  border-bottom: 3px solid var(--ink);
  background: var(--choice-color);
}

.monster-choice-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  image-rendering: pixelated;
  transform: translateY(1px);
}

.monster-choice-rarity {
  position: absolute;
  z-index: 1;
  top: 7px;
  left: 7px;
  padding: 4px 6px;
  color: var(--white);
  background: var(--black);
  font-size: 6px;
  font-weight: 700;
}

.monster-choice-rarity.rare { background: var(--blue); }
.monster-choice-rarity.epic { color: var(--black); background: var(--purple); }
.monster-choice-rarity.legendary { color: var(--black); background: var(--yellow); }

.relic-rarity {
  display: inline-block;
  width: max-content;
  padding: 4px 6px;
  color: var(--white);
  background: var(--black);
  font-size: 6px;
  font-style: normal;
}

.relic-rarity.uncommon { color: var(--black); background: var(--green); }
.relic-rarity.rare { background: var(--blue); }
.relic-rarity.legendary { color: var(--black); background: var(--yellow); }
.relic-rarity.cursed { background: var(--raspberry); }

.event-view.is-relic-shop {
  grid-template-columns: 1fr;
  align-content: start;
  overflow-y: auto;
}

.event-view.is-elite-reward {
  grid-template-columns: 1fr;
  align-content: start;
  overflow-y: auto;
}

.event-view.is-boss-reward {
  grid-template-columns: 1fr;
  align-content: start;
  overflow-y: auto;
}

.event-view.is-elite-reward .event-mark { display: none; }
.event-view.is-elite-reward .event-copy { text-align: center; }
.event-view.is-elite-reward .event-copy p { margin: 0 auto; }
.event-view.is-elite-reward .event-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.event-view.is-boss-reward .event-mark { display: none; }
.event-view.is-boss-reward .event-copy { text-align: center; }
.event-view.is-boss-reward .event-copy p { margin: 0 auto; }
.event-view.is-boss-reward .event-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.event-view.is-relic-shop .event-mark { display: none; }
.event-view.is-relic-shop .event-copy { text-align: center; }
.event-view.is-relic-shop .event-copy p { margin: 0 auto; }
.event-view.is-relic-shop .event-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.relic-offer,
.elite-bundle,
.boss-reward {
  position: relative;
  display: grid !important;
  align-content: start !important;
  gap: 9px;
  min-height: 140px;
  text-align: left;
}

.relic-offer strong,
.elite-bundle strong,
.boss-reward strong { font-size: 9px; line-height: 1.45; }
.relic-offer small,
.elite-bundle small,
.boss-reward small { font-size: 7px; line-height: 1.55; }
.relic-offer.is-purchased { opacity: .35; }
.merchant-leave { grid-column: 1 / -1; }

.elite-bundle-monster .monster-choice-image { min-height: 110px; }
.elite-bundle-monster .monster-choice-copy { padding: 7px; }
.elite-bundle-plus { color: var(--blue); font-size: 16px; text-align: center; }
.elite-bundle-secondary { display: grid; gap: 7px; }
.boss-reward-heading { color: var(--blue); font-size: 6px; line-height: 1.5; }
.boss-reward .monster-choice-image { min-height: 145px; border: 2px solid var(--ink); }
.boss-reward .monster-choice-copy { padding: 8px 0; }
.boss-xp-reward { place-content: center; text-align: center; }
.boss-xp-reward b { color: var(--blue); font-size: 58px; line-height: 1; }

.monster-choice-copy {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 12px;
}

.monster-choice-copy strong {
  font-family: "Archivo Black", sans-serif;
  font-size: 17px;
  line-height: 1;
}

.monster-choice-copy small,
.monster-choice-copy em {
  font-size: 6px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.45;
}

.monster-choice-copy em { color: var(--blue); }

.result-view { align-content: center; justify-items: center; text-align: center; }
.result-view.is-active { display: grid; }
.result-view > p { margin: 0; font-size: 8px; font-weight: 700; letter-spacing: 1.3px; }
.result-view > h2 { margin: 12px 0 22px; font-family: "Archivo Black", sans-serif; font-size: 58px; line-height: .85; letter-spacing: -3px; }
.result-ledger { display: grid; grid-template-columns: repeat(4, 1fr); width: min(650px, 100%); margin-bottom: 23px; border: 2px solid var(--ink); }
.result-ledger div { display: grid; gap: 5px; padding: 13px; border-right: 1px solid var(--ink); }
.result-ledger div:last-child { border: 0; }
.result-ledger span { font-size: 6px; font-weight: 700; }
.result-ledger strong { font-size: 17px; }

.toast {
  position: absolute;
  z-index: 30;
  right: 18px;
  bottom: 18px;
  max-width: 380px;
  padding: 10px 13px;
  color: var(--cream);
  background: var(--ink);
  font-size: 7px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: .18s ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }

.exp-console-foot {
  display: grid;
  grid-template-columns: 1fr 140px 150px;
  align-items: center;
  min-height: 105px;
  padding: 18px 12px 0;
}
.relic-strip > span { color: var(--white); font-size: 6px; font-weight: 700; }
#relic-strip { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; color: rgba(219,240,240,.55); font-size: 6px; font-weight: 700; }
#relic-strip .relic-chip {
  position: relative;
  padding: 5px 7px;
  border: 1px solid rgba(219,240,240,.45);
  color: var(--white);
  cursor: help;
  font-style: normal;
}

#relic-strip .relic-chip > i {
  display: block;
  margin-bottom: 3px;
  color: rgba(219,240,240,.62);
  font-size: 4px;
  font-style: normal;
}

#relic-strip .relic-chip::after {
  position: absolute;
  z-index: 50;
  bottom: calc(100% + 10px);
  left: 0;
  width: 230px;
  padding: 9px 10px;
  border: 1px solid #565656;
  color: var(--white);
  background: #080808;
  box-shadow: 5px 5px 0 rgba(0,0,0,.45);
  content: attr(data-tooltip);
  font-size: 7px;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px);
  transition: opacity .12s ease, transform .12s ease;
}

#relic-strip .relic-chip:hover::after,
#relic-strip .relic-chip:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}
.console-buttons { display: flex; gap: 10px; transform: rotate(-10deg); }
.console-buttons i { display: grid; place-items: center; width: 62px; height: 62px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; color: var(--white); background: var(--blue); box-shadow: inset 0 -7px 0 rgba(0,0,0,.25), 0 5px 0 #050505; font-family: "Archivo Black", sans-serif; font-size: 24px; font-style: normal; }
.console-buttons i:last-child { margin-top: 24px; background: var(--red); }
.speaker { display: flex; justify-content: flex-end; gap: 7px; transform: rotate(-11deg); }
.speaker i { width: 5px; height: 45px; border: 1px solid rgba(219,240,240,.4); border-radius: 4px; background: transparent; }

.field-guide {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 250px 1fr 230px;
  width: min(1120px, 94vw);
  margin: 30px auto 0;
  border: 1px solid var(--line);
}
.field-guide > * { min-height: 75px; padding: 16px 18px; }
.field-guide div { display: grid; gap: 7px; border-right: 1px solid var(--line); }
.field-guide span { color: rgba(219,240,240,.54); font-size: 7px; font-weight: 700; }
.field-guide strong { font-size: 9px; }
.field-guide p { margin: 0; color: rgba(219,240,240,.7); font-size: 7px; line-height: 1.7; }
.field-guide button { border: 0; border-left: 1px solid var(--line); color: var(--cream); background: var(--blue); font-size: 8px; font-weight: 700; }

.dex-dialog {
  width: min(1050px, 94vw);
  height: min(780px, 90vh);
  padding: 0;
  border: 1px solid var(--line);
  color: var(--cream);
  background: var(--black);
}
.dex-dialog::backdrop { background: rgba(0,0,0,.85); }
.dex-window { height: 100%; overflow: auto; }
.dex-window header { position: sticky; z-index: 2; top: 0; display: flex; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); background: rgba(32,32,31,.97); }
.dex-window header div { display: grid; gap: 4px; }
.dex-window header span { color: rgba(219,240,240,.54); font-size: 7px; font-weight: 700; }
.dex-window header strong { font-family: "Archivo Black", sans-serif; font-size: 24px; }
.dex-window header button { border: 1px solid var(--line); background: transparent; font-size: 8px; }
.dex-stats { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--line); }
.dex-stats div { display: grid; gap: 4px; padding: 15px; border-right: 1px solid var(--line); }
.dex-stats span { color: rgba(219,240,240,.54); font-size: 6px; }
.dex-stats strong { font-size: 16px; }
.dex-stats small { color: var(--yellow); font-size: 5px; line-height: 1.5; }
.dex-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; padding: 1px; background: var(--line); }
.dex-entry { min-height: 160px; color: var(--cream); background: var(--black); }
.dex-entry.is-locked { display: grid; place-items: center; color: rgba(219,240,240,.28); font-family: "Archivo Black", sans-serif; font-size: 22px; }
.dex-entry img { width: 100%; height: 100px; object-fit: contain; image-rendering: pixelated; background: var(--entry-color); }
.dex-entry div { padding: 7px; }
.dex-entry strong { display: block; font-size: 7px; }
.dex-entry span { display: block; margin-top: 4px; color: rgba(219,240,240,.64); font-size: 5px; line-height: 1.4; }

.game-dialog {
  width: min(900px, 94vw);
  max-height: 90vh;
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--white);
  color: var(--white);
  background: #080808;
  font-family: var(--pixel);
  box-shadow: 0 30px 100px #000;
}

.game-dialog::backdrop { background: rgba(0,0,0,.86); }
.game-dialog-window { max-height: 90vh; overflow-y: auto; }
.game-dialog header {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #464646;
  background: #080808;
}
.game-dialog header div { display: grid; gap: 5px; }
.game-dialog header span { color: rgba(219,240,240,.62); font-size: 6px; }
.game-dialog header strong { font-size: 13px; }
.game-dialog header button {
  border: 1px solid #565656;
  color: var(--white);
  background: transparent;
  font-size: 7px;
}

.squad-dialog-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid #464646;
}
.squad-dialog-summary span { padding: 13px; border-right: 1px solid #464646; font-size: 6px; }
.squad-dialog-summary strong { display: block; margin-top: 7px; color: var(--yellow); font-size: 12px; }
.squad-dialog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
}
.squad-dialog-grid .unit-slot { min-height: 190px; color: var(--black); background: var(--white); }
.squad-dialog-grid .unit-portrait { height: 128px; }
.squad-storage-card {
  display: grid;
  gap: 7px;
}
.squad-storage-card > button {
  padding: 10px 8px;
  border: 2px solid #464646;
  color: var(--yellow);
  background: #080808;
  font-size: 6px;
}
.squad-dialog-relics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 18px;
  border-top: 1px solid #464646;
}
.squad-dialog-relics h3 {
  grid-column: 1 / -1;
  margin: 4px 0 2px;
  color: var(--yellow);
  font-size: 8px;
}
.dialog-relic { display: grid; gap: 7px; padding: 11px; border: 1px solid #464646; }
.dialog-relic strong { font-size: 8px; }
.dialog-relic span { color: rgba(219,240,240,.68); font-size: 6px; line-height: 1.55; }
.reserve-card { background: rgba(219, 240, 240, .06); }
.reserve-card button {
  padding: 8px 7px;
  border: 2px solid var(--white);
  color: var(--white);
  background: transparent;
  font-size: 6px;
}
.squad-storage-card > button:hover,
.reserve-card button:hover {
  color: var(--black);
  background: var(--yellow);
}
.squad-storage-card > button:disabled,
.reserve-card button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.replacement-candidate { display: grid; gap: 8px; padding: 16px 18px 0; font-size: 6px; }
.replacement-candidate-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  border: 2px solid var(--white);
  background: var(--unit-color);
}
.replacement-candidate-card img { width: 110px; height: 110px; object-fit: contain; object-position: center bottom; image-rendering: pixelated; }
.replacement-candidate-card strong { padding: 14px; color: var(--black); font-size: 10px; }
.replacement-warning { margin: 14px 18px 0; color: var(--yellow); font-size: 7px; line-height: 1.6; }
.replacement-grid { padding-bottom: 8px; }
.replacement-slot { padding: 0; border: 3px solid transparent; background: transparent; }
.replacement-slot.is-selected { border-color: var(--yellow); }
.replacement-slot .unit-slot { height: 100%; pointer-events: none; }
.replacement-alt-actions {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.replacement-alt-actions button {
  padding: 10px 8px;
  border: 2px solid var(--white);
  color: var(--white);
  background: transparent;
  font-size: 6px;
}
.replacement-alt-actions button:hover {
  color: var(--black);
  background: var(--yellow);
}
.replacement-alt-actions button:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.replacement-confirm { display: block; width: calc(100% - 36px); margin: 8px 18px 20px; }

.exp-screen *,
.dex-dialog,
.dex-dialog * {
  font-family: var(--pixel);
}

.title-view > p,
.title-view > small {
  font-size: 8px;
  letter-spacing: .4px;
  line-height: 1.65;
}

.title-view h2 {
  font-family: var(--pixel);
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1;
  letter-spacing: -2px;
}

.archive-protocol {
  display: block;
  max-width: 620px;
  margin-top: 12px !important;
  color: var(--blue);
}

.view-head span,
.view-head p,
.panel-title,
.board-label {
  font-size: 8px;
  line-height: 1.45;
}

.view-head strong {
  font-size: 15px;
  line-height: 1.3;
}

.node-copy strong { font-size: 11px; line-height: 1.35; }
.node-copy small { font-size: 8px; line-height: 1.65; }

.prep-layout {
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 16px;
  height: 350px;
}

.prep-layout > div { min-width: 0; }

.player-board {
  height: 326px;
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.player-board .unit-slot:not(.is-empty) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-content: start;
}

.player-board .unit-portrait {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  max-width: 112px;
  height: auto;
  aspect-ratio: 1;
  justify-self: center;
  border-right: 2px solid var(--ink);
  border-left: 2px solid var(--ink);
}

.unit-portrait img {
  display: block;
  min-width: 0;
  max-width: 100%;
  object-position: center bottom;
  transform: translateY(1px);
}

.unit-rarity { font-size: 6px; }
.unit-info strong { font-size: 7px; line-height: 1.35; }
.unit-info span { margin-top: 4px; font-size: 6px; line-height: 1.45; }

.synergy-panel {
  height: 350px;
  min-height: 0;
  max-height: 350px;
}

.synergy-row strong { font-size: 8px; line-height: 1.35; }
.synergy-row span { margin-top: 4px; font-size: 6px; line-height: 1.5; }
.empty-signals { font-size: 8px; }

.inspector-hero { height: 88px; }
.inspector-name strong { font-size: 10px; line-height: 1.35; }
.inspector-name span { margin-top: 5px; font-size: 6px; line-height: 1.45; }
.inspector-stats span { font-size: 6px; }
.inspector-trait strong { font-size: 7px; line-height: 1.35; }
.inspector-trait span { margin-top: 5px; font-size: 6px; line-height: 1.55; }
.inspector-help { font-size: 6px; }

.prep-footer {
  margin-top: 10px;
  padding-top: 10px;
}

#enemy-preview { font-size: 8px; line-height: 1.5; }
.versus-signal { font-family: var(--pixel); }
.capture-details h2 { font-family: var(--pixel); font-size: 22px; line-height: 1.25; }
.event-mark { font-family: var(--pixel); font-size: 88px; }
.event-copy h2 { font-family: var(--pixel); font-size: 31px; line-height: 1.15; letter-spacing: -1px; }
.monster-choice-copy strong { font-family: var(--pixel); font-size: 13px; }
.monster-choice-copy small,
.monster-choice-copy em { font-size: 7px; }
.result-view > h2 { font-family: var(--pixel); font-size: 38px; line-height: 1.05; letter-spacing: -2px; }

.result-archive {
  max-width: 680px;
  margin: -8px 0 20px;
  color: var(--blue);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.65;
}

.dex-window header strong { font-family: var(--pixel); font-size: 18px; }
.dex-entry.is-locked { font-family: var(--pixel); font-size: 18px; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes unit-hit {
  33% { transform: translateX(-6px); filter: brightness(2); }
  66% { transform: translateX(6px); }
}
@keyframes enemy-hit {
  33% { transform: rotate(180deg) translateX(-6px); filter: brightness(2); }
  66% { transform: rotate(180deg) translateX(6px); }
}
@keyframes idle-bob {
  50% { filter: brightness(1.08); }
}
@keyframes damage-rise {
  0% { opacity: 0; transform: translate(-50%, 8px); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -24px); }
}
@keyframes screen-shake {
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
}
@keyframes screen-flash {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (max-width: 850px) {
  .exp-heading { display: block; }
  .meta-summary { width: 180px; margin-top: 22px; text-align: left; }
  .exp-console { width: min(920px, 92vw); padding: 34px 34px 30px; }
  .exp-console-head { grid-template-columns: 140px 1fr; }
  .exp-console-head em { display: none; }
  .cartridge-label { justify-self: end; }
  .exp-screen { min-height: 710px; border-width: 18px 24px 28px; }
  .prep-layout { grid-template-columns: minmax(0, 1fr) 220px; }
  .synergy-panel { min-height: 0; }
  #synergy-list { display: grid; grid-template-columns: repeat(2, 1fr); }
  .reward-layout { grid-template-columns: 230px 1fr; }
  .field-guide { grid-template-columns: 1fr; }
  .field-guide div, .field-guide button { border: 0; border-bottom: 1px solid var(--line); }
  .dex-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 620px) {
  .exp-topbar { grid-template-columns: 145px 1fr; min-height: 60px; }
  .exp-wordmark { padding: 0 16px; font-size: 20px; }
  .exp-status { display: none; }
  .console-link { padding: 0 13px; font-size: 7px; }
  .exp-shell { min-height: calc(100vh - 60px); padding: 42px 10px; }
  .exp-shell::before { inset: 15px 10px; }
  .exp-heading { width: 100%; padding: 0 10px; }
  .exp-heading h1 { font-size: 43px; letter-spacing: -2.5px; }
  .exp-console { width: 100%; padding: 27px 14px 23px; border-radius: 24px 24px 64px 24px; }
  .exp-console-head { display: flex; justify-content: space-between; padding: 0 8px 10px; }
  .cartridge-label { max-width: 130px; font-size: 5px; text-align: right; }
  .exp-screen { --hud-height: 54px; min-height: 734px; border-width: 17px 11px 24px; border-radius: 12px 12px 38px 12px; }
  .screen-hud { grid-template-columns: .9fr 1.35fr .8fr .9fr .75fr; }
  .hud-stat { gap: 3px; padding: 6px 5px; }
  .hud-stat span { font-size: 4px; letter-spacing: .5px; }
  .hud-stat strong { font-size: 8px; }
  .gold-stat strong { font-size: 17px; }
  .view { padding: 16px 12px; }
  .title-actions { flex-direction: column; width: min(280px, 100%); }
  .view-head { align-items: start; }
  .view-head p { display: none; }
  .route-progress { margin: 16px 0 20px; }
  .progress-step { font-size: 5px; }
  .node-grid { grid-template-columns: 1fr; gap: 8px; }
  .route-node { grid-template-columns: 65px 1fr; grid-template-rows: auto 1fr; min-height: 105px; }
  .node-number { grid-column: 1 / -1; padding: 5px 8px; }
  .node-icon { min-height: 78px; font-size: 35px; }
  .node-copy { padding: 10px; }
  .node-copy strong { font-size: 10px; }
  .unit-board { grid-template-rows: repeat(2, 125px); gap: 5px; }
  .unit-portrait { height: 78px; }
  .unit-info { padding: 5px; }
  .unit-info strong { font-size: 5.5px; }
  .unit-info span { font-size: 4px; }
  #synergy-list { grid-template-columns: 1fr; }
  .prep-footer { align-items: stretch; flex-direction: column; }
  .combat-board-wrap { height: 510px; padding: 8px 0; }
  .combat-side { grid-template-columns: 25px 1fr; gap: 4px; }
  .combat-board { grid-template-rows: repeat(2, 89px); }
  .combat-board .unit-portrait { height: 60px; }
  .boss-combat-card {
    grid-template-columns: 118px 1fr;
    min-height: 145px;
    padding: 8px;
  }
  .boss-info strong { font-size: 9px; }
  .boss-info span { font-size: 5px; }
  .combat-log { height: 58px; font-size: 5.5px; }
  .reward-layout { grid-template-columns: 1fr; gap: 10px; }
  .capture-card { display: grid; grid-template-columns: 125px 1fr; min-height: 180px; }
  .capture-image { height: 100%; border: 0; border-right: 3px solid var(--ink); }
  .capture-details { padding: 10px; }
  .capture-details h2 { font-size: 19px; }
  .reward-options { gap: 6px; }
  .reward-options button { min-height: 88px; padding: 10px; }
  .event-view { grid-template-columns: 1fr; align-content: center; }
  .event-mark { width: 100%; height: 130px; font-size: 70px; }
  .event-copy h2 { font-size: 32px; }
  .event-view.is-monster-choice { align-content: start; }
  .event-view.is-monster-choice .event-copy h2 { font-size: 23px; }
  .event-view.is-monster-choice .event-copy p { font-size: 5px; line-height: 1.45; }
  .event-actions.monster-choice-grid { gap: 5px; }
  .event-actions .monster-choice { grid-template-rows: 105px auto; min-height: 245px; border-width: 2px; }
  .monster-choice-image { min-height: 105px; border-bottom-width: 2px; }
  .monster-choice-rarity { top: 4px; left: 4px; padding: 3px 4px; font-size: 4px; }
  .monster-choice-copy { gap: 4px; padding: 7px 5px; }
  .monster-choice-copy strong { font-size: 9px; }
  .monster-choice-copy small,
  .monster-choice-copy em { font-size: 4px; line-height: 1.4; }
  .result-view > h2 { font-size: 40px; }
  .result-ledger { grid-template-columns: repeat(2, 1fr); }
  .result-ledger div:nth-child(2) { border-right: 0; }
  .result-ledger div:nth-child(-n+2) { border-bottom: 1px solid var(--ink); }
  .exp-console-foot { grid-template-columns: 1fr 90px; min-height: 80px; }
  .speaker { display: none; }
  .console-buttons i { width: 35px; height: 35px; font-size: 9px; }
  .field-guide { width: 100%; }
  .dex-stats { grid-template-columns: repeat(2, 1fr); }
  .dex-grid { grid-template-columns: repeat(3, 1fr); }
  .dex-entry { min-height: 135px; }
  .dex-entry img { height: 80px; }
}

@media (max-width: 620px) {
  .hud-stat span { font-size: 6px; }
  .hud-stat strong { font-size: 9px; }
  .title-view > p,
  .title-view > small { font-size: 7px; }
  .prep-view { overflow-y: auto; }
  .prep-layout { grid-template-columns: 1fr; height: auto; }
  .player-board {
    height: 300px;
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }
  .player-board .unit-portrait { width: 100%; max-width: 90px; height: auto; }
  .unit-info strong { font-size: 6px; }
  .unit-info span { font-size: 5px; }
  .synergy-panel { height: 270px; max-height: 270px; }
  .event-view.is-monster-choice .event-copy p { font-size: 7px; line-height: 1.6; }
  .monster-choice-rarity { font-size: 5px; }
  .monster-choice-copy small,
  .monster-choice-copy em { font-size: 6px; line-height: 1.5; }
  .result-archive { font-size: 7px; }
  .route-progress { grid-template-columns: repeat(5, 1fr); row-gap: 16px; }
  .event-view.is-relic-shop .event-actions,
  .event-view.is-elite-reward .event-actions,
  .event-view.is-boss-reward .event-actions { grid-template-columns: 1fr; }
  .squad-dialog-summary { grid-template-columns: repeat(2, 1fr); }
  .squad-dialog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; }
  .squad-dialog-grid .unit-slot { min-height: 150px; }
  .squad-dialog-grid .unit-portrait { height: 95px; }
  .squad-dialog-relics { grid-template-columns: 1fr; padding: 10px; }
  .replacement-candidate-card { grid-template-columns: 82px 1fr; }
  .replacement-candidate-card img { width: 82px; height: 82px; }
  .replacement-candidate-card strong { font-size: 7px; }
}

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