@import url("https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&family=Philosopher:wght@400;700&display=swap");
:root {
  color-scheme: dark;
  --bg: #101b21;
  --panel: #17242b;
  --line: #2c3b40;
  --text: #ece8dc;
  --muted: #8c9b9d;
  --gold: #e8c689;
  --green: #78b9a0;
  --red: #dd8a7f;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 0, #21332f 0, transparent 60%), var(--bg);
  color: var(--text);
  font:
    13px "Be Vietnam Pro",
    system-ui,
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  color: inherit;
  border: 1px solid var(--line);
  background: #203039;
  border-radius: 6px;
  padding: 10px 13px;
  transition:
    background 0.18s,
    border-color 0.18s,
    transform 0.18s;
}
button:hover:not(:disabled) {
  border-color: var(--gold);
  background: #34413e;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
a {
  color: var(--muted);
  text-decoration: none;
}
a:hover {
  color: var(--gold);
}
[hidden] {
  display: none !important;
}
.topbar {
  height: 84px;
  border-bottom: 1px solid var(--line);
  padding: 0 4%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #101a20bb;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--gold);
  font:
    700 23px "Philosopher",
    Georgia,
    serif;
  letter-spacing: 3px;
}
.brand-seal {
  font: 26px Georgia;
  display: grid;
  place-items: center;
  width: 42px;
  height: 46px;
  border: 1px solid #b3925f;
  border-radius: 3px;
  background: #40382b;
  transform: rotate(-4deg);
}
.brand small {
  display: block;
  font:
    8px "Be Vietnam Pro",
    sans-serif;
  letter-spacing: 2.2px;
  color: var(--muted);
  margin-top: 4px;
}
nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 11px;
}
.training-label {
  color: var(--green);
  font-size: 9px;
  letter-spacing: 1.4px;
}
.training-label i,
.tiny-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  margin-right: 7px;
  box-shadow: 0 0 12px #7ec6a369;
}
.quiet {
  background: transparent;
  color: #bac4bf;
}
.primary {
  background: var(--gold);
  color: #24302b;
  border-color: var(--gold);
  font-weight: 700;
  box-shadow: 0 3px 14px #0002;
}
.primary:hover:not(:disabled) {
  background: #f5dba5;
  color: #15231c;
}
.primary span {
  margin-left: 24px;
}
main {
  max-width: 1550px;
  margin: auto;
  padding: 36px 4% 18px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--gold);
}
h1 {
  font:
    700 35px "Philosopher",
    Georgia,
    serif;
  margin: 11px 0 9px;
}
h1 em {
  font-weight: 400;
  font-style: normal;
  color: var(--gold);
}
.page-heading p {
  color: var(--muted);
  font-size: 11px;
  margin: 0;
}
.chapter-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #968362;
}
.chapter-mark span {
  font: 42px Georgia;
}
.chapter-mark small {
  font-size: 8px;
  letter-spacing: 1.5px;
}
.workspace {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 20px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 14px;
  gap: 8px;
}
.panel-title h2 {
  font-size: 12px;
  margin: 0;
  font-weight: 600;
}
.count {
  font-size: 10px;
  padding: 3px 7px;
  background: #26372f;
  color: var(--green);
  border-radius: 4px;
}
.search {
  display: flex;
  align-items: center;
  margin: 0 16px;
  background: #111e25;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  gap: 8px;
  color: var(--muted);
}
.search span {
  font-size: 24px;
}
.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 11px 0;
  outline: none;
  font-size: 10px;
}
.tier-filters {
  display: flex;
  padding: 14px 16px;
  gap: 5px;
}
.tier-filters button {
  padding: 6px 10px;
  font-size: 9px;
  background: transparent;
  color: var(--muted);
}
.tier-filters button.active {
  color: var(--gold);
  background: #3a372c;
  border-color: #8b7854;
}
.roster-panel {
  display: flex;
  flex-direction: column;
  max-height: 830px;
}
.roster {
  overflow: auto;
  flex: 1;
  padding: 0 12px 10px;
  scrollbar-width: thin;
  scrollbar-color: #48564f transparent;
  min-height: 180px;
}
.hero-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin-bottom: 7px;
  text-align: left;
  background: #1d2c32;
  border: 1px solid transparent;
  position: relative;
}
.hero-card.selected {
  border-color: var(--gold);
  background: #343b32;
}
.hero-card.deployed:after {
  content: "✓";
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 11px;
  color: var(--green);
}
.hero-card img,
.hero-card .portrait-fallback {
  width: 47px;
  height: 49px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #70664f;
}
.hero-card .hero-text {
  flex: 1;
  min-width: 0;
}
.hero-name {
  font-weight: 600;
  font-size: 11px;
  display: block;
  margin-bottom: 5px;
}
.hero-faction {
  font-size: 8px;
  color: var(--muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 152px;
}
.hero-stats {
  font-size: 9px;
  color: #a5aaa0;
  margin-top: 5px;
  display: flex;
  gap: 12px;
}
.tier {
  font-size: 10px;
  color: var(--gold);
  background: #58482b;
  padding: 3px 5px;
  border-radius: 3px;
  align-self: flex-start;
  min-width: 20px;
  text-align: center;
}
.tier-B {
  color: #9dc3ae;
  background: #29443a;
}
.tier-A {
  color: #b4a1d9;
  background: #3c3455;
}
.tier-U,
.tier-E,
.tier-M {
  color: #e4a0a1;
  background: #513239;
}
.roster-foot {
  padding: 15px;
  border-top: 1px solid var(--line);
  font-size: 8px;
  color: var(--muted);
}
.main-column {
  min-width: 0;
}
.arena-heading {
  height: 76px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.arena-location {
  display: flex;
  align-items: center;
  gap: 12px;
}
.arena-location > span {
  color: var(--gold);
  font-size: 26px;
}
.arena-location h2 {
  font:
    700 19px "Philosopher",
    Georgia,
    serif;
  margin: 0 0 5px;
}
.arena-location small {
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 1.2px;
}
.stage-picker {
  display: flex;
  gap: 7px;
}
.stage-picker button {
  font-size: 10px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
}
.stage-picker .active {
  border-color: #a88d59;
  color: var(--gold);
  background: #39382d;
}
.round-badge {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 1px;
}
.round-badge b {
  font-size: 24px;
  margin: 0 5px;
  color: var(--gold);
}
.round-badge span {
  font-size: 9px;
}
.battlefield {
  position: relative;
  isolation: isolate;
  height: 420px;
  overflow: hidden;
  background: #243a37;
}
.scene {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(
    #263e3c 0%,
    #638079 42%,
    #718378 54%,
    #354b3f 54%,
    #26392f 100%
  );
}
.scene:after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 20%, transparent, #0a211f66 80%);
  pointer-events: none;
}
.sun {
  position: absolute;
  width: 77px;
  height: 77px;
  background: #dad4ae70;
  border-radius: 50%;
  left: 49%;
  top: 22px;
  filter: blur(1px);
  box-shadow: 0 0 70px #d9d1a55e;
}
.mountain {
  position: absolute;
  left: -10%;
  width: 120%;
  height: 150px;
  clip-path: polygon(
    0 100%,
    0 65%,
    8% 42%,
    17% 58%,
    25% 18%,
    34% 54%,
    42% 28%,
    53% 62%,
    65% 4%,
    76% 43%,
    85% 28%,
    94% 62%,
    100% 42%,
    100% 100%
  );
}
.mountain-back {
  top: 35px;
  background: #385c55;
  opacity: 0.55;
}
.mountain-front {
  top: 85px;
  background: #304d44;
  transform: scaleX(-1);
  opacity: 0.65;
}
.gate {
  position: absolute;
  width: 150px;
  height: 145px;
  left: calc(50% - 75px);
  top: 52px;
  border-top: 9px solid #202f28;
  border-radius: 45% 45% 0 0;
  box-shadow: 0 -7px 0 -3px #293b30;
}
.gate:before {
  content: "";
  position: absolute;
  top: 13px;
  left: 7px;
  right: 7px;
  border-top: 8px solid #26372c;
}
.gate i {
  position: absolute;
  top: 3px;
  width: 9px;
  height: 140px;
  background: #2a3b2d;
}
.gate i:first-child {
  left: 20px;
}
.gate i:nth-child(2) {
  right: 20px;
}
.gate span {
  position: absolute;
  left: 53px;
  top: 29px;
  padding: 5px;
  background: #4b5140;
  color: #c0b282;
  font-size: 10px;
  letter-spacing: 3px;
  writing-mode: vertical-lr;
}
.bamboo {
  position: absolute;
  bottom: 125px;
  width: 150px;
  height: 340px;
  background: repeating-linear-gradient(
    91deg,
    transparent 0 29px,
    #1a332d 30px 36px,
    transparent 37px 58px
  );
  opacity: 0.8;
  transform: rotate(-7deg);
}
.bamboo:before,
.bamboo:after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    20deg,
    transparent 0 45px,
    #1e3c30 46px 53px,
    transparent 54px 90px
  );
  clip-path: polygon(0 0, 100% 15%, 20% 35%, 100% 50%, 0 67%, 70% 85%, 0 100%);
}
.bamboo-left {
  left: -40px;
}
.bamboo-right {
  right: -40px;
  transform: scaleX(-1) rotate(-6deg);
}
.ground {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 47%;
  bottom: -30%;
  background: radial-gradient(ellipse, #79806b88, transparent 65%);
  transform: perspective(300px) rotateX(25deg);
}
.ground-lines {
  position: absolute;
  inset: 52% 0 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 45px, #c6c5a50a 46px 47px),
    repeating-linear-gradient(95deg, transparent 0 95px, #b0b7970a 96px 97px);
  mask-image: radial-gradient(ellipse, #000, transparent 75%);
}
.field-label {
  position: absolute;
  top: 23px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 1.7px;
  font-size: 8px;
  color: #c7d8bf;
}
.field-label-a {
  left: 6%;
}
.field-label-b {
  right: 6%;
  color: #edbba4;
}
.field-label span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.formation-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, 1fr);
  gap: 4px 5px;
  position: absolute;
  top: 62px;
  bottom: 54px;
  width: 39%;
  align-items: center;
  justify-items: center;
}
.board-a {
  left: 4%;
}
.board-b {
  right: 4%;
}
.slot {
  width: 100%;
  height: 100%;
  min-height: 0;
  position: relative;
  border: 1px dashed #adc0a12e;
  border-radius: 10px;
  background: #c6d3b707;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  isolation: isolate;
}
.slot:empty:before {
  content: "+";
  font-size: 22px;
  font-weight: 400;
  color: #bdc9b33b;
}
.slot.enemy-empty {
  border-color: #d8a58b18;
  background: #dfb29b03;
}
.slot.enemy-empty:empty:before {
  content: "·";
  color: #d5b69b29;
}
.slot.selected-slot {
  border-color: var(--gold);
  background: #e5c98a17;
}
.slot .slot-number {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 7px;
  color: #adc3a166;
}
.slot:hover:not(:disabled) {
  background: #c1d5b51c;
  border-color: #d5c59a;
}
.sprite {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  width: 100%;
  height: 100%;
  justify-content: center;
  pointer-events: none;
  animation: appear 0.25s ease-out;
}
.sprite:before {
  content: "";
  position: absolute;
  bottom: 9px;
  width: 64%;
  height: 14px;
  border-radius: 50%;
  background: #071b1b55;
  filter: blur(3px);
  z-index: -1;
}
.sprite img,
.sprite .portrait-fallback {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px 12px 16px 16px;
  border: 2px solid #c4ac79;
  box-shadow: 0 4px 7px #10262280;
  transition:
    filter 0.3s,
    transform 0.3s;
  animation: breathe 3.3s ease-in-out infinite;
}
.board-b .sprite img {
  border-color: #b37f6e;
}
.sprite-name {
  font-size: 8px;
  line-height: 1.5;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f4ecd6;
  text-shadow: 0 1px 4px #000;
  padding: 1px 3px;
}
.sprite-tier {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 8px;
  color: #f4ddb1;
  text-shadow: 0 1px 3px #000;
}
.hp-bar {
  width: 72%;
  height: 4px;
  background: #0d1e1d;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 1px 2px #0005;
}
.hp-bar span {
  height: 100%;
  display: block;
  background: #8bc09b;
  transition: width 0.35s;
}
.board-b .hp-bar span {
  background: #d8957e;
}
.hp-label {
  font-size: 7px;
  color: #d1dacb;
  line-height: 1.3;
}
.slot.battle-slot {
  border-color: transparent;
  background: transparent;
}
.slot.battle-slot:disabled {
  opacity: 1;
  cursor: default;
}
.slot.battle-slot.defeated:disabled {
  opacity: 0.32;
}
.slot.battle-slot:hover:not(:disabled) {
  background: #d2d3a90c;
}
.slot.current {
  background: radial-gradient(ellipse at 50% 55%, #edcb6d33, transparent 72%);
  border: 1px solid #e7cd7c44;
}
.slot.current:after {
  content: "▼";
  position: absolute;
  top: -9px;
  color: #f4d289;
  font-size: 13px;
  animation: pointer 1s infinite;
}
.slot.targetable {
  border: 1px dashed #d7b99490;
  background: #d6b0760b;
}
.slot.target-selected {
  border: 1px solid #f7d68e;
  background: #f3ce7330;
  box-shadow: inset 0 0 16px #e6c47022;
}
.slot.defeated {
  opacity: 0.32;
  filter: grayscale(1);
}
.slot.defeated img {
  transform: rotate(-10deg) !important;
  animation: none;
}
.status-icons {
  position: absolute;
  bottom: 0;
  right: 0;
  font-size: 10px;
  letter-spacing: 1px;
}
.center-line {
  position: absolute;
  top: 52%;
  left: 48%;
  width: 4%;
  text-align: center;
  color: #c5b68d55;
  font: italic 18px Georgia;
}
.center-line:before,
.center-line:after {
  content: "";
  display: block;
  height: 38px;
  width: 1px;
  margin: 8px auto;
  background: linear-gradient(transparent, #c6b88c44, transparent);
}
.setup-instruction {
  position: absolute;
  bottom: 14px;
  width: 100%;
  text-align: center;
  font-size: 9px;
  color: #e0ddc6;
}
.setup-instruction span {
  display: block;
  font-size: 7px;
  color: #a8ba9d;
  margin-top: 5px;
}
.arena-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  gap: 10px;
  min-height: 83px;
}
.arena-footer strong {
  display: block;
  font-size: 11px;
  color: var(--gold);
  margin-bottom: 5px;
}
.arena-footer > div > span {
  font-size: 8px;
  color: var(--muted);
}
.formation-tools {
  display: flex;
  gap: 7px;
}
.formation-tools button {
  font-size: 9px;
  padding: 10px;
}
.bottom-panels {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
  margin-top: 18px;
}
.detail-panel,
.journal-panel {
  height: 251px;
}
.hero-detail {
  padding: 0 18px 15px;
}
.detail-top {
  display: flex;
  gap: 13px;
  align-items: center;
}
.detail-portrait {
  width: 65px;
  height: 70px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid #8d7e5e;
}
.detail-top h3 {
  font:
    700 18px "Philosopher",
    serif;
  margin: 0 0 5px;
}
.detail-top p {
  font-size: 8px;
  color: var(--muted);
  margin: 0 0 7px;
}
.stat-row {
  display: flex;
  gap: 15px;
  font-size: 9px;
  color: #c5cbbf;
}
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 11px 0;
}
.skill-tags span {
  font-size: 8px;
  color: #c4c9b9;
  border: 1px solid #3c4b43;
  background: #24362f;
  padding: 4px 6px;
  border-radius: 3px;
}
.equip-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9px;
  color: var(--muted);
}
.equip-row select {
  background: #101f25;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 4px;
  padding: 8px;
  width: 100%;
  min-width: 0;
  font-size: 9px;
}
.remove-btn {
  margin-left: auto;
  font-size: 8px;
  padding: 5px;
  color: #dc9a89;
  flex-shrink: 0;
}
.muted {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}
.live-tag {
  color: var(--green);
  font-size: 7px;
  letter-spacing: 1px;
}
.journal {
  height: 192px;
  overflow: auto;
  padding: 0 18px 12px;
  scrollbar-width: thin;
  scrollbar-color: #48564f transparent;
}
.journal-welcome {
  text-align: center;
  padding-top: 20px;
  color: var(--muted);
}
.journal-welcome > span {
  font-size: 28px;
  color: #a28e64;
}
.journal-welcome p {
  font-size: 11px;
  color: #c7c7b7;
}
.journal-welcome small {
  font-size: 9px;
  line-height: 1.9;
  color: #7f9291;
}
.log-entry {
  font-size: 9px;
  line-height: 1.9;
  padding: 8px 0;
  border-bottom: 1px solid #ffffff09;
  white-space: pre-line;
  color: #b6c3bb;
}
.log-entry:last-child {
  color: #e5d4ad;
}
.log-entry .log-index {
  font-size: 7px;
  color: #788f85;
  margin-right: 8px;
}
.page-footer {
  display: flex;
  justify-content: space-between;
  margin: 22px 0 0;
  font-size: 8px;
  color: #6c8280;
  gap: 12px;
}
.page-footer > span:first-child {
  letter-spacing: 1px;
}
.page-footer b {
  margin: 0 10px;
  color: #ad9465;
}
.turn-strip {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  gap: 14px;
  height: 83px;
}
.turn-strip > span {
  font-size: 8px;
  color: var(--muted);
  width: 45px;
  line-height: 1.8;
  letter-spacing: 1px;
}
.turn-strip > div {
  display: flex;
  gap: 6px;
  flex: 1;
  overflow: auto;
  padding: 4px;
}
.turn-chip {
  width: 35px;
  height: 40px;
  object-fit: cover;
  border: 1px solid #746c52;
  border-radius: 5px;
  opacity: 0.55;
}
.turn-chip:first-child {
  opacity: 1;
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.turn-chip.enemy {
  border-color: var(--red);
}
.turn-strip > button {
  font-size: 9px;
  white-space: nowrap;
  padding: 8px;
}
.action-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.action-heading img {
  width: 44px;
  height: 47px;
  border-radius: 5px;
  object-fit: cover;
  border: 1px solid var(--gold);
}
.action-heading h3 {
  font:
    700 16px "Philosopher",
    serif;
  margin: 0 0 4px;
}
.action-heading p {
  color: var(--muted);
  font-size: 8px;
  margin: 0;
}
.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.action-btn {
  text-align: left;
  padding: 10px;
  background: #22342f;
  font-size: 10px;
  position: relative;
}
.action-btn small {
  display: block;
  font-size: 7px;
  color: #98aaa2;
  margin-top: 4px;
}
.action-btn.active {
  border-color: var(--gold);
  background: #3b4130;
}
.action-btn.power {
  color: var(--gold);
}
.action-btn.guard {
  color: #a1c4e0;
}
.action-btn.potion {
  color: #a4d5b2;
}
.turn-hint {
  font-size: 8px;
  color: var(--gold);
  line-height: 1.7;
  margin: 10px 0 0;
}
.field-message {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 12px;
  background: #0f2026d9;
  border: 1px solid #d4bd7744;
  border-radius: 20px;
  color: var(--gold);
  font-size: 9px;
  white-space: nowrap;
}
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: #352e28;
  border: 1px solid #b59867;
  color: #f5d7a7;
  border-radius: 8px;
  padding: 14px 22px;
  font-size: 12px;
  box-shadow: 0 10px 35px #0007;
  max-width: 90vw;
}
.result-overlay {
  position: absolute;
  inset: 0;
  background: #0a1b21bb;
  backdrop-filter: blur(5px);
  z-index: 10;
  display: grid;
  place-items: center;
}
.result-card {
  text-align: center;
  padding: 22px;
  width: 340px;
  max-width: 90%;
}
.result-card > #resultSymbol {
  font: 70px Georgia;
  color: var(--gold);
  margin: 15px 0;
  text-shadow: 0 0 50px #e6c47f77;
}
.result-card h2 {
  font:
    700 32px "Philosopher",
    serif;
  margin: 0 0 8px;
}
.result-card p {
  font-size: 10px;
  color: #b5c3b7;
  line-height: 1.9;
}
.result-card button {
  display: block;
  width: 100%;
  margin-top: 12px;
  font-size: 11px;
}
.float-number {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 8;
  font-weight: 800;
  font-size: 22px;
  color: #ffb19c;
  text-shadow: 0 2px 3px #000;
  animation: damage-up 1s forwards;
  pointer-events: none;
}
.float-number.heal {
  color: #a5efb2;
}
.slot.attacking .sprite {
  animation: lunge 0.42s ease-in-out;
}
.board-b .slot.attacking .sprite {
  animation: lunge-back 0.42s ease-in-out;
}
.slot.hit .sprite img {
  animation: hit 0.45s;
}
.portrait-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #677357, #314737);
  font:
    28px "Philosopher",
    serif;
  color: #f4dbaf;
}
.empty-roster {
  text-align: center;
  padding: 30px 10px;
  color: var(--muted);
  font-size: 11px;
}
dialog {
  border: 1px solid #6d6c50;
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  width: 540px;
  max-width: 94vw;
  padding: 30px;
  box-shadow: 0 20px 90px #0008;
}
dialog::backdrop {
  background: #071319c9;
  backdrop-filter: blur(4px);
}
dialog h2 {
  font:
    700 27px "Philosopher",
    serif;
}
dialog ol {
  padding-left: 20px;
  font-size: 11px;
  line-height: 1.9;
  color: #b9c6bd;
}
dialog li {
  margin: 10px 0;
}
dialog b {
  color: var(--gold);
}
.dialog-close {
  float: right;
  border: 0;
  padding: 0;
}
.action-wait {
  padding: 20px 0;
  text-align: center;
  color: var(--gold);
  font-size: 13px;
}
.action-wait small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 12px;
}
.battle-mode .roster-panel {
  opacity: 0.8;
}
.battle-mode .hero-card {
  cursor: default;
}
.battle-mode .roster-foot {
  color: var(--gold);
}
@keyframes breathe {
  50% {
    transform: translateY(-3px);
  }
}
@keyframes pointer {
  50% {
    transform: translateY(-4px);
  }
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes lunge {
  40% {
    transform: translateX(22px) scale(1.08);
  }
  70% {
    transform: translateX(12px);
  }
}
@keyframes lunge-back {
  40% {
    transform: translateX(-22px) scale(1.08);
  }
  70% {
    transform: translateX(-12px);
  }
}
@keyframes hit {
  30%,
  70% {
    filter: brightness(1.8) sepia(1) saturate(3);
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(4px);
  }
}
@keyframes damage-up {
  0% {
    opacity: 0;
    transform: translate(-50%, 5px);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -44px);
  }
}
@media (min-width: 1450px) {
  .battlefield {
    height: 470px;
  }
  .sprite img {
    width: 75px;
    height: 75px;
  }
  .roster-panel {
    max-height: 880px;
  }
  .sprite-name {
    font-size: 9px;
  }
}
@media (max-width: 1100px) {
  main {
    padding: 25px 3%;
  }
  .workspace {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 14px;
  }
  .formation-board {
    width: 42%;
    gap: 3px;
  }
  .board-a {
    left: 2%;
  }
  .board-b {
    right: 2%;
  }
  .sprite img,
  .sprite .portrait-fallback {
    width: 53px;
    height: 55px;
  }
  .arena-footer {
    padding: 14px;
    flex-wrap: wrap;
  }
  .formation-tools {
    width: 100%;
    justify-content: flex-end;
  }
  .bottom-panels {
    gap: 12px;
  }
  .panel-title {
    padding: 16px 12px 12px;
  }
  .hero-detail,
  .journal {
    padding-left: 12px;
    padding-right: 12px;
  }
  .detail-top {
    gap: 8px;
  }
  .detail-top h3 {
    font-size: 15px;
  }
  .detail-portrait {
    width: 46px;
    height: 52px;
  }
  .skill-tags span {
    font-size: 7px;
  }
  .detail-panel,
  .journal-panel {
    height: 270px;
  }
  .journal {
    height: 218px;
  }
  .hero-faction {
    max-width: 115px;
  }
  .topbar {
    padding: 0 3%;
  }
  nav {
    gap: 14px;
  }
}
@media (max-width: 760px) {
  .topbar {
    height: 69px;
  }
  .brand {
    font-size: 18px;
    letter-spacing: 2px;
  }
  .brand-seal {
    width: 33px;
    height: 38px;
    font-size: 22px;
  }
  .brand small {
    font-size: 6px;
    letter-spacing: 1.5px;
  }
  nav {
    gap: 10px;
    font-size: 9px;
  }
  nav .training-label {
    display: none;
  }
  nav .quiet {
    padding: 7px;
    font-size: 9px;
  }
  main {
    padding: 22px 12px 14px;
  }
  h1 {
    font-size: 27px;
    line-height: 1.25;
  }
  .page-heading p {
    font-size: 9px;
    line-height: 1.8;
  }
  .eyebrow {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .page-heading {
    margin-bottom: 20px;
  }
  .chapter-mark {
    display: none;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .roster-panel {
    max-height: none;
    order: 2;
  }
  .main-column {
    order: 1;
  }
  .roster {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 300px;
    gap: 5px;
    padding: 0 10px 8px;
  }
  .hero-card {
    margin: 0;
    gap: 6px;
    padding: 6px;
  }
  .hero-card img,
  .hero-card .portrait-fallback {
    width: 38px;
    height: 40px;
  }
  .hero-name {
    font-size: 9px;
  }
  .hero-faction {
    max-width: 110px;
    font-size: 7px;
  }
  .hero-stats {
    font-size: 8px;
    gap: 8px;
  }
  .tier {
    font-size: 8px;
    padding: 2px 4px;
    min-width: 16px;
  }
  .tier-filters {
    padding: 10px 16px;
  }
  .roster-foot {
    padding: 10px;
  }
  .arena-heading {
    height: 64px;
    padding: 0 14px;
  }
  .arena-location h2 {
    font-size: 17px;
  }
  .arena-location small {
    font-size: 6px;
  }
  .stage-picker button {
    padding: 6px 10px;
    font-size: 9px;
  }
  .battlefield {
    height: 380px;
  }
  .formation-board {
    top: 65px;
    bottom: 48px;
    width: 44%;
    gap: 3px;
  }
  .board-a {
    left: 1%;
  }
  .board-b {
    right: 1%;
  }
  .sprite img,
  .sprite .portrait-fallback {
    width: 49px;
    height: 52px;
    border-radius: 9px;
  }
  .sprite-name {
    font-size: 6px;
  }
  .hp-bar {
    width: 80%;
  }
  .hp-label {
    font-size: 6px;
  }
  .center-line {
    font-size: 14px;
  }
  .field-label {
    font-size: 6px;
    letter-spacing: 1px;
  }
  .field-label-a {
    left: 4%;
  }
  .field-label-b {
    right: 4%;
  }
  .setup-instruction {
    font-size: 8px;
    bottom: 12px;
  }
  .setup-instruction span {
    font-size: 6px;
  }
  .arena-footer {
    padding: 12px;
    gap: 12px;
  }
  .arena-footer strong {
    font-size: 10px;
  }
  .arena-footer > div > span {
    font-size: 7px;
  }
  .formation-tools {
    justify-content: space-between;
    gap: 5px;
  }
  .formation-tools button {
    font-size: 8px;
    padding: 10px 8px;
  }
  .primary span {
    margin-left: 10px;
  }
  .bottom-panels {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 12px;
  }
  .detail-panel {
    height: auto;
    min-height: 223px;
  }
  .journal-panel {
    height: 180px;
  }
  .journal {
    height: 135px;
  }
  .journal-welcome {
    padding: 5px;
  }
  .journal-welcome > span {
    display: none;
  }
  .journal-welcome p {
    margin: 6px;
  }
  .journal-welcome small br {
    display: none;
  }
  .detail-portrait {
    width: 53px;
    height: 57px;
  }
  .detail-top h3 {
    font-size: 18px;
  }
  .hero-detail {
    padding-bottom: 15px;
  }
  .detail-top p {
    font-size: 9px;
  }
  .stat-row {
    font-size: 10px;
  }
  .skill-tags span {
    font-size: 8px;
  }
  .equip-row {
    font-size: 10px;
  }
  .equip-row select {
    font-size: 10px;
  }
  .page-footer {
    font-size: 7px;
    line-height: 1.8;
  }
  .page-footer > span:last-child {
    max-width: 180px;
    text-align: right;
  }
  .turn-strip {
    height: 73px;
    padding: 10px;
    gap: 8px;
  }
  .turn-chip {
    width: 29px;
    height: 34px;
  }
  .turn-strip > span {
    font-size: 6px;
    width: 37px;
  }
  .turn-strip > button {
    font-size: 8px;
  }
  .field-message {
    font-size: 7px;
    padding: 6px 9px;
  }
  .action-buttons {
    gap: 8px;
  }
  .action-btn {
    padding: 11px;
    font-size: 11px;
  }
  .action-btn small {
    font-size: 8px;
  }
  .battle-mode .roster-panel {
    display: none;
  }
  .status-icons {
    font-size: 8px;
  }
  .sprite-tier {
    font-size: 6px;
    top: 1px;
    right: 1px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Commander and six visible soldiers form one selectable army unit. */
.soldiers {
  position: absolute;
  left: 0;
  right: 0;
  top: 34%;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: -1;
}
.soldier {
  position: relative;
  width: 12px;
  height: 25px;
  display: block;
  filter: drop-shadow(0 2px 1px #13261e);
  transition: opacity 0.3s;
}
.soldier:before {
  content: "";
  position: absolute;
  top: 0;
  left: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d6b58b;
  border-top: 3px solid #63877c;
}
.soldier:after {
  content: "";
  position: absolute;
  top: 8px;
  left: 1px;
  width: 11px;
  height: 16px;
  background: #63877c;
  clip-path: polygon(
    25% 0,
    75% 0,
    100% 65%,
    65% 65%,
    65% 100%,
    40% 100%,
    40% 65%,
    0 65%
  );
}
.board-b .soldier:after {
  background: #b37f6e;
}
.board-b .soldier:before {
  border-color: #b37f6e;
}
.soldiers.magic .soldier:after {
  background: #9382b4;
}
.soldiers.support .soldier:after {
  background: #c4a465;
}
.soldier.fallen {
  opacity: 0.12;
}
.sprite > img,
.sprite > .portrait-fallback {
  position: relative;
  z-index: 1;
}
.morale-bar {
  width: 72%;
  height: 3px;
  background: #152426;
  margin-top: 2px;
  border-radius: 2px;
  overflow: hidden;
}
.morale-bar span {
  display: block;
  height: 100%;
  background: #e8c689;
  transition: width 0.3s;
}
.morale-label {
  font-size: 7px;
  color: #e8c689;
  line-height: 1.4;
}
.battle-mode .sprite > img {
  width: 54px;
  height: 54px;
}
.troop-row {
  margin-top: 7px;
}
.troop-description {
  font-size: 8px;
  color: #d4c292;
  line-height: 1.5;
  margin: 6px 0 0;
}
.detail-panel {
  height: auto;
  min-height: 285px;
}
.bottom-panels {
  align-items: stretch;
}
.journal-panel {
  height: auto;
  min-height: 285px;
}
@media (max-width: 760px) {
  .battle-mode .sprite > img {
    width: 40px;
    height: 42px;
  }
  .soldier {
    width: 7px;
    transform: scale(0.7);
  }
  .soldiers {
    top: 30%;
  }
  .hp-label {
    font-size: 5px;
  }
  .morale-label {
    font-size: 6px;
  }
  .detail-panel {
    min-height: 285px;
  }
  .journal-panel {
    min-height: 180px;
  }
  .troop-description {
    font-size: 9px;
  }
}

.combat-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: #102127;
  border-top: 1px solid var(--line);
}
.combat-controls button {
  font-size: 11px;
  padding: 9px 12px;
}
.combat-controls .active,
.army-choice-row button.active {
  border-color: var(--gold);
  background: #3c402d;
  color: var(--gold);
}
.speed-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.speed-controls > span,
#autoCombatStatus {
  font-size: 9px;
  color: var(--muted);
}
.army-setup {
  padding: 16px 18px;
  background: #192d2b;
  border-top: 1px solid var(--line);
}
.army-setup-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--gold);
}
.army-setup-heading span {
  font-size: 9px;
  color: var(--muted);
}
.army-choices {
  display: grid;
  gap: 8px;
}
.army-choice-row {
  display: grid;
  grid-template-columns: 32px 120px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.army-choice-row > img,
.army-choice-row > .portrait-fallback {
  width: 32px;
  height: 34px;
  object-fit: cover;
  border-radius: 5px;
}
.army-choice-row > strong {
  font-size: 10px;
}
.army-choice-row > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.army-choice-row button {
  text-align: left;
  padding: 8px;
  font-size: 10px;
  line-height: 1.5;
}
.army-choice-row small {
  display: block;
  font-size: 8px;
  color: var(--muted);
  margin-top: 3px;
  font-weight: 400;
}
.slot.attacking .sprite {
  animation-duration: calc(0.42s / var(--combat-speed, 1));
}
.board-b .slot.attacking .sprite {
  animation-duration: calc(0.42s / var(--combat-speed, 1));
}
.slot.hit .sprite img {
  animation-duration: calc(0.45s / var(--combat-speed, 1));
}
.float-number {
  animation-duration: calc(1s / var(--combat-speed, 1));
}
@media (max-width: 760px) {
  .army-setup {
    padding: 12px;
  }
  .army-choice-row {
    grid-template-columns: 27px minmax(0, 1fr);
    gap: 7px;
  }
  .army-choice-row > div {
    grid-column: 1/-1;
  }
  .army-choice-row > img {
    width: 27px;
    height: 29px;
  }
  .army-choice-row button {
    font-size: 10px;
  }
  .army-choice-row small {
    font-size: 8px;
  }
  .combat-controls {
    gap: 9px;
    padding: 10px 12px;
  }
  #autoCombatStatus {
    width: 100%;
  }
}
.damage-rules-dialog {
  width: 880px;
}
.damage-table-scroll {
  overflow-x: auto;
}
.damage-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
  font-size: 10px;
}
.damage-table th,
.damage-table td {
  padding: 12px 8px;
  border: 1px solid var(--line);
  text-align: center;
}
.damage-table th {
  color: var(--gold);
  background: #20342e;
}
.damage-table th small {
  display: block;
  color: var(--muted);
  font-size: 8px;
  margin-top: 5px;
}
.damage-table caption {
  font-size: 10px;
  color: var(--muted);
  text-align: left;
  margin: 10px 0;
}
.damage-table .advantage {
  color: #9dd9b0;
  background: #1e3c2e;
}
.damage-table .disadvantage {
  color: #dd9d91;
  background: #382d2c;
}
/* A consistent rarity border in roster, formations, both armies and turn queue. */
.rarity-B,
.tier-B {
  --hero-rarity: #4aa3ff;
}
.rarity-A,
.tier-A {
  --hero-rarity: #b968f7;
}
.rarity-S,
.tier-S {
  --hero-rarity: #f1c84c;
}
.rarity-M,
.tier-M {
  --hero-rarity: #ff4d4d;
}
.rarity-U,
.tier-U {
  --hero-rarity: #ff9d3c;
}
.rarity-E,
.tier-E {
  --hero-rarity: #a3122b;
}
img.hero-portrait[class*="rarity-"],
span.hero-portrait[class*="rarity-"] {
  border: 2px solid var(--hero-rarity);
  box-shadow:
    0 0 0 1px #102025,
    0 0 8px color-mix(in srgb, var(--hero-rarity) 35%, transparent);
}
.rarity-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 14px;
  font-size: 9px;
}
.rarity-legend span {
  color: var(--hero-rarity);
}

/* Match public/css/style.css --tier-b/a/s/m/u/e exactly. */
.hero-card[class*="rarity-"] {
  border-color: var(--hero-rarity);
  box-shadow: inset 3px 0 var(--hero-rarity);
}
.hero-card.selected {
  outline: 1px solid var(--gold);
  outline-offset: 1px;
}
.tier[class*="tier-"] {
  color: var(--hero-rarity);
  border: 1px solid var(--hero-rarity);
  background: #16242b;
}

.hero-filters {
  padding: 0 16px 12px;
  display: grid;
  gap: 8px;
}
.hero-filters label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
}
.hero-filters select {
  width: 100%;
  min-width: 0;
  background: #111e25;
  color: var(--text);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 10px;
}
.hero-role {
  display: inline-block;
  font-size: 8px;
  padding: 2px 5px;
  border-radius: 3px;
  margin: 0 0 4px;
  background: #283c35;
  color: #9fd7b2;
}
.hero-role.role-magic {
  background: #362e4b;
  color: #c9aff4;
}
.hero-role.role-support {
  background: #3d3929;
  color: #ead08b;
}

.roster-school-heading {
  grid-column: 1/-1;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 5px 8px;
  color: var(--gold);
  font-size: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 7px;
  line-height: 1.6;
}
.roster-school-heading span {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}
.pattern-picker {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--gold);
  font-size: 10px;
  margin-bottom: 12px;
}
.pattern-picker select {
  min-width: 0;
  flex: 1;
  background: #102127;
  border: 1px solid #8b7854;
  color: var(--text);
  border-radius: 5px;
  padding: 8px;
  font-size: 10px;
}
.slot.area-preview {
  background: repeating-linear-gradient(
    135deg,
    #e8c68920 0 8px,
    #e8c68909 8px 16px
  );
  box-shadow: inset 0 0 0 1px #e8c68988;
}
.skill-fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  overflow: hidden;
  --fx-color: #f7d077;
}
.skill-fx-layer.fx-magic {
  --fx-color: #8edfff;
}
.skill-fx-layer.fx-heal {
  --fx-color: #9bffad;
}
.skill-fx-layer.fx-drum {
  --fx-color: #ffce74;
}
.skill-fx-layer.fx-strategy {
  --fx-color: #ff9a75;
}
.fx-impact {
  position: absolute;
  display: grid;
  place-items: center;
  isolation: isolate;
  color: var(--fx-color);
  filter: drop-shadow(0 0 8px var(--fx-color));
  animation: skill-impact calc(0.85s / var(--combat-speed, 1)) ease-out both;
}
.fx-impact:before,
.fx-impact:after {
  content: "";
  position: absolute;
  inset: 10%;
  border: 2px solid var(--fx-color);
  border-radius: 50%;
  box-shadow:
    0 0 12px var(--fx-color),
    inset 0 0 10px var(--fx-color);
  animation: skill-ring calc(0.85s / var(--combat-speed, 1)) ease-out both;
}
.fx-impact:after {
  inset: 24%;
  transform: rotate(45deg);
  border-radius: 12%;
  animation: skill-sigil calc(0.85s / var(--combat-speed, 1)) ease-out both;
}
.fx-impact span {
  font:
    700 35px Georgia,
    serif;
  z-index: 1;
  text-shadow: 0 0 12px var(--fx-color);
  animation: skill-glyph calc(0.85s / var(--combat-speed, 1)) ease-out both;
}
.fx-impact i {
  position: absolute;
  width: 5px;
  height: 20%;
  border-radius: 50%;
  background: var(--fx-color);
  box-shadow: 0 0 12px var(--fx-color);
  transform: rotate(45deg) translate(25px, -15px);
}
.fx-impact i:last-child {
  transform: rotate(-35deg) translate(-25px, 12px);
}
.fx-impact.fx-slash:before,
.fx-impact.fx-strategy:before {
  inset: 46% 0;
  height: 5px;
  border: 0;
  border-radius: 50%;
  background: #fff6d4;
  box-shadow: 0 0 16px var(--fx-color);
  transform: rotate(-40deg);
  animation: skill-slash calc(0.65s / var(--combat-speed, 1)) ease-out both;
}
.fx-impact.fx-slash:after {
  inset: 46% 5%;
  height: 3px;
  border: 0;
  border-radius: 50%;
  background: var(--fx-color);
  transform: rotate(35deg);
}
.fx-impact.fx-heal:before {
  background: radial-gradient(ellipse, #b7ffb43b, transparent 65%);
}
.fx-impact.fx-heal:after {
  border-radius: 50%;
  border-style: dashed;
}
.fx-impact.fx-drum:after {
  inset: 0;
  border-radius: 50%;
  border-style: dashed;
}
.skill-projectile {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff7dd;
  box-shadow:
    0 0 8px 4px var(--fx-color),
    0 0 22px var(--fx-color);
  animation: skill-projectile calc(0.32s / var(--combat-speed, 1)) ease-out both;
}
.skill-zone {
  position: absolute;
  border: 2px solid var(--fx-color);
  border-radius: 10px;
  background: repeating-linear-gradient(
    135deg,
    transparent 0 18px,
    #fff6ce20 18px 21px
  );
  box-shadow:
    0 0 24px var(--fx-color),
    inset 0 0 24px var(--fx-color);
  animation: skill-zone calc(0.85s / var(--combat-speed, 1)) ease-out both;
}
.skill-announcement {
  position: absolute;
  left: 50%;
  top: 39%;
  transform: translate(-50%, -50%);
  padding: 10px 22px;
  border-top: 1px solid var(--fx-color);
  border-bottom: 1px solid var(--fx-color);
  background: linear-gradient(
    90deg,
    transparent,
    #0b1f26e8 20% 80%,
    transparent
  );
  color: #fff0c6;
  font:
    700 17px "Philosopher",
    Georgia,
    serif;
  text-align: center;
  white-space: nowrap;
  letter-spacing: 2px;
  text-shadow: 0 0 10px var(--fx-color);
  animation: skill-caption calc(0.85s / var(--combat-speed, 1)) ease-out both;
}
@keyframes skill-projectile {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.4);
  }
  15% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--travel-x), var(--travel-y)) scale(1.6);
  }
}
@keyframes skill-ring {
  0% {
    opacity: 0;
    scale: 0.25;
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    scale: 1.4;
  }
}
@keyframes skill-sigil {
  0% {
    opacity: 0;
    rotate: 0deg;
    scale: 0.6;
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    rotate: 90deg;
    scale: 1.2;
  }
}
@keyframes skill-impact {
  0% {
    opacity: 0;
  }
  20%,
  60% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes skill-glyph {
  0% {
    opacity: 0;
    translate: 0 15px;
    scale: 0.5;
  }
  25% {
    opacity: 1;
    scale: 1.3;
  }
  100% {
    opacity: 0;
    translate: 0 -22px;
    scale: 1;
  }
}
@keyframes skill-slash {
  0% {
    opacity: 0;
    scale: 0.1 1;
  }
  20%,
  50% {
    opacity: 1;
    scale: 1 1;
  }
  100% {
    opacity: 0;
    scale: 1.4 1;
  }
}
@keyframes skill-zone {
  0% {
    opacity: 0;
    scale: 0.95;
  }
  25% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    scale: 1.05;
  }
}
@keyframes skill-caption {
  0% {
    opacity: 0;
    translate: 0 8px;
  }
  20%,
  65% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    translate: 0 -6px;
  }
}
@media (max-width: 760px) {
  .pattern-picker {
    font-size: 9px;
  }
  .pattern-picker select {
    font-size: 9px;
  }
  .skill-announcement {
    font-size: 11px;
    letter-spacing: 1px;
    padding: 8px 10px;
  }
  .fx-impact span {
    font-size: 25px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .skill-fx-layer *,
  .skill-fx-layer *:before,
  .skill-fx-layer *:after {
    animation: none !important;
  }
  .skill-projectile {
    display: none;
  }
  .skill-announcement {
    opacity: 1;
  }
  .fx-impact {
    opacity: 0.75;
  }
}
.skill-fx-layer.fx-ice {
  --fx-color: #b4efff;
}
.skill-fx-layer.fx-fire {
  --fx-color: #ff984f;
}
.skill-fx-layer.fx-poison {
  --fx-color: #c5ff77;
}
.fx-impact.fx-fire:before {
  background: radial-gradient(ellipse, #fff8be, #ff8e3e66 35%, transparent 70%);
  border-radius: 50% 50% 25% 25%;
}
.fx-impact.fx-ice:after {
  border-style: dashed;
  border-radius: 0;
}
.fx-impact.fx-poison:before {
  background: radial-gradient(ellipse, #b8ff5a55, transparent 70%);
  border-style: dotted;
}

/* Generated transparent 4 × 2 skill atlas; cells stay unmodified. */
.signature-sprite {
  position: absolute; width: 200px; height: 200px;
  background-image: url('/tactics/assets/hero-skills.png');
  background-size: 400% 200%; background-repeat: no-repeat;
  filter: hue-rotate(var(--signature-hue, 0deg)) drop-shadow(0 0 12px #bff);
  z-index: 4; pointer-events: none;
}
.signature-burst { animation: signature-burst calc(850ms / var(--combat-speed, 1)) ease-out both; }
.piercing-dagger {
  width: 220px; height: 150px;
  background-image: url('/tactics/assets/flying-dagger.png');
  background-size: contain; background-position: center;
  animation: piercing-dagger calc(850ms / var(--combat-speed, 1)) linear both;
}
@keyframes piercing-dagger {
  0% { opacity: 0; transform: translateX(0) scaleX(var(--facing, 1)); }
  12% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translateX(var(--flight)) scaleX(var(--facing, 1)); }
}
@keyframes signature-burst {
  0% { opacity: 0; transform: scale(.25) rotate(-15deg); }
  30% { opacity: 1; transform: scale(1.1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.3); }
}
@media (prefers-reduced-motion: reduce) {
  .signature-sprite { animation: none; opacity: .85; }
  .piercing-dagger { transform: translateX(calc(var(--flight) / 2)) scaleX(var(--facing, 1)); }
}

/* Visible troop artwork: six columns × idle/action/hit rows, original PNG. */
.battlefield { height: 690px; }
.sprite { justify-content: center; gap: 1px; }
.sprite .commander { position: relative; display: flex; justify-content: center; }
.sprite .commander > img, .sprite .commander > .portrait-fallback {
  width: 35px; height: 35px; border-radius: 8px;
}
.sprite .sprite-tier { top: 0; right: -12px; }
.sprite .sprite-name { font-size: 9px; line-height: 13px; max-width: 100%; }
.sprite .soldiers {
  position: relative; inset: auto; display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 114px); height: 65px;
  gap: 0; z-index: 1; justify-items: center;
}
.soldier, .troop-preview {
  display: block; width: 32px; height: 43px;
  background-image: var(--troop-atlas, url('/tactics/assets/troops.png'));
  background-size: 600% 300%;
  background-position: var(--troop-column, 0%) 0%;
  background-repeat: no-repeat;
  transform: none; flex-shrink: 0;
  filter: drop-shadow(0 2px 2px #0009);
}
.sprite .soldier { width: 32px; height: 43px; margin-top: -3px; }
.sprite .soldier:nth-child(n+4) { margin-top: -15px; }
.soldier:before, .soldier:after { display: none; }
.board-b .soldier { transform: scaleX(-1); }
.soldier.fallen { opacity: .12; filter: grayscale(1); }
.slot.attacking .soldier { background-position-y: 50%; }
.slot.hit .soldier { background-position-y: 100%; }
.troop-banner {
  max-width: 100%; border: 1px solid var(--troop-color);
  border-radius: 3px; padding: 1px 4px;
  color: var(--troop-color); background: #09171de8;
  font-size: 9px; font-weight: 700; white-space: nowrap;
}
.slot:has(.troop-banner) { border-left: 3px solid var(--army-color, #adc0a1); }
.slot:has(.troop-infantry) { --army-color: #53cfbb; }
.slot:has(.troop-cavalry) { --army-color: #70afff; }
.slot:has(.troop-mage) { --army-color: #c599ff; }
.slot:has(.troop-warlock) { --army-color: #f48eab; }
.slot:has(.troop-drummer) { --army-color: #ffc868; }
.slot:has(.troop-medic) { --army-color: #9deb90; }
.army-choice-row button { display: flex; align-items: center; gap: 8px; text-align: left; }
.army-choice-row .troop-preview { width: 48px; height: 64px; }
.equipment-bonuses { padding: 10px; margin-top: 8px; background: #0b1a20; border: 1px solid #66807855; border-radius: 6px; }
.equipment-bonuses strong { font-size: 11px; color: #e8c689; }
.equipment-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px 12px; margin-top: 8px; }
.equipment-stat-grid span { display: flex; justify-content: space-between; font-size: 10px; color: #95a8a3; }
.equipment-stat-grid .stat-bonus { color: #9deb90; }
.equipment-combat-summary { padding: 8px; color: #9deb90; font-size: 11px; line-height: 1.6; }
@media (max-width: 760px) {
  .battlefield { height: 1110px; }
  .formation-board { width: 94%; height: 460px; bottom: auto; left: 3%; right: auto; top: 65px; gap: 5px; }
  .board-b { top: 595px; }
  .field-label-a { left: 4%; top: 35px; }
  .field-label-b { right: 4%; top: 563px; }
  .center-line { top: 540px; height: 22px; bottom: auto; }
  .sprite .commander > img, .sprite .commander > .portrait-fallback { width: 29px; height: 29px; }
  .sprite .sprite-name { font-size: 8px; }
  .sprite .soldiers { height: 55px; width: 96px; }
  .sprite .soldier { width: 28px; height: 37px; }
  .troop-banner { font-size: 8px; padding: 1px 3px; }
  .hp-label { font-size: 7px; }
}
.sprite > .commander, .sprite > .sprite-name, .sprite > .soldiers,
.sprite > .troop-banner, .sprite > .hp-bar, .sprite > .hp-label,
.sprite > .morale-bar, .sprite > .morale-label { flex-shrink: 0; }
.sprite .sprite-name { height: 13px; }
.sprite .hp-label { white-space: nowrap; }

/* Six simultaneous equipment slots; item tiers are separate from hero rarity. */
.equipment-panel { margin: 14px 0; padding: 12px; border: 1px solid #778f7955; border-radius: 10px; background: #0a171db0; }
.equipment-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.equipment-panel-heading h4 { margin: 0; color: #eed7a6; font-size: 15px; }
.equipment-panel-heading > span { color: #b1c9bd; font-size: 11px; }
.equipment-intro { font-size: 10px; line-height: 1.6; color: #a1b6ae; margin: 7px 0; }
.equipment-presets { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.equipment-presets button { border: 1px solid var(--equipment-color, #678078); color: var(--equipment-color, #afc3b9); background: #10242a; border-radius: 5px; padding: 6px 8px; font: inherit; font-size: 10px; cursor: pointer; }
.equipment-presets button:hover:not(:disabled) { background: #284037; }
.equipment-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.equipment-slot { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px; border: 1px dashed #557269; border-radius: 8px; background: #122329; }
.equipment-slot.equipped { border: 1px solid var(--equipment-color); background: linear-gradient(135deg, #263c3755, #122329); }
.equipment-slot-heading { display: flex; justify-content: space-between; align-items: center; gap: 6px; color: #dfdfcd; font-size: 12px; }
.equipment-slot-heading b { color: var(--equipment-color); font-size: 10px; }
.equipment-slot > small { color: #a6bab0; font-size: 10px; }
.equipment-slot > small strong { color: #b3e7a4; }
.equipment-slot select { width: 100%; min-width: 0; background: #0b1a20; border: 1px solid #567068; color: #e8ebdc; border-radius: 5px; font: inherit; font-size: 10px; padding: 8px 4px; }
.equipment-slot select:focus-visible, .equipment-presets button:focus-visible { outline: 2px solid #e8c689; outline-offset: 2px; }
.equipment-panel button:disabled, .equipment-panel select:disabled { opacity: .45; cursor: default; }
.brand { font-size: 19px; letter-spacing: 1px; }
@media (max-width: 760px) {
  .brand { font-size: 12px; letter-spacing: .3px; gap: 7px; }
  .brand small { font-size: 6px; letter-spacing: 1px; }
  .equipment-panel { padding: 10px; }
  .equipment-slot { padding: 8px; }
}
.army-choice-row .open-equipment { display: block; width: auto; margin-top: 6px; padding: 5px 7px; color: #edd39c; border: 1px solid #9b885f; background: #1b302e; border-radius: 4px; font-size: 10px; white-space: nowrap; }
.float-number.morale-gain { color: #ffe099; text-shadow: 0 1px 3px #000, 0 0 9px #d69825; font-size: 16px; }
.signature-description { font-size: 11px; line-height: 1.7; color: #e8cc95; }
.account-status { margin: -10px 0 18px; padding: 10px 14px; border: 1px solid #658a7855; border-radius: 7px; color: #c3d8c9; background: #17302a77; font-size: 12px; line-height: 1.6; }
.hero-star { color: #eed299; font-size: 10px; }
.sprite .sprite-tier { white-space: nowrap; right: -36px; }
.passive-effect {
  position: absolute; top: calc(8px + var(--passive-index, 0) * 19px); left: 50%;
  transform: translateX(-50%); z-index: 9; pointer-events: none;
  padding: 3px 5px; border-radius: 4px; white-space: nowrap;
  background: #103729ed; border: 1px solid #91daa7; color: #b9ffc9;
  font-size: 10px; line-height: 1.2; box-shadow: 0 2px 8px #0008;
}
.passive-buff_atk { background: #473113ed; border-color: #edbf67; color: #ffe4a1; }
@media (max-width: 760px) { .passive-effect { font-size: 8px; padding: 2px 3px; } }
.hero-role.role-strategy { color: #edc477; background: #68451444; border-color: #c99a4c66; }
.hero-role.role-magic { color: #cdb0ff; }
.hero-role.role-physical { color: #8cddc4; }
.hero-damage-type { color: #edcf95; font-weight: 700; }

/* In-game home and focused destinations share the same live account state. */
[hidden] { display: none !important; }
.game-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.game-nav .active { color: var(--gold); border-color: var(--gold); background: #354238; }
.home-screen { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.home-banner { padding: 32px; background: radial-gradient(ellipse at top right, #47604a88, transparent 70%), #17282c; }
.home-banner h2 { font: 700 34px Philosopher, serif; color: var(--gold); margin: 18px 0; }
.home-banner p { line-height: 1.8; color: var(--muted); }
.home-party { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; }
.home-party button { width: 96px; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 5px; }
.home-party .detail-portrait { width: 58px; height: 66px; object-fit: contain; }
.home-party strong { font-size: 10px; }
.home-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.home-menu button { text-align: left; padding: 24px; background: linear-gradient(145deg, #263b3c, #17242b); }
.home-menu span { display: block; font-size: 32px; color: var(--gold); margin-bottom: 16px; }
.home-menu strong { display: block; font-size: 19px; margin-bottom: 10px; }
.home-menu small { color: var(--muted); line-height: 1.7; }
.screen-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 24px 0; }
.screen-heading h2 { margin: 0; color: var(--gold); }
.screen-heading button { flex-shrink: 0; }
body:not([data-screen="home"]) .page-heading { display: none; }
body[data-screen="equipment"] .arena-panel,
body[data-screen="equipment"] .journal-panel { display: none; }
body[data-screen="equipment"] .bottom-panels { display: block; }
body[data-screen="equipment"] .detail-panel { min-height: 440px; }
.ranking-screen { padding: 24px; min-height: 300px; }
.ranking-table-scroll { overflow-x: auto; }
.ranking-table { width: 100%; border-collapse: collapse; text-align: left; }
.ranking-table th, .ranking-table td { padding: 14px 10px; border-bottom: 1px solid var(--line); }
.rank-me, .rank-summary strong { color: var(--gold); }
@media(max-width: 760px) {
  .home-screen { grid-template-columns: 1fr; }
  .home-banner { padding: 22px; }
  .home-banner h2 { font-size: 27px; }
  .home-menu button { padding: 18px; }
  .game-nav button { flex: 1 1 auto; padding: 10px; }
  .screen-heading { align-items: flex-start; }
  .screen-heading p { font-size: 11px; line-height: 1.7; }
}
#rankBattleControls { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 16px; }
#rankBattleControls p { line-height: 1.8; }
#rankBattleControls button { margin: 6px 6px 6px 0; }
#rankMatchResult { margin-top: 20px; padding: 18px; border: 1px solid var(--gold); border-radius: 8px; line-height: 1.9; color: var(--gold); }
.rank-summary { line-height: 2; }
#rankRewards li { padding: 5px 0; }

/* Military planning and durable campaign records. */
.command-section{padding:24px;margin-bottom:20px;min-width:0}.command-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:16px;margin:20px 0}.command-card{padding:18px;background:#15272e;border:1px solid #43514b;border-radius:12px;min-width:0}.command-card input{display:block;box-sizing:border-box;width:100%;margin-top:8px;padding:10px;border:1px solid #6b7564;border-radius:6px;background:#0f1e24;color:#f5ecd5}.command-card button{margin:5px 4px 0 0}.formation-mini{display:grid;grid-template-columns:repeat(3,32px);gap:4px;margin:12px 0}.formation-mini span{display:grid;place-items:center;height:32px;border:1px solid #52615d;color:#8d9b95;border-radius:4px}.formation-mini .occupied{background:#715937;color:#fff0ba;border-color:#d4b465}.campaign-stars{font-size:27px;color:#f2c66c;letter-spacing:4px}.matchup-good{color:#8de7b5}.matchup-weak{color:#efa393}.battle-report{padding:16px 0;border-bottom:1px solid #3a4a4e}.battle-report summary{cursor:pointer;line-height:1.7}.battle-report time{display:inline-block;font-size:12px;color:#9babae;margin-left:12px}.command-section .ranking-table-scroll{max-width:100%;overflow-x:auto}.command-section .ranking-table{min-width:680px}@media(max-width:600px){.command-section{padding:16px}.command-section h2{font-size:21px}.command-card{padding:14px}}
.workshop-sections{grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr))}.workshop-sections section{margin-bottom:0}.workshop-sections button{display:block;margin:10px 0;max-width:100%;white-space:normal}.workshop-sections label{display:block;font-size:13px}.workshop-sections select{display:block;box-sizing:border-box;width:100%;max-width:100%;margin:10px 0;padding:10px;background:#13262e;color:#e8dcc1;border:1px solid #7c745c;border-radius:6px}.workshop-result ul{line-height:1.9;max-height:350px;overflow:auto;padding-left:22px}.workshop-wallet strong{color:#f2ce7b}.workshop-result p,.workshop-wallet p{overflow-wrap:anywhere}

/* Painted jianghu directory: all destinations use ordinary accessible buttons. */
.home-screen{display:block}.town-directory{overflow:hidden;margin-bottom:22px;border-color:#9a8554}.town-directory-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:20px 24px;background:linear-gradient(110deg,#1a3033,#203a36)}.town-directory-heading h2{margin:8px 0 0;font:700 25px Philosopher,serif;color:#efd7a0}.town-directory-heading p{font-size:12px;color:#c9cdb7;max-width:300px;line-height:1.6}.town-pan-hint{display:none}.town-scroll{overflow-x:auto;overscroll-behavior-x:contain;scrollbar-color:#ae915c #142a2c}.town-scroll:focus-visible{outline:3px solid #e8bd63;outline-offset:-3px}.town-scene{position:relative;aspect-ratio:3/2;min-width:720px;background:#526753;isolation:isolate}.town-backdrop{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none;user-select:none}.town-directory .town-destination{position:absolute;left:calc(var(--town-x)*1%);top:calc(var(--town-y)*1%);width:16%;transform:translateX(-50%);padding:0;border:0;background:none;box-shadow:none;display:flex;align-items:center;flex-direction:column;gap:0;color:#fff4d3;z-index:2;transition:filter .16s,translate .16s}.town-sprite{display:block;position:relative;overflow:hidden;width:100%;aspect-ratio:3/4;filter:drop-shadow(0 7px 5px #18272180);pointer-events:none}.town-sprite img{position:absolute;left:calc(var(--town-col)*-100%);top:calc(var(--town-row)*-100%);width:400%;height:200%;max-width:none;user-select:none;pointer-events:none}.town-directory .town-destination strong{position:relative;display:block;padding:7px 12px;margin-top:-6px;border:1px solid #d4b777;border-radius:6px;background:linear-gradient(#34443a,#152b2a);box-shadow:0 3px 9px #10232188;white-space:nowrap;font-size:clamp(11px,1.15vw,16px);line-height:1.2}.town-destination small{display:block;margin-top:4px;padding:3px 6px;color:#fff7df;text-shadow:0 1px 3px #000,0 1px 6px #000;background:#18312bc9;border-radius:4px;font-size:clamp(9px,.85vw,12px);white-space:nowrap}.town-directory .town-destination:hover,.town-directory .town-destination:focus-visible{filter:brightness(1.18);translate:0 -5px;outline:0}.town-directory .town-destination:focus-visible strong{outline:3px solid #fff0bb;outline-offset:3px}.town-directory .town-destination:hover strong{background:#705a31}.town-destination-0{--town-x:23;--town-y:2}.town-destination-1{--town-x:40;--town-y:2}.town-destination-2{--town-x:60;--town-y:2}.town-destination-3{--town-x:79;--town-y:2}.town-destination-4{--town-x:18;--town-y:46}.town-destination-5{--town-x:38;--town-y:46}.town-destination-6{--town-x:61;--town-y:46}.town-destination-7{--town-x:81;--town-y:46}.town-plaza{position:absolute;top:40%;left:50%;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;padding:9px 22px;border:1px solid #b18b46;border-radius:12px;background:#f1e2b7e8;color:#4a422a;box-shadow:0 4px 20px #263a2944;pointer-events:none;z-index:1}.town-plaza span{font-size:25px;line-height:1.1}.town-plaza strong{font:700 19px Philosopher,serif;letter-spacing:3px}.town-plaza small{font-size:9px;letter-spacing:3px;margin-top:3px}.town-shortcuts{display:none}.home-banner{margin-top:20px}.home-banner h2{font-size:27px}.home-party{margin-bottom:16px}@media(max-width:760px){.town-directory-heading{padding:16px;display:block}.town-directory-heading h2{font-size:22px}.town-directory-heading p{margin-bottom:0;max-width:none}.town-pan-hint{display:inline}.town-shortcuts{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:12px;background:#183035}.town-shortcuts button{font-size:11px;padding:10px 6px}.town-destination strong{font-size:11px!important}.town-destination small{font-size:9px}.town-plaza{padding:5px 12px;top:40%}.town-plaza span{font-size:17px}.town-plaza strong{font-size:14px}.town-plaza small{font-size:7px}.home-party{gap:6px}.home-party button{width:80px}}@media(prefers-reduced-motion:reduce){.town-directory .town-destination{transition:none}.town-directory .town-destination:hover,.town-directory .town-destination:focus-visible{translate:0 0}}
body[data-screen="home"] .page-heading{display:none}
/* Keep the transparent building silhouette when the global button hover applies. */
.town-directory .town-destination:hover:not(:disabled),
.town-directory .town-destination:focus,
.town-directory .town-destination:focus-visible,
.town-directory .town-destination:active{background:transparent;border-color:transparent;box-shadow:none}
.tier-damage-info{padding:9px 12px;border:1px solid #8f7846;border-radius:6px;color:#e8cf93;font-size:12px;line-height:1.6}

/* Eight original Cuồng spell motifs; no hue rotation so each weapon keeps its identity. */
.cuong-sprite {
  position: absolute; z-index: 5; pointer-events: none;
  background: url('/tactics/assets/cuong-skills.png?v=army-corn-8') no-repeat;
  background-size: 400% 200%;
  filter: drop-shadow(0 0 10px #bff8);
}
.cuong-flight { animation: cuong-flight calc(850ms / var(--combat-speed, 1)) ease-in-out both; }
.cuong-cast { animation: cuong-cast calc(850ms / var(--combat-speed, 1)) ease-out both; }
.cuong-echo { animation: cuong-echo calc(650ms / var(--combat-speed, 1)) ease-out both; animation-delay: calc(var(--echo-delay, 0ms) / var(--combat-speed, 1)); }
.cuong-dragon-saber { filter: drop-shadow(0 0 15px #ff741acc); }
.cuong-fan-wind { filter: drop-shadow(0 0 12px #74efddcc); }
.cuong-pearl-heal, .cuong-willow-heal { filter: drop-shadow(0 0 12px #e6a9ffcc); }
@keyframes cuong-flight {
  0% { opacity: 0; transform: translate(0, 0) scale(.5) scaleX(var(--facing)); }
  15% { opacity: 1; }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--travel-x), var(--travel-y)) scale(1.15) scaleX(var(--facing)); }
}
@keyframes cuong-cast {
  0% { opacity: 0; transform: translateY(-60px) scale(.35); }
  35% { opacity: 1; transform: translateY(0) scale(1.15); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.35); }
}
@keyframes cuong-echo {
  0% { opacity: 0; transform: scale(.3); }
  40% { opacity: .85; }
  100% { opacity: 0; transform: scale(1.25); }
}
@media (prefers-reduced-motion: reduce) {
  .cuong-sprite { animation: none; opacity: .85; }
  .cuong-flight { transform: translate(var(--travel-x), var(--travel-y)); }
}
.fixed-skill-area { padding: 10px 12px; border-left: 3px solid #dab66c; border-radius: 4px; background: #dab66c12; color: #f1d79e; font-size: 12px; line-height: 1.65; }
.army-supply { display: none; padding: 16px; border: 1px solid #b79d6466; border-radius: 10px; background: linear-gradient(120deg,#293b2d,#172c31); margin: 12px 0; }
body[data-screen="campaign"] .army-supply { display: block; }
.army-supply-heading,.army-recruit,.army-stock { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.army-supply-heading { justify-content:space-between; color:#efd08e; }
.army-stock { margin:12px 0; }.army-stock span { padding:7px 10px; background:#11212a; border-radius:6px; }.army-stock b { color:#f4d78b; margin-left:6px; }
.army-supply p { font-size:12px; line-height:1.7; }.army-recruit label { font-size:12px; display:grid; gap:6px; }.army-recruit input { max-width:180px; width:100%; padding:9px; }
.army-recruit .army-recruit-btn { background:#b59145; color:#151e22; border-color:#efcf8d; font-weight:700; }
@media(max-width:600px) { .army-recruit { align-items:stretch; }.army-recruit label { width:100%; }.army-recruit button { flex:1; } }

.troop-siege { --troop-atlas: url('/tactics/assets/troops-siege.png'); }
.troop-reroll-btn { margin-top:8px; border-color:#a18552; background:linear-gradient(130deg,#6b5431,#3e4334); color:#ffe0a0; }
.troop-reroll-note { display:block; font-size:10px; font-weight:400; color:#9aafa8; margin-top:5px; line-height:1.5; }
.army-choice-row > strong { min-width:0; }
.troop-guide .troop-preview { width:96px; height:128px; margin:auto; }
.troop-guide h3 { font-size:15px; }
.skill-fx-layer.fx-stone { --fx-color:#d6b58b; }
.fx-stone .skill-projectile { width:18px; height:18px; border-radius:40%; background:radial-gradient(circle at 30% 25%,#e5dccb,#71675c 65%); box-shadow:0 0 8px #d5ad7577; }
.troop-roll-panel { border:2px solid #d4ac62; border-radius:10px; padding:16px; margin:14px 0; background:linear-gradient(115deg,#493e28,#203b3a); display:flex; gap:20px; align-items:center; }
.troop-roll-panel strong { color:#ffe0a0; font-size:18px; }.troop-roll-panel p {font-size:12px;line-height:1.6;}.troop-roll-controls {min-width:240px;display:grid;gap:8px;}.troop-roll-controls label {display:grid;font-size:12px;gap:6px;}.troop-roll-controls select {max-width:100%;width:100%;}.troop-roll-controls .troop-reroll-btn {background:#b88f3f;color:#111e20;font-weight:700;min-height:42px;}.troop-roll-panel small {font-size:11px;}
@media(max-width:760px){.troop-roll-panel{display:block;}.troop-roll-controls{min-width:0;margin-top:12px;}}
.army-recruit .army-coin-btn { background:#304c62; border-color:#84c0df; color:#ddf5ff; font-weight:700; }
