:root {
  --ink: #101c31;
  --panel: #182941;
  --panel2: #20334a;
  --text: #f1eee5;
  --muted: #b4c1cc;
  --gold: #e2c48d;
  --line: #596577;
  --blue: #a2d4e3;
  --red: #ff9a95;
  --paper: #ece7d9;
  --dark: #213044;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--text);
  background: var(--ink);
  color-scheme: dark;
  font-size: 14px;
  line-height: 1.65;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  color: var(--text);
  border: 1px solid #6e7b8e;
  background: #1c3049;
  padding: 9px 18px;
  border-radius: 3px;
  transition:
    background 0.18s,
    border 0.18s;
}
button:hover {
  border-color: var(--gold);
  background: #2d4159;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.primary {
  background: var(--gold);
  color: #182333;
  font-weight: 700;
  border-color: var(--gold);
}
.primary:hover {
  background: #f1d9ac;
}
.danger {
  border-color: var(--red);
  color: var(--red);
}
a {
  color: var(--blue);
}
h1,
h2,
h3,
p {
  margin: 0 0 14px;
}
h1,
h2 {
  font-family: "Songti SC", "SimSun", serif;
  letter-spacing: 2px;
}
h1 {
  font-size: clamp(34px, 4vw, 60px);
  line-height: 1.2;
}
h2 {
  font-size: 26px;
}
h3 {
  font-size: 17px;
}
small,
.muted {
  color: var(--muted);
}
.eyebrow {
  font:
    11px/1.8 Consolas,
    monospace;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 12px;
}
.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 70% -10%, #3f587166, transparent 55%),
    radial-gradient(circle at 12% 28%, #e2c48d0e, transparent 20%),
    radial-gradient(#ccd8ee60 1px, transparent 1px);
  background-size:
    auto,
    auto,
    143px 137px;
  z-index: -1;
}
.sky:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, #101c3180);
}
header {
  height: 80px;
  padding: 12px clamp(18px, 4vw, 60px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #55647b60;
  background: #101c31e6;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 0;
  background: none;
  padding: 0;
  font-weight: 700;
  font-size: 23px;
  letter-spacing: 3px;
}
.brand img {
  width: 48px;
  height: 48px;
}
.brand-sub {
  display: block;
  font:
    9px/1.8 Consolas,
    monospace;
  letter-spacing: 1px;
  color: var(--gold);
}
nav {
  display: flex;
  gap: 8px;
}
nav button {
  font-size: 12px;
  background: none;
  padding: 7px 10px;
  border-color: transparent;
}
main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 36px 40px;
}
.panel {
  position: relative;
  background: linear-gradient(125deg, #20334adb, #15273fed);
  border: 1px solid #697588;
  padding: 26px;
  border-radius: 3px;
}
.panel:before {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 12px;
  height: 12px;
  border-top: 1px solid var(--gold);
  border-left: 1px solid var(--gold);
  pointer-events: none;
}
.panel:after {
  content: "";
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 12px;
  height: 12px;
  border-bottom: 1px solid var(--gold);
  border-right: 1px solid var(--gold);
  pointer-events: none;
}
.hero {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  gap: 30px;
  align-items: stretch;
}
.title-art {
  min-height: 575px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 42px;
  background: linear-gradient(180deg, #213855, #101b2e);
  border: 1px solid #65778b;
  position: relative;
}
.title-art:before {
  content: "";
  position: absolute;
  inset: 35px 0 180px;
  background: url("assets/astrolabe.svg") center/contain no-repeat;
  opacity: 0.24;
  transform: rotate(-12deg);
}
.title-art h1,
.title-art p,
.title-art .facts {
  position: relative;
}
.title-art p {
  max-width: 380px;
  margin-top: 22px;
}
.title-art .eyebrow {
  position: absolute;
  top: 40px;
  left: 42px;
}
.facts {
  display: flex;
  gap: 28px;
  border-top: 1px solid #a1a8ad80;
  padding-top: 24px;
  margin-top: 25px;
}
.facts strong {
  display: block;
  font: 28px/1.4 Georgia;
  color: var(--gold);
}
form label {
  display: block;
  margin: 15px 0 5px;
  color: var(--muted);
}
input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  background: #0f1c2e;
  border: 1px solid #74818d;
  color: var(--text);
  border-radius: 3px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.mode {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #0f2037;
  border: 1px solid #6e7b8e;
  padding: 12px;
  margin: 10px 0;
  line-height: 1.5;
}
.mode input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  margin: 3px 0;
}
.mode small {
  display: block;
  margin-top: 3px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.triptych {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 30px;
  border-top: 1px solid #778295;
}
.triptych article {
  padding: 24px;
  border-right: 1px solid #778295;
}
.triptych article:last-child {
  border: 0;
}
.wheel-page {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 32px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 20px;
}
.step-track {
  display: flex;
  gap: 5px;
  margin: 8px 0 20px;
}
.step-track i {
  flex: 1;
  height: 3px;
  background: #35485f;
}
.step-track i.done {
  background: var(--gold);
}
.wheel-stage {
  text-align: center;
}
.wheel-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 12px;
}
.wheel-controls button {
  padding: 4px 9px;
}
.wheel-wrap {
  position: relative;
  width: min(460px, 100%);
  margin: 0 auto;
  aspect-ratio: 1;
  filter: drop-shadow(0 16px 25px #0006);
}
.rotor {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  will-change: transform;
}
.rotor svg {
  width: 100%;
  height: 100%;
  display: block;
}
.pointer {
  position: absolute;
  left: calc(50% - 11px);
  top: 0;
  width: 22px;
  height: 34px;
  background: linear-gradient(90deg, #ad8748, #f6dfa3, #bc995f);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 2px 3px #000);
  z-index: 2;
}
.wheel-center {
  position: absolute;
  top: 37%;
  left: 31%;
  width: 38%;
  height: 26%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.wheel-center strong {
  font: 36px Georgia;
  color: var(--gold);
}
.wheel-center span {
  font-size: 11px;
  color: var(--muted);
}
.wheel-help {
  max-width: 520px;
  margin: 16px auto;
  color: var(--muted);
}
.wheel-result {
  margin: 16px auto;
  padding: 16px;
  background: var(--paper);
  color: var(--dark);
  border-left: 4px solid #7ba5b3;
  max-width: 550px;
  text-align: left;
}
.wheel-result h3,
.wheel-result strong {
  color: #624618;
}
.hidden-badge {
  display: inline-block;
  background: #e7c789;
  color: #352812;
  padding: 2px 7px;
  border: 1px solid #d3aa60;
  margin-right: 7px;
  font-size: 12px;
  font-weight: 700;
}
.options-panel {
  padding: 0;
  max-height: 650px;
  display: flex;
  flex-direction: column;
}
.options-head {
  padding: 16px 20px;
  border-bottom: 1px solid #6e7b8e;
  display: flex;
  justify-content: space-between;
}
.options-list {
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 18px;
  border-bottom: 1px solid #576579;
  color: var(--text);
  font-size: 13px;
}
.option.selected {
  background: var(--paper);
  color: #25354c;
  font-weight: 700;
  border-left: 4px solid #567e8f;
}
.option .pct {
  font: 11px Consolas;
  white-space: nowrap;
}
.option .index {
  font: 11px Consolas;
  color: inherit;
  opacity: 0.8;
  margin-right: 10px;
}
.archive {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.stat {
  background: #122238;
  padding: 10px 12px;
  border: 1px solid #637185;
  min-width: 0;
}
.stat span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  white-space: normal;
}
.stat strong {
  display: block;
  font: 23px/1.4 Georgia;
  color: var(--text);
}
.stat small {
  display: block;
  font-size: 10px;
  color: var(--gold);
  line-height: 1.4;
}
.camp-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 28px;
}
.camp-info {
  margin: 20px 0;
  padding: 20px;
  border: 1px solid #697588;
  background: #13263b;
}
.journey-map {
  display: flex;
  gap: 7px;
  overflow: auto;
  margin: 20px 0;
}
.journey-map span {
  flex: 1;
  min-width: 48px;
  padding: 10px 3px;
  text-align: center;
  background: #15273d;
  border-bottom: 2px solid #647185;
  font-size: 11px;
}
.journey-map .current {
  border-color: var(--gold);
  color: var(--gold);
}
.skill-detail {
  border-left: 2px solid var(--gold);
  padding: 12px 14px;
  margin: 9px 0;
  background: #132338;
  font-size: 12px;
  line-height: 1.8;
}
.skill-detail h3 {
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--gold);
}
.skill-detail small {
  display: block;
  margin-bottom: 4px;
}
.battle-page {
  height: calc(100dvh - 136px);
  min-height: 550px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mission {
  border-left: 3px solid var(--gold);
  background: #203349;
  padding: 10px 16px;
  flex: none;
}
.mission p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.mission-top {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}
.mission strong {
  font-size: 16px;
}
.battle-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(305px, 1fr);
  gap: 14px;
  min-height: 0;
  flex: 1;
}
.arena {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 8px;
}
.unit-side {
  background: #101f33;
  border: 1px solid #687589;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.side-title {
  padding: 5px 12px;
  border-bottom: 1px solid #526177;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.units {
  overflow: auto;
  min-height: 0;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 6px;
  touch-action: pan-y;
}
.unit {
  position: relative;
  padding: 8px 10px;
  background: #20344a;
  border: 1px solid #708196;
  border-radius: 3px;
  font-size: 11px;
  min-height: 107px;
  cursor: pointer;
}
.unit.selected {
  border: 2px solid var(--gold);
  padding: 7px 9px;
  background: #2e3d50;
}
.unit.dead {
  opacity: 0.48;
}
.unit.actor {
  box-shadow: inset 0 0 0 1px var(--blue);
}
.unit-top {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
}
.unit-name {
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.portrait {
  width: 32px;
  height: 32px;
  object-fit: contain;
  background: #112337;
  border-radius: 50%;
  border: 1px solid #b6a078;
  flex: none;
}
.unit-tier {
  font-size: 10px;
  color: var(--gold);
  text-align: right;
  line-height: 1.3;
  max-width: 95px;
}
.unit-line {
  display: flex;
  justify-content: space-between;
  margin: 3px 0 2px;
}
.bar {
  height: 4px;
  background: #0a1525;
  overflow: hidden;
  border-radius: 2px;
}
.bar > i {
  display: block;
  height: 100%;
  background: #96cfba;
  width: 0;
  transition: width 0.3s;
}
.bar.energy > i {
  background: #91b7e9;
}
.tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 5px;
}
.tags span {
  font-size: 10px;
  background: #132439;
  padding: 0 5px;
  border: 1px solid #658097;
}
.tags .res {
  color: #f5dda9;
  border-color: #bd9b5d;
}
.side-stack {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 10px;
}
.battle-skills {
  flex: 1;
  overflow: auto;
  border: 1px solid #637185;
  padding: 10px 14px;
  background: #15273f;
  touch-action: pan-y;
}
.combat-log {
  height: 140px;
  overflow: auto;
  padding: 10px 14px;
  background: #0c1b2b;
  border: 1px solid #5d6c80;
  font-size: 11px;
}
.combat-log p {
  margin: 2px 0;
}
.combat-log .enemy {
  color: #ffc1ba;
}
.combat-log .gold {
  color: var(--gold);
}
.combat-log .death {
  color: #ff9f9a;
}
.battle-file {
  padding: 12px;
  background: #1b2d43;
  border: 1px solid #6e7b8e;
}
.battle-file .archive {
  gap: 4px;
}
.battle-file .stat {
  padding: 5px 9px;
}
.battle-file .stat strong {
  font-size: 18px;
}
.battle-file .stat span {
  font-size: 10px;
}
.battle-file .stat small {
  font-size: 9px;
}
.command-bar {
  padding: 12px 16px;
  border: 1px solid #778295;
  background: #172b41;
  flex: none;
}
.command-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--gold);
  margin-bottom: 8px;
}
.commands {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.commands button {
  padding: 8px 13px;
  font-size: 12px;
}
.commands .skill-btn {
  border-color: #c3aa76;
  color: #f6d99f;
}
.branch-box {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 7px 0;
  font-size: 12px;
}
.branch-box select {
  width: auto;
  padding: 3px 10px;
  max-width: 230px;
}
.battle-tabs {
  display: none;
}
.gain-page {
  max-width: 1000px;
  margin: 20px auto;
}
.gain-head {
  text-align: center;
  padding: 24px;
}
.gain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.gain-card {
  padding: 20px;
  border: 1px solid #8b846c;
  background: #162b42;
}
.gain-card strong {
  font: 28px Georgia;
  display: block;
  color: var(--gold);
}
.gain-card .increase {
  font: 19px Georgia;
  color: #a8dfbe;
  margin-left: 12px;
}
.gain-card p {
  margin: 6px 0;
}
.gain-arrow {
  color: var(--muted);
  font-size: 15px;
  margin: 0 8px;
}
.gain-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #697588;
  padding: 22px 0;
  margin-top: 25px;
}
.ending {
  max-width: 1120px;
  margin: auto;
}
.ending-cover {
  padding: 38px;
  background: linear-gradient(130deg, #2c3f56, #152339);
  border-top: 4px solid var(--gold);
  position: relative;
}
.ending-cover:after {
  content: "";
  position: absolute;
  right: 40px;
  top: 30px;
  width: 110px;
  height: 110px;
  background: url("assets/astrolabe.svg") center/contain no-repeat;
  opacity: 0.25;
}
.ending-story {
  padding: 25px;
  background: var(--paper);
  color: #273748;
  line-height: 2;
}
.ending-story p:last-child {
  margin: 0;
}
.ending-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}
.ledger {
  padding: 20px;
  border: 1px solid #718098;
  background: #14283e;
}
.ledger-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid #55647a;
  font-size: 12px;
}
.ledger-row strong {
  color: var(--gold);
}
.library-top {
  display: flex;
  gap: 12px;
  margin: 20px 0;
}
.library-top input {
  flex: 1;
}
.library-top select {
  width: 140px;
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.library-card {
  background: #1b2f47;
  padding: 15px;
  border: 1px solid #6c7b8e;
  cursor: pointer;
}
.library-card:hover {
  border-color: var(--gold);
}
.library-card .portrait {
  width: 54px;
  height: 54px;
  float: right;
}
.library-card h3 {
  font-size: 16px;
  color: var(--gold);
  margin: 8px 0;
}
.library-card p {
  font-size: 12px;
  margin: 0;
}
.rules {
  max-width: 1000px;
  margin: auto;
}
.rules section {
  margin-bottom: 20px;
}
.rules ul {
  padding-left: 21px;
}
.rules li {
  margin: 7px 0;
}
.feedback {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  align-items: stretch;
}
.feedback textarea {
  min-height: 260px;
}
.feedback aside h2 {
  font-size: 24px;
}
.loading {
  padding: 100px;
  text-align: center;
}
dialog {
  color: var(--text);
  background: #172a42;
  border: 1px solid var(--gold);
  padding: 30px;
  max-width: min(720px, 92vw);
  max-height: 85dvh;
  border-radius: 3px;
  box-shadow: 0 20px 100px #0008;
}
dialog::backdrop {
  background: #030916c9;
  backdrop-filter: blur(4px);
}
dialog .close {
  float: right;
}
.leader-dialog {
  text-align: center;
  min-width: min(520px, 90vw);
  border-color: #e9958b;
  padding: 48px 30px;
}
.leader-dialog .eyebrow {
  color: #ff928a;
}
.leader-dialog h2 {
  color: #ffc0b7;
  font-size: 32px;
}
.leader-dialog .leader-label {
  color: #ff746a;
  font-size: 21px;
  letter-spacing: 8px;
  margin: 10px 0;
}
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--paper);
  color: #203044;
  border: 1px solid #b0a489;
  padding: 12px 22px;
  z-index: 50;
  max-width: 85vw;
}
.hit-flash {
  animation: hitFlash 0.4s;
}
.float-text {
  position: fixed;
  z-index: 60;
  color: #fff;
  font-weight: 800;
  font-size: 24px;
  text-shadow:
    0 2px 3px #000,
    0 0 8px #000;
  pointer-events: none;
  animation: floatNumber 0.9s forwards;
}
.reaction-text {
  font-size: 17px;
  color: #f5d58c;
}
.beam {
  position: fixed;
  z-index: 45;
  height: 3px;
  transform-origin: left center;
  background: linear-gradient(90deg, transparent, #dceafb);
  box-shadow: 0 0 9px 3px #b3daf880;
  pointer-events: none;
  animation: beam 0.4s forwards;
}
.reveal {
  animation: reveal 0.5s;
}
.mastery {
  height: 4px;
  background: #0d1a2d;
  margin: 9px 0;
}
.mastery i {
  display: block;
  background: var(--gold);
  height: 100%;
}
#fx {
  pointer-events: none;
}
.no-results {
  padding: 40px;
  color: var(--muted);
}
.text-link {
  background: none;
  border: 0;
  padding: 5px;
  color: var(--blue);
}
.sub-note {
  margin-top: 15px;
  font-size: 11px;
  color: var(--muted);
}
@keyframes floatNumber {
  to {
    transform: translateY(-55px);
    opacity: 0;
  }
}
@keyframes hitFlash {
  30% {
    filter: brightness(1.7);
    transform: translateX(3px);
  }
}
@keyframes beam {
  0% {
    opacity: 0;
    scale: 0.2 1;
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (min-width: 1450px) {
  .battle-page {
    height: calc(100dvh - 136px);
  }
}
@media (max-width: 1050px) {
  main {
    padding: 22px;
  }
  .wheel-page {
    grid-template-columns: 1fr 320px;
    gap: 20px;
  }
  .library-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .hero {
    gap: 20px;
  }
  .title-art {
    padding: 30px;
  }
  .battle-grid {
    grid-template-columns: 1.35fr 1fr;
  }
  .units {
    grid-template-columns: 1fr;
  }
  .camp-layout {
    grid-template-columns: 1fr 310px;
  }
}
@media (max-width: 720px) {
  header {
    height: 68px;
    padding: 10px 14px;
    gap: 10px;
  }
  .brand {
    font-size: 18px;
    gap: 8px;
    letter-spacing: 1px;
  }
  .brand img {
    width: 32px;
    height: 32px;
  }
  .brand-sub {
    font-size: 7px;
    letter-spacing: 0;
  }
  nav {
    gap: 0;
  }
  nav button {
    font-size: 10px;
    padding: 5px 7px;
  }
  nav button[data-nav="rules"],
  #export {
    display: none;
  }
  main {
    padding: 18px 14px 26px;
  }
  .hero,
  .wheel-page,
  .camp-layout,
  .feedback {
    grid-template-columns: 1fr;
  }
  .title-art {
    min-height: 330px;
    padding: 30px;
  }
  .title-art:before {
    inset: 15px 0 70px;
  }
  .title-art .eyebrow {
    top: 20px;
    left: 30px;
  }
  .title-art h1 {
    font-size: 36px;
  }
  .title-art p {
    margin-top: 12px;
  }
  .facts {
    margin-top: 16px;
    padding-top: 12px;
  }
  .facts strong {
    font-size: 23px;
  }
  .panel {
    padding: 20px;
  }
  .triptych {
    grid-template-columns: 1fr;
  }
  .triptych article {
    border-right: 0;
    border-bottom: 1px solid #526177;
    padding: 18px 0;
  }
  .form-grid {
    gap: 10px;
  }
  .wheel-wrap {
    width: min(350px, 92vw);
  }
  .wheel-help {
    font-size: 12px;
  }
  .options-panel {
    padding: 0;
    max-height: 330px;
  }
  .wheel-page {
    gap: 16px;
  }
  .page-head {
    align-items: flex-start;
  }
  .page-head h2 {
    font-size: 22px;
  }
  .archive {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stat {
    padding: 9px;
  }
  .stat strong {
    font-size: 20px;
  }
  .gain-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .gain-card {
    padding: 14px;
  }
  .gain-card strong {
    font-size: 22px;
  }
  .gain-card .increase {
    font-size: 16px;
  }
  .gain-foot {
    gap: 20px;
    align-items: flex-start;
  }
  .ending-grid {
    grid-template-columns: 1fr;
  }
  .ending-cover {
    padding: 28px 22px;
  }
  .ending-cover:after {
    right: 15px;
    width: 75px;
    height: 75px;
  }
  .ending-story {
    padding: 20px;
    font-size: 13px;
  }
  .library-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .library-card {
    padding: 12px;
  }
  .library-card .portrait {
    width: 38px;
    height: 38px;
  }
  .library-top {
    gap: 7px;
    flex-wrap: wrap;
  }
  .library-top input {
    width: 100%;
    flex-basis: 100%;
  }
  .library-top select {
    flex: 1;
    font-size: 12px;
  }
  .battle-page {
    height: calc(100dvh - 100px);
    min-height: 0;
    gap: 8px;
  }
  .mission {
    padding: 8px 10px;
  }
  .mission strong {
    font-size: 13px;
  }
  .mission p {
    font-size: 10px;
    line-height: 1.5;
    max-height: 45px;
    overflow: auto;
  }
  .mission-top small {
    font-size: 10px;
    white-space: nowrap;
  }
  .battle-grid {
    display: flex;
    min-height: 0;
  }
  .arena {
    width: 100%;
    flex: 1;
  }
  .units {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 5px;
    gap: 5px;
  }
  .unit {
    padding: 6px 7px;
    min-height: 105px;
    font-size: 10px;
  }
  .unit.selected {
    padding: 5px 6px;
  }
  .unit-name {
    font-size: 11px;
    gap: 5px;
  }
  .unit-tier {
    font-size: 9px;
    max-width: 64px;
  }
  .portrait {
    width: 26px;
    height: 26px;
  }
  .tags span {
    font-size: 9px;
    padding: 0 3px;
  }
  .side-title {
    padding: 3px 8px;
    font-size: 11px;
  }
  .side-stack {
    width: 100%;
    display: none;
  }
  .battle-tabs {
    display: flex;
    gap: 5px;
    flex: none;
  }
  .battle-tabs button {
    flex: 1;
    font-size: 11px;
    padding: 5px 2px;
  }
  .battle-tabs .chosen {
    background: var(--paper);
    color: #26374a;
    border-color: var(--paper);
  }
  .battle-page[data-tab="skills"] .arena,
  .battle-page[data-tab="log"] .arena,
  .battle-page[data-tab="file"] .arena {
    display: none;
  }
  .battle-page[data-tab="skills"] .side-stack,
  .battle-page[data-tab="log"] .side-stack,
  .battle-page[data-tab="file"] .side-stack {
    display: flex;
  }
  .battle-page[data-tab="arena"] .side-stack {
    display: none;
  }
  .battle-skills,
  .combat-log,
  .battle-file {
    display: none;
  }
  .battle-page[data-tab="skills"] .battle-skills {
    display: block;
    flex: 1;
  }
  .battle-page[data-tab="log"] .combat-log {
    display: block;
    height: auto;
    flex: 1;
    font-size: 12px;
  }
  .battle-page[data-tab="file"] .battle-file {
    display: block;
    overflow: auto;
    flex: 1;
  }
  .battle-file .archive {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .battle-file .stat {
    padding: 13px;
  }
  .battle-file .stat strong {
    font-size: 24px;
  }
  .battle-file .stat span {
    font-size: 12px;
  }
  .battle-file .stat small {
    font-size: 11px;
  }
  .command-bar {
    padding: 8px 10px;
  }
  .command-meta {
    font-size: 10px;
    margin-bottom: 5px;
  }
  .commands {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
  }
  .commands button {
    padding: 7px 3px;
    font-size: 11px;
    min-height: 34px;
  }
  .branch-box {
    font-size: 11px;
    margin: 4px 0;
  }
  .branch-box select {
    font-size: 11px;
  }
  .skill-detail {
    font-size: 12px;
  }
  .skill-detail h3 {
    font-size: 14px;
  }
  dialog {
    padding: 22px;
  }
  .leader-dialog {
    padding: 35px 20px;
  }
  .leader-dialog h2 {
    font-size: 26px;
  }
  .sub-note {
    font-size: 10px;
  }
  .gain-head h1 {
    font-size: 32px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
.title-art {
  background:
    linear-gradient(180deg, #11223800 0%, #101b2e44 35%, #101b2ef2 78%),
    url("assets/horizon.svg") center 30% / cover no-repeat;
}
.title-art:before {
  opacity: 0.13;
}
.title-art .eyebrow {
  color: #efdbaf;
}
.battle-skills {
  min-height: 150px;
}
.battle-file .eyebrow {
  margin-bottom: 4px;
}
.battle-file p {
  margin-bottom: 10px;
}
.battle-file h3 {
  margin-bottom: 6px;
}
.battle-file .sub-note {
  margin-top: 8px;
}
.battle-file .mastery {
  margin: 6px 0;
}

#more {
  display: none;
}
@media (max-width: 720px) {
  #more {
    display: block;
  }
  nav button {
    padding: 5px;
  }
  header {
    gap: 5px;
  }
  .brand-sub {
    font-size: 6.5px;
  }
}
