:root {
  color-scheme: dark;
  --bg: #11151d;
  --panel: #1a202beb;
  --line: #ffffff16;
  --text: #f1ece4;
  --muted: #a2abb9;
  --accent: #ffbc89;
  --mint: #a5e1c6;
  --danger: #ff8e9e;
  --radius: 18px;
  font-family:
    Inter,
    Segoe UI,
    Arial,
    sans-serif;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  border: 1px solid var(--line);
  background: #ffffff07;
  border-radius: 9px;
  padding: 10px 15px;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.15s;
}
button:hover {
  background: #ffffff13;
  border-color: #ffffff45;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button.primary {
  background: var(--accent);
  color: #242020;
  border-color: var(--accent);
  font-weight: 700;
}
button.primary:hover {
  background: #ffd3b2;
}
button.secondary {
  background: #c5adff20;
  color: #d5c4ff;
}
button.danger {
  color: var(--danger);
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
p {
  line-height: 1.7;
}
small,
.muted {
  color: var(--muted);
}
kbd {
  font-size: 11px;
  background: #ffffff0e;
  border: 1px solid #ffffff20;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
}
em {
  font-style: normal;
  color: var(--accent);
}
canvas#canvas3d {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  outline: none;
}
.topbar {
  position: fixed;
  inset: 0 0 auto;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 38px;
  z-index: 20;
  background: linear-gradient(#11151df5, #11151d9c);
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: none;
  padding: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 3px;
  text-align: left;
}
.brand-glyph {
  font-size: 43px;
  color: var(--accent);
}
.wordmark-small {
  display: block;
  font-size: 8px;
  letter-spacing: 2.7px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 4px;
}
nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
nav > .muted {
  font-size: 10px;
  letter-spacing: 2px;
  margin-right: 16px;
}
.menu {
  position: fixed;
  inset: 82px 0 0;
  overflow: auto;
  background:
    radial-gradient(ellipse at 80% 30%, #77544412, transparent 60%), linear-gradient(100deg, #11151dfa, #11151de8);
}
.menu-content {
  max-width: 1280px;
  margin: auto;
  padding: 52px 40px 22px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c5c8ce;
}
.live-dot {
  width: 6px;
  height: 6px;
  background: var(--mint);
  border-radius: 50%;
  box-shadow: 0 0 12px #a5e1c66b;
}
h1 {
  font-size: clamp(32px, 4.1vw, 58px);
  line-height: 1.1;
  letter-spacing: -2px;
  margin: 22px 0;
}
h1 em {
  font-weight: 400;
}
.menu-intro {
  max-width: 600px;
  font-size: 15px;
  color: #aeb6c4;
}
.mode-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 18px;
  margin-top: 32px;
}
.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  text-align: left;
  padding: 24px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #242b35eb, #191e28ed);
  overflow: hidden;
  min-height: 256px;
}
.mode-card:hover {
  transform: translateY(-4px);
  border-color: #ffd6b360;
}
.mode-card.featured {
  border-color: #ffbc8955;
  background: linear-gradient(135deg, #48352deb, #25242ced);
}
.card-overline {
  font-size: 9px;
  letter-spacing: 1.6px;
  color: #b2b7c1;
  width: 100%;
  display: flex;
  justify-content: space-between;
}
.mode-symbol {
  font-size: 40px;
  color: var(--accent);
  margin: 15px 0 8px;
}
.mode-card:nth-child(2) .mode-symbol {
  color: #c5adff;
}
.mode-card:nth-child(3) .mode-symbol {
  color: #91d0e5;
}
.mode-card strong {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.6px;
}
.mode-card p {
  font-size: 12px;
  color: #b7bec9;
  margin: 10px 0 22px;
  max-width: 300px;
}
.card-footer {
  border-top: 1px solid var(--line);
  padding-top: 17px;
  margin-top: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #a4adb9;
  font-size: 10px;
}
.card-footer b {
  color: var(--accent);
  font-size: 12px;
}
.menu-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  gap: 15px;
}
.text-button {
  background: none;
  border: 0;
  padding-left: 0;
  font-size: 12px;
}
.text-button span {
  margin-left: 20px;
}
.chapter-strip {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 30px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  color: #68717f;
  font-size: 10px;
}
.chapter-strip b {
  color: #a2abb9;
  font-weight: 400;
  margin-left: 10px;
}
.chapter-strip i {
  height: 1px;
  width: 55px;
  background: var(--line);
}
#mode-hud {
  position: fixed;
  inset: 82px 0 0;
  pointer-events: none;
}
#mode-hud button,
#mode-hud input,
#mode-hud select,
.panel {
  pointer-events: auto;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  backdrop-filter: blur(15px);
}
.hud-heading {
  position: absolute;
  left: 24px;
  top: 22px;
  min-width: 220px;
  max-width: 330px;
}
.eyebrow.small {
  font-size: 9px;
  letter-spacing: 1.8px;
}
.hud-heading h2 {
  font-size: 24px;
  letter-spacing: -0.7px;
  margin: 6px 0;
}
.hud-heading p {
  font-size: 11px;
  color: var(--muted);
}
.stage-dots {
  display: flex;
  gap: 5px;
  margin: 13px 0;
}
.stage-dots i {
  width: 17px;
  height: 3px;
  background: #ffffff20;
}
.stage-dots i.done {
  background: var(--accent);
}
.stage-dots i.current {
  background: white;
}
.hud-right {
  position: absolute;
  right: 24px;
  top: 22px;
  width: 230px;
  font-size: 12px;
}
.hud-right p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
}
.synergy {
  padding: 6px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
}
.synergy small {
  font-size: 10px;
}
.keybar {
  position: absolute;
  bottom: 156px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  align-items: center;
  border-radius: 8px;
  background: #101720dc;
  padding: 9px 14px;
  font-size: 10px;
  color: #c9d0da;
  white-space: nowrap;
}
.squad-dock {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 190px));
  gap: 9px;
  max-width: calc(100% - 36px);
  width: 1140px;
  pointer-events: auto;
}
.hero-card {
  background: #151b25ee;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  min-height: 115px;
  text-align: left;
  position: relative;
}
.hero-card.ready {
  border-color: var(--hero-color);
  box-shadow: 0 0 18px #ffffff08;
}
.hero-card.dead {
  opacity: 0.45;
}
.hero-top {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}
.hero-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 33px;
  height: 33px;
  flex-shrink: 0;
  border-radius: 9px;
  background: color-mix(in srgb, var(--hero-color), transparent 85%);
  color: var(--hero-color);
  font-size: 23px;
}
.hero-name {
  font-size: 12px;
  font-weight: 600;
}
.hero-role {
  font-size: 9px;
  color: var(--muted);
  margin-top: 3px;
}
.bar {
  height: 4px;
  border-radius: 4px;
  background: #ffffff10;
  overflow: hidden;
  margin: 5px 0;
}
.bar > i {
  display: block;
  height: 100%;
  background: var(--mint);
  width: 100%;
  transition: width 0.1s;
}
.bar.energy > i {
  background: #b4a0f3;
}
.bar.break > i {
  background: var(--accent);
}
.hero-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  color: #bac1ce;
  margin-top: 7px;
}
.empty-slot {
  border: 1px dashed #ffffff20;
  background: #10172180;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}
.boss-hud {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  text-align: center;
  padding: 12px 20px;
  background: #11151ddd;
  border-radius: 10px;
}
.boss-hud strong {
  font-size: 14px;
}
.boss-hud small {
  font-size: 10px;
}
.battle-banner {
  width: calc(100% - 750px);
  max-width: 700px;
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}
.battle-banner h2 {
  font-size: 20px;
}
.battle-banner p {
  font-size: 11px;
  color: var(--muted);
  margin: 7px 0;
}
.bottom-panel {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 18px;
  pointer-events: auto;
}
.shop-row,
.bench-row,
.row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.shop-row {
  margin-top: 12px;
}
.shop-row > button {
  flex: 1;
  text-align: left;
  padding: 12px;
}
.bench-row {
  flex-wrap: wrap;
  margin-top: 12px;
}
.bench-row button {
  font-size: 11px;
}
.selected {
  border-color: var(--accent) !important;
  background: #ffbc8918 !important;
}
.split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.turn-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 95%;
  pointer-events: auto;
}
.timeline {
  flex-wrap: wrap;
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}
.timeline span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 10px;
  background: #17202c;
}
.timeline .active {
  border-color: var(--accent);
  color: var(--accent);
}
dialog {
  color: var(--text);
  background: linear-gradient(140deg, #252b35, #171d27);
  border: 1px solid #ffffff26;
  border-radius: 22px;
  padding: 0;
  width: min(850px, calc(100% - 32px));
  max-height: calc(100vh - 50px);
  box-shadow: 0 30px 120px #0009;
  overflow: auto;
}
dialog::backdrop {
  background: #090d16c9;
  backdrop-filter: blur(8px);
}
#modal-content {
  padding: 36px;
}
.dialog-eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 12px;
}
dialog h2 {
  font-size: 32px;
  letter-spacing: -1px;
  font-weight: 600;
  margin-bottom: 12px;
}
dialog p {
  color: #aeb8c7;
  font-size: 13px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
}
.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 24px;
}
.choice {
  text-align: left;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  background: #ffffff04;
  border-radius: 14px;
}
.choice .symbol {
  font-size: 32px;
  color: var(--accent);
}
.choice strong {
  font-size: 17px;
}
.choice p {
  font-size: 12px;
}
.choice small {
  margin-top: auto;
}
.hero-select {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 23px;
}
dialog:has(.catalog-layout) {
  width: min(1320px, 96vw);
  max-width: 1320px;
}
.team-slots {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  margin: 18px 0;
}
.team-slot {
  position: relative;
  min-height: 105px;
  background: #18222f;
  border: 1px solid #455567;
  border-radius: 10px;
  overflow: hidden;
}
.team-slot > button:first-child {
  border: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  text-align: left;
}
.team-slot img {
  width: 68px;
  height: 68px;
  object-fit: cover;
  margin: 0 auto;
  display: block;
}
.team-slot span {
  display: block;
  padding: 4px 9px 8px;
  font-size: 10px;
  line-height: 1.25;
}
.team-slot b {
  position: absolute;
  left: 8px;
  top: 5px;
  color: #ffe09b;
}
.team-slot [data-remove] {
  position: absolute;
  right: 3px;
  top: 3px;
  padding: 0;
  width: 25px;
  height: 25px;
  background: #0b101ee0;
  font-size: 20px;
}
.team-slot.empty {
  display: grid;
  place-content: center;
  border-style: dashed;
  color: #8695a8;
}
.catalog-controls {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}
.catalog-controls label {
  display: grid;
  gap: 5px;
  flex: 1;
  min-width: 140px;
  font-size: 11px;
  color: #adb8c8;
}
.catalog-controls input,
.catalog-controls select {
  min-width: 0;
  width: 100%;
  padding: 10px;
  border: 1px solid #405068;
  border-radius: 7px;
  color: #e7edf7;
  background: #111925;
  font: inherit;
}
.catalog-controls > button {
  padding: 10px;
  font-size: 12px;
}
.catalog-count {
  margin: 12px 0 !important;
}
.catalog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 20px;
  align-items: start;
}
.creature-gallery {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  max-height: 690px;
  overflow: auto;
  align-content: start;
  padding: 3px 6px 8px 3px;
  scrollbar-color: #60748c #111925;
}
.creature-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 0 0 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  border: 1px solid #334256;
  background: #16202c;
}
.creature-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}
.creature-card strong,
.creature-card small {
  margin: 0 8px;
  font-size: 10px;
  line-height: 1.3;
}
.creature-card small {
  font-size: 9px;
  color: #a7b4c5;
}
.creature-card.inspected {
  outline: 2px solid #f3d398;
  outline-offset: 0;
}
.creature-card.selected {
  border-color: var(--hero-color);
  background: #24303a;
}
.pick-order {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 23px;
  height: 23px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f3d398;
  color: #161e29;
  font-size: 12px;
}
.creature-preview {
  background: #111b27;
  border: 1px solid #405068;
  border-radius: 12px;
  padding: 12px;
}
.creature-portrait {
  background: radial-gradient(ellipse at center, #314051, #15202d 80%);
  border-radius: 8px;
  overflow: hidden;
}
.creature-portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}
.creature-preview h3 {
  font-size: 19px;
  margin: 3px 0 5px;
}
.creature-id {
  font-size: 9px !important;
  letter-spacing: 0.1em;
  margin: 12px 0 2px !important;
}
.creature-role-label {
  color: #f3d398 !important;
  font-size: 12px !important;
  margin: 0 0 12px !important;
}
.creature-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.creature-stats div {
  border-bottom: 1px solid #304050;
  padding-bottom: 6px;
}
.creature-stats dt {
  font-size: 9px;
  color: #a6b4c6;
}
.creature-stats dd {
  margin: 3px 0 0;
  font-size: 13px;
  color: #fff;
}
.creature-traits strong {
  font-size: 11px;
  color: #d8e4ce;
}
.creature-preview p {
  font-size: 11px;
  line-height: 1.5;
  margin: 5px 0 10px;
}
.toggle-creature {
  width: 100%;
  margin-top: 8px;
  font-size: 12px;
  padding: 12px 4px;
}
.thumbnail-missing::before {
  content: "◇";
  display: block;
  margin: auto;
  padding: 20px;
  color: var(--hero-color, #d5bd91);
  font-size: 34px;
}
@media (max-width: 1000px) {
  .creature-gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .catalog-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
}
@media (max-width: 720px) {
  .catalog-layout {
    grid-template-columns: 1fr;
  }
  .creature-gallery {
    max-height: 360px;
  }
  .creature-preview {
    display: flow-root;
  }
  .creature-portrait {
    float: left;
    width: 42%;
    margin: 0 14px 10px 0;
  }
  .team-slots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .creature-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .creature-card strong {
    font-size: 10px;
  }
}
.hero-option {
  text-align: left;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 130px;
}
.hero-option strong {
  font-size: 12px;
}
.hero-option small {
  font-size: 10px;
}
.hero-option .symbol {
  font-size: 27px;
  color: var(--hero-color);
}
.hero-option[disabled] {
  opacity: 0.32;
}
.hero-detail {
  margin-top: 16px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 95px;
}
.hero-detail strong {
  font-size: 13px;
}
.hero-detail p {
  font-size: 12px;
  margin-top: 6px;
}
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.setting input[type="range"] {
  width: 220px;
  accent-color: var(--accent);
}
.setting select,
.key-input {
  background: #101722;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px;
  border-radius: 6px;
}
.key-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 15px;
}
.key-grid label {
  font-size: 11px;
  color: var(--muted);
}
.key-input {
  width: 100%;
  margin-top: 5px;
  text-align: center;
}
.rule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}
.rule-grid strong {
  color: var(--accent);
  font-size: 13px;
}
.rule-grid p {
  font-size: 12px;
  margin-top: 5px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 25px;
}
.stat {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.stat strong {
  font-size: 27px;
  display: block;
}
.stat small {
  font-size: 11px;
}
.codex-list {
  position: absolute;
  left: 24px;
  top: 22px;
  bottom: 24px;
  width: 260px;
  display: flex;
  flex-direction: column;
}
.codex-list input {
  padding: 11px;
  background: #101721;
  color: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 15px 0;
}
.codex-items {
  overflow: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.codex-items button {
  text-align: left;
  padding: 11px 13px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
}
.codex-items small {
  font-size: 9px;
}
.codex-detail {
  position: absolute;
  right: 24px;
  top: 22px;
  bottom: 24px;
  width: 310px;
  overflow: auto;
}
.codex-detail h2 {
  font-size: 25px;
  margin: 10px 0;
}
.codex-detail p {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0;
}
.codex-detail h3 {
  font-size: 12px;
  color: var(--accent);
  margin-top: 24px;
}
.codex-detail .tag {
  font-size: 9px;
  padding: 5px 8px;
  background: #ffffff0c;
  border-radius: 4px;
}
.codex-detail details {
  margin-top: 25px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
  font-size: 11px;
}
.codex-detail summary {
  cursor: pointer;
  color: var(--muted);
}
.codex-detail .row {
  flex-wrap: wrap;
  margin-top: 12px;
}
.codex-detail button {
  font-size: 10px;
  padding: 8px;
}
.codex-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 185px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 600px;
  background: #222b39f2;
  border: 1px solid #ffffff25;
  padding: 13px 20px;
  border-radius: 10px;
  text-align: center;
  font-size: 12px;
  z-index: 25;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#toast.show {
  opacity: 1;
}
#damage-numbers-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.floating-damage {
  position: absolute;
  font-size: 15px;
  font-weight: 800;
  text-shadow: 0 2px 4px #000;
  animation: damage 0.9s ease-out forwards;
}
@keyframes damage {
  to {
    transform: translateY(-45px);
    opacity: 0;
  }
}
.loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 15px;
  background: #11151d;
  z-index: 60;
}
.loading small {
  font-size: 12px;
}
.status-line {
  font-size: 11px;
  color: var(--muted);
  margin-top: 12px;
}
.target-info {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.target-info strong {
  font-size: 12px;
}
.mini {
  font-size: 10px;
}
.scoreboard {
  display: flex;
  gap: 20px;
  margin: 12px 0;
}
.scoreboard strong {
  display: block;
  color: var(--accent);
  font-size: 22px;
}
.scoreboard small {
  font-size: 10px;
}
.explanation {
  max-width: 650px;
}
.pill {
  padding: 5px 9px;
  border-radius: 20px;
  background: #ffffff0a;
  border: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
}
@media (max-width: 1000px) {
  .topbar {
    padding: 0 20px;
    height: 70px;
  }
  .menu,
  #mode-hud {
    top: 70px;
  }
  .menu-content {
    padding: 30px 24px;
  }
  .mode-card {
    padding: 20px;
  }
  .mode-card strong {
    font-size: 19px;
  }
  nav > .muted {
    display: none;
  }
  .hud-heading {
    left: 15px;
    top: 15px;
    max-width: 220px;
    min-width: 180px;
  }
  .hud-right {
    right: 15px;
    top: 15px;
    width: 180px;
  }
  .squad-dock {
    grid-template-columns: repeat(4, 1fr);
  }
  .codex-list {
    width: 220px;
  }
  .codex-detail {
    width: 260px;
  }
  .hero-card {
    padding: 10px;
  }
  .boss-hud {
    width: 250px;
  }
  .keybar {
    gap: 8px;
  }
}
@media (max-width: 760px) {
  .mode-grid {
    grid-template-columns: 1fr;
  }
  .mode-card {
    min-height: 200px;
  }
  .mode-symbol {
    position: absolute;
    right: 20px;
    top: 25px;
  }
  .mode-card strong {
    margin-top: 20px;
  }
  .menu-bottom {
    flex-wrap: wrap;
  }
  .chapter-strip {
    gap: 10px;
  }
  .topbar {
    padding: 0 12px;
  }
  .wordmark {
    font-size: 16px;
    letter-spacing: 2px;
  }
  .brand-glyph {
    font-size: 32px;
  }
  nav {
    gap: 5px;
  }
  nav button {
    font-size: 10px;
    padding: 8px;
  }
  .hero-select {
    grid-template-columns: repeat(2, 1fr);
  }
  .choice-grid {
    grid-template-columns: 1fr;
  }
  .rule-grid {
    grid-template-columns: 1fr;
  }
  #modal-content {
    padding: 24px;
  }
  .hud-right {
    display: none;
  }
  .hud-heading {
    max-width: 200px;
  }
  .squad-dock {
    gap: 4px;
    bottom: 12px;
  }
  .hero-role {
    display: none;
  }
  .hero-name {
    font-size: 9px;
  }
  .hero-icon {
    width: 20px;
    font-size: 16px;
  }
  .hero-card {
    padding: 7px;
    min-height: 105px;
  }
  .keybar {
    bottom: 126px;
    max-width: 95%;
    white-space: normal;
    flex-wrap: wrap;
    justify-content: center;
  }
  .boss-hud {
    top: 125px;
    width: 240px;
  }
  .codex-list {
    width: 170px;
    left: 10px;
  }
  .codex-detail {
    right: 10px;
    width: 210px;
  }
  .codex-hint {
    display: none;
  }
  .key-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .turn-controls {
    flex-wrap: wrap;
    width: 95%;
  }
  .bottom-panel {
    left: 10px;
    right: 10px;
  }
  .shop-row {
    gap: 4px;
  }
  .shop-row > button {
    padding: 7px;
    font-size: 10px;
  }
  .battle-banner {
    top: 140px;
    width: 90%;
  }
  .timeline {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
  .floating-damage {
    animation: none;
    opacity: 0.8;
  }
}

@media (max-height: 800px) and (min-width: 1000px) {
  .menu-content {
    padding-top: 26px;
    padding-bottom: 16px;
  }
  h1 {
    font-size: 44px;
    margin: 16px 0;
  }
  .menu-intro {
    font-size: 13px;
  }
  .mode-grid {
    margin-top: 24px;
  }
  .mode-card {
    min-height: 225px;
    padding: 20px;
  }
  .mode-symbol {
    font-size: 32px;
    margin: 8px 0;
  }
  .mode-card p {
    margin: 8px 0 16px;
  }
  .menu-bottom {
    margin-top: 12px;
  }
  .chapter-strip {
    margin-top: 16px;
    padding-top: 12px;
  }
}
