:root {
  color-scheme: dark;
  --ink: #17140f;
  --ink-soft: #2b261d;
  --paper: #e7dcc1;
  --paper-deep: #cdbf9d;
  --cinnabar: #b94232;
  --cinnabar-bright: #e15c42;
  --gold: #d5ad58;
  --jade: #6f9078;
  --food: #d3b761;
  --danger: #b84736;
  --hex-w: 13.75%;
  --hex-h: 13.7%;
  font-family: "STKaiti", "KaiTi", "FangSong", "Noto Serif SC", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--paper);
  background:
    radial-gradient(circle at 18% 20%, rgba(158, 62, 43, 0.13), transparent 28%),
    radial-gradient(circle at 82% 80%, rgba(176, 137, 70, 0.1), transparent 30%),
    #0f0d0a;
}

button {
  font: inherit;
}

.game-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 18px;
  position: relative;
}

.phone-frame {
  width: min(100%, 430px);
  height: min(920px, calc(100dvh - 28px));
  min-height: 650px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(231, 220, 193, 0.18);
  border-radius: 28px;
  background:
    linear-gradient(rgba(23, 20, 15, 0.96), rgba(23, 20, 15, 0.99)),
    repeating-linear-gradient(90deg, transparent 0 4px, rgba(255, 255, 255, 0.02) 4px 5px);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55), inset 0 0 60px rgba(0, 0, 0, 0.2);
}

.phone-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  border-radius: 28px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: max(12px, env(safe-area-inset-top)) 18px 10px;
  border-bottom: 1px solid rgba(231, 220, 193, 0.08);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.seal {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(231, 220, 193, 0.75);
  color: var(--paper);
  background: var(--cinnabar);
  box-shadow: inset 0 0 0 2px var(--cinnabar), inset 0 0 0 3px rgba(231, 220, 193, 0.55);
  transform: rotate(-3deg);
  font-size: 20px;
  font-weight: 800;
}

.eyebrow,
.brand-block h1 {
  margin: 0;
}

.eyebrow {
  color: rgba(231, 220, 193, 0.55);
  font-family: system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0.16em;
}

.brand-block h1 {
  margin-top: 2px;
  font-size: 19px;
  letter-spacing: 0.18em;
}

.icon-button,
.text-button {
  border: 1px solid rgba(231, 220, 193, 0.18);
  color: rgba(231, 220, 193, 0.76);
  background: rgba(231, 220, 193, 0.045);
  cursor: pointer;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.icon-button.muted {
  opacity: 0.45;
  text-decoration: line-through;
}

.status-strip {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 7px;
  padding: 9px 14px 7px;
}

.status-card {
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid rgba(231, 220, 193, 0.09);
  border-radius: 10px;
  background: rgba(231, 220, 193, 0.035);
}

.status-label,
.status-card small {
  display: block;
  overflow: hidden;
  color: rgba(231, 220, 193, 0.5);
  font-family: system-ui, sans-serif;
  font-size: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.status-card strong {
  display: block;
  margin-top: 1px;
  color: var(--paper);
  font-family: system-ui, sans-serif;
  font-size: 17px;
}

.food-status strong {
  color: var(--food);
}

.mini-track,
.morale-track {
  height: 3px;
  overflow: hidden;
  margin-top: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.mini-track span,
.morale-track span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cinnabar), var(--cinnabar-bright));
  transition: width 240ms ease;
}

.battlefield-wrap {
  min-height: 0;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 2px 8px 4px;
}

.battlefield-wrap::before {
  content: "";
  position: absolute;
  inset: 4% 5%;
  border: 1px solid rgba(205, 191, 157, 0.09);
  border-radius: 50% 42% 48% 44%;
  background:
    linear-gradient(rgba(218, 205, 172, 0.93), rgba(198, 183, 145, 0.9)),
    repeating-linear-gradient(0deg, rgba(64, 52, 35, 0.035) 0 1px, transparent 1px 5px);
  box-shadow: inset 0 0 60px rgba(54, 43, 29, 0.28), 0 12px 30px rgba(0, 0, 0, 0.2);
  transform: rotate(-0.5deg);
}

.battlefield {
  width: min(100%, 390px);
  aspect-ratio: 320 / 365;
  position: relative;
  z-index: 2;
  isolation: isolate;
}

.map-refresh-button {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 18;
  display: grid;
  grid-template-columns: 30px auto;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  min-width: 88px;
  min-height: 50px;
  padding: 6px 10px 6px 7px;
  border: 1px solid rgba(230, 190, 102, 0.66);
  border-radius: 12px;
  color: #f4dfac;
  background: linear-gradient(145deg, rgba(102, 50, 34, 0.96), rgba(47, 31, 23, 0.96));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.34), inset 0 0 15px rgba(218, 153, 69, 0.1);
  cursor: pointer;
  animation: mapRefreshReady 1.5s ease-in-out infinite alternate;
}

.map-refresh-button.hidden { display: none; }

.map-refresh-button span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 28px;
  height: 34px;
  border-radius: 7px;
  color: #49271d;
  background: #d7b568;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 22px;
  font-weight: 900;
}

.map-refresh-button strong {
  align-self: end;
  font-size: 14px;
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.map-refresh-button em {
  align-self: start;
  color: rgba(244, 223, 172, 0.72);
  font-family: system-ui, sans-serif;
  font-size: 10px;
  font-style: normal;
  line-height: 1.3;
}

.map-refresh-button.blocked {
  border-color: rgba(170, 154, 125, 0.5);
  color: #d0c3a5;
  filter: saturate(0.55);
  animation: none;
}

@keyframes mapRefreshReady {
  from { transform: translateY(0); filter: brightness(0.96); }
  to { transform: translateY(-2px); filter: brightness(1.1); }
}

.battlefield::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 2% 1%;
  border-radius: 42% 48% 44% 46%;
  opacity: 0.3;
  pointer-events: none;
}

.battlefield[data-terrain="river"]::before,
.battlefield[data-terrain="fogRiver"]::before,
.battlefield[data-terrain="fireRiver"]::before {
  background: repeating-radial-gradient(ellipse at 50% 8%, transparent 0 13px, rgba(45, 91, 103, 0.34) 14px 16px, transparent 17px 28px);
  clip-path: polygon(0 4%, 100% 0, 92% 100%, 7% 96%);
}

.battlefield[data-terrain="city"]::before,
.battlefield[data-terrain="temple"]::before,
.battlefield[data-terrain="siege"]::before {
  background:
    linear-gradient(90deg, transparent 48%, rgba(82, 58, 36, 0.26) 49% 51%, transparent 52%),
    repeating-linear-gradient(0deg, transparent 0 35px, rgba(82, 58, 36, 0.18) 36px 38px);
  border: 4px double rgba(91, 61, 35, 0.2);
  border-radius: 4px 4px 28% 28%;
}

.battlefield[data-terrain="pass"]::before,
.battlefield[data-terrain="mountain"]::before,
.battlefield[data-terrain="chase"]::before {
  background:
    radial-gradient(ellipse at 4% 42%, rgba(63, 76, 55, 0.42) 0 18%, transparent 19%),
    radial-gradient(ellipse at 96% 56%, rgba(63, 76, 55, 0.38) 0 20%, transparent 21%);
}

.battlefield[data-terrain="fire"]::before,
.battlefield[data-terrain="fireRiver"]::before {
  box-shadow: inset 0 0 70px rgba(160, 53, 29, 0.26);
}

.battlefield[data-terrain="mist"]::before,
.battlefield[data-terrain="fogRiver"]::before {
  opacity: 0.42;
  filter: blur(3px);
}

.boss-panel {
  position: absolute;
  z-index: 19;
  top: 8px;
  left: 50%;
  width: min(72%, 286px);
  padding: 7px 10px 8px;
  border: 1px solid rgba(239, 201, 118, 0.34);
  border-radius: 9px;
  color: #f3dfb6;
  background: rgba(45, 25, 20, 0.91);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.34), inset 0 0 18px rgba(130, 48, 35, 0.18);
  transform: translateX(-50%);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.boss-panel.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -8px);
}

.boss-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.boss-heading strong {
  font-size: 11px;
  letter-spacing: 0.12em;
}

.boss-heading small {
  color: rgba(243, 223, 182, 0.62);
  font-family: system-ui, sans-serif;
  font-size: 8px;
}

.boss-track {
  height: 4px;
  overflow: hidden;
  margin-top: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.boss-track span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #dc6b42, #b8392d, #e4b75b);
  transform-origin: left;
  transition: width 160ms ease;
}

.grid-layer,
.unit-layer,
.effect-layer,
.route-layer {
  position: absolute;
  inset: 0;
}

.route-layer { z-index: 1; }
.grid-layer { z-index: 2; }
.unit-layer { z-index: 3; }
.effect-layer { z-index: 4; }

.unit-layer,
.effect-layer,
.route-layer {
  pointer-events: none;
}

.grid-layer {
  pointer-events: auto;
}

.route-layer {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.route-line {
  fill: none;
  stroke: rgba(86, 65, 40, 0.44);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#roughen);
}

.route-dash {
  fill: none;
  stroke: rgba(151, 67, 49, 0.42);
  stroke-width: 2;
  stroke-dasharray: 5 8;
  stroke-linecap: round;
  animation: routeMarch 3s linear infinite;
}

.route-dash.route-1 { animation-direction: reverse; }
.route-dash.route-2 { stroke-dasharray: 2 7; }
.route-dash.route-3 { stroke-dasharray: 8 5; animation-duration: 2.4s; }

.battlefield[data-terrain="river"] .route-line,
.battlefield[data-terrain="fogRiver"] .route-line,
.battlefield[data-terrain="fireRiver"] .route-line {
  stroke: rgba(45, 76, 82, 0.5);
}

.battlefield[data-terrain="river"] .route-dash,
.battlefield[data-terrain="fogRiver"] .route-dash,
.battlefield[data-terrain="fireRiver"] .route-dash {
  stroke: rgba(196, 147, 63, 0.62);
}

@keyframes routeMarch {
  to { stroke-dashoffset: -26; }
}

.hex-cell {
  position: absolute;
  width: var(--hex-w);
  height: var(--hex-h);
  padding: 0;
  border: 0;
  outline: none;
  clip-path: polygon(50% 0, 96% 24%, 96% 76%, 50% 100%, 4% 76%, 4% 24%);
  color: #34291e;
  background: rgba(237, 224, 192, 0.72);
  cursor: default;
  transform: translateZ(0);
  transition: filter 160ms ease, transform 200ms ease, background 220ms ease, opacity 180ms ease;
}

.hex-cell.concealed {
  visibility: hidden;
  opacity: 0;
  transform: scale(0.56);
  pointer-events: none;
}

.hex-cell::before {
  content: "";
  position: absolute;
  inset: 3px;
  clip-path: inherit;
  border: 1px solid rgba(78, 58, 39, 0.2);
  background:
    radial-gradient(circle at 42% 34%, rgba(255, 255, 255, 0.24), transparent 35%),
    rgba(233, 219, 184, 0.12);
  pointer-events: none;
}

.hex-cell .glyph {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: clamp(17px, 5.2vw, 25px);
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.22);
}

.hex-cell .cell-cost,
.hex-cell .cell-badge {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 4px;
  translate: -50% 0;
  padding: 1px 4px;
  border-radius: 999px;
  color: #f2e6c8;
  background: rgba(40, 31, 22, 0.78);
  font-family: system-ui, sans-serif;
  font-size: 7px;
  line-height: 1.2;
  white-space: nowrap;
}

.hex-cell.fog {
  color: rgba(218, 205, 172, 0.22);
  background:
    radial-gradient(circle at 44% 35%, rgba(94, 88, 76, 0.18), transparent 45%),
    #292721;
  cursor: not-allowed;
}

.hex-cell.fog::before {
  border-color: rgba(220, 207, 174, 0.08);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.03), transparent 58%);
}

.hex-cell.fog .glyph {
  font-size: 18px;
  text-shadow: none;
}

.hex-cell.frontier {
  color: #e0bc67;
  background:
    radial-gradient(circle at 50% 42%, rgba(213, 173, 88, 0.2), transparent 48%),
    #37352e;
  cursor: pointer;
  animation: frontierPulse 1.7s ease-in-out infinite;
}

.hex-cell.frontier:hover,
.hex-cell.frontier:focus-visible {
  filter: brightness(1.25);
  transform: scale(1.06);
}

@keyframes frontierPulse {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(213, 173, 88, 0.2)); }
  50% { filter: drop-shadow(0 0 8px rgba(213, 173, 88, 0.85)); }
}

.hex-cell.path {
  background: rgba(188, 165, 123, 0.74);
}

.hex-cell.path::after {
  content: "";
  position: absolute;
  z-index: 1;
  width: 7px;
  height: 7px;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  background: rgba(74, 52, 34, 0.25);
  transform: translate(-50%, -50%);
}

.hex-cell.path.route-entry {
  color: #ead69d;
  background: linear-gradient(145deg, #713c31, #3f3028);
  filter: drop-shadow(0 0 6px rgba(139, 50, 37, 0.28));
}

.hex-cell.path.route-entry::after {
  display: none;
}

.hex-cell.path.route-entry .glyph {
  font-size: clamp(16px, 4.8vw, 22px);
}

.hex-cell.path.route-junction:not(.route-entry)::after {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(225, 190, 111, 0.58);
  background: rgba(116, 54, 39, 0.58);
  box-shadow: 0 0 0 3px rgba(225, 190, 111, 0.12);
}

.hex-cell.camp {
  color: #f0dfbb;
  background: #7d3228;
  filter: drop-shadow(0 4px 7px rgba(99, 34, 25, 0.28));
}

.hex-cell.camp.shielded {
  color: #fff1c8;
  background: #5a5f48;
  filter: drop-shadow(0 0 11px rgba(213, 189, 108, 0.85));
}

.hex-cell.hero {
  color: #f3e5c5;
  background: #35483b;
  filter: drop-shadow(0 3px 6px rgba(36, 58, 45, 0.35));
}

.hex-cell.hero.hero-zhang {
  background: #54422b;
}

.hex-cell.hero.hero-zhou {
  color: #ffe7b0;
  background: #713b32;
  filter: drop-shadow(0 3px 8px rgba(121, 52, 39, 0.45));
}

.hex-cell.hero.hero-zhao { color: #edf2ed; background: #4b6062; filter: drop-shadow(0 3px 8px rgba(79, 111, 113, 0.48)); }
.hex-cell.hero.hero-huang { color: #fff0ba; background: #735b2e; filter: drop-shadow(0 3px 8px rgba(137, 99, 38, 0.46)); }
.hex-cell.hero.hero-sun { color: #ffe1df; background: #713f51; filter: drop-shadow(0 3px 8px rgba(121, 55, 76, 0.46)); }
.hex-cell.hero.hero-cao,
.hex-cell.hero.hero-xiahou,
.hex-cell.hero.hero-zhangliao,
.hex-cell.hero.hero-xuchu,
.hex-cell.hero.hero-guojia,
.hex-cell.hero.hero-dianwei,
.hex-cell.hero.hero-xunyu,
.hex-cell.hero.hero-sima { color: #e3ebef; background: #465663; filter: drop-shadow(0 3px 8px rgba(63, 83, 98, 0.5)); }
.hex-cell.hero.hero-liubei,
.hex-cell.hero.hero-zhuge,
.hex-cell.hero.hero-machao,
.hex-cell.hero.hero-pangtong { color: #e7f0d3; background: #4e6541; filter: drop-shadow(0 3px 8px rgba(65, 92, 54, 0.48)); }
.hex-cell.hero.hero-sunquan,
.hex-cell.hero.hero-ganning,
.hex-cell.hero.hero-luxun,
.hex-cell.hero.hero-huanggai,
.hex-cell.hero.hero-taishici,
.hex-cell.hero.hero-lvmeng { color: #ffe7b0; background: #7a4330; filter: drop-shadow(0 3px 8px rgba(127, 67, 42, 0.5)); }

.hex-cell.forest {
  color: #304b39;
  background: #b7b88f;
  cursor: pointer;
}

.hex-cell.supply {
  color: #6f5221;
  background: #d4c38e;
}

.hex-cell.hero-slot {
  color: #70452d;
  background: #c9af83;
  cursor: pointer;
}

.hex-cell.ambush {
  color: #7c2f25;
  background: #c99b79;
}

.hex-cell.outpost {
  color: #f1ddb0;
  background:
    radial-gradient(circle at 50% 38%, rgba(224, 183, 101, 0.18), transparent 42%),
    #60483a;
  cursor: pointer;
  filter: drop-shadow(0 3px 7px rgba(69, 42, 27, 0.34));
}

.hex-cell.outpost .cell-badge { font-size: 9px; }
.hex-cell.outpost-fighting {
  color: #ffe0ad;
  background: #853c2e;
  animation: outpostBattlePulse 560ms ease-in-out infinite alternate;
}

.hex-cell.outpost-captured {
  color: #fff0ba;
  background: #50694e;
  filter: drop-shadow(0 0 9px rgba(117, 157, 91, 0.58));
}

@keyframes outpostBattlePulse {
  from { filter: brightness(1) drop-shadow(0 0 4px rgba(172, 70, 45, 0.42)); }
  to { filter: brightness(1.24) drop-shadow(0 0 11px rgba(219, 105, 58, 0.88)); }
}

.hex-cell.event {
  color: #4f3d6b;
  background: #c7b6ce;
  cursor: pointer;
  filter: drop-shadow(0 2px 6px rgba(72, 51, 92, 0.28));
}

.hex-cell.wind {
  color: #315e64;
  background: #b8d0c9;
  filter: drop-shadow(0 2px 8px rgba(56, 105, 110, 0.3));
}

.hex-cell.bitter {
  color: #7a3028;
  background: #d0aa8e;
  filter: drop-shadow(0 2px 7px rgba(122, 48, 40, 0.28));
}

.hex-cell.letter {
  color: #493c2d;
  background: #d8c9a6;
  filter: drop-shadow(0 2px 7px rgba(70, 56, 39, 0.24));
}

.hex-cell.chain {
  color: #3f4d51;
  background: #aeb6b1;
  filter: drop-shadow(0 2px 8px rgba(51, 69, 73, 0.3));
}

.hex-cell.altar {
  color: #725326;
  background: #d0bd84;
  filter: drop-shadow(0 2px 8px rgba(116, 83, 36, 0.3));
}

.hex-cell.star {
  color: #f4dc8c;
  background: #4e536b;
  filter: drop-shadow(0 0 8px rgba(232, 204, 105, 0.48));
}

.hex-cell.fire-ship {
  color: #f2d6a0;
  background: #8b392b;
  filter: drop-shadow(0 2px 9px rgba(171, 57, 34, 0.46));
}

.hex-cell.memory {
  color: #705028;
  background: #d3c296;
  filter: drop-shadow(0 2px 8px rgba(112, 80, 40, 0.28));
}

.hex-cell.feint {
  color: #f2d7ad;
  background: #874237;
  filter: drop-shadow(0 2px 8px rgba(132, 55, 43, 0.36));
}

.hex-cell.seal-cell,
.hex-cell.county-seal {
  color: #6b3027;
  background: #d1b779;
  filter: drop-shadow(0 2px 8px rgba(122, 80, 37, 0.34));
}

.hex-cell.people {
  color: #365844;
  background: #bdd0aa;
  filter: drop-shadow(0 2px 8px rgba(55, 92, 66, 0.3));
}

.hex-cell.oath {
  color: #f1d599;
  background: #66473a;
  filter: drop-shadow(0 2px 9px rgba(111, 70, 50, 0.42));
}

.hex-cell.qiao {
  color: #6b3d25;
  background: #d4be91;
  filter: drop-shadow(0 2px 8px rgba(112, 73, 38, 0.3));
}

.hex-cell.marriage {
  color: #f2d2c5;
  background: #8b3e4f;
  filter: drop-shadow(0 2px 9px rgba(139, 62, 79, 0.42));
}

.hex-cell.brocade {
  color: #efe0aa;
  background: #62547f;
  filter: drop-shadow(0 2px 9px rgba(85, 69, 115, 0.44));
}

.hex-cell.pass {
  color: #315661;
  background: #b5cac7;
  filter: drop-shadow(0 2px 8px rgba(48, 91, 99, 0.3));
}

.hex-cell.encirclement {
  color: #f0d29c;
  background: #704032;
  filter: drop-shadow(0 2px 9px rgba(116, 58, 44, 0.44));
}

.hex-cell.burning {
  color: #f8dca2;
  background: #9b3e28;
  animation: burnPulse 480ms ease-in-out infinite alternate;
  filter: drop-shadow(0 0 8px rgba(230, 84, 45, 0.82));
}

.hex-cell.targetable {
  animation: fireTarget 620ms ease-in-out infinite alternate;
}

.hex-cell.target-guard {
  box-shadow: inset 0 0 0 3px rgba(213, 189, 108, 0.72);
  animation: guardTarget 620ms ease-in-out infinite alternate;
}

.hex-cell.target-cut {
  box-shadow: inset 0 0 0 3px rgba(100, 137, 147, 0.72);
  animation: cutTarget 620ms ease-in-out infinite alternate;
}

.hex-cell.blocked {
  color: #eef0df;
  background: #44565a;
  filter: drop-shadow(0 0 8px rgba(97, 143, 153, 0.82));
}

@keyframes burnPulse {
  from { filter: brightness(1) drop-shadow(0 0 4px rgba(230, 84, 45, 0.5)); }
  to { filter: brightness(1.28) drop-shadow(0 0 12px rgba(255, 139, 48, 0.95)); }
}

@keyframes fireTarget {
  from { transform: scale(1); filter: drop-shadow(0 0 4px rgba(230, 84, 45, 0.35)); }
  to { transform: scale(1.08); filter: drop-shadow(0 0 12px rgba(230, 84, 45, 0.95)); }
}

@keyframes guardTarget {
  from { transform: scale(1); filter: brightness(1); }
  to { transform: scale(1.08); filter: brightness(1.35) drop-shadow(0 0 9px rgba(213, 189, 108, 0.8)); }
}

@keyframes cutTarget {
  from { transform: scale(1); filter: brightness(1); }
  to { transform: scale(1.08); filter: brightness(1.32) drop-shadow(0 0 9px rgba(97, 143, 153, 0.9)); }
}

.unit {
  position: absolute;
  z-index: 8;
  width: 8.5%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  translate: -50% -50%;
  border-radius: 50%;
  color: #f1dfbd;
  background: #31261d;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(231, 220, 193, 0.18);
  font-size: clamp(12px, 3.6vw, 17px);
  font-weight: 800;
  will-change: left, top;
}

.unit.cavalry {
  background: #58352a;
}

.unit.flag {
  color: #f0cb70;
  background: #782f27;
  box-shadow: 0 0 0 2px rgba(211, 183, 97, 0.2), 0 3px 9px rgba(0, 0, 0, 0.4);
}

.unit.shield {
  color: #e8e0be;
  background: #445256;
  box-shadow: 0 0 0 2px rgba(144, 166, 164, 0.28), 0 3px 9px rgba(0, 0, 0, 0.42);
}

.unit.general {
  width: 11%;
  color: #ffe5a4;
  background: #67291f;
  box-shadow: 0 0 0 2px rgba(231, 188, 91, 0.38), 0 0 18px rgba(137, 40, 27, 0.42);
}

.unit.general.enraged {
  animation: bossEnrage 420ms ease-in-out infinite alternate;
}

.unit.enemy-veteran {
  outline: 1px solid rgba(217, 164, 74, 0.72);
  outline-offset: 1px;
  box-shadow: 0 0 9px rgba(191, 104, 46, 0.46), inset 0 0 0 1px rgba(255, 224, 151, 0.22);
}

.unit.enemy-elite {
  outline: 2px solid rgba(214, 69, 43, 0.78);
  outline-offset: 1px;
  box-shadow: 0 0 13px rgba(213, 67, 40, 0.62), inset 0 0 0 1px rgba(255, 226, 154, 0.3);
}

.unit.enemy-elite::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 5px;
  height: 5px;
  rotate: 45deg;
  border: 1px solid rgba(255, 220, 134, 0.88);
  background: #9d3427;
}

.unit.under-banner:not(.flag) {
  filter: drop-shadow(0 0 4px rgba(213, 177, 75, 0.7));
}

.unit.outpost-defender {
  width: 10%;
  color: #ffe2a5;
  background: #713b2e;
  box-shadow: 0 0 0 2px rgba(231, 186, 92, 0.35), 0 0 15px rgba(114, 55, 37, 0.48);
  animation: outpostGuard 680ms ease-in-out infinite alternate;
}

@keyframes outpostGuard {
  from { transform: scale(0.96); }
  to { transform: scale(1.06); }
}

@keyframes bossEnrage {
  from { filter: brightness(1) drop-shadow(0 0 4px rgba(202, 62, 38, 0.45)); }
  to { filter: brightness(1.35) drop-shadow(0 0 12px rgba(239, 91, 43, 0.92)); }
}

.armor-track {
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: -8px;
  height: 2px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.38);
}

.armor-track i {
  display: block;
  width: 100%;
  height: 100%;
  background: #9db4b2;
  transform-origin: left;
}

.unit.stunned {
  filter: saturate(0.5) brightness(1.35);
}

.unit.halted {
  filter: saturate(0.55) drop-shadow(0 0 6px rgba(99, 153, 164, 0.9));
}

.unit.scorched {
  box-shadow: 0 0 0 2px rgba(226, 102, 52, 0.5), 0 0 13px rgba(226, 83, 42, 0.65);
}

#battlefield.skill-time-frozen .unit {
  animation-play-state: paused !important;
}

.hp-track {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -4px;
  height: 2px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.38);
}

.hp-track i {
  display: block;
  width: 100%;
  height: 100%;
  background: #d7b25d;
  transform-origin: left;
}

.damage-pop,
.food-pop {
  position: absolute;
  z-index: 15;
  pointer-events: none;
  translate: -50% -50%;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  font-weight: 800;
  animation: floatUp 650ms ease-out forwards;
}

.damage-pop { color: #a52d20; }
.food-pop { color: #76571e; }

@keyframes floatUp {
  from { opacity: 1; transform: translateY(0) scale(0.9); }
  to { opacity: 0; transform: translateY(-24px) scale(1.12); }
}

.slash-effect {
  position: absolute;
  z-index: 12;
  width: 17%;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, #792e23 20% 75%, transparent);
  transform-origin: left center;
  pointer-events: none;
  animation: slashOut 260ms ease-out forwards;
}

@keyframes slashOut {
  from { opacity: 1; scale: 0.45 1; }
  to { opacity: 0; scale: 1.2 0.25; }
}

/* Prototype 29.0 · visible weapon attacks */
.hex-cell.armed-hero .glyph {
  transform-origin: 50% 70%;
}

.hero-held-weapon {
  position: absolute;
  z-index: 4;
  width: 21px;
  height: 24px;
  right: -1px;
  top: 2px;
  color: #d7c59f;
  opacity: 0.84;
  filter: drop-shadow(0 1px 1px rgba(18, 13, 9, 0.68));
  transform: rotate(23deg) scale(0.88);
  transform-origin: 50% 78%;
  object-fit: contain;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.battle-weapon-frame {
  display: block;
}

.battle-weapon-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.battle-weapon-frame[data-weapon-orientation="reverse"] .battle-weapon-image {
  transform: rotate(180deg);
}

.hex-cell[data-weapon-quality="green"] .hero-held-weapon { color: #91b27c; }
.hex-cell[data-weapon-quality="blue"] .hero-held-weapon { color: #83acd0; }
.hex-cell[data-weapon-quality="purple"] .hero-held-weapon { color: #b99bd0; }
.hex-cell[data-weapon-quality="gold"] .hero-held-weapon { color: #e6bb63; filter: drop-shadow(0 0 3px rgba(230, 187, 99, 0.72)); }
.hex-cell[data-weapon-quality="red"] .hero-held-weapon { color: #e2604b; filter: drop-shadow(0 0 4px rgba(226, 73, 53, 0.78)); }

.hex-cell.armed-thrust .hero-held-weapon { transform: rotate(42deg) scale(0.9); }
.hex-cell.armed-bow .hero-held-weapon { transform: rotate(-18deg) scale(0.86); }
.hex-cell.armed-fan .hero-held-weapon { transform: rotate(-24deg) scale(0.88); }
.hex-cell.armed-heavy .hero-held-weapon { width: 23px; height: 26px; transform: rotate(18deg) scale(0.91); }

.hex-cell.hero-attacking .hero-held-weapon { opacity: 0; }
.hex-cell.hero-attacking .glyph { animation: heroAttackRecoil 300ms cubic-bezier(0.2, 0.9, 0.22, 1); }

@keyframes heroAttackRecoil {
  0% { transform: translateX(-1px) rotate(-3deg) scale(0.96); }
  42% { transform: translateX(3px) rotate(3deg) scale(1.08); }
  100% { transform: translateX(0) rotate(0) scale(1); }
}

.weapon-strike,
.weapon-attack-arc,
.weapon-projectile,
.weapon-impact {
  position: absolute;
  pointer-events: none;
}

.weapon-strike {
  z-index: 16;
  width: 44px;
  height: 44px;
  translate: -24% -58%;
  transform: rotate(var(--attack-angle));
  transform-origin: 20% 54%;
}

.weapon-strike.motion-heavy { width: 50px; height: 50px; }

.weapon-strike-art {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  filter:
    drop-shadow(0 0 3px color-mix(in srgb, var(--weapon-color, #e2c57c) 72%, transparent))
    drop-shadow(0 2px 2px rgba(19, 13, 9, 0.72));
  transform-origin: 22% 78%;
  user-select: none;
  -webkit-user-drag: none;
}

.weapon-strike.motion-slash .weapon-strike-art { animation: weaponSlashSwing 400ms cubic-bezier(0.16, 0.84, 0.2, 1) forwards; }
.weapon-strike.motion-heavy .weapon-strike-art { animation: weaponHeavySwing 430ms cubic-bezier(0.15, 0.8, 0.18, 1) forwards; }
.weapon-strike.motion-thrust .weapon-strike-art { animation: weaponSpearThrust 360ms cubic-bezier(0.16, 0.86, 0.22, 1) forwards; }
.weapon-strike.motion-bow .weapon-strike-art { animation: weaponBowRelease 420ms ease-out forwards; }
.weapon-strike.motion-fan .weapon-strike-art { animation: weaponFanCast 420ms cubic-bezier(0.2, 0.8, 0.24, 1) forwards; }

@keyframes weaponSlashSwing {
  0% { opacity: 0.35; transform: translate(-7px, 8px) rotate(-128deg) scale(0.72); }
  52% { opacity: 1; transform: translate(8px, -6px) rotate(4deg) scale(1.05); }
  100% { opacity: 0; transform: translate(15px, 1px) rotate(44deg) scale(0.88); }
}

@keyframes weaponHeavySwing {
  0% { opacity: 0.4; transform: translate(-9px, 9px) rotate(-142deg) scale(0.76); }
  56% { opacity: 1; transform: translate(8px, -7px) rotate(0deg) scale(1.15); }
  100% { opacity: 0; transform: translate(14px, 4px) rotate(54deg) scale(0.94); }
}

@keyframes weaponSpearThrust {
  0% { opacity: 0.38; transform: translate(-11px, 2px) rotate(-43deg) scale(0.82); }
  48% { opacity: 1; transform: translate(25px, -1px) rotate(-43deg) scale(1.06); }
  100% { opacity: 0; transform: translate(17px, 0) rotate(-43deg) scale(0.92); }
}

@keyframes weaponBowRelease {
  0% { opacity: 0.5; transform: translate(-5px, 2px) rotate(-32deg) scaleX(0.82); }
  48% { opacity: 1; transform: translate(1px, 0) rotate(-43deg) scaleX(1.08); }
  100% { opacity: 0; transform: translate(3px, 0) rotate(-38deg) scaleX(0.9); }
}

@keyframes weaponFanCast {
  0% { opacity: 0.4; transform: translate(-5px, 5px) rotate(-92deg) scale(0.74); }
  50% { opacity: 1; transform: translate(6px, -5px) rotate(12deg) scale(1.08); }
  100% { opacity: 0; transform: translate(12px, -2px) rotate(38deg) scale(1.22); }
}

.weapon-attack-arc {
  z-index: 15;
  width: 48px;
  height: 28px;
  translate: 2px -50%;
  transform: rotate(var(--attack-angle));
  transform-origin: left center;
  border-top: 3px solid var(--weapon-color, #e2c57c);
  border-radius: 50%;
  filter: drop-shadow(0 0 3px var(--weapon-color, #e2c57c));
  animation: weaponArcFlash 360ms ease-out forwards;
}

.weapon-attack-arc.motion-heavy { width: 54px; height: 34px; border-top-width: 5px; }
.weapon-attack-arc.motion-thrust { width: 58px; height: 2px; border: 0; background: linear-gradient(90deg, transparent, var(--weapon-color), transparent); border-radius: 99px; }
.weapon-attack-arc.motion-bow { width: 34px; height: 20px; border-top-width: 2px; opacity: 0.7; }
.weapon-attack-arc.motion-fan { width: 50px; border-top-width: 4px; border-color: color-mix(in srgb, var(--weapon-color) 68%, #dce7d0); }

@keyframes weaponArcFlash {
  0% { opacity: 0; scale: 0.25 0.55; }
  34% { opacity: 0.95; scale: 0.88 1; }
  100% { opacity: 0; scale: 1.26 0.45; }
}

.weapon-projectile {
  z-index: 15;
  height: 18px;
  translate: 5px -50%;
  transform: rotate(var(--attack-angle));
  transform-origin: left center;
}

.weapon-projectile i {
  position: absolute;
  left: 0;
  top: 50%;
  display: block;
  width: 13px;
  height: 2px;
  border-radius: 99px;
  background: var(--weapon-color, #e2c57c);
  box-shadow: 0 0 5px var(--weapon-color, #e2c57c);
  animation: weaponProjectileFly 390ms cubic-bezier(0.12, 0.72, 0.22, 1) forwards;
}

.weapon-projectile.motion-bow i::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -3px;
  width: 5px;
  height: 5px;
  border-top: 2px solid var(--weapon-color);
  border-right: 2px solid var(--weapon-color);
  transform: rotate(45deg);
}

.weapon-projectile.motion-fan i {
  width: 18px;
  height: 9px;
  top: calc(50% - 4px);
  border: 1px solid color-mix(in srgb, var(--weapon-color) 74%, #e9efda);
  border-radius: 50%;
  background: color-mix(in srgb, var(--weapon-color) 38%, transparent);
  filter: blur(0.4px) drop-shadow(0 0 5px var(--weapon-color));
}

@keyframes weaponProjectileFly {
  0% { left: 0; opacity: 0; scale: 0.7; }
  16% { opacity: 1; }
  86% { opacity: 1; }
  100% { left: calc(100% - 13px); opacity: 0; scale: 1.12; }
}

.weapon-impact {
  z-index: 17;
  width: 25px;
  height: 25px;
  translate: -50% -50%;
  opacity: 0;
  animation: weaponImpactBurst 300ms 76ms ease-out forwards;
}

.weapon-impact.motion-bow,
.weapon-impact.motion-fan { animation-delay: 210ms; }

.weapon-impact::before,
.weapon-impact::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--weapon-color), transparent);
  box-shadow: 0 0 4px var(--weapon-color);
}

.weapon-impact::before { transform: translate(-50%, -50%) rotate(34deg); }
.weapon-impact::after { transform: translate(-50%, -50%) rotate(-42deg); }

@keyframes weaponImpactBurst {
  0% { opacity: 0; scale: 0.35; }
  35% { opacity: 1; scale: 1.15; }
  100% { opacity: 0; scale: 1.55; }
}

@media (prefers-reduced-motion: reduce) {
  .hex-cell.hero-attacking .glyph,
  .weapon-strike-art,
  .weapon-attack-arc,
  .weapon-projectile i,
  .weapon-impact { animation-duration: 1ms !important; }
}

.ember {
  position: absolute;
  z-index: 13;
  width: 4px;
  height: 9px;
  border-radius: 50% 50% 40% 40%;
  background: #ed7841;
  pointer-events: none;
  animation: emberRise 900ms ease-out forwards;
}

@keyframes emberRise {
  from { opacity: 0.95; transform: translate(0, 0) rotate(0deg); }
  to { opacity: 0; transform: translate(var(--drift, 8px), -48px) rotate(38deg); }
}

.ink-cloud {
  position: absolute;
  border-radius: 50%;
  background: rgba(30, 27, 22, 0.12);
  filter: blur(8px);
  pointer-events: none;
}

.ink-cloud-a {
  width: 160px;
  height: 90px;
  left: 2%;
  top: 11%;
  transform: rotate(20deg);
}

.ink-cloud-b {
  width: 130px;
  height: 80px;
  right: 0;
  bottom: 12%;
  transform: rotate(-18deg);
}

.combo-banner {
  position: absolute;
  z-index: 18;
  left: 50%;
  top: 47%;
  width: 78%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 16px;
  opacity: 0;
  border-top: 1px solid rgba(247, 225, 180, 0.5);
  border-bottom: 1px solid rgba(247, 225, 180, 0.5);
  color: #f5dfb4;
  background: linear-gradient(90deg, transparent, rgba(91, 34, 24, 0.94) 20% 80%, transparent);
  transform: translate(-50%, -50%) scale(0.8);
  pointer-events: none;
}

.combo-banner.show {
  animation: comboReveal 1500ms ease-out forwards;
}

.combo-banner span {
  font-size: 17px;
  letter-spacing: 0.16em;
}

.combo-banner strong {
  color: #ffbf67;
  font-size: 35px;
}

@keyframes comboReveal {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  18%, 66% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.08); }
}

.control-panel {
  padding: 7px 14px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(231, 220, 193, 0.08);
  background: rgba(15, 13, 10, 0.72);
  backdrop-filter: blur(9px);
}

.objective-row,
.command-row,
.morale-heading {
  display: flex;
  align-items: center;
}

.objective-row {
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
}

.objective-kicker {
  color: var(--gold);
  font-family: system-ui, sans-serif;
  font-size: 9px;
  letter-spacing: 0.16em;
}

.formation-badge {
  display: inline-block;
  max-width: 145px;
  margin-left: 7px;
  padding: 1px 5px;
  overflow: hidden;
  border: 1px solid rgba(213, 173, 88, 0.22);
  border-radius: 999px;
  color: rgba(231, 220, 193, 0.56);
  font-family: system-ui, sans-serif;
  font-size: 8px;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.objective-row p {
  margin: 2px 0 0;
  color: rgba(231, 220, 193, 0.75);
  font-family: system-ui, sans-serif;
  font-size: 11px;
  line-height: 1.35;
}

.text-button {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 10px;
}

.command-row {
  gap: 6px;
  margin-top: 7px;
}

.command-card {
  min-width: 0;
  flex: 1;
  min-height: 55px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  padding: 6px;
  border: 1px solid rgba(225, 92, 66, 0.34);
  border-radius: 13px;
  color: var(--paper);
  background: linear-gradient(145deg, rgba(151, 55, 38, 0.48), rgba(84, 35, 28, 0.35));
  cursor: pointer;
  text-align: left;
  transition: transform 150ms ease, filter 150ms ease;
}

.command-card:not(:disabled):hover,
.command-card:not(:disabled):focus-visible {
  filter: brightness(1.2);
  transform: translateY(-2px);
}

.command-card.locked {
  opacity: 0.47;
  border-color: rgba(231, 220, 193, 0.12);
  background: rgba(231, 220, 193, 0.035);
  cursor: not-allowed;
}

.command-card.selected {
  border-color: #ef9b5e;
  box-shadow: 0 0 0 2px rgba(225, 92, 66, 0.18), 0 0 20px rgba(225, 92, 66, 0.2);
}

.command-card.guard:not(.locked) {
  border-color: rgba(213, 189, 108, 0.42);
  background: linear-gradient(145deg, rgba(116, 108, 65, 0.52), rgba(64, 62, 42, 0.4));
}

.command-card.cut:not(.locked) {
  border-color: rgba(110, 151, 159, 0.42);
  background: linear-gradient(145deg, rgba(63, 97, 105, 0.54), rgba(39, 60, 65, 0.4));
}

.command-glyph {
  display: grid;
  place-items: center;
  width: 34px;
  height: 38px;
  border: 1px solid rgba(247, 225, 180, 0.25);
  border-radius: 8px;
  color: #ffe0ab;
  background: var(--cinnabar);
  font-size: 24px;
  font-weight: 900;
  transform: rotate(-2deg);
}

.command-meta {
  min-width: 0;
}

.command-meta strong,
.command-meta small {
  display: block;
}

.command-meta strong {
  font-size: 11px;
}

.command-meta small {
  margin-top: 3px;
  color: rgba(231, 220, 193, 0.55);
  font-family: system-ui, sans-serif;
  font-size: 7px;
  white-space: nowrap;
}

.morale-panel {
  min-width: 0;
}

.morale-heading {
  justify-content: space-between;
  color: rgba(231, 220, 193, 0.64);
  font-family: system-ui, sans-serif;
  font-size: 10px;
}

.morale-heading strong {
  color: var(--gold);
}

.morale-track {
  height: 5px;
  margin-top: 4px;
}

.morale-track span {
  width: 0;
  background: linear-gradient(90deg, #8e342a, #e16f3f, #e7bd60);
}

.morale-panel p {
  min-height: 14px;
  margin: 4px 0 0;
  color: rgba(231, 220, 193, 0.62);
  font-family: system-ui, sans-serif;
  font-size: 10px;
  line-height: 1.4;
}

.toast {
  position: absolute;
  z-index: 40;
  left: 50%;
  bottom: 148px;
  max-width: 82%;
  padding: 7px 12px;
  opacity: 0;
  border: 1px solid rgba(231, 220, 193, 0.16);
  border-radius: 999px;
  color: #f4e6c8;
  background: rgba(28, 23, 17, 0.92);
  box-shadow: 0 7px 22px rgba(0, 0, 0, 0.26);
  transform: translate(-50%, 8px);
  pointer-events: none;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  text-align: center;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.home-screen {
  position: absolute;
  z-index: 48;
  inset: 0;
  overflow: hidden;
  color: #eadfca;
  background:
    radial-gradient(circle at 78% 16%, rgba(167, 66, 45, 0.24), transparent 28%),
    radial-gradient(circle at 22% 66%, rgba(154, 119, 60, 0.1), transparent 32%),
    linear-gradient(160deg, #201812, #100e0b 62%);
}

.home-screen.hidden {
  display: none;
}

.home-scroll {
  height: calc(100% - 70px);
  overflow-y: auto;
  padding: max(18px, env(safe-area-inset-top)) 17px 24px;
  scrollbar-width: none;
}

.home-scroll::-webkit-scrollbar { display: none; }

.home-profile {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 10px;
}

.home-avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 2px double rgba(236, 216, 174, 0.58);
  color: #f1ddb3;
  background: #87392e;
  box-shadow: inset 0 0 0 2px rgba(26, 18, 13, 0.4), 0 5px 15px rgba(0, 0, 0, 0.28);
  font-size: 24px;
  font-weight: 900;
  transform: rotate(-2deg);
}

.home-profile-copy small,
.home-profile-copy strong,
.home-profile-copy span {
  display: block;
}

.home-profile-copy small,
.home-profile-copy span {
  color: rgba(234, 223, 202, 0.5);
  font-family: system-ui, sans-serif;
  font-size: 8px;
}

.home-profile-copy strong {
  margin: 2px 0;
  font-size: 17px;
  letter-spacing: 0.12em;
}

.home-round-button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(234, 223, 202, 0.14);
  border-radius: 50%;
  color: rgba(234, 223, 202, 0.76);
  background: rgba(234, 223, 202, 0.05);
}

.home-resources {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 14px;
}

.home-resources button {
  min-width: 0;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 7px;
  padding: 7px 8px;
  border: 1px solid rgba(232, 213, 174, 0.1);
  border-radius: 9px;
  color: #e7d5b2;
  background: rgba(232, 213, 174, 0.045);
  text-align: left;
}

.home-resources button > span {
  grid-row: 1 / span 2;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  align-self: center;
  border-radius: 50%;
  color: #3e2d20;
  background: #cfb16e;
  font-size: 13px;
  font-weight: 800;
}

.home-resources b {
  overflow: hidden;
  font-family: system-ui, sans-serif;
  font-size: 12px;
  text-overflow: ellipsis;
}

.home-resources small {
  color: rgba(234, 223, 202, 0.42);
  font-family: system-ui, sans-serif;
  font-size: 7px;
}

.campaign-banner {
  min-height: 184px;
  margin-top: 13px;
  padding: 20px 20px 18px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(232, 202, 137, 0.2);
  background:
    linear-gradient(110deg, rgba(32, 22, 17, 0.96), rgba(82, 35, 27, 0.86)),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(255, 255, 255, 0.025) 5px 6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.27), inset 0 0 36px rgba(204, 141, 70, 0.06);
}

.campaign-banner::after {
  content: "战";
  position: absolute;
  right: -10px;
  bottom: -42px;
  opacity: 0.055;
  font-size: 164px;
  font-weight: 900;
  transform: rotate(-8deg);
}

.campaign-kicker {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  color: rgba(238, 216, 171, 0.58);
  font-family: system-ui, sans-serif;
  font-size: 9px;
}

.campaign-kicker b { color: #e4bb69; }

.campaign-banner h2 {
  position: relative;
  z-index: 1;
  margin: 25px 0 7px;
  color: #f0dcaf;
  font-size: 25px;
  letter-spacing: 0.08em;
}

.campaign-progress {
  height: 4px;
  overflow: hidden;
  margin: 13px 0 15px;
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.08);
}

.campaign-progress span {
  display: block;
  width: 8%;
  height: 100%;
  background: linear-gradient(90deg, #b44734, #d8ae5c);
}

.campaign-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 8px;
}

.home-primary,
.home-secondary {
  min-height: 42px;
  border: 1px solid rgba(232, 215, 181, 0.18);
  color: #f1dfba;
}

.home-primary {
  background: #9b3e30;
  box-shadow: 0 5px 12px rgba(92, 27, 20, 0.3);
  font-weight: 800;
}

.home-secondary { background: rgba(232, 215, 181, 0.07); }

.home-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.home-quick-grid button {
  min-width: 0;
  min-height: 72px;
  padding: 9px 4px 8px;
  position: relative;
  border: 1px solid rgba(232, 213, 174, 0.1);
  color: #e8d7b5;
  background: rgba(232, 213, 174, 0.04);
}

.home-quick-grid button > span,
.home-quick-grid button > strong {
  display: block;
}

.home-quick-grid button > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin: 0 auto 6px;
  border: 1px solid rgba(236, 213, 169, 0.28);
  color: #e6c77d;
  background: rgba(142, 60, 44, 0.35);
  font-size: 19px;
  font-weight: 900;
}

.home-quick-grid strong { font-size: 10px; }
.home-quick-grid i { position: absolute; right: 6px; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: #d8543e; box-shadow: 0 0 7px #d8543e; }

.home-hero-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
  padding: 11px 12px;
  border-left: 3px solid #8d3d30;
  background: rgba(232, 213, 174, 0.045);
}

.home-hero-strip small,
.home-hero-strip strong { display: block; }
.home-hero-strip small { color: rgba(234, 223, 202, 0.42); font-family: system-ui, sans-serif; font-size: 8px; }
.home-hero-strip > div { min-width: 0; }
.home-hero-strip strong { margin-top: 3px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.home-hero-strip button { padding: 7px 9px; border: 1px solid rgba(232, 213, 174, 0.15); color: #d9bc7a; background: transparent; font-size: 9px; }

.home-nav {
  height: 70px;
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  padding: 7px 7px max(7px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(232, 213, 174, 0.1);
  background: rgba(15, 13, 10, 0.97);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.22);
}

.home-nav button {
  min-width: 0;
  padding: 3px;
  border: 0;
  color: rgba(232, 217, 188, 0.44);
  background: transparent;
}

.home-nav span,
.home-nav small { display: block; }
.home-nav span { font-size: 18px; font-weight: 900; }
.home-nav small { margin-top: 2px; font-family: system-ui, sans-serif; font-size: 8px; }
.home-nav .active { color: #dfbd73; }
.home-nav .battle-nav { color: #f0dba9; }
.home-nav .battle-nav span { width: 46px; height: 46px; display: grid; place-items: center; margin: -21px auto 0; border: 3px solid #17120e; border-radius: 50%; background: #a64031; box-shadow: 0 4px 15px rgba(130, 45, 32, 0.5); font-size: 23px; }

.system-screen { z-index: 66; }

.system-scroll {
  width: min(100%, 370px);
  max-height: min(760px, calc(100dvh - 30px));
  overflow-y: auto;
  padding: 20px 18px 22px;
  border: 1px solid rgba(82, 58, 34, 0.24);
  color: #34271d;
  background: linear-gradient(rgba(235, 223, 194, 0.99), rgba(204, 186, 146, 0.99));
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.52), inset 0 0 42px rgba(82, 54, 30, 0.1);
  scrollbar-width: none;
}

.system-scroll::-webkit-scrollbar { display: none; }

.system-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(69, 50, 31, 0.16);
}

.system-scroll .system-head {
  position: sticky;
  z-index: 6;
  top: 0;
  margin: -20px -18px 12px;
  padding: 20px 18px 12px;
  background: linear-gradient(180deg, rgba(239, 226, 197, 0.995), rgba(226, 210, 174, 0.98));
  box-shadow: 0 8px 18px rgba(69, 46, 27, 0.1);
}

.system-head small,
.system-head h2 { display: block; margin: 0; }
.system-head small { color: rgba(72, 51, 31, 0.48); font-family: system-ui, sans-serif; font-size: 8px; letter-spacing: 0.14em; }
.system-head h2 { margin-top: 3px; font-size: 25px; letter-spacing: 0.12em; }
.system-head button { width: 34px; height: 34px; border: 1px solid rgba(71, 50, 30, 0.18); border-radius: 50%; color: #694a32; background: rgba(255, 255, 255, 0.16); font: 22px/1 system-ui, sans-serif; }

.system-body { padding-top: 13px; }
.system-note { margin: 0 0 12px; color: rgba(52, 39, 29, 0.58); font-family: system-ui, sans-serif; font-size: 10px; line-height: 1.55; }
.system-list { display: grid; gap: 8px; }
.system-card { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid rgba(69, 50, 31, 0.14); background: rgba(255, 255, 255, 0.14); }
.system-card.locked { opacity: 0.48; filter: grayscale(0.5); }
.system-glyph { width: 40px; height: 40px; display: grid; place-items: center; color: #f0ddba; background: #714437; font-size: 23px; font-weight: 900; }
.system-copy strong,
.system-copy small { display: block; }
.system-copy strong { font-size: 13px; }
.system-copy small { margin-top: 3px; color: rgba(52, 39, 29, 0.56); font-family: system-ui, sans-serif; font-size: 9px; line-height: 1.4; }
.system-tag { color: #8f3b2f; font-family: system-ui, sans-serif; font-size: 9px; font-style: normal; }
.system-action { padding: 7px 9px; border: 1px solid rgba(120, 60, 42, 0.25); color: #f3dfb9; background: #923d30; font-size: 9px; }
.system-action:disabled { opacity: 0.42; }
.system-progress { height: 4px; overflow: hidden; margin-top: 7px; background: rgba(63, 45, 28, 0.1); }
.system-progress span { display: block; height: 100%; background: #a84a36; }
.system-summary { padding: 12px; margin-bottom: 10px; color: #f1dfbb; background: #673d31; }
.system-summary strong,
.system-summary small { display: block; }
.system-summary strong { font-size: 20px; }
.system-summary small { margin-top: 4px; color: rgba(241, 223, 187, 0.62); font-family: system-ui, sans-serif; font-size: 9px; }
.system-placeholder { padding: 17px 14px; border: 1px dashed rgba(70, 49, 29, 0.24); color: rgba(52, 39, 29, 0.62); background: rgba(255, 255, 255, 0.1); text-align: center; font-family: system-ui, sans-serif; font-size: 10px; line-height: 1.65; }

.overlay-screen {
  position: absolute;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at center, rgba(125, 50, 40, 0.2), transparent 46%),
    rgba(14, 12, 9, 0.92);
  backdrop-filter: blur(8px);
  transition: opacity 240ms ease, visibility 240ms ease;
}

.overlay-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-scroll,
.result-scroll,
.strategy-scroll {
  width: min(100%, 340px);
  min-width: 0;
  max-width: 100%;
  padding: 32px 28px;
  position: relative;
  border: 1px solid rgba(73, 54, 34, 0.24);
  color: #31251b;
  background:
    linear-gradient(rgba(235, 222, 190, 0.96), rgba(204, 187, 147, 0.96)),
    repeating-linear-gradient(0deg, rgba(89, 65, 38, 0.05) 0 1px, transparent 1px 5px);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.48), inset 0 0 45px rgba(81, 55, 30, 0.11);
  text-align: center;
}

.start-scroll::before,
.start-scroll::after,
.result-scroll::before,
.result-scroll::after,
.strategy-scroll::before,
.strategy-scroll::after {
  content: "";
  position: absolute;
  left: -9px;
  right: -9px;
  height: 14px;
  border-radius: 50%;
  background: #bca77a;
  box-shadow: inset 0 0 6px rgba(51, 38, 25, 0.26);
}

.start-scroll::before,
.result-scroll::before,
.strategy-scroll::before { top: -7px; }
.start-scroll::after,
.result-scroll::after,
.strategy-scroll::after { bottom: -7px; }

.chapter-mark {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid rgba(128, 44, 35, 0.4);
  color: #8a352b;
  font-family: system-ui, sans-serif;
  font-size: 9px;
  letter-spacing: 0.18em;
}

.start-eyebrow,
.result-eyebrow,
.strategy-eyebrow {
  margin: 20px 0 6px;
  color: #8f3b2f;
  font-size: 13px;
  letter-spacing: 0.12em;
}

.start-scroll h2,
.result-scroll h2,
.strategy-scroll h2 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 0.18em;
}

.mode-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 15px 0 4px;
}

.mode-card {
  min-width: 0;
  padding: 9px 7px 8px;
  border: 1px solid rgba(64, 46, 27, 0.16);
  color: rgba(49, 37, 27, 0.68);
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
  text-align: left;
}

.mode-card span,
.mode-card strong,
.mode-card small {
  display: block;
}

.mode-card span {
  color: rgba(49, 37, 27, 0.44);
  font-family: system-ui, sans-serif;
  font-size: 8px;
}

.mode-card strong {
  margin-top: 3px;
  font-size: 12px;
}

.mode-card small {
  margin-top: 3px;
  overflow: hidden;
  color: rgba(49, 37, 27, 0.5);
  font-family: system-ui, sans-serif;
  font-size: 7px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mode-card.selected {
  border-color: rgba(147, 59, 47, 0.58);
  background: rgba(147, 59, 47, 0.1);
  box-shadow: inset 0 0 0 1px rgba(147, 59, 47, 0.12);
}

.mode-card.daily.selected {
  border-color: rgba(86, 84, 124, 0.58);
  background: rgba(84, 72, 119, 0.1);
  box-shadow: inset 0 0 0 1px rgba(84, 72, 119, 0.12);
}

.chapter-selector {
  min-width: 0;
  max-width: 100%;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(70, 49, 28, 0.14);
}

.chapter-selector.hidden,
.secondary-button.hidden {
  display: none;
}

.chapter-selector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: rgba(49, 37, 27, 0.56);
  font-family: system-ui, sans-serif;
  font-size: 8px;
}

.chapter-selector-head strong {
  color: #87382d;
  font-weight: 700;
}

.chapter-volumes {
  display: flex;
  width: 100%;
  gap: 5px;
  margin-bottom: 7px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chapter-volumes::-webkit-scrollbar { display: none; }

.chapter-volumes button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid rgba(84, 56, 32, 0.18);
  color: #684a35;
  background: rgba(255, 255, 255, 0.14);
  font: 800 12px/1 system-ui, sans-serif;
  white-space: nowrap;
  cursor: pointer;
}

.chapter-volumes button.selected {
  border-color: rgba(151, 61, 46, 0.58);
  color: #8e382e;
  background: rgba(151, 61, 46, 0.12);
  box-shadow: inset 0 -2px rgba(151, 61, 46, 0.55);
}

.chapter-volumes button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.chapter-choices {
  display: flex;
  width: 100%;
  min-width: 0;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 3px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.chapter-choices::-webkit-scrollbar { display: none; }

.chapter-card {
  flex: 0 0 88px;
  min-width: 88px;
  min-height: 58px;
  padding: 6px 5px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(65, 46, 27, 0.15);
  color: rgba(49, 37, 27, 0.68);
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  scroll-snap-align: start;
  text-align: left;
}

.chapter-card span,
.chapter-card strong,
.chapter-card small,
.chapter-card em {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chapter-card span {
  color: rgba(49, 37, 27, 0.42);
  font-family: system-ui, sans-serif;
  font-size: 7px;
}

.chapter-card strong {
  margin-top: 2px;
  font-size: 10px;
}

.chapter-card small {
  margin-top: 2px;
  color: rgba(49, 37, 27, 0.45);
  font-family: system-ui, sans-serif;
  font-size: 6px;
}

.chapter-card em {
  margin-top: 4px;
  color: #9a6d28;
  font-family: system-ui, sans-serif;
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.04em;
}

.chapter-card.selected {
  border-color: rgba(147, 59, 47, 0.58);
  background: rgba(147, 59, 47, 0.1);
  box-shadow: inset 0 0 0 1px rgba(147, 59, 47, 0.1);
}

.chapter-card.locked {
  color: rgba(49, 37, 27, 0.3);
  background: rgba(65, 55, 43, 0.07);
  cursor: not-allowed;
}

.chapter-card.locked::after {
  content: "锁";
  position: absolute;
  right: 5px;
  top: 4px;
  color: rgba(49, 37, 27, 0.28);
  font-size: 9px;
}

.start-demo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 11px 0 8px;
}

.start-demo span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(74, 55, 34, 0.24);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 21px;
  font-weight: 800;
}

.start-demo .fire-demo {
  color: #f0d2a2;
  background: #a44031;
}

.start-demo .burn-demo {
  color: #f6daa2;
  background: #713126;
  box-shadow: 0 0 18px rgba(173, 55, 31, 0.28);
}

.start-demo b {
  color: rgba(49, 37, 27, 0.45);
  font-family: system-ui, sans-serif;
}

.result-scroll > p:not(.result-eyebrow),
.strategy-scroll > p:not(.strategy-eyebrow) {
  margin: 16px auto 22px;
  color: rgba(49, 37, 27, 0.72);
  font-family: system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.7;
}

.primary-button {
  width: 100%;
  padding: 13px 18px;
  border: 0;
  border-radius: 4px;
  color: #f5e5c5;
  background: #933b2f;
  box-shadow: 0 6px 14px rgba(107, 42, 33, 0.24);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.primary-button:hover,
.primary-button:focus-visible {
  filter: brightness(1.12);
}

.secondary-button {
  width: 100%;
  margin-bottom: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(113, 56, 42, 0.34);
  color: #6f3228;
  background: rgba(255, 255, 255, 0.17);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.secondary-button:hover,
.secondary-button:focus-visible {
  background: rgba(147, 59, 47, 0.1);
}

.start-scroll > small {
  display: block;
  margin-top: 13px;
  color: rgba(49, 37, 27, 0.45);
  font-family: system-ui, sans-serif;
  font-size: 9px;
}

.result-seal {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border: 3px double rgba(248, 225, 184, 0.9);
  color: #f6e1b9;
  background: #9e3b2d;
  box-shadow: 0 7px 18px rgba(92, 36, 28, 0.3);
  transform: rotate(-4deg);
  font-size: 36px;
  font-weight: 900;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 22px 0 8px;
}

.mode-score {
  display: inline-block;
  margin: 10px 0 -7px !important;
  padding: 3px 8px;
  border: 1px solid rgba(104, 70, 41, 0.18);
  border-radius: 999px;
  color: rgba(49, 37, 27, 0.62) !important;
  background: rgba(255, 255, 255, 0.15);
  font-family: system-ui, sans-serif !important;
  font-size: 9px !important;
  line-height: 1.3 !important;
}

.mode-score.daily-score {
  border-color: rgba(82, 68, 118, 0.34);
  color: #584875 !important;
  background: rgba(84, 72, 119, 0.08);
  font-weight: 700;
}

.result-stats div {
  padding: 10px 5px;
  border-top: 1px solid rgba(64, 46, 27, 0.16);
  border-bottom: 1px solid rgba(64, 46, 27, 0.16);
}

.result-reward {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 3px 10px;
  margin: 9px 0 5px;
  padding: 9px 11px;
  border: 1px solid rgba(157, 91, 38, 0.24);
  color: #6e3b22;
  background: linear-gradient(100deg, rgba(212, 155, 65, 0.12), rgba(255, 255, 255, 0.12));
  font-family: system-ui, sans-serif;
}

.result-reward span {
  font-size: 9px;
  letter-spacing: 0.08em;
}

.result-reward strong {
  justify-self: end;
  font-size: 14px;
}

.result-reward small {
  grid-column: 1 / -1;
  color: rgba(66, 43, 25, 0.62);
  font-size: 9px;
}

.result-stats span,
.result-stats strong {
  display: block;
  font-family: system-ui, sans-serif;
}

.strategy-screen {
  z-index: 55;
  background:
    radial-gradient(circle at center, rgba(104, 91, 46, 0.24), transparent 48%),
    rgba(14, 12, 9, 0.9);
}

.strategy-scroll {
  width: min(100%, 362px);
  padding: 25px 20px 22px;
}

.strategy-scroll h2 {
  font-size: 28px;
}

.strategy-eyebrow {
  margin-top: 15px;
}

.strategy-scroll > p:not(.strategy-eyebrow) {
  margin: 8px auto 14px;
  font-size: 11px;
}

.strategy-choices {
  display: grid;
  gap: 8px;
}

.strategy-choice {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid rgba(87, 63, 36, 0.2);
  color: #33261a;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  text-align: left;
}

.strategy-choice:hover,
.strategy-choice:focus-visible {
  border-color: rgba(147, 59, 47, 0.66);
  background: rgba(147, 59, 47, 0.09);
}

.strategy-choice-glyph {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #f4e1b8;
  background: #774131;
  font-size: 24px;
  font-weight: 900;
}

.strategy-choice-copy strong,
.strategy-choice-copy small {
  display: block;
}

.strategy-choice-copy strong {
  font-size: 13px;
}

.strategy-choice-copy small {
  margin-top: 3px;
  color: rgba(49, 37, 27, 0.62);
  font-family: system-ui, sans-serif;
  font-size: 9px;
  line-height: 1.35;
}

.strategy-choice-arrow {
  color: #933b2f;
  font-family: system-ui, sans-serif;
  font-size: 15px;
}

.decision-screen {
  z-index: 58;
  background:
    radial-gradient(circle at center, rgba(79, 61, 99, 0.24), transparent 48%),
    rgba(14, 12, 9, 0.92);
}

.decision-scroll {
  width: min(100%, 362px);
  padding: 26px 20px 20px;
  position: relative;
  border: 1px solid rgba(73, 54, 34, 0.24);
  color: #31251b;
  background:
    linear-gradient(rgba(235, 222, 190, 0.97), rgba(204, 187, 147, 0.97)),
    repeating-linear-gradient(0deg, rgba(89, 65, 38, 0.05) 0 1px, transparent 1px 5px);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.48), inset 0 0 45px rgba(81, 55, 30, 0.11);
  text-align: center;
}

.decision-scroll::before,
.decision-scroll::after {
  content: "";
  position: absolute;
  left: -9px;
  right: -9px;
  height: 14px;
  border-radius: 50%;
  background: #bca77a;
  box-shadow: inset 0 0 6px rgba(51, 38, 25, 0.26);
}

.decision-scroll::before { top: -7px; }
.decision-scroll::after { bottom: -7px; }

.decision-eyebrow {
  margin: 14px 0 5px;
  color: #76537d;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.decision-scroll h2 {
  margin: 0 0 16px;
  font-size: 28px;
  letter-spacing: 0.12em;
}

.decision-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.decision-choice {
  min-width: 0;
  padding: 13px 10px 11px;
  border: 1px solid rgba(74, 55, 34, 0.2);
  color: #33261a;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  text-align: center;
}

.decision-choice:hover,
.decision-choice:focus-visible {
  border-color: rgba(147, 59, 47, 0.66);
  background: rgba(147, 59, 47, 0.09);
}

.decision-choice-glyph {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 8px;
  border: 2px double rgba(246, 225, 183, 0.68);
  color: #f5dfb3;
  background: #55412d;
  font-size: 31px;
  font-weight: 900;
}

.decision-choice.zhou .decision-choice-glyph {
  background: #793b31;
}

.decision-choice.zhao .decision-choice-glyph { background: #4b6062; }
.decision-choice.huang .decision-choice-glyph { background: #735b2e; }
.decision-choice.sun .decision-choice-glyph { background: #713f51; }
.decision-choice.cao .decision-choice-glyph,
.decision-choice.xiahou .decision-choice-glyph,
.decision-choice.zhangliao .decision-choice-glyph,
.decision-choice.xuchu .decision-choice-glyph,
.decision-choice.guojia .decision-choice-glyph,
.decision-choice.dianwei .decision-choice-glyph,
.decision-choice.xunyu .decision-choice-glyph,
.decision-choice.sima .decision-choice-glyph { background: #465663; }
.decision-choice.liubei .decision-choice-glyph,
.decision-choice.zhuge .decision-choice-glyph,
.decision-choice.machao .decision-choice-glyph,
.decision-choice.pangtong .decision-choice-glyph { background: #4e6541; }
.decision-choice.sunquan .decision-choice-glyph,
.decision-choice.ganning .decision-choice-glyph,
.decision-choice.luxun .decision-choice-glyph,
.decision-choice.huanggai .decision-choice-glyph,
.decision-choice.taishici .decision-choice-glyph,
.decision-choice.lvmeng .decision-choice-glyph { background: #7a4330; }

.decision-choice.risk .decision-choice-glyph {
  background: #6c3150;
}

.decision-choice.reward .decision-choice-glyph {
  background: #5c6438;
}

.decision-choice strong,
.decision-choice small,
.decision-choice em {
  display: block;
}

.decision-choice strong {
  font-size: 14px;
}

.decision-choice small {
  min-height: 39px;
  margin-top: 5px;
  color: rgba(49, 37, 27, 0.64);
  font-family: system-ui, sans-serif;
  font-size: 9px;
  line-height: 1.45;
}

.decision-choice em {
  margin-top: 8px;
  color: #933b2f;
  font-family: system-ui, sans-serif;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}

.event-screen .decision-choices {
  grid-template-columns: 1fr;
}

.event-screen .decision-choice {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  column-gap: 10px;
  padding: 10px;
  text-align: left;
}

.event-screen .decision-choice-glyph {
  grid-row: 1 / span 3;
  width: 48px;
  height: 48px;
  margin: 0;
  font-size: 26px;
}

.event-screen .decision-choice small {
  min-height: 0;
}

.event-screen .decision-choice em {
  margin-top: 4px;
}

.decision-cancel {
  margin-top: 12px;
  padding: 6px 16px;
  border: 0;
  color: rgba(49, 37, 27, 0.55);
  background: transparent;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.result-stats span {
  color: rgba(49, 37, 27, 0.48);
  font-size: 9px;
}

.result-stats strong {
  margin-top: 3px;
  font-size: 19px;
}

.result-highlight {
  margin: 13px 0 0 !important;
  padding: 7px 9px;
  border: 1px solid rgba(137, 54, 42, 0.22);
  color: #87382d !important;
  background: rgba(153, 61, 48, 0.06);
  font-weight: 700;
}

.result-highlight + #resultComment {
  margin-top: 8px;
  margin-bottom: 14px;
}

.highlight-screen {
  z-index: 64;
  background:
    radial-gradient(circle at 50% 36%, rgba(153, 52, 36, 0.28), transparent 46%),
    rgba(13, 11, 8, 0.94);
}

.highlight-poster {
  width: min(100%, 344px);
  min-height: 500px;
  padding: 28px 24px 22px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(231, 213, 171, 0.36);
  color: #f0dfba;
  background:
    linear-gradient(155deg, rgba(78, 28, 22, 0.98), rgba(24, 23, 19, 0.99) 58%, rgba(57, 47, 29, 0.98)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 6px);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.58), inset 0 0 60px rgba(226, 110, 54, 0.08);
  text-align: center;
}

.highlight-poster::before {
  content: "曹";
  position: absolute;
  right: -18px;
  top: 42px;
  opacity: 0.055;
  font-size: 178px;
  font-weight: 900;
  transform: rotate(-9deg);
}

.highlight-stamp {
  display: inline-block;
  padding: 4px 9px;
  border: 1px solid rgba(238, 196, 106, 0.48);
  color: #efc875;
  font-family: system-ui, sans-serif;
  font-size: 9px;
  letter-spacing: 0.2em;
}

.highlight-eyebrow {
  margin: 25px 0 5px;
  color: rgba(240, 223, 186, 0.58);
  font-size: 11px;
  letter-spacing: 0.13em;
}

.highlight-poster h2 {
  margin: 0;
  color: #f6d994;
  font-size: 34px;
  letter-spacing: 0.18em;
}

.highlight-formula {
  margin: 20px 0 0;
  padding: 10px 8px;
  border-top: 1px solid rgba(235, 204, 135, 0.2);
  border-bottom: 1px solid rgba(235, 204, 135, 0.2);
  color: #eda76b;
  font-size: 16px;
  letter-spacing: 0.08em;
}

.highlight-line {
  min-height: 46px;
  margin: 13px 0;
  color: rgba(240, 223, 186, 0.74);
  font-family: system-ui, sans-serif;
  font-size: 11px;
  line-height: 1.65;
}

.highlight-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.highlight-stats div {
  padding: 8px 4px;
  background: rgba(255, 255, 255, 0.035);
}

.highlight-stats span,
.highlight-stats strong {
  display: block;
  font-family: system-ui, sans-serif;
}

.highlight-stats span {
  color: rgba(240, 223, 186, 0.42);
  font-size: 8px;
}

.highlight-stats strong {
  margin-top: 2px;
  color: #efc875;
  font-size: 17px;
}

.highlight-build {
  margin: 13px 0 11px;
  color: rgba(240, 223, 186, 0.66);
  font-size: 10px;
}

.highlight-poster > small {
  display: block;
  margin-bottom: 13px;
  color: rgba(240, 223, 186, 0.32);
  font-family: system-ui, sans-serif;
  font-size: 8px;
}

.highlight-poster .primary-button {
  position: relative;
  z-index: 2;
  padding: 11px;
  background: #963a2e;
  font-size: 13px;
}

.prototype-note {
  position: fixed;
  left: 28px;
  bottom: 26px;
  width: 230px;
  color: rgba(231, 220, 193, 0.45);
  font-family: system-ui, sans-serif;
  font-size: 11px;
  line-height: 1.55;
}

.prototype-note span {
  color: rgba(213, 173, 88, 0.65);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.prototype-note p {
  margin: 6px 0 0;
}

@media (max-width: 760px) {
  .game-shell {
    padding: 0;
  }

  .phone-frame {
    width: 100%;
    height: 100dvh;
    min-height: 580px;
    border: 0;
    border-radius: 0;
  }

  .phone-frame::after {
    display: none;
  }

  .prototype-note {
    display: none;
  }
}

/* ---------- V14 · 随演义章节变化的场景色 ---------- */

.phone-frame {
  --scene-home-glow: rgba(158, 58, 41, 0.3);
  --scene-banner-a: #211611;
  --scene-banner-b: #68271f;
  --scene-paper-a: #e8dcc0;
  --scene-paper-b: #cbb98f;
  --scene-foil: #e2b85f;
  --scene-route: rgba(157, 56, 39, 0.52);
  --scene-mountain: #d8ad5e;
}

.phone-frame[data-scene="mist"],
.phone-frame[data-scene="daily"] {
  --scene-home-glow: rgba(75, 102, 108, 0.3);
  --scene-banner-a: #182124;
  --scene-banner-b: #334c50;
  --scene-paper-a: #dce0d3;
  --scene-paper-b: #adbab1;
  --scene-foil: #9fc8c3;
  --scene-route: rgba(60, 105, 109, 0.55);
  --scene-mountain: #8cb3ad;
}

.phone-frame[data-scene="ruse"],
.phone-frame[data-scene="siege"] {
  --scene-home-glow: rgba(113, 48, 76, 0.28);
  --scene-banner-a: #20151c;
  --scene-banner-b: #5b2638;
  --scene-paper-a: #e3d6c1;
  --scene-paper-b: #c3ab95;
  --scene-foil: #d79479;
  --scene-route: rgba(130, 46, 57, 0.52);
  --scene-mountain: #bd6c66;
}

.phone-frame[data-scene="iron"] {
  --scene-home-glow: rgba(85, 96, 99, 0.3);
  --scene-banner-a: #171c1d;
  --scene-banner-b: #3d4a4d;
  --scene-paper-a: #d9d7c7;
  --scene-paper-b: #aaa99c;
  --scene-foil: #c1c4aa;
  --scene-route: rgba(60, 72, 75, 0.58);
  --scene-mountain: #8d9994;
}

.phone-frame[data-scene="wind"],
.phone-frame[data-scene="jade"] {
  --scene-home-glow: rgba(68, 107, 78, 0.28);
  --scene-banner-a: #142019;
  --scene-banner-b: #34563f;
  --scene-paper-a: #e0dfc5;
  --scene-paper-b: #b7bd96;
  --scene-foil: #b4cd81;
  --scene-route: rgba(62, 103, 71, 0.55);
  --scene-mountain: #85a46f;
}

.phone-frame[data-scene="blaze"] {
  --scene-home-glow: rgba(205, 69, 35, 0.35);
  --scene-banner-a: #28120d;
  --scene-banner-b: #8b2c1d;
  --scene-paper-a: #ead7b6;
  --scene-paper-b: #c79e71;
  --scene-foil: #f0ae4c;
  --scene-route: rgba(200, 61, 31, 0.62);
  --scene-mountain: #e17743;
}

.phone-frame[data-scene="dusk"],
.phone-frame[data-scene="city"] {
  --scene-home-glow: rgba(129, 91, 43, 0.3);
  --scene-banner-a: #201912;
  --scene-banner-b: #59442b;
  --scene-paper-a: #e4d7bc;
  --scene-paper-b: #bfa77e;
  --scene-foil: #d4aa64;
  --scene-route: rgba(119, 82, 42, 0.56);
  --scene-mountain: #b28a52;
}

.phone-frame[data-scene="silk"] {
  --scene-home-glow: rgba(121, 66, 103, 0.3);
  --scene-banner-a: #21151f;
  --scene-banner-b: #603950;
  --scene-paper-a: #e6d8cc;
  --scene-paper-b: #c1a7ae;
  --scene-foil: #d9a2bb;
  --scene-route: rgba(118, 65, 101, 0.55);
  --scene-mountain: #ba7898;
}

.phone-frame[data-scene] .home-screen {
  background:
    radial-gradient(ellipse at 82% 14%, var(--scene-home-glow), transparent 31%),
    radial-gradient(ellipse at 18% 72%, rgba(181, 135, 60, 0.09), transparent 35%),
    linear-gradient(160deg, #231810 0%, #130f0c 52%, #0d0c0a 100%);
  transition: background 320ms ease;
}

.phone-frame[data-scene] .campaign-banner {
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 234, 184, 0.12), transparent 20%),
    linear-gradient(118deg, var(--scene-banner-a), var(--scene-banner-b));
  transition: background 320ms ease, border-color 320ms ease;
}

.phone-frame[data-scene] .campaign-banner::before {
  background: linear-gradient(150deg, var(--scene-mountain), var(--scene-banner-b));
}

.phone-frame[data-scene] .campaign-banner::after {
  content: attr(data-seal);
  color: var(--scene-foil);
}

.phone-frame[data-scene] .campaign-progress span {
  background: linear-gradient(90deg, var(--scene-banner-b), var(--scene-mountain) 62%, var(--scene-foil));
  box-shadow: 0 0 11px rgba(223, 174, 86, 0.34);
}

.phone-frame[data-scene] .battlefield-wrap::before {
  background:
    radial-gradient(ellipse at 16% 86%, rgba(62, 73, 55, 0.16) 0 12%, transparent 13%),
    radial-gradient(ellipse at 72% 10%, rgba(91, 74, 50, 0.09) 0 15%, transparent 16%),
    repeating-linear-gradient(0deg, rgba(88, 67, 41, 0.025) 0 1px, transparent 1px 5px),
    linear-gradient(160deg, var(--scene-paper-a), var(--scene-paper-b));
  transition: background 320ms ease;
}

.phone-frame[data-scene] .route-dash {
  stroke: var(--scene-route);
}

.phone-frame[data-scene] .hex-cell.frontier {
  color: var(--scene-foil);
}

.phone-frame[data-scene] .mode-card.selected,
.phone-frame[data-scene] .chapter-card.selected {
  border-color: var(--scene-route);
  background: rgba(112, 73, 47, 0.09);
  box-shadow: inset 0 0 0 1px rgba(112, 73, 47, 0.08);
}

.phone-frame[data-scene] .chapter-mark {
  border-color: var(--scene-route);
  color: var(--scene-banner-b);
}

.phone-frame[data-scene] .system-card::before {
  background: var(--scene-route);
}

.phone-frame[data-scene] .home-hero-strip {
  border-left-color: var(--scene-route);
}

.home-resources button,
.home-quick-grid button,
.home-primary,
.home-secondary,
.home-hero-strip button,
.home-nav button,
.system-action,
.mode-card,
.chapter-card,
.command-card {
  transition: transform 120ms ease, filter 160ms ease, border-color 180ms ease, background 180ms ease;
}

.home-resources button:active,
.home-quick-grid button:active,
.home-primary:active,
.home-secondary:active,
.home-hero-strip button:active,
.home-nav button:active,
.system-action:not(:disabled):active,
.mode-card:active,
.chapter-card:not(:disabled):active,
.command-card:not(:disabled):active {
  transform: scale(0.975);
}

.phone-frame[data-scene="mist"] .ink-cloud,
.phone-frame[data-scene="daily"] .ink-cloud {
  opacity: 0.72;
  background: rgba(70, 96, 101, 0.24);
  animation: inkDrift 7s ease-in-out infinite alternate;
}

.phone-frame[data-scene="blaze"] .ink-cloud {
  opacity: 0.62;
  background: rgba(178, 58, 31, 0.22);
  animation: emberBreath 2.8s ease-in-out infinite alternate;
}

.phone-frame[data-scene="wind"] .ink-cloud,
.phone-frame[data-scene="jade"] .ink-cloud {
  background: rgba(55, 91, 65, 0.2);
  animation: inkDrift 9s ease-in-out infinite alternate-reverse;
}

.overlay-screen:not(.hidden) > .start-scroll,
.overlay-screen:not(.hidden) > .result-scroll,
.overlay-screen:not(.hidden) > .system-scroll,
.overlay-screen:not(.hidden) > .decision-scroll,
.overlay-screen:not(.hidden) > .strategy-scroll {
  animation: scrollUnfurl 260ms ease-out both;
}

@keyframes inkDrift {
  from { translate: -7px 2px; scale: 0.96; }
  to { translate: 9px -5px; scale: 1.08; }
}

@keyframes emberBreath {
  from { opacity: 0.35; scale: 0.94; }
  to { opacity: 0.72; scale: 1.09; }
}

@keyframes scrollUnfurl {
  from { opacity: 0; transform: translateY(8px) scaleY(0.96); }
  to { opacity: 1; transform: translateY(0) scaleY(1); }
}

/* ---------- V15 · 群雄初起篇文字地标 ---------- */

.hex-cell.peach {
  color: #7b3943;
  background: linear-gradient(145deg, #dfc3b0, #c89d9d);
  filter: drop-shadow(0 2px 7px rgba(124, 55, 70, 0.28));
}

.hex-cell.yellow-banner {
  color: #6d4315;
  background: linear-gradient(145deg, #d9c06d, #b7943e);
  filter: drop-shadow(0 2px 7px rgba(126, 84, 25, 0.3));
}

.hex-cell.warm-wine {
  color: #f4d8a1;
  background: linear-gradient(145deg, #9d4933, #6f3028);
  filter: drop-shadow(0 2px 8px rgba(129, 47, 34, 0.4));
}

.hex-cell.alliance {
  color: #f0dfb6;
  background: linear-gradient(145deg, #66523a, #3c4d3e);
  filter: drop-shadow(0 2px 8px rgba(50, 64, 51, 0.36));
}

.hex-cell.xu-seal {
  color: #f1dbac;
  background: linear-gradient(145deg, #87603c, #60412d);
  filter: drop-shadow(0 2px 7px rgba(91, 60, 34, 0.34));
}

.hex-cell.thunder {
  color: #dbe8df;
  background: linear-gradient(145deg, #617177, #3e4a51);
  filter: drop-shadow(0 0 8px rgba(116, 151, 160, 0.38));
}

.hex-cell.gate {
  color: #e9d7b1;
  background: linear-gradient(145deg, #655340, #3f342b);
  filter: drop-shadow(0 3px 7px rgba(50, 39, 29, 0.38));
}

.hex-cell.visit {
  color: #e6e5c4;
  background: linear-gradient(145deg, #6b7853, #46563f);
  filter: drop-shadow(0 2px 8px rgba(57, 77, 51, 0.36));
}

.hex-cell.lure {
  color: #f3d9a5;
  background: linear-gradient(145deg, #a45c35, #733829);
  filter: drop-shadow(0 2px 8px rgba(145, 62, 35, 0.38));
}

.hex-cell.adou {
  color: #3e5e63;
  background: linear-gradient(145deg, #c8d4c3, #9eb8ae);
  filter: drop-shadow(0 2px 8px rgba(70, 106, 110, 0.28));
}

.hex-cell.bridge {
  color: #4b3d31;
  background: linear-gradient(145deg, #c0b39a, #948a78);
  filter: drop-shadow(0 3px 7px rgba(62, 51, 39, 0.3));
}

@media (max-height: 740px) {
  .topbar {
    min-height: 58px;
    padding-top: 8px;
    padding-bottom: 7px;
  }

  .seal {
    width: 32px;
    height: 32px;
    font-size: 17px;
  }

  .brand-block h1 {
    font-size: 16px;
  }

  .status-strip {
    padding-top: 6px;
    padding-bottom: 4px;
  }

  .status-card {
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .control-panel {
    padding-top: 5px;
    padding-bottom: 7px;
  }

  .objective-row {
    min-height: 34px;
  }

  .command-card {
    min-height: 48px;
  }

  .command-glyph {
    width: 31px;
    height: 34px;
    font-size: 21px;
  }
}

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

/* ---------- V13 · 汉末军帐 / 水墨兵书美术统一 ---------- */

body {
  background:
    radial-gradient(ellipse at 50% 115%, rgba(173, 112, 46, 0.16), transparent 48%),
    radial-gradient(circle at 14% 22%, rgba(151, 49, 35, 0.18), transparent 25%),
    linear-gradient(135deg, #080705 0%, #15100c 48%, #090806 100%);
}

body::before {
  content: "赤壁";
  position: fixed;
  right: 5vw;
  top: 4vh;
  color: rgba(213, 173, 88, 0.025);
  font-size: clamp(120px, 22vw, 340px);
  font-weight: 900;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
  pointer-events: none;
}

.phone-frame {
  border-color: rgba(210, 174, 102, 0.28);
  background:
    linear-gradient(180deg, rgba(27, 20, 14, 0.985), rgba(13, 12, 9, 0.995)),
    repeating-linear-gradient(90deg, transparent 0 5px, rgba(255, 255, 255, 0.025) 5px 6px);
  box-shadow:
    0 34px 110px rgba(0, 0, 0, 0.72),
    0 0 0 5px rgba(95, 62, 31, 0.12),
    inset 0 0 80px rgba(0, 0, 0, 0.3);
}

.topbar {
  border-bottom-color: rgba(211, 176, 104, 0.15);
  background:
    linear-gradient(90deg, rgba(128, 50, 35, 0.12), transparent 42%),
    repeating-linear-gradient(0deg, transparent 0 6px, rgba(255, 255, 255, 0.015) 6px 7px);
}

.seal,
.home-avatar {
  border-radius: 2px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 45%),
    #8e3028;
  box-shadow:
    inset 0 0 0 2px rgba(92, 28, 23, 0.75),
    inset 0 0 0 3px rgba(239, 213, 158, 0.52),
    0 6px 15px rgba(0, 0, 0, 0.28);
}

.brand-block h1,
.home-profile-copy strong,
.campaign-banner h2 {
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.42);
}

.status-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(218, 186, 123, 0.14);
  border-radius: 3px;
  background: linear-gradient(145deg, rgba(232, 213, 174, 0.07), rgba(232, 213, 174, 0.02));
}

.status-card::after {
  content: "";
  position: absolute;
  width: 32px;
  height: 32px;
  right: -17px;
  bottom: -18px;
  border: 1px solid rgba(215, 177, 102, 0.09);
  border-radius: 50%;
}

.battlefield-wrap::before {
  border-color: rgba(121, 92, 53, 0.19);
  border-radius: 47% 44% 49% 42% / 45% 48% 44% 50%;
  background:
    radial-gradient(ellipse at 16% 86%, rgba(62, 73, 55, 0.18) 0 12%, transparent 13%),
    radial-gradient(ellipse at 72% 10%, rgba(108, 74, 45, 0.13) 0 15%, transparent 16%),
    repeating-linear-gradient(0deg, rgba(88, 67, 41, 0.025) 0 1px, transparent 1px 5px),
    linear-gradient(160deg, #e8dcc0, #cbb98f);
  box-shadow:
    inset 0 0 75px rgba(62, 48, 29, 0.28),
    inset 0 0 0 4px rgba(244, 232, 201, 0.12),
    0 17px 35px rgba(0, 0, 0, 0.26);
}

.battlefield-wrap::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 7%;
  right: 7%;
  bottom: 10%;
  height: 23%;
  opacity: 0.14;
  background:
    repeating-radial-gradient(ellipse at 50% 115%, transparent 0 12px, rgba(68, 61, 47, 0.45) 13px 14px, transparent 15px 24px);
  clip-path: polygon(0 28%, 14% 36%, 30% 18%, 48% 43%, 64% 24%, 82% 40%, 100% 22%, 100% 100%, 0 100%);
  pointer-events: none;
}

.route-line {
  stroke: rgba(73, 54, 34, 0.5);
  stroke-width: 13;
}

.route-dash {
  stroke: rgba(157, 56, 39, 0.52);
  stroke-width: 2.4;
}

.hex-cell {
  filter: drop-shadow(0 2px 2px rgba(48, 36, 23, 0.16));
}

.hex-cell::before {
  inset: 2.5px;
  border-color: rgba(72, 50, 31, 0.25);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 45%),
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(75, 51, 31, 0.025) 4px 5px);
}

.hex-cell.fog {
  background:
    radial-gradient(circle at 38% 30%, rgba(180, 171, 145, 0.08), transparent 24%),
    linear-gradient(145deg, #302d27, #201f1b);
}

.hex-cell.frontier {
  color: #efc870;
  background:
    radial-gradient(circle at 50% 45%, rgba(230, 181, 80, 0.22), transparent 48%),
    linear-gradient(145deg, #484136, #292923);
}

.hex-cell.hero,
.hex-cell.camp {
  filter: drop-shadow(0 4px 7px rgba(45, 24, 17, 0.38)) drop-shadow(0 0 4px rgba(222, 185, 100, 0.22));
}

.hex-cell .glyph {
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 248, 224, 0.2), 0 2px 5px rgba(44, 30, 18, 0.12);
}

.control-panel {
  border-top-color: rgba(222, 183, 107, 0.18);
  background:
    linear-gradient(180deg, rgba(25, 19, 14, 0.92), rgba(11, 10, 8, 0.98)),
    repeating-linear-gradient(90deg, transparent 0 6px, rgba(255, 255, 255, 0.015) 6px 7px);
  box-shadow: 0 -14px 30px rgba(0, 0, 0, 0.22);
}

.command-card {
  border-radius: 4px;
  box-shadow: inset 0 0 18px rgba(235, 203, 142, 0.025), 0 5px 12px rgba(0, 0, 0, 0.16);
}

.command-glyph {
  border-radius: 2px;
  box-shadow: inset 0 0 0 2px rgba(92, 28, 22, 0.25);
}

.home-screen {
  isolation: isolate;
  background:
    radial-gradient(ellipse at 82% 14%, rgba(157, 58, 40, 0.3), transparent 30%),
    radial-gradient(ellipse at 18% 72%, rgba(181, 135, 60, 0.11), transparent 35%),
    linear-gradient(160deg, #241810 0%, #130f0c 52%, #0d0c0a 100%);
}

.home-screen::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 70px;
  opacity: 0.2;
  background:
    linear-gradient(152deg, transparent 0 56%, rgba(205, 180, 125, 0.13) 57% 58%, transparent 59%),
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(234, 218, 184, 0.025) 7px 8px);
  pointer-events: none;
}

.home-screen::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -8%;
  right: -8%;
  bottom: 66px;
  height: 27%;
  opacity: 0.16;
  background: linear-gradient(170deg, transparent 0 40%, #b9985d 41% 43%, transparent 44% 100%);
  clip-path: polygon(0 100%, 0 62%, 10% 53%, 19% 70%, 31% 30%, 42% 64%, 55% 41%, 66% 73%, 79% 24%, 90% 60%, 100% 46%, 100% 100%);
  pointer-events: none;
}

.home-profile {
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(223, 190, 122, 0.11);
}

.home-resources button {
  border-color: rgba(225, 190, 120, 0.15);
  border-radius: 3px;
  background: linear-gradient(145deg, rgba(230, 205, 154, 0.075), rgba(230, 205, 154, 0.025));
  box-shadow: inset 0 0 16px rgba(211, 154, 68, 0.025);
}

.home-resources button > span {
  border: 1px solid rgba(255, 237, 192, 0.35);
  color: #40291a;
  background: linear-gradient(145deg, #e2c580, #ae8744);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.24);
}

.campaign-banner {
  border-color: rgba(235, 194, 109, 0.32);
  background:
    radial-gradient(circle at 88% 12%, rgba(229, 165, 75, 0.12), transparent 19%),
    linear-gradient(118deg, rgba(29, 20, 15, 0.98), rgba(104, 38, 29, 0.92));
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.34),
    inset 0 0 42px rgba(215, 139, 59, 0.08),
    inset 0 0 0 3px rgba(34, 24, 18, 0.3);
}

.campaign-banner::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: -3%;
  right: -3%;
  bottom: 48px;
  height: 53%;
  opacity: 0.2;
  background: linear-gradient(150deg, #e3be72, #7f3029);
  clip-path: polygon(0 100%, 0 68%, 10% 51%, 20% 72%, 34% 27%, 47% 67%, 60% 45%, 72% 74%, 84% 35%, 100% 64%, 100% 100%);
}

.campaign-banner::after {
  right: -2px;
  bottom: -30px;
  opacity: 0.07;
  color: #f0cc78;
  font-size: 148px;
  text-shadow: none;
}

.campaign-progress {
  height: 5px;
  border: 1px solid rgba(235, 210, 158, 0.08);
  background: rgba(9, 7, 5, 0.35);
}

.campaign-progress span {
  background: linear-gradient(90deg, #a83b2e, #dc8950 62%, #ebc775);
  box-shadow: 0 0 10px rgba(225, 138, 72, 0.35);
}

.home-primary,
.primary-button {
  position: relative;
  overflow: hidden;
  border-color: rgba(247, 216, 157, 0.28);
  background: linear-gradient(145deg, #ac4936, #7f2b24);
  box-shadow: inset 0 0 0 2px rgba(79, 24, 20, 0.2), 0 7px 17px rgba(67, 21, 17, 0.32);
}

.home-primary::after,
.primary-button::after {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(255, 232, 184, 0.09);
  pointer-events: none;
}

.home-secondary {
  background: linear-gradient(145deg, rgba(232, 215, 181, 0.1), rgba(232, 215, 181, 0.025));
}

.home-quick-grid button {
  border-color: rgba(226, 190, 117, 0.14);
  background: linear-gradient(155deg, rgba(232, 213, 174, 0.07), rgba(232, 213, 174, 0.02));
  box-shadow: inset 0 0 22px rgba(206, 143, 60, 0.02), 0 5px 13px rgba(0, 0, 0, 0.13);
}

.home-quick-grid button > span {
  border-color: rgba(239, 206, 139, 0.36);
  background: linear-gradient(145deg, rgba(146, 54, 42, 0.78), rgba(74, 35, 28, 0.72));
  box-shadow: inset 0 0 0 2px rgba(37, 24, 18, 0.24), 0 4px 9px rgba(0, 0, 0, 0.2);
  transform: rotate(-1.5deg);
}

.home-hero-strip {
  border-top: 1px solid rgba(225, 192, 127, 0.1);
  border-right: 1px solid rgba(225, 192, 127, 0.08);
  border-bottom: 1px solid rgba(225, 192, 127, 0.1);
  background: linear-gradient(90deg, rgba(145, 54, 41, 0.11), rgba(232, 213, 174, 0.035));
}

.home-nav {
  border-top-color: rgba(222, 183, 107, 0.18);
  background:
    linear-gradient(180deg, rgba(25, 19, 14, 0.98), rgba(9, 8, 7, 0.995)),
    repeating-linear-gradient(90deg, transparent 0 7px, rgba(255, 255, 255, 0.015) 7px 8px);
}

.home-nav .battle-nav span {
  border-color: #160f0b;
  background: linear-gradient(145deg, #bb4d37, #79271f);
  box-shadow: 0 6px 20px rgba(134, 42, 30, 0.58), inset 0 0 0 2px rgba(245, 209, 144, 0.12);
}

.system-screen {
  background:
    radial-gradient(circle at 50% 34%, rgba(165, 105, 47, 0.18), transparent 40%),
    rgba(8, 7, 5, 0.92);
}

.system-scroll {
  position: relative;
  isolation: isolate;
  border-color: rgba(102, 68, 33, 0.4);
  background:
    radial-gradient(ellipse at 86% 8%, rgba(145, 54, 41, 0.08), transparent 22%),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(73, 49, 28, 0.025) 5px 6px),
    linear-gradient(160deg, #f0e3c4, #cfbc92);
  box-shadow: 0 24px 85px rgba(0, 0, 0, 0.68), inset 0 0 55px rgba(82, 54, 30, 0.13);
}

.system-scroll::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 7px;
  border: 1px solid rgba(82, 53, 29, 0.09);
  pointer-events: none;
}

.system-card {
  position: relative;
  border-color: rgba(76, 49, 27, 0.17);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(111, 74, 38, 0.035));
  box-shadow: 0 3px 8px rgba(67, 42, 22, 0.06);
}

.system-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2px;
  background: rgba(142, 52, 41, 0.42);
}

.system-glyph {
  border: 1px solid rgba(80, 41, 31, 0.22);
  background: linear-gradient(145deg, #825043, #5d342c);
  box-shadow: inset 0 0 0 2px rgba(240, 216, 171, 0.08), 0 3px 8px rgba(70, 39, 27, 0.18);
}

.system-action {
  border-color: rgba(106, 43, 34, 0.35);
  background: linear-gradient(145deg, #a14535, #753027);
  box-shadow: inset 0 0 0 1px rgba(243, 213, 159, 0.08);
}

.system-summary {
  border: 1px solid rgba(231, 194, 120, 0.18);
  background: linear-gradient(135deg, #704236, #4e3028);
  box-shadow: inset 0 0 24px rgba(232, 176, 81, 0.05);
}

.start-scroll,
.result-scroll,
.strategy-scroll,
.decision-scroll {
  background:
    radial-gradient(ellipse at 84% 12%, rgba(148, 58, 42, 0.07), transparent 22%),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(74, 48, 27, 0.025) 5px 6px),
    linear-gradient(160deg, #f0e2c1, #ccb88c);
  box-shadow:
    0 24px 85px rgba(0, 0, 0, 0.62),
    inset 0 0 55px rgba(75, 48, 25, 0.14),
    inset 0 0 0 1px rgba(255, 247, 222, 0.24);
}

.chapter-mark {
  border-color: rgba(133, 45, 35, 0.48);
  box-shadow: inset 0 0 0 1px rgba(133, 45, 35, 0.06);
}

.result-reward {
  border-color: rgba(156, 87, 34, 0.32);
  background:
    linear-gradient(100deg, rgba(211, 153, 62, 0.17), rgba(255, 255, 255, 0.08)),
    repeating-linear-gradient(90deg, transparent 0 5px, rgba(95, 57, 26, 0.025) 5px 6px);
  box-shadow: inset 0 0 18px rgba(151, 86, 31, 0.05);
}

button:focus-visible {
  outline: 2px solid rgba(236, 190, 99, 0.85);
  outline-offset: 2px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ui-icon {
  width: 1em;
  height: 1em;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.icon-button .ui-icon,
.home-round-button .ui-icon {
  width: 19px;
  height: 19px;
  margin: auto;
}

.home-resources button > span .ui-icon {
  width: 18px;
  height: 18px;
}

.home-quick-grid button > span .ui-icon {
  width: 19px;
  height: 19px;
}

.home-quick-grid button > span,
.home-resources button > span {
  color: #f3d998;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 226, 161, 0.18), transparent 35%),
    linear-gradient(145deg, #86503d, #5e312a);
  box-shadow:
    inset 0 0 0 1px rgba(247, 216, 153, 0.12),
    0 3px 8px rgba(35, 18, 14, 0.28);
}

.home-quick-grid button > span {
  border: 1px solid rgba(231, 191, 112, 0.22);
  transform: rotate(45deg);
}

.home-quick-grid button > span .ui-icon {
  transform: rotate(-45deg);
}

.home-recruit-seal .ui-icon {
  width: 25px;
  height: 25px;
  stroke-width: 1.7;
}

.home-nav button > span .ui-icon {
  width: 20px;
  height: 20px;
  margin: auto;
  stroke-width: 1.85;
}

.home-nav button:not(.battle-nav) > span {
  width: 28px;
  height: 25px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border-bottom: 1px solid rgba(230, 192, 118, 0.14);
}

.home-nav .battle-nav span .ui-icon {
  width: 25px;
  height: 25px;
  filter: drop-shadow(0 2px 2px rgba(32, 13, 10, 0.42));
}

.home-nav button:hover .ui-icon,
.home-quick-grid button:hover .ui-icon,
.home-resources button:hover .ui-icon,
.home-recruit-card:hover .ui-icon {
  filter: drop-shadow(0 0 5px rgba(241, 198, 106, 0.35));
}

.home-recruit-card {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  overflow: hidden;
  border: 1px solid rgba(223, 182, 99, 0.2);
  color: #ecd9b1;
  background:
    radial-gradient(circle at 13% 50%, rgba(218, 160, 74, 0.19), transparent 23%),
    linear-gradient(105deg, rgba(93, 49, 39, 0.96), rgba(41, 31, 27, 0.96));
  text-align: left;
  box-shadow: inset 0 0 24px rgba(211, 147, 56, 0.04), 0 5px 14px rgba(0, 0, 0, 0.16);
}

.home-recruit-card::after {
  content: "募";
  position: absolute;
  right: 33px;
  top: -20px;
  color: rgba(240, 204, 138, 0.045);
  font-size: 80px;
  font-weight: 900;
  transform: rotate(-8deg);
}

.home-recruit-seal {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 208, 136, 0.24);
  color: #ffe5aa;
  background: linear-gradient(145deg, #a14634, #6d2f29);
  box-shadow: inset 0 0 0 2px rgba(249, 220, 161, 0.08);
  font-size: 23px;
  font-weight: 900;
}

.home-recruit-card small,
.home-recruit-card strong,
.home-recruit-card em { display: block; position: relative; z-index: 1; }
.home-recruit-card small { color: rgba(236, 217, 177, 0.54); font: 8px/1.3 system-ui, sans-serif; }
.home-recruit-card strong { margin-top: 3px; font-size: 13px; letter-spacing: 0.08em; }
.home-recruit-card em { margin-top: 3px; color: #d9ae61; font: 8px/1.2 system-ui, sans-serif; font-style: normal; }
.home-recruit-card > b { position: relative; z-index: 1; color: #dfba71; font: 9px/1 system-ui, sans-serif; }

.home-hero-strip em {
  display: block;
  margin-top: 3px;
  color: #c79852;
  font: 8px/1.2 system-ui, sans-serif;
  font-style: normal;
  letter-spacing: 0.04em;
}

.home-hero-strip em[data-quality="green"] { color: #55835b; }
.home-hero-strip em[data-quality="blue"] { color: #527aab; }
.home-hero-strip em[data-quality="purple"] { color: #80569b; }
.home-hero-strip em[data-quality="gold"] { color: #b27b23; text-shadow: 0 0 8px rgba(211, 155, 45, 0.16); }
.home-hero-strip em[data-quality="red"] { color: #b23f35; text-shadow: 0 0 8px rgba(196, 51, 41, 0.18); }

.home-bond-line {
  display: block;
  max-width: 218px;
  margin-top: 3px;
  overflow: hidden;
  color: rgba(226, 210, 180, 0.52);
  font: 7px/1.2 system-ui, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-bond-line.active {
  color: #d6a850;
  text-shadow: 0 0 8px rgba(222, 164, 60, 0.17);
}

.hero-card-actions { display: grid; gap: 5px; min-width: 58px; }
.system-action.secondary { color: #713c30; background: rgba(255, 255, 255, 0.18); box-shadow: none; }

.lineup-summary { padding: 12px; }
.lineup-summary > strong,
.lineup-summary > small { display: block; }
.lineup-summary > small { margin-top: 4px; color: rgba(244, 222, 179, 0.65); }

.lineup-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.lineup-slots > span {
  min-width: 0;
  padding: 7px 4px 6px;
  border: 1px solid rgba(237, 203, 137, 0.19);
  background: rgba(255, 255, 255, 0.055);
  text-align: center;
}

.lineup-slots > span.empty { border-style: dashed; opacity: 0.48; }
.lineup-slots i,
.lineup-slots b,
.lineup-slots em { display: block; }
.lineup-slots i { color: rgba(244, 222, 179, 0.5); font: 6px/1 system-ui, sans-serif; font-style: normal; }
.lineup-slots b { width: 30px; height: 30px; display: grid; place-items: center; margin: 5px auto; border: 1px solid rgba(244, 211, 146, 0.22); color: #f5dca9; background: linear-gradient(145deg, #934938, #56312a); font-size: 17px; }
.lineup-slots em { overflow: hidden; color: #f1dcb4; font: 8px/1 system-ui, sans-serif; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }

.hero-roster-card.in-lineup {
  border-color: rgba(169, 109, 45, 0.34);
  background: linear-gradient(145deg, rgba(255, 250, 225, 0.25), rgba(179, 113, 46, 0.08));
}

.hero-roster-card.in-lineup::before { width: 3px; background: #b87832; }

.bond-section-title {
  margin: 16px 0 8px;
  color: #6d392b;
  font-size: 14px;
  letter-spacing: 0.14em;
}

.bond-grid { display: grid; gap: 7px; }

.bond-card {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid rgba(77, 51, 30, 0.15);
  background: rgba(255, 255, 255, 0.11);
  opacity: 0.62;
}

.bond-card > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(94, 54, 34, 0.22);
  color: #edd5a8;
  background: linear-gradient(145deg, #6b4b3d, #3d3732);
  font-size: 18px;
  font-weight: 900;
}

.bond-card strong,
.bond-card small { display: block; }
.bond-card strong { color: #4c3025; font-size: 11px; }
.bond-card small { margin-top: 2px; color: rgba(56, 39, 28, 0.54); font: 7px/1.2 system-ui, sans-serif; }
.bond-card p { margin: 5px 0 0; color: rgba(56, 39, 28, 0.72); font: 8px/1.45 system-ui, sans-serif; }
.bond-card > em { padding: 3px 5px; border: 1px solid rgba(75, 52, 33, 0.14); color: rgba(58, 40, 29, 0.52); font: 7px/1 system-ui, sans-serif; font-style: normal; }
.bond-card.active { opacity: 1; border-color: rgba(174, 94, 39, 0.42); background: linear-gradient(145deg, rgba(255, 244, 205, 0.38), rgba(173, 80, 42, 0.1)); box-shadow: inset 3px 0 #a84d37, 0 5px 12px rgba(84, 45, 28, 0.08); }
.bond-card.active > span { color: #ffe1a3; background: linear-gradient(145deg, #ad4b36, #703027); box-shadow: 0 0 12px rgba(176, 72, 47, 0.2); }
.bond-card.active > em { color: #f0d6a6; border-color: #8d3d30; background: #8d3d30; }

.recruit-banner {
  position: relative;
  min-height: 142px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  align-items: center;
  gap: 10px;
  padding: 17px;
  overflow: hidden;
  border: 1px solid rgba(239, 198, 113, 0.24);
  color: #f2dfb8;
  background:
    radial-gradient(circle at 80% 40%, rgba(225, 169, 72, 0.23), transparent 27%),
    repeating-linear-gradient(120deg, transparent 0 8px, rgba(255, 230, 177, 0.018) 8px 9px),
    linear-gradient(135deg, #65372f, #2e2925 72%);
  box-shadow: inset 0 0 36px rgba(230, 177, 83, 0.05), 0 7px 18px rgba(62, 39, 25, 0.18);
}

.recruit-banner-copy { position: relative; z-index: 1; }
.recruit-banner-copy small { color: rgba(243, 220, 177, 0.56); font: 8px/1.3 system-ui, sans-serif; letter-spacing: 0.08em; }
.recruit-banner-copy strong { display: block; margin-top: 7px; font-size: 20px; letter-spacing: 0.08em; }
.recruit-banner-copy p { margin: 8px 0 0; color: rgba(243, 226, 194, 0.67); font: 9px/1.55 system-ui, sans-serif; }
.recruit-banner-glyph {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(241, 199, 108, 0.4);
  border-radius: 50%;
  color: #ffe4a6;
  background: radial-gradient(circle, #a94a36, #672e28 70%);
  box-shadow: 0 0 0 6px rgba(239, 191, 97, 0.05), 0 9px 24px rgba(0, 0, 0, 0.25);
  font-size: 39px;
  font-weight: 900;
}

.recruit-status {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 10px 0;
}

.recruit-status span { padding: 9px 6px; border: 1px solid rgba(79, 52, 29, 0.14); background: rgba(255, 255, 255, 0.13); text-align: center; }
.recruit-status small,
.recruit-status strong { display: block; }
.recruit-status small { color: rgba(52, 39, 29, 0.52); font: 8px/1.2 system-ui, sans-serif; }
.recruit-status strong { margin-top: 4px; color: #76372f; font-size: 15px; }

.recruit-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.recruit-actions button { padding: 11px 8px; border: 1px solid rgba(117, 47, 35, 0.34); color: #f5e1b9; background: linear-gradient(145deg, #a54b37, #6e2e27); }
.recruit-actions button:last-child { color: #39271c; border-color: rgba(125, 84, 37, 0.3); background: linear-gradient(145deg, #e0be79, #b88542); }
.recruit-actions button:disabled { opacity: 0.38; filter: grayscale(0.4); }
.recruit-actions strong,
.recruit-actions small { display: block; }
.recruit-actions strong { font-size: 12px; }
.recruit-actions small { margin-top: 4px; opacity: 0.7; font: 8px/1.2 system-ui, sans-serif; }
.recruit-welcome { width: 100%; margin-top: 7px; padding: 8px; border: 1px dashed rgba(126, 76, 31, 0.34); color: #74412e; background: rgba(255, 247, 218, 0.15); font: 9px/1.2 system-ui, sans-serif; }
.recruit-welcome:disabled { opacity: 0.45; }
.recruit-rule { margin-top: 11px; }

.recruit-roster { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.recruit-roster > div { padding: 8px 5px; border: 1px dashed rgba(76, 48, 27, 0.16); opacity: 0.47; text-align: center; }
.recruit-roster > div.owned { opacity: 1; border-style: solid; background: rgba(255, 255, 255, 0.11); }
.recruit-roster span { width: 34px; height: 34px; display: grid; place-items: center; margin: 0 auto 5px; color: #f0dab2; background: #6b4035; font-size: 18px; font-weight: 900; }
.recruit-roster strong,
.recruit-roster small { display: block; }
.recruit-roster strong { font-size: 10px; }
.recruit-roster small { margin-top: 3px; color: rgba(52, 39, 29, 0.53); font: 7px/1.25 system-ui, sans-serif; }

.recruit-results { margin: 10px 0; padding: 9px; border: 1px solid rgba(148, 89, 34, 0.2); background: rgba(255, 248, 226, 0.14); }
.recruit-results > p { margin: 0 0 7px; color: #7f4930; font-size: 10px; text-align: center; letter-spacing: 0.18em; }
.recruit-results > div { display: flex; justify-content: center; gap: 5px; }
.recruit-result { min-width: 49px; padding: 6px 3px; border: 1px solid rgba(82, 54, 30, 0.16); background: rgba(255, 255, 255, 0.15); text-align: center; animation: recruit-reveal 420ms both; }
.recruit-result:nth-child(2) { animation-delay: 70ms; }
.recruit-result:nth-child(3) { animation-delay: 140ms; }
.recruit-result:nth-child(4) { animation-delay: 210ms; }
.recruit-result:nth-child(5) { animation-delay: 280ms; }
.recruit-result.new { border-color: rgba(163, 91, 31, 0.48); background: linear-gradient(#f1dcae, rgba(210, 163, 80, 0.2)); box-shadow: 0 0 14px rgba(198, 137, 47, 0.18); }
.recruit-result span { width: 30px; height: 30px; display: grid; place-items: center; margin: 0 auto 4px; color: #f6dfb2; background: #743d32; font-size: 17px; font-weight: 900; }
.recruit-result strong,
.recruit-result small { display: block; }
.recruit-result strong { font-size: 9px; }
.recruit-result small { margin-top: 3px; color: #934133; font: 7px/1 system-ui, sans-serif; }

.weapon-summary {
  border-color: rgba(103, 69, 39, 0.24);
  background:
    linear-gradient(115deg, rgba(255, 250, 231, 0.16), rgba(116, 75, 44, 0.06)),
    repeating-linear-gradient(135deg, transparent 0 6px, rgba(83, 51, 29, 0.018) 6px 7px);
}

.weapon-quality-badge {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 4px;
  border: 1px solid currentColor;
  color: var(--weapon-quality, #55835b);
  background: rgba(255, 255, 255, 0.12);
  font: 6px/1 system-ui, sans-serif;
  font-style: normal;
  letter-spacing: 0;
  vertical-align: 2px;
}

.weapon-card,
.weapon-summary,
.weapon-draw-results .recruit-result,
.weapon-roster > div { --weapon-quality: #55835b; }
.weapon-card.quality-green,
.weapon-summary.quality-green,
.weapon-draw-results .quality-green,
.weapon-roster > .quality-green { --weapon-quality: #4f8a59; }
.weapon-card.quality-blue,
.weapon-summary.quality-blue,
.weapon-draw-results .quality-blue,
.weapon-roster > .quality-blue { --weapon-quality: #4779af; }
.weapon-card.quality-purple,
.weapon-summary.quality-purple,
.weapon-draw-results .quality-purple,
.weapon-roster > .quality-purple { --weapon-quality: #8152a1; }
.weapon-card.quality-gold,
.weapon-summary.quality-gold,
.weapon-draw-results .quality-gold,
.weapon-roster > .quality-gold { --weapon-quality: #c18a28; }
.weapon-card.quality-red,
.weapon-summary.quality-red,
.weapon-draw-results .quality-red,
.weapon-roster > .quality-red { --weapon-quality: #bd3e34; }

.weapon-card {
  border-color: color-mix(in srgb, var(--weapon-quality) 38%, rgba(76, 49, 27, 0.17));
}

.weapon-card::before { background: var(--weapon-quality); }
.weapon-card .weapon-glyph {
  border-color: color-mix(in srgb, var(--weapon-quality) 58%, rgba(80, 41, 31, 0.22));
  background: linear-gradient(145deg, color-mix(in srgb, var(--weapon-quality) 62%, #806650), #343735);
}

.weapon-summary .weapon-quality-badge { color: #f5dfb4; border-color: rgba(247, 222, 170, 0.35); background: color-mix(in srgb, var(--weapon-quality) 48%, transparent); }
.weapon-summary.quality-gold { box-shadow: inset 3px 0 var(--weapon-quality), inset 0 0 26px rgba(226, 172, 59, 0.1); }
.weapon-summary.quality-red { box-shadow: inset 3px 0 var(--weapon-quality), inset 0 0 30px rgba(208, 54, 42, 0.13); }

.weapon-draw-entry {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin: 9px 0 11px;
  padding: 9px 10px;
  overflow: hidden;
  border: 1px solid rgba(105, 60, 34, 0.28);
  color: #f0d7aa;
  background:
    radial-gradient(circle at 9% 50%, rgba(236, 172, 63, 0.22), transparent 23%),
    linear-gradient(110deg, #60443a, #2f3231 72%);
  text-align: left;
  box-shadow: 0 5px 13px rgba(47, 29, 20, 0.16), inset 0 0 20px rgba(242, 189, 83, 0.04);
}

.weapon-draw-entry::after {
  content: "兵";
  position: absolute;
  right: 38px;
  top: -18px;
  color: rgba(255, 225, 166, 0.04);
  font-size: 67px;
  font-weight: 900;
  transform: rotate(-8deg);
}

.weapon-draw-entry > span {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(246, 210, 138, 0.31);
  color: #ffe0a2;
  background: linear-gradient(145deg, #a34932, #683025);
  font-size: 20px;
  font-weight: 900;
}

.weapon-draw-entry strong,
.weapon-draw-entry b { position: relative; z-index: 1; }
.weapon-draw-entry strong { font-size: 11px; letter-spacing: 0.08em; }
.weapon-draw-entry b { color: #d9af67; font: 8px/1 system-ui, sans-serif; }

.weapon-glyph {
  color: #f4d7a2;
  background: linear-gradient(145deg, #6f4f42, #353938);
  box-shadow: inset 0 0 0 2px rgba(246, 213, 151, 0.06);
}

.weapon-card.locked .weapon-glyph {
  color: rgba(72, 53, 39, 0.4);
  background: rgba(77, 62, 48, 0.1);
  box-shadow: none;
}

.weapon-draw-banner {
  border-color: rgba(230, 178, 87, 0.28);
  background:
    radial-gradient(circle at 79% 40%, rgba(241, 154, 55, 0.28), transparent 26%),
    repeating-linear-gradient(125deg, transparent 0 9px, rgba(255, 232, 184, 0.02) 9px 10px),
    linear-gradient(135deg, #493e38, #242d2d 72%);
}

.weapon-draw-banner .recruit-banner-glyph {
  border-radius: 8px 50% 8px 50%;
  color: #ffe2aa;
  background: radial-gradient(circle, #a84930, #56352d 72%);
}

.weapon-vault-link {
  width: 100%;
  margin-top: 7px;
  padding: 8px;
  border: 1px solid rgba(90, 58, 34, 0.22);
  color: #69412f;
  background: rgba(255, 250, 232, 0.15);
  font: 9px/1.2 system-ui, sans-serif;
}

.weapon-overview { grid-template-columns: repeat(2, 1fr); }

.weapon-pity-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin: -3px 0 9px;
}

.weapon-pity-strip span {
  position: relative;
  padding: 7px 3px 6px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--pity-color) 42%, rgba(79, 52, 29, 0.14));
  background: color-mix(in srgb, var(--pity-color) 8%, rgba(255, 255, 255, 0.12));
  text-align: center;
}

.weapon-pity-strip span::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--pity-color);
}

.weapon-pity-strip .quality-purple { --pity-color: #8152a1; }
.weapon-pity-strip .quality-gold { --pity-color: #c18a28; }
.weapon-pity-strip .quality-red { --pity-color: #bd3e34; }
.weapon-pity-strip small,
.weapon-pity-strip strong { display: block; }
.weapon-pity-strip small { color: rgba(52, 39, 29, 0.57); font: 7px/1.2 system-ui, sans-serif; }
.weapon-pity-strip strong { margin-top: 3px; color: var(--pity-color); font-size: 11px; }

.weapon-roster > div.owned {
  border-color: rgba(126, 77, 39, 0.28);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(156, 96, 43, 0.08));
}

.weapon-roster > div {
  position: relative;
  border-color: color-mix(in srgb, var(--weapon-quality) 36%, rgba(76, 48, 27, 0.16));
}

.weapon-roster > div::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 2px;
  height: 2px;
  background: var(--weapon-quality);
  opacity: 0.65;
}

.weapon-roster > div > i {
  display: block;
  margin: 0 0 5px;
  color: var(--weapon-quality);
  font: 6px/1 system-ui, sans-serif;
  font-style: normal;
}

.weapon-roster span,
.weapon-draw-results .recruit-result span {
  border: 1px solid color-mix(in srgb, var(--weapon-quality) 60%, transparent);
  background: linear-gradient(145deg, color-mix(in srgb, var(--weapon-quality) 62%, #715747), #343b3a);
}

.weapon-draw-results .recruit-result {
  min-width: 0;
  flex: 1;
}

.weapon-draw-results .recruit-result strong {
  overflow: hidden;
  font-size: 7px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weapon-draw-results .recruit-result {
  position: relative;
  border-color: color-mix(in srgb, var(--weapon-quality) 50%, rgba(82, 54, 30, 0.16));
}

.weapon-draw-results .recruit-result > i {
  display: block;
  margin: 0 0 3px;
  color: var(--weapon-quality);
  font: 6px/1 system-ui, sans-serif;
  font-style: normal;
}

.weapon-draw-results .recruit-result.quality-gold {
  box-shadow: inset 0 0 11px rgba(211, 155, 45, 0.16), 0 0 9px rgba(211, 155, 45, 0.09);
}

.weapon-draw-results .recruit-result.quality-red {
  background: linear-gradient(145deg, rgba(245, 213, 167, 0.35), rgba(184, 54, 43, 0.14));
  box-shadow: inset 0 0 14px rgba(204, 62, 48, 0.2), 0 0 13px rgba(204, 62, 48, 0.18);
  animation: recruit-reveal 420ms both, artifact-pulse 1.6s 520ms ease-in-out infinite alternate;
}

@keyframes artifact-pulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.13); }
}

@keyframes recruit-reveal {
  from { opacity: 0; transform: translateY(9px) rotateY(70deg); filter: brightness(1.8); }
  to { opacity: 1; transform: translateY(0) rotateY(0); filter: brightness(1); }
}

.home-avatar {
  padding: 0;
  border: 1px solid rgba(236, 200, 127, 0.32);
  cursor: pointer;
}

.phone-frame[data-faction="wei"] .home-avatar { color: #e5edf2; background: linear-gradient(145deg, #667887, #354652); }
.phone-frame[data-faction="shu"] .home-avatar { color: #edf2d7; background: linear-gradient(145deg, #657a4b, #3e5537); }
.phone-frame[data-faction="wu"] .home-avatar { color: #ffe5b0; background: linear-gradient(145deg, #9a5738, #663328); }

.faction-summary { margin-bottom: 12px; }

.faction-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.faction-choice {
  min-width: 0;
  min-height: 245px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 13px 7px 10px;
  border: 1px solid rgba(78, 51, 29, 0.2);
  color: #3e2c21;
  background: rgba(255, 255, 255, 0.13);
  text-align: center;
  box-shadow: inset 0 0 24px rgba(88, 52, 27, 0.04);
}

.faction-choice > span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border: 2px solid rgba(245, 213, 149, 0.26);
  border-radius: 50%;
  color: #f5e5c7;
  background: #654032;
  box-shadow: 0 7px 16px rgba(53, 31, 21, 0.2), inset 0 0 0 4px rgba(255, 239, 201, 0.05);
  font-size: 30px;
  font-weight: 900;
}

.faction-choice strong,
.faction-choice em,
.faction-choice small,
.faction-choice b { display: block; }
.faction-choice strong { min-height: 34px; font-size: 13px; }
.faction-choice em { min-height: 32px; margin-top: 7px; color: #8d3d30; font: 9px/1.45 system-ui, sans-serif; font-style: normal; font-weight: 700; }
.faction-choice small { min-height: 28px; margin-top: 6px; color: rgba(55, 39, 28, 0.56); font: 8px/1.4 system-ui, sans-serif; }
.faction-choice b { width: 100%; margin-top: auto; padding: 8px 3px; border: 1px solid rgba(102, 55, 35, 0.22); color: #f1dcb4; background: #7c382e; font: 9px/1 system-ui, sans-serif; }
.faction-choice:disabled { opacity: 1; }
.faction-choice.selected { box-shadow: inset 0 0 0 2px rgba(137, 67, 45, 0.18); }
.faction-choice.selected b { color: #75402d; background: rgba(255, 255, 255, 0.18); }
.faction-choice.faction-wei > span { background: linear-gradient(145deg, #687d8c, #354753); }
.faction-choice.faction-shu > span { background: linear-gradient(145deg, #6e8151, #405739); }
.faction-choice.faction-wu > span { background: linear-gradient(145deg, #a35a39, #663328); }
.system-screen[data-system="faction"] .system-head button:disabled { visibility: hidden; }

@media (max-width: 760px) {
  body::before { display: none; }

  .phone-frame {
    box-shadow: none;
  }
}

/* Prototype 21.2 · mobile readability pass */
.game-shell small {
  font-size: 12px !important;
  line-height: 1.4 !important;
}

.eyebrow,
.status-label,
.objective-kicker,
.formation-badge,
.campaign-kicker,
.system-head small,
.chapter-mark {
  font-size: 11px !important;
  letter-spacing: 0.09em;
}

.status-label,
.status-card small,
.boss-heading small,
.home-profile-copy small,
.home-profile-copy span,
.home-resources small,
.campaign-kicker,
.home-hero-strip small,
.system-head small {
  color: rgba(239, 226, 200, 0.72);
}

.status-card {
  min-height: 58px;
  padding: 8px 9px;
}

.status-card strong { font-size: 18px; }
.boss-heading strong { font-size: 13px; }
.boss-heading small { font-size: 11px !important; }
.damage-pop,
.food-pop { font-size: 14px; }

.objective-row { min-height: 52px; }
.formation-badge {
  max-width: 190px;
  padding: 3px 7px;
}
.objective-row p { font-size: 13px; }
.text-button { padding: 8px 11px; font-size: 12px; }
.command-card { min-height: 64px; }
.command-meta strong { font-size: 14px; }
.command-meta small { font-size: 11px !important; }
.morale-heading,
.morale-panel p { font-size: 12px; }
.toast { font-size: 13px; }

.home-scroll {
  height: calc(100% - 78px);
  padding-bottom: 34px;
}

.home-profile-copy small,
.home-profile-copy span { font-size: 11px !important; }
.home-profile-copy strong { font-size: 19px; }
.home-resources button {
  min-height: 52px;
  padding: 9px 8px;
}
.home-resources b { font-size: 14px; }
.home-resources small { font-size: 11px !important; }
.campaign-kicker { font-size: 12px !important; }
.home-primary,
.home-secondary { min-height: 46px; font-size: 14px; }
.home-quick-grid button { min-height: 80px; }
.home-quick-grid strong { font-size: 12px; }
.home-hero-strip { padding: 13px 12px; }
.home-hero-strip small { font-size: 11px !important; }
.home-hero-strip strong { font-size: 13px; }
.home-hero-strip button { padding: 9px 10px; font-size: 12px; }
.home-bond-line {
  max-width: 224px;
  font-size: 11px;
  line-height: 1.35;
}
.home-recruit-card small,
.home-recruit-card em,
.home-recruit-card > b { font-size: 11px !important; line-height: 1.35; }
.home-recruit-card strong { font-size: 15px; }
.home-nav {
  height: 78px;
  padding-top: 9px;
}
.home-nav small { font-size: 11px !important; }

.system-scroll { padding: 21px 18px 25px; }
.system-head small { color: rgba(72, 51, 31, 0.7); }
.system-note,
.system-placeholder { font-size: 12px; line-height: 1.6; }
.system-card { padding: 12px 10px; }
.system-copy strong { font-size: 14px; }
.system-copy small { color: rgba(52, 39, 29, 0.72); font-size: 12px !important; }
.system-tag { font-size: 11px; }
.system-action { padding: 9px 10px; font-size: 12px; }
.system-summary small { color: rgba(246, 229, 195, 0.8); font-size: 12px !important; }

.mode-card { padding: 11px 9px; }
.mode-card span { font-size: 11px; }
.mode-card strong { font-size: 14px; }
.mode-card small { font-size: 11px !important; }
.chapter-card strong { font-size: 14px; }
.chapter-card span,
.chapter-card em { font-size: 11px; }
.chapter-card small { font-size: 12px !important; }
.start-eyebrow,
.result-eyebrow,
.strategy-eyebrow,
.decision-eyebrow { font-size: 14px; }
.start-scroll > p:not(.start-eyebrow),
.result-scroll > p:not(.result-eyebrow),
.strategy-scroll > p:not(.strategy-eyebrow),
.decision-scroll > p:not(.decision-eyebrow) { font-size: 13px; line-height: 1.55; }
.decision-choice strong,
.strategy-choice-copy strong { font-size: 14px; }
.decision-choice small,
.strategy-choice-copy small { font-size: 12px !important; }
.decision-choice em,
.strategy-choice-arrow { font-size: 11px; }
.decision-cancel { font-size: 12px; }
.result-stats span,
.highlight-stats span { font-size: 12px; }
.result-reward small { font-size: 12px !important; }
.highlight-eyebrow,
.highlight-line,
.highlight-build { font-size: 13px; line-height: 1.5; }

.lineup-slots i,
.lineup-slots em { font-size: 11px; line-height: 1.2; }
.bond-card strong { font-size: 13px; }
.bond-card small { font-size: 11px !important; }
.bond-card p { font-size: 12px; line-height: 1.5; }
.bond-card > em { font-size: 11px; }

.recruit-banner-copy small,
.recruit-status small,
.recruit-actions small,
.recruit-roster small,
.recruit-result small,
.weapon-pity-strip small { font-size: 11px !important; }
.recruit-banner-copy p,
.recruit-welcome,
.weapon-vault-link { font-size: 12px; line-height: 1.5; }
.recruit-actions strong,
.recruit-roster strong { font-size: 13px; }
.recruit-result strong { font-size: 11px; }
.weapon-draw-entry strong { font-size: 13px; }
.weapon-draw-entry b,
.weapon-roster > div > i,
.weapon-draw-results .recruit-result > i { font-size: 11px; }
.weapon-pity-strip strong { font-size: 13px; }
.weapon-draw-results .recruit-result strong { font-size: 11px; }

.faction-choice strong { font-size: 14px; }
.faction-choice em,
.faction-choice small,
.faction-choice b { font-size: 11px; line-height: 1.45; }

.status-label,
.status-card small,
.home-nav small,
.chapter-mark { font-size: 12px !important; }

/* Prototype 33.0 · generated high-detail weapon illustrations */
.weapon-art {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 3px 3px rgba(17, 12, 9, 0.42));
  transform-origin: center;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.weapon-card .weapon-art,
.weapon-summary .weapon-art,
.weapon-roster .weapon-art,
.weapon-draw-results .weapon-art {
  filter:
    drop-shadow(0 0 5px color-mix(in srgb, var(--weapon-quality, #9a7445) 32%, transparent))
    drop-shadow(0 3px 3px rgba(17, 12, 9, 0.42));
}

.weapon-art[data-weapon-art="ring-blade"],
.weapon-art[data-weapon-art="ancient-blade"],
.weapon-art[data-weapon-art="seven-star-blade"],
.weapon-art[data-weapon-art="green-dragon"],
.weapon-art[data-weapon-art="heaven-sword"],
.weapon-art[data-weapon-art="sky-halberd"] { transform: scale(0.97); }

.weapon-art[data-weapon-art="iron-spear"],
.weapon-art[data-weapon-art="serpent-spear"],
.weapon-art[data-weapon-art="silver-spear"] { transform: scale(0.98); }

.weapon-art[data-weapon-art="mulberry-bow"],
.weapon-art[data-weapon-art="yangyou-bow"] { transform: scale(0.96); }

.weapon-art[data-weapon-art="vermillion-fan"] { transform: rotate(-3deg) scale(0.93); }

#homeWeaponLine {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
}

#homeWeaponLine .home-weapon-art {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  color: currentColor;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.42));
}

#homeWeaponLine > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weapon-summary {
  min-height: 112px;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 10px 12px;
  color: #f6e6c5;
  background:
    radial-gradient(circle at 14% 52%, color-mix(in srgb, var(--weapon-quality) 24%, transparent), transparent 28%),
    repeating-linear-gradient(135deg, transparent 0 7px, rgba(255, 232, 184, 0.018) 7px 8px),
    linear-gradient(115deg, #5c453a, #2d302f 74%);
}

.weapon-summary-visual {
  width: 78px;
  height: 90px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--weapon-quality) 62%, rgba(255, 229, 177, 0.24));
  background:
    radial-gradient(circle at 50% 48%, color-mix(in srgb, var(--weapon-quality) 28%, transparent), transparent 62%),
    linear-gradient(145deg, rgba(255, 240, 206, 0.1), rgba(16, 17, 16, 0.28));
  box-shadow: inset 0 0 20px rgba(255, 219, 150, 0.05), 0 6px 14px rgba(22, 15, 11, 0.24);
}

.weapon-summary-art { width: 70px; height: 82px; }
.weapon-summary-copy { min-width: 0; }
.weapon-summary-copy strong { line-height: 1.35; }
.weapon-summary-copy small { line-height: 1.55; }

.weapon-card { grid-template-columns: 62px minmax(0, 1fr) auto; }
.weapon-card .weapon-glyph {
  width: 58px;
  height: 66px;
  padding: 4px;
  overflow: hidden;
}

.weapon-card.locked .weapon-art,
.weapon-roster > .locked .weapon-art {
  color: rgba(67, 55, 43, 0.58);
  filter: grayscale(1) drop-shadow(0 2px 2px rgba(30, 23, 17, 0.18));
  opacity: 0.72;
}

.weapon-roster span {
  width: 50px;
  height: 58px;
  padding: 3px;
  overflow: hidden;
}

.weapon-draw-results .recruit-result span {
  width: 42px;
  height: 50px;
  padding: 2px;
  overflow: hidden;
}

.weapon-summary.quality-gold .weapon-art,
.weapon-card.quality-gold .weapon-art,
.weapon-roster > .quality-gold .weapon-art,
.weapon-summary.quality-red .weapon-art,
.weapon-card.quality-red .weapon-art,
.weapon-roster > .quality-red .weapon-art {
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--weapon-quality) 74%, transparent)) drop-shadow(0 3px 3px rgba(17, 12, 9, 0.42));
}

/* Prototype 25.0 · every general has a tactic and an independent ultimate */
.hero-roster-card { align-items: start; }
.hero-roster-card > .system-glyph,
.hero-roster-card > .hero-card-actions { margin-top: 2px; }

.hero-skill-pair {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}

.hero-skill {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 6px;
  row-gap: 4px;
  padding: 7px 8px;
  border: 1px solid rgba(80, 54, 35, 0.14);
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.22), rgba(118, 80, 45, 0.055));
}

.hero-skill.ultimate {
  border-color: rgba(157, 65, 47, 0.22);
  background: linear-gradient(115deg, rgba(171, 73, 51, 0.105), rgba(211, 160, 72, 0.06));
}

.hero-skill > i {
  min-width: 30px;
  padding: 3px 5px;
  color: #f4dfb2;
  background: #625142;
  font: 700 11px/1.1 system-ui, sans-serif;
  font-style: normal;
  text-align: center;
}

.hero-skill.ultimate > i { background: #963f33; }
.hero-skill > b { color: #513326; font-size: 13px; line-height: 1.25; }
.hero-skill > em {
  color: #8b6338;
  font: 700 11px/1.2 system-ui, sans-serif;
  font-style: normal;
  white-space: nowrap;
}

.hero-skill > span {
  grid-column: 1 / -1;
  color: rgba(55, 39, 29, 0.76);
  font: 12px/1.48 system-ui, sans-serif;
}

.hero-roster-card.locked .hero-skill-pair { display: none; }

/* Prototype 28.0 · compact manual dual-skill controls */
.hero-skill-dock {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  margin: 7px 0;
}

.skill-hero-switch,
.hero-skill-button {
  min-width: 0;
  min-height: 56px;
  border: 1px solid rgba(221, 186, 116, 0.18);
  color: #f0dfbd;
  background: linear-gradient(145deg, rgba(98, 78, 57, 0.54), rgba(38, 32, 25, 0.72));
  box-shadow: inset 0 0 15px rgba(241, 207, 140, 0.025);
}

.skill-hero-switch {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 5px;
  padding: 6px;
  text-align: left;
}

.skill-hero-switch > span {
  grid-row: 1 / span 2;
  width: 28px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 217, 160, 0.22);
  color: #ffe4ad;
  background: #7e382e;
  font-size: 18px;
  font-weight: 900;
}

.skill-hero-switch > strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-hero-switch > em {
  color: rgba(237, 218, 180, 0.62);
  font: 11px/1.2 system-ui, sans-serif;
  font-style: normal;
}

.skill-hero-switch:disabled { opacity: 0.76; }

.hero-skill-button {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 6px;
  padding: 6px 8px;
  text-align: left;
  transition: filter 150ms ease, transform 150ms ease, border-color 150ms ease;
}

.hero-skill-button > span {
  grid-row: 1 / span 2;
  padding: 4px 5px;
  color: #f6e1b5;
  background: #625142;
  font: 700 11px/1.1 system-ui, sans-serif;
}

.hero-skill-button.ultimate > span { background: #913c31; }
.hero-skill-button > strong {
  overflow: hidden;
  color: #f4e4c5;
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-skill-button > em {
  color: #d6ad61;
  font: 700 11px/1.2 system-ui, sans-serif;
  font-style: normal;
}

.hero-skill-button:disabled { opacity: 0.5; }
.hero-skill-button.ready {
  opacity: 1;
  border-color: rgba(235, 183, 86, 0.7);
  background: linear-gradient(145deg, rgba(145, 64, 43, 0.72), rgba(70, 49, 34, 0.74));
  box-shadow: 0 0 12px rgba(212, 139, 53, 0.18), inset 0 0 18px rgba(250, 216, 143, 0.06);
  animation: manualSkillReady 780ms ease-in-out infinite alternate;
}

.hero-skill-button.ready:hover,
.hero-skill-button.ready:focus-visible { filter: brightness(1.2); transform: translateY(-1px); }

@keyframes manualSkillReady {
  from { filter: brightness(1); }
  to { filter: brightness(1.14); }
}

.toast { bottom: 214px; }

/* Prototype 29.1 · compact battle status strip */
.status-strip {
  grid-template-columns: minmax(132px, 1.45fr) minmax(72px, 0.72fr) minmax(76px, 0.78fr);
  gap: 5px;
  padding: 4px 12px 3px;
}

.status-card {
  min-height: 44px;
  padding: 4px 7px;
}

.status-label {
  font-size: 10px !important;
  line-height: 1.05;
}

.status-card strong {
  margin-top: 2px;
  font-size: 15px;
  line-height: 1.05;
}

.status-card small {
  margin-top: 2px;
  font-size: 9px !important;
  line-height: 1.05;
}

.camp-status {
  padding-right: 6px;
}

.camp-hearts {
  display: flex !important;
  min-height: 13px;
  align-items: center;
  gap: 2px;
  overflow: hidden;
  font-size: 0 !important;
  white-space: nowrap;
}

.camp-heart {
  flex: 0 0 auto;
  color: #cf5344;
  font: 900 12px/1 system-ui, sans-serif;
  font-style: normal;
  filter: drop-shadow(0 1px 2px rgba(173, 52, 41, 0.28));
}

.camp-heart.empty {
  color: rgba(232, 210, 180, 0.18);
  filter: none;
}

.camp-status .mini-track {
  display: none;
}

#campDetail {
  position: absolute;
  top: 4px;
  right: 6px;
  margin: 0;
  color: #e8bd69;
  font-size: 9px !important;
}

#campDetail[hidden] {
  display: none !important;
}

.food-status strong,
.wave-status strong {
  font-size: 15px;
}

.food-status small,
.wave-status small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 390px) {
  .status-strip {
    grid-template-columns: minmax(122px, 1.35fr) minmax(68px, 0.7fr) minmax(72px, 0.75fr);
    padding-inline: 10px;
  }

  .camp-hearts { gap: 1px; }
  .camp-heart { font-size: 11px; }
}

/* Prototype 29.2 · move restart into the top-right settings menu */
.topbar {
  position: relative;
  z-index: 25;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.battle-settings {
  position: relative;
}

.settings-button[aria-expanded="true"] {
  border-color: rgba(220, 170, 82, 0.56);
  color: #f2ce81;
  background: rgba(143, 58, 43, 0.42);
}

.battle-settings-menu {
  position: absolute;
  z-index: 46;
  top: 44px;
  right: 0;
  width: 236px;
  padding: 11px;
  border: 1px solid rgba(222, 184, 109, 0.27);
  color: #eee0c4;
  background:
    linear-gradient(145deg, rgba(104, 48, 37, 0.18), transparent 48%),
    rgba(24, 19, 14, 0.98);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55), inset 0 0 24px rgba(230, 190, 112, 0.03);
}

.battle-settings-menu[hidden] {
  display: none;
}

.settings-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.settings-menu-head > span {
  color: #e9c376;
  font: 700 12px/1.2 system-ui, sans-serif;
  letter-spacing: 0.08em;
}

.battle-settings-menu .formation-badge {
  max-width: 130px;
  margin: 0;
  font-size: 10px !important;
}

.battle-settings-menu > p {
  margin: 9px 0 10px;
  color: rgba(239, 224, 194, 0.72);
  font: 11px/1.45 system-ui, sans-serif;
}

.settings-restart {
  width: 100%;
  min-height: 43px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 7px 10px;
  border: 1px solid rgba(205, 92, 68, 0.38);
  color: #f2dfbc;
  background: rgba(124, 49, 39, 0.38);
  text-align: left;
  cursor: pointer;
}

.settings-restart span {
  font: 700 12px/1.2 system-ui, sans-serif;
}

.settings-restart small {
  color: rgba(238, 213, 171, 0.56);
  font: 10px/1.2 system-ui, sans-serif;
}

.settings-restart[data-confirm="true"] {
  border-color: rgba(232, 114, 79, 0.76);
  background: rgba(157, 55, 42, 0.72);
}

.control-panel {
  padding-top: 4px;
}

/* Prototype 30.0 · independent weapon slots for every general */
#homeWeaponLine {
  width: 100%;
  min-height: 31px;
  display: flex;
  align-items: stretch;
  gap: 4px;
  overflow: hidden;
}

#homeWeaponLine > .home-hero-weapon {
  min-width: 0;
  flex: 1 1 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 4px;
  padding: 3px 5px;
  border: 1px solid color-mix(in srgb, var(--weapon-quality, #9a7445) 28%, transparent);
  color: #e5c889;
  background: color-mix(in srgb, var(--weapon-quality, #9a7445) 8%, rgba(34, 27, 20, 0.55));
}

.home-hero-weapon.quality-green { --weapon-quality: #4f8a59; }
.home-hero-weapon.quality-blue { --weapon-quality: #4779af; }
.home-hero-weapon.quality-purple { --weapon-quality: #8152a1; }
.home-hero-weapon.quality-gold { --weapon-quality: #c18a28; }
.home-hero-weapon.quality-red { --weapon-quality: #bd3e34; }

#homeWeaponLine .home-hero-weapon .home-weapon-art {
  grid-row: 1 / span 2;
  width: 23px;
  height: 27px;
}

.home-hero-weapon > b {
  color: #f1dfbd;
  font: 800 11px/1.15 system-ui, sans-serif;
}

.home-hero-weapon > em {
  overflow: hidden;
  color: rgba(231, 211, 174, 0.65);
  font: 9px/1.15 system-ui, sans-serif;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weapon-hero-picker {
  display: flex;
  gap: 6px;
  margin-bottom: 9px;
  padding: 2px 1px 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.weapon-hero-picker::-webkit-scrollbar { display: none; }

.weapon-hero-tab {
  min-width: 86px;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 5px;
  padding: 6px;
  border: 1px solid rgba(91, 64, 39, 0.2);
  color: #5c412d;
  background: rgba(255, 255, 255, 0.15);
  text-align: left;
  cursor: pointer;
}

.weapon-hero-tab > span {
  grid-row: 1 / span 2;
  width: 27px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #f3dca9;
  background: #774236;
  font-size: 17px;
  font-weight: 900;
}

.weapon-hero-tab > strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weapon-hero-tab > small {
  overflow: hidden;
  color: rgba(73, 50, 33, 0.62);
  font: 9px/1.15 system-ui, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weapon-hero-tab.selected {
  border-color: rgba(150, 65, 46, 0.58);
  background: rgba(152, 67, 48, 0.12);
  box-shadow: inset 3px 0 #9a4938;
}

.weapon-equipped-hero {
  display: block;
  margin-bottom: 5px;
  color: #92503d;
  font: 800 11px/1.2 system-ui, sans-serif;
  font-style: normal;
  letter-spacing: 0.05em;
}

.weapon-equip-rule {
  margin-top: 8px;
}

.weapon-card.equipped-selected {
  box-shadow: inset 3px 0 var(--weapon-quality), inset 0 0 22px color-mix(in srgb, var(--weapon-quality) 12%, transparent);
}

.weapon-card.equipped-other {
  background: color-mix(in srgb, var(--weapon-quality) 5%, rgba(255, 255, 255, 0.1));
}

/* Prototype 31.0 · full-screen hero ultimate cinematics */
.ultimate-cinematic {
  --ultimate-accent: #d5b76f;
  position: absolute;
  inset: 0;
  z-index: 49;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  isolation: isolate;
  background:
    radial-gradient(circle at 72% 42%, color-mix(in srgb, var(--ultimate-accent) 30%, transparent), transparent 42%),
    #07090c;
}

.ultimate-cinematic.show {
  visibility: visible;
  animation: ultimate-scene 4s linear both;
}

.ultimate-art {
  position: absolute;
  inset: -3%;
  width: 106%;
  height: 106%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transform: scale(1.12);
  filter: saturate(1.15) contrast(1.08) brightness(0.83);
  will-change: transform, opacity, filter;
}

.ultimate-cinematic.show .ultimate-art {
  animation: ultimate-art-in 4s cubic-bezier(0.12, 0.68, 0.18, 1) both;
}

.ultimate-cinematic.art-missing .ultimate-art {
  display: none;
}

.ultimate-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.3), transparent 23%, transparent 53%, rgba(4, 7, 9, 0.88) 88%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.54), transparent 48%);
}

.ultimate-shade::before,
.ultimate-shade::after {
  content: "";
  position: absolute;
  inset: -20%;
  border: 1px solid color-mix(in srgb, var(--ultimate-accent) 56%, transparent);
  opacity: 0;
  transform: rotate(-20deg) scale(0.45);
}

.ultimate-cinematic.show .ultimate-shade::before {
  animation: ultimate-ring 0.82s 0.08s ease-out both;
}

.ultimate-cinematic.show .ultimate-shade::after {
  animation: ultimate-ring 0.9s 0.22s ease-out reverse both;
}

.ultimate-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: var(--ultimate-accent);
  mix-blend-mode: screen;
}

.ultimate-cinematic.show .ultimate-flash {
  animation: ultimate-flash 4s linear both;
}

.ultimate-streak {
  position: absolute;
  left: -28%;
  width: 150%;
  height: 4px;
  opacity: 0;
  background: linear-gradient(90deg, transparent 4%, var(--ultimate-accent) 35%, #fff 53%, transparent 82%);
  box-shadow: 0 0 18px var(--ultimate-accent), 0 0 36px color-mix(in srgb, var(--ultimate-accent) 60%, transparent);
  transform: rotate(-19deg) translateX(-35%);
  transform-origin: center;
}

.ultimate-streak-a { top: 35%; }
.ultimate-streak-b { top: 58%; height: 2px; transform: rotate(-13deg) translateX(-42%); }
.ultimate-cinematic.show .ultimate-streak-a { animation: ultimate-streak 0.5s 0.1s ease-out both; }
.ultimate-cinematic.show .ultimate-streak-b { animation: ultimate-streak 0.54s 0.25s ease-out both; }

.ultimate-copy {
  position: absolute;
  z-index: 3;
  left: 24px;
  right: 24px;
  bottom: max(62px, calc(env(safe-area-inset-bottom) + 44px));
  display: grid;
  justify-items: start;
  opacity: 0;
  transform: translateY(22px);
  color: #fff8e8;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.92), 0 0 18px rgba(0, 0, 0, 0.76);
}

.ultimate-cinematic.show .ultimate-copy {
  animation: ultimate-copy-in 4s cubic-bezier(0.17, 0.72, 0.2, 1) both;
}

.ultimate-copy > span {
  margin-bottom: 8px;
  padding: 5px 10px 4px;
  border-left: 3px solid var(--ultimate-accent);
  color: var(--ultimate-accent);
  background: rgba(6, 8, 10, 0.68);
  font: 800 12px/1 system-ui, sans-serif;
  letter-spacing: 0.18em;
}

.ultimate-copy > strong {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ultimate-copy i {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--ultimate-accent) 80%, #fff 20%);
  color: #16110b;
  background: var(--ultimate-accent);
  box-shadow: inset 0 0 0 3px rgba(19, 14, 8, 0.22), 0 0 24px color-mix(in srgb, var(--ultimate-accent) 40%, transparent);
  font: 900 31px/1 "STKaiti", "KaiTi", serif;
  font-style: normal;
  transform: rotate(-3deg);
}

.ultimate-copy b {
  color: #fff8e8;
  font: 900 38px/1 "STKaiti", "KaiTi", serif;
  letter-spacing: 0.08em;
}

.ultimate-copy em {
  margin-top: 9px;
  color: var(--ultimate-accent);
  font: 900 25px/1.1 "STKaiti", "KaiTi", serif;
  font-style: normal;
  letter-spacing: 0.12em;
}

.ultimate-copy q {
  display: block;
  margin-top: 10px;
  color: #fff2d6;
  font: 800 17px/1.2 "STKaiti", "KaiTi", serif;
  letter-spacing: 0.08em;
  quotes: none;
}

.ultimate-copy q::before,
.ultimate-copy q::after { content: ""; }

.ultimate-stamp {
  position: absolute;
  z-index: 3;
  right: 27px;
  bottom: max(69px, calc(env(safe-area-inset-bottom) + 51px));
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 3px double rgba(255, 244, 216, 0.88);
  color: rgba(255, 244, 216, 0.92);
  background: color-mix(in srgb, var(--ultimate-accent) 74%, #45120f 26%);
  font: 900 29px/1 "STKaiti", "KaiTi", serif;
  transform: rotate(8deg) scale(1.8);
  opacity: 0;
  box-shadow: 0 3px 20px rgba(0, 0, 0, 0.58);
}

.ultimate-cinematic.show .ultimate-stamp {
  animation: ultimate-stamp-in 4s cubic-bezier(0.16, 0.76, 0.25, 1) both;
}

.ultimate-cinematic[data-visual="dragon-slash"] .ultimate-art { object-position: 56% center; transform-origin: 68% 50%; }
.ultimate-cinematic[data-visual="thunder-roar"] .ultimate-art { object-position: 52% center; transform-origin: 50% 46%; }
.ultimate-cinematic[data-visual="silver-charge"] .ultimate-art { object-position: 54% center; transform-origin: 62% 58%; }
.ultimate-cinematic[data-visual="arrow-rain"] .ultimate-art { object-position: 50% 42%; transform-origin: 50% 28%; }
.ultimate-cinematic[data-visual="wind-fire-array"] .ultimate-art { object-position: 51% center; transform-origin: 50% 42%; }
.ultimate-cinematic[data-visual="commander-swords"] .ultimate-art { object-position: 50% 48%; transform-origin: 50% 58%; }

.ultimate-cinematic[data-visual="arrow-rain"] .ultimate-streak {
  left: 6%;
  width: 120%;
  transform: rotate(68deg) translateX(-42%);
}

.ultimate-cinematic[data-visual="wind-fire-array"] .ultimate-shade::before,
.ultimate-cinematic[data-visual="wind-fire-array"] .ultimate-shade::after {
  border-radius: 50%;
  transform: rotate(-20deg) scale(0.32);
}

.ultimate-cinematic[data-visual="thunder-roar"] .ultimate-streak {
  height: 6px;
  transform: rotate(-36deg) translateX(-40%);
}

@keyframes ultimate-scene {
  0% { opacity: 0; }
  4%, 82% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes ultimate-art-in {
  0% { opacity: 0; transform: scale(1.18); filter: saturate(0.55) contrast(1.3) brightness(1.55); }
  12% { opacity: 1; filter: saturate(1.3) contrast(1.12) brightness(0.92); }
  82% { opacity: 1; transform: scale(1.025); filter: saturate(1.12) contrast(1.08) brightness(0.84); }
  100% { opacity: 0; transform: scale(1); filter: saturate(0.8) contrast(1.08) brightness(0.58); }
}

@keyframes ultimate-flash {
  0% { opacity: 0.88; }
  5% { opacity: 0; }
  12% { opacity: 0.35; }
  17%, 78% { opacity: 0; }
  84% { opacity: 0.16; }
  100% { opacity: 0; }
}

@keyframes ultimate-ring {
  0% { opacity: 0.72; transform: rotate(-20deg) scale(0.34); }
  100% { opacity: 0; transform: rotate(12deg) scale(1.1); }
}

@keyframes ultimate-streak {
  0% { opacity: 0; translate: -20% 0; }
  18% { opacity: 1; }
  100% { opacity: 0; translate: 72% 0; }
}

@keyframes ultimate-copy-in {
  0%, 13% { opacity: 0; transform: translateY(22px); }
  28%, 80% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-6px); }
}

@keyframes ultimate-stamp-in {
  0%, 30% { opacity: 0; transform: rotate(8deg) scale(1.8); }
  40%, 80% { opacity: 0.92; transform: rotate(8deg) scale(1); }
  100% { opacity: 0; transform: rotate(8deg) scale(0.95); }
}

@media (max-height: 720px) {
  .ultimate-copy { bottom: 38px; }
  .ultimate-stamp { right: 22px; bottom: 44px; }
  .ultimate-copy b { font-size: 32px; }
  .ultimate-copy em { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .ultimate-cinematic.show,
  .ultimate-cinematic.show .ultimate-art,
  .ultimate-cinematic.show .ultimate-copy,
  .ultimate-cinematic.show .ultimate-stamp {
    animation-duration: 4s;
    animation-timing-function: linear;
  }
  .ultimate-cinematic.show .ultimate-art { transform: none; }
  .ultimate-cinematic.show .ultimate-streak,
  .ultimate-cinematic.show .ultimate-shade::before,
  .ultimate-cinematic.show .ultimate-shade::after { display: none; }
}

/* Prototype 36.0 · long-term campaign and split hero growth */
#homeMaterials {
  font-size: 12px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.material-ledger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}

.material-ledger article {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 74px;
  padding: 10px;
  border: 1px solid rgba(98, 63, 31, 0.2);
  background: linear-gradient(145deg, rgba(255, 251, 239, 0.72), rgba(219, 199, 162, 0.25));
}

.material-ledger article > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(115, 63, 33, 0.3);
  border-radius: 50%;
  color: #f4e0b5;
  background: #784232;
  box-shadow: inset 0 0 0 3px rgba(245, 217, 160, 0.08);
  font-size: 18px;
}

.material-ledger article:nth-child(2) > span { background: #4f5961; }
.material-ledger strong,
.material-ledger small { display: block; }
.material-ledger strong { color: #4c3023; font-size: 14px; }
.material-ledger small { margin-top: 4px; color: rgba(55, 42, 30, 0.68); font-size: 11px; line-height: 1.35; }

.hero-rank-line {
  color: #8a541e !important;
  font-size: 12px !important;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.material-exchange-card {
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(102, 63, 34, 0.19);
  background: rgba(255, 253, 244, 0.48);
  box-shadow: inset 3px 0 #8f4a35;
}

.material-exchange-card.weapon-material-card { box-shadow: inset 3px 0 #596670; }

.material-exchange-card > header {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.material-exchange-card > header > span {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  overflow: hidden;
  border: 1px solid rgba(91, 53, 29, 0.24);
  border-radius: 50%;
  color: #f2dfb9;
  background: linear-gradient(145deg, #9a5139, #5c3027);
  font-size: 23px;
}

.weapon-material-card > header > span {
  border-radius: 4px;
  background: linear-gradient(145deg, #6f7473, #303b3f);
}

.material-exchange-card header strong,
.material-exchange-card header small { display: block; }
.material-exchange-card header strong { color: #4e3022; font-size: 14px; line-height: 1.35; }
.material-exchange-card header small { margin-top: 4px; color: rgba(59, 43, 30, 0.65); font-size: 12px; }
.material-weapon-art { width: 48px; height: 48px; }

.material-target-picker {
  display: flex;
  gap: 7px;
  padding: 9px 1px 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.material-target-picker::-webkit-scrollbar { display: none; }
.material-target-picker button {
  flex: 0 0 66px;
  min-height: 62px;
  padding: 6px 4px;
  border: 1px solid rgba(87, 55, 31, 0.2);
  color: #5b3b29;
  background: rgba(255, 255, 255, 0.22);
}

.material-target-picker button > span,
.material-target-picker button > strong { display: block; }
.material-target-picker button > span { margin: 0 auto 4px; color: #8b4432; font-size: 21px; }
.material-target-picker button > strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.material-target-picker button.selected { border-color: #9d5038; background: rgba(158, 76, 51, 0.11); box-shadow: inset 0 -3px #a65239; }
.weapon-target-picker button { flex-basis: 76px; min-height: 72px; }
.weapon-target-picker button > span { width: 40px; height: 40px; }
.material-target-art { width: 40px; height: 40px; }

.material-exchange-button,
.material-back-link {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(245, 217, 162, 0.28);
  color: #f5e3bd;
  background: linear-gradient(145deg, #9e4b35, #783126);
  font-size: 13px;
  font-weight: 700;
}

.material-exchange-button.weapon { background: linear-gradient(145deg, #626d73, #3d4a50); }
.material-exchange-button:disabled { opacity: 0.42; filter: grayscale(0.45); }
.material-back-link { min-height: 34px; margin-top: 6px; border-color: rgba(82, 53, 33, 0.16); color: #77523a; background: transparent; font-size: 12px; }

.material-source-title {
  margin: 18px 0 9px;
  color: #593527;
  font-size: 17px;
}

.material-source-card { align-items: start; }
.material-source-card .system-copy small { font-size: 12px; line-height: 1.5; }
.outpost-drop-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.outpost-drop-tags i {
  padding: 4px 6px;
  border: 1px solid rgba(116, 76, 39, 0.18);
  border-radius: 2px;
  color: #72503a;
  background: rgba(170, 124, 62, 0.07);
  font: normal 11px/1.2 system-ui, sans-serif;
}

.material-route-button { border-color: rgba(155, 84, 49, 0.28); color: #8b4733; background: rgba(158, 73, 47, 0.06); }
.result-reward strong { max-width: 100%; font-size: 14px; line-height: 1.45; }

/* Prototype 43.0 · unified gameplay measurements and generated stat copy */
.phone-frame { overflow: clip; }

.home-readiness {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 9px 0 11px;
  padding: 8px 10px;
  border: 1px solid rgba(226, 194, 126, 0.2);
  color: rgba(244, 228, 195, 0.82);
  background: rgba(15, 25, 25, 0.28);
  font: 700 12px/1.25 system-ui, sans-serif;
}

.home-readiness strong { color: #e2bc70; font-size: 13px; }
.campaign-banner[data-risk="favored"] .home-readiness strong { color: #9bc6a1; }
.campaign-banner[data-risk="danger"] .home-readiness strong { color: #ee9b80; }

.war-council {
  margin-top: 10px;
  padding: 11px;
  border: 1px solid rgba(101, 67, 36, 0.2);
  color: #503528;
  background: linear-gradient(145deg, rgba(255, 252, 237, 0.52), rgba(183, 146, 91, 0.1));
  box-shadow: inset 3px 0 #9c4837;
}

.war-council > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.war-council > header span {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.war-council > header strong {
  padding: 5px 8px;
  color: #f6e2b9;
  background: #9c4837;
  font: 800 12px/1 system-ui, sans-serif;
}

.war-council[data-risk="favored"] { box-shadow: inset 3px 0 #557e61; }
.war-council[data-risk="favored"] > header strong { background: #557e61; }
.war-council[data-risk="danger"] { box-shadow: inset 3px 0 #a7372d; }
.war-council[data-risk="danger"] > header strong { background: #a7372d; }

.war-council-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-top: 9px;
}

.war-council-grid > span {
  min-width: 0;
  padding: 7px 4px;
  border: 1px solid rgba(91, 57, 31, 0.13);
  background: rgba(255, 255, 255, 0.25);
  text-align: center;
}

.war-council-grid small,
.war-council-grid b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.war-council-grid small { color: rgba(72, 49, 34, 0.62); font-size: 11px !important; }
.war-council-grid b { margin-top: 3px; color: #713a2f; font-size: 12px; }

.war-lineup {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.war-lineup::-webkit-scrollbar { display: none; }
.war-lineup > span {
  flex: 1 0 88px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 6px;
  align-items: center;
  min-width: 0;
  padding: 6px;
  border: 1px solid rgba(96, 60, 34, 0.14);
  background: rgba(133, 69, 49, 0.06);
}

.war-lineup i {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 28px;
  height: 34px;
  color: #f7dfae;
  background: #853f31;
  font: 900 17px/1 serif;
}

.war-lineup b,
.war-lineup small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.war-lineup b { font-size: 12px; }
.war-lineup small { color: rgba(67, 46, 32, 0.63); font-size: 10px !important; }
.war-council > p { margin: 9px 0 0; color: #713a2e; font: 700 12px/1.5 system-ui, sans-serif; }
.war-council > small { display: block; margin-top: 4px; color: rgba(67, 47, 33, 0.66); font-size: 11px !important; }
.war-council + .start-demo { display: none; }

.hero-roster-card .system-copy > strong,
.weapon-card .system-copy > strong {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 7px;
}

.hero-power,
.weapon-power {
  margin-left: auto;
  padding: 3px 6px;
  color: #f1ddb3;
  background: #7f3c30;
  font: 800 11px/1 system-ui, sans-serif;
  white-space: nowrap;
}

.weapon-power { color: #70482c; background: rgba(181, 133, 59, 0.14); }

.hero-skill-details {
  margin-top: 8px;
  border: 1px solid rgba(90, 59, 36, 0.14);
  background: rgba(255, 255, 255, 0.17);
}

.hero-skill-details > summary {
  padding: 8px;
  color: #754333;
  font: 800 12px/1.35 system-ui, sans-serif;
  cursor: pointer;
  list-style-position: inside;
}

.hero-skill-details[open] > summary { border-bottom: 1px solid rgba(90, 59, 36, 0.12); }
.hero-skill-details .hero-skill-pair { margin: 0; padding: 7px; }
.hero-roster-card { row-gap: 7px; }
.hero-roster-card > .hero-card-actions { align-self: start; }

.recruit-pity-progress {
  position: relative;
  height: 30px;
  margin: 8px 0 11px;
  overflow: hidden;
  border: 1px solid rgba(102, 63, 34, 0.18);
  background: rgba(94, 64, 40, 0.08);
}

.recruit-pity-progress > span {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, rgba(138, 57, 45, 0.42), rgba(190, 124, 59, 0.55));
  transition: width 220ms ease;
}

.recruit-pity-progress > small {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  height: 100%;
  color: #5d382a;
  font-size: 12px !important;
  font-weight: 800;
}

.battle-intel-label {
  display: block;
  margin-top: 7px;
  color: #d7ad63;
  font: 800 11px/1 system-ui, sans-serif;
  letter-spacing: 0.08em;
}

#tutorialText {
  min-height: 34px;
  margin-top: 4px;
  padding: 6px 8px;
  border-left: 3px solid #9a4636;
  color: rgba(244, 229, 199, 0.86);
  background: rgba(154, 70, 54, 0.08);
  font-size: 12px !important;
  line-height: 1.45 !important;
}

.hero-skill-button > strong { font-size: 13px; }
.hero-skill-button > em,
.skill-hero-switch > em { font-size: 12px; }
.command-meta small { font-size: 12px !important; }

.result-star-goals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0;
}

.result-star-goals.hidden { display: none; }
.result-star-goals > span {
  min-width: 0;
  padding: 8px 6px;
  border: 1px solid rgba(95, 61, 35, 0.16);
  background: rgba(255, 255, 255, 0.16);
  text-align: center;
}

.result-star-goals i,
.result-star-goals b,
.result-star-goals small { display: block; }
.result-star-goals i { margin: 0 auto 4px; color: #f0dba8; font: 900 14px/25px system-ui, sans-serif; width: 25px; height: 25px; border-radius: 50%; background: #775d46; }
.result-star-goals b { color: #6d3b2f; font-size: 12px; }
.result-star-goals small { margin-top: 3px; color: rgba(62, 43, 30, 0.7); font-size: 11px !important; line-height: 1.35 !important; }
.result-star-goals .met { border-color: rgba(156, 94, 39, 0.3); background: rgba(186, 129, 51, 0.1); }
.result-star-goals .met i { background: #a1692e; }
.result-star-goals .missed { opacity: 0.58; }

.system-copy small,
.system-note,
.weapon-summary-copy small,
.recruit-banner-copy p { font-size: 13px !important; line-height: 1.5; }
.chapter-selector-head { font-size: 12px; }
.chapter-card { flex-basis: 100px; min-width: 100px; min-height: 70px; padding: 8px 7px; }
.chapter-card span,
.chapter-card em { font-size: 11px !important; }
.chapter-card strong { font-size: 14px; }
.chapter-card small { font-size: 12px !important; }
.system-action { min-height: 36px; }

/* Prototype 44.0 · command-center UI and full settings experience */
:root {
  --ui-gold: #e2bd71;
  --ui-gold-soft: rgba(226, 189, 113, 0.22);
  --ui-red: #9d3e30;
  --ui-red-bright: #c45a40;
  --ui-night: #130f0c;
  --ui-panel: rgba(36, 27, 20, 0.96);
  --ui-paper: #eadab7;
}

button { touch-action: manipulation; }

.battle-command-bar {
  min-height: 66px;
  padding: max(10px, env(safe-area-inset-top)) 14px 9px;
  border-bottom: 1px solid var(--ui-gold-soft);
  background:
    radial-gradient(circle at 8% 50%, rgba(173, 64, 45, 0.2), transparent 34%),
    linear-gradient(180deg, #211710, #15110d);
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.22);
}

.battle-brand { min-width: 0; gap: 9px; }
.battle-brand .seal { width: 36px; height: 36px; flex: 0 0 36px; font-size: 19px; }
.battle-title-copy { min-width: 0; }
.battle-title-copy .eyebrow {
  max-width: 235px;
  overflow: hidden;
  color: rgba(237, 216, 176, 0.68);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.battle-title-copy h1 { display: flex; align-items: baseline; gap: 7px; margin-top: 3px; font-size: 18px; letter-spacing: 0.12em; }
.battle-title-copy h1 span { color: rgba(226, 189, 113, 0.58); font: 700 10px/1 system-ui, sans-serif; letter-spacing: 0.06em; white-space: nowrap; }
.topbar-actions { gap: 7px; }
.topbar-actions .icon-button,
.home-round-button {
  width: 40px;
  height: 40px;
  border-color: rgba(226, 189, 113, 0.2);
  color: #e8d4aa;
  background: linear-gradient(145deg, rgba(238, 215, 168, 0.09), rgba(238, 215, 168, 0.025));
  box-shadow: inset 0 0 0 1px rgba(255, 240, 205, 0.025);
}
.settings-button[aria-expanded="true"] { border-color: rgba(226, 189, 113, 0.65); color: #ffdda0; background: rgba(157, 62, 48, 0.52); }

.status-strip {
  gap: 6px;
  padding: 7px 10px 6px;
  background: linear-gradient(180deg, rgba(23, 17, 13, 0.9), rgba(19, 15, 12, 0.55));
}
.status-card { min-height: 52px; padding: 6px 8px; border-color: rgba(226, 189, 113, 0.13); background: rgba(238, 216, 175, 0.035); }
.status-label { color: rgba(238, 219, 181, 0.62); font-size: 10px; letter-spacing: 0.08em; }
.status-card strong { margin-top: 2px; font-size: 18px; line-height: 1.05; }
.status-card small { margin-top: 3px; color: rgba(238, 219, 181, 0.55); font-size: 10px; }
.camp-heart { color: #db7257; text-shadow: 0 0 7px rgba(213, 81, 57, 0.28); }

.home-screen {
  background:
    radial-gradient(ellipse at 85% 10%, rgba(164, 55, 41, 0.3), transparent 27%),
    radial-gradient(ellipse at 7% 63%, rgba(184, 134, 59, 0.12), transparent 34%),
    linear-gradient(158deg, #291a11 0%, #14100c 55%, #0b0a08 100%);
}
.home-screen::before {
  inset: 0 0 76px;
  opacity: 0.28;
  background:
    radial-gradient(ellipse at 64% 29%, transparent 0 15%, rgba(228, 201, 146, 0.06) 16% 16.4%, transparent 17%),
    linear-gradient(152deg, transparent 0 60%, rgba(205, 180, 125, 0.14) 61% 61.5%, transparent 62%),
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(234, 218, 184, 0.02) 7px 8px);
}
.home-scroll { height: calc(100% - 76px); padding: max(15px, env(safe-area-inset-top)) 14px 28px; }
.home-profile { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; padding: 0 1px 12px; }
.home-profile-copy small,
.home-profile-copy span { font-size: 11px !important; }
.home-profile-copy strong { margin: 2px 0; font-size: 19px; letter-spacing: 0.1em; }
.home-profile-actions { display: flex; align-items: center; gap: 6px; }
.home-avatar { width: 48px; height: 48px; font-size: 24px; }

.home-resources { gap: 6px; margin-top: 10px; }
.home-resources button { min-height: 52px; padding: 7px; border-radius: 3px; }
.home-resources button > span { width: 28px; height: 28px; }
.home-resources b { font-size: 14px; }
.home-resources small { font-size: 11px !important; }

.campaign-banner {
  min-height: 205px;
  margin-top: 11px;
  padding: 17px 17px 16px;
  border: 1px solid rgba(237, 198, 117, 0.34);
  background:
    radial-gradient(circle at 86% 16%, rgba(238, 176, 82, 0.14), transparent 18%),
    linear-gradient(120deg, rgba(29, 21, 16, 0.98), rgba(111, 39, 29, 0.93));
}
.campaign-kicker { font-size: 11px; letter-spacing: 0.06em; }
.campaign-banner h2 { margin: 20px 0 8px; font-size: 26px; }
.home-readiness { margin: 8px 0 10px; min-height: 38px; font-size: 12px; }
.home-primary,
.home-secondary { min-height: 46px; font-size: 14px; }

.home-section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 15px 2px 7px; }
.home-section-title strong { color: #efd59d; font-size: 17px; letter-spacing: 0.16em; }
.home-section-title span { color: rgba(233, 216, 183, 0.46); font: 11px/1 system-ui, sans-serif; letter-spacing: 0.05em; }
.home-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 0; }
.home-quick-grid button {
  min-height: 58px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  text-align: left;
}
.home-quick-grid button > span { width: 36px; height: 36px; margin: 0; }
.home-quick-grid strong { font-size: 14px; }
.home-recruit-card { min-height: 72px; margin-top: 8px; padding: 10px 12px; }
.home-recruit-card strong { font-size: 15px; }
.home-recruit-card small,
.home-recruit-card em { font-size: 11px !important; }
.home-hero-strip { min-height: 72px; margin-top: 8px; }
.home-hero-strip small { font-size: 11px !important; }
.home-hero-strip strong { font-size: 13px; }
.home-hero-strip button { min-height: 38px; padding: 8px 10px; font-size: 12px; }

.home-nav { height: 76px; padding: 8px 5px max(8px, env(safe-area-inset-bottom)); }
.home-nav button { min-height: 50px; padding: 4px; }
.home-nav small { margin-top: 4px; font-size: 11px !important; }
.home-nav .battle-nav span { width: 50px; height: 50px; margin-top: -22px; }

.start-screen { padding: 0; background: rgba(9, 7, 5, 0.96); }
.start-scroll {
  width: 100%;
  max-width: none;
  max-height: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: max(24px, env(safe-area-inset-top)) 17px calc(max(24px, env(safe-area-inset-bottom)) + 116px);
  border: 0;
  background:
    radial-gradient(ellipse at 85% 6%, rgba(152, 56, 41, 0.11), transparent 25%),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(74, 48, 27, 0.022) 5px 6px),
    linear-gradient(160deg, #f1e3c2, #cbb68a);
  scrollbar-width: none;
}
.start-scroll::-webkit-scrollbar { display: none; }

.start-fixed-actions {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: max(8px, env(safe-area-inset-bottom));
  width: calc(100% - 34px);
  max-width: 356px;
  translate: -50% 0;
  display: grid;
  gap: 5px;
  padding-top: 16px;
  background: linear-gradient(180deg, transparent, rgba(215, 197, 157, 0.96) 18%, rgba(215, 197, 157, 0.99));
}

.start-fixed-actions .primary-button {
  min-height: 50px;
  margin: 0;
  font-size: 16px;
}

#backHomeButton.start-fixed-back {
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 8px 16px;
  border: 1px solid rgba(105, 70, 43, 0.26);
  color: #604534;
  background: linear-gradient(180deg, rgba(239, 225, 193, 0.98), rgba(211, 192, 151, 0.98));
  box-shadow: 0 3px 10px rgba(49, 32, 20, 0.16);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-decoration: none;
}

#backHomeButton.start-fixed-back:hover,
#backHomeButton.start-fixed-back:focus-visible {
  color: #853b30;
  border-color: rgba(143, 59, 47, 0.46);
  background: linear-gradient(180deg, #f2e5c6, #d8c49b);
}

button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.primary-button:active,
.secondary-button:active,
.system-action:active,
.mode-card:active,
.chapter-card:active,
.start-fixed-back:active {
  translate: 0 1px;
  filter: brightness(0.96);
}
.start-eyebrow { font-size: 12px !important; letter-spacing: 0.12em; }
.start-scroll > h2 { margin: 5px 0 15px; font-size: 30px; }
.mode-selector { gap: 8px; }
.mode-card { min-height: 88px; padding: 12px; }
.mode-card span,
.mode-card small { font-size: 11px !important; }
.mode-card strong { margin-top: 5px; font-size: 16px; }
.chapter-selector { margin-top: 13px; padding: 11px; }
.chapter-selector-head { font-size: 13px; }
.chapter-volumes button { min-height: 36px; padding-inline: 11px; font-size: 12px; }
.chapter-card { flex-basis: 112px; min-width: 112px; min-height: 82px; padding: 9px; }
.chapter-card span,
.chapter-card em { font-size: 11px !important; }
.chapter-card strong { font-size: 15px; }
.chapter-card small { font-size: 12px !important; }
.war-council { padding: 12px; }
.war-council-grid > span { min-height: 49px; }
.war-council-grid small { font-size: 11px !important; }
.war-council-grid b { font-size: 13px; }
.start-scroll .primary-button { min-height: 50px; font-size: 16px; }

.settings-screen {
  position: absolute;
  z-index: 96;
  inset: 0;
  display: grid;
  place-items: stretch;
  background: rgba(6, 5, 4, 0.78);
  backdrop-filter: blur(5px);
}
.settings-screen.hidden { display: none; }
.settings-sheet {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  color: #3d2d21;
  background:
    radial-gradient(ellipse at 93% 5%, rgba(159, 62, 45, 0.12), transparent 25%),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(77, 53, 31, 0.022) 5px 6px),
    linear-gradient(155deg, #f1e4c7, #cdb88c);
  animation: settings-enter 180ms ease-out both;
}
@keyframes settings-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.settings-head {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) 17px 12px;
  border-bottom: 1px solid rgba(83, 55, 31, 0.2);
  background: rgba(255, 250, 235, 0.18);
}
.settings-head span { color: rgba(65, 45, 30, 0.62); font: 700 11px/1 system-ui, sans-serif; letter-spacing: 0.15em; }
.settings-head h2 { margin: 4px 0 0; color: #4b3023; font-size: 25px; letter-spacing: 0.14em; }
.settings-head button,
.system-head button { width: 44px; height: 44px; border-radius: 50%; font-size: 25px; cursor: pointer; }
.settings-layout { min-height: 0; display: grid; grid-template-columns: 80px minmax(0, 1fr); }
.settings-tabs {
  min-height: 0;
  padding: 10px 7px;
  border-right: 1px solid rgba(79, 53, 31, 0.19);
  background: rgba(89, 59, 35, 0.07);
}
.settings-tabs button {
  width: 100%;
  min-height: 70px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  margin-bottom: 6px;
  border: 1px solid transparent;
  color: rgba(66, 47, 32, 0.58);
  background: transparent;
  cursor: pointer;
}
.settings-tabs button b {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(92, 57, 32, 0.18);
  color: #805142;
  background: rgba(255, 255, 255, 0.22);
  font-size: 16px;
}
.settings-tabs button span { font-size: 13px; font-weight: 800; }
.settings-tabs button.active { border-color: rgba(137, 58, 43, 0.2); color: #7b3028; background: rgba(154, 62, 47, 0.09); box-shadow: inset 3px 0 #9b4233; }
.settings-tabs button.active b { color: #f3dfb9; background: #8f3d31; }
.settings-content { min-height: 0; overflow-y: auto; padding: 16px 14px 28px; scrollbar-width: none; }
.settings-content::-webkit-scrollbar { display: none; }
.settings-panel[hidden] { display: none; }
.settings-panel h3 { margin: 0 0 13px; color: #4d3022; font-size: 20px; letter-spacing: 0.1em; }
.settings-row {
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(128px, 0.9fr);
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(78, 53, 32, 0.14);
}
.settings-row > div:first-child strong,
.settings-row > div:first-child span { display: block; }
.settings-row > div:first-child strong { color: #4a3023; font-size: 15px; }
.settings-row > div:first-child span { margin-top: 5px; color: rgba(62, 45, 32, 0.65); font: 12px/1.45 system-ui, sans-serif; }
.settings-row-stack { grid-template-columns: 1fr; gap: 8px; }
.setting-segments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.setting-segments.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.setting-segments button {
  min-height: 40px;
  padding: 7px 4px;
  border: 1px solid rgba(92, 59, 34, 0.18);
  color: #6b4a35;
  background: rgba(255, 255, 255, 0.2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.setting-segments button.selected { border-color: #904335; color: #f6e4bf; background: linear-gradient(145deg, #a64b38, #793228); box-shadow: inset 0 0 0 1px rgba(255, 230, 182, 0.08); }
.settings-battle-card {
  margin: 15px 0 9px;
  padding: 12px;
  border: 1px solid rgba(90, 57, 33, 0.2);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 3px 0 #9c4434;
}
.settings-battle-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.settings-battle-card header > span { color: #804437; font-size: 13px; font-weight: 900; }
.settings-battle-card p { margin: 9px 0 0; color: rgba(57, 41, 30, 0.76); font: 13px/1.55 system-ui, sans-serif; }
.settings-battle-card .formation-badge { font-size: 12px !important; }
.settings-battle-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.settings-restart {
  min-height: 55px;
  padding: 9px 12px;
  border-color: rgba(153, 66, 51, 0.34);
  color: #593426;
  background: rgba(154, 65, 49, 0.08);
}
.settings-restart span { font-size: 14px; }
.settings-restart small { margin-top: 3px; color: rgba(80, 52, 36, 0.62); font-size: 12px; }
.settings-restart[data-confirm="true"] { color: #f7e3bc; background: #9c4031; }
.settings-restart[data-confirm="true"] small { color: rgba(255, 235, 198, 0.7); }
.settings-exit {
  width: 100%;
  min-height: 55px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  padding: 9px 12px;
  border: 1px solid rgba(76, 59, 48, 0.28);
  color: #4f3b30;
  background: rgba(66, 52, 44, 0.07);
  text-align: left;
  cursor: pointer;
}
.settings-exit span { font-size: 14px; font-weight: 700; }
.settings-exit small { color: rgba(73, 56, 45, 0.64); font-size: 12px; }
.settings-exit[data-confirm="true"] { border-color: #8e382d; color: #f7e3bc; background: #87382e; }
.settings-exit[data-confirm="true"] small { color: rgba(255, 235, 198, 0.76); }
.battle-only-setting[hidden] { display: none !important; }
.settings-unit-note { margin-top: 12px; padding: 11px; border: 1px dashed rgba(84, 56, 33, 0.23); }
.settings-unit-note strong,
.settings-unit-note span { display: block; }
.settings-unit-note strong { color: #694132; font-size: 13px; }
.settings-unit-note span { margin-top: 5px; color: rgba(63, 45, 32, 0.67); font: 12px/1.55 system-ui, sans-serif; }
.settings-foot { min-height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 10px 17px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(82, 55, 33, 0.18); color: rgba(63, 44, 31, 0.56); font: 11px/1 system-ui, sans-serif; }
.settings-foot b { color: #8b4939; }

/* Prototype 56.0 · split the roster and bond atlas into focused pages */
.hero-system-tabs {
  position: sticky;
  z-index: 5;
  top: 70px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: -5px 0 10px;
  padding: 5px 0;
  background: linear-gradient(180deg, rgba(229, 214, 181, 0.99), rgba(218, 200, 160, 0.97));
  box-shadow: 0 7px 10px rgba(65, 43, 27, 0.06);
}

.hero-system-tabs button {
  min-height: 54px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid rgba(91, 58, 35, 0.18);
  color: #674333;
  background: rgba(255, 255, 255, 0.16);
  text-align: left;
}

.hero-system-tabs button > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #f3ddb4;
  background: #704337;
  font-size: 17px;
  font-weight: 900;
}

.hero-system-tabs button strong { font-size: 14px; }
.hero-system-tabs button small { color: rgba(78, 54, 39, 0.62); font-size: 12px; }
.hero-system-tabs button.selected {
  border-color: rgba(151, 64, 48, 0.45);
  color: #713127;
  background: linear-gradient(145deg, rgba(174, 74, 54, 0.19), rgba(210, 165, 83, 0.08));
  box-shadow: inset 3px 0 #9d4636;
}
.hero-system-tabs button.selected > span { background: linear-gradient(145deg, #a84c39, #703027); }

.hero-roster-filters {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid rgba(85, 55, 34, 0.17);
  background: rgba(255, 255, 255, 0.12);
}

.hero-filter-row { display: grid; gap: 6px; }
.hero-filter-row.status-filter { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hero-filter-row.faction-filter { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 7px; }
.hero-filter-row button {
  min-width: 0;
  min-height: 44px;
  padding: 6px 4px;
  border: 1px solid rgba(86, 55, 34, 0.16);
  color: #674536;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
}
.hero-filter-row.status-filter button strong,
.hero-filter-row.status-filter button small { display: block; }
.hero-filter-row.status-filter button strong { font-size: 12px; }
.hero-filter-row.status-filter button small { margin-top: 2px; color: rgba(72, 51, 38, 0.58); font-size: 12px; }
.hero-filter-row.faction-filter button { display: flex; align-items: center; justify-content: center; gap: 4px; }
.hero-filter-row.faction-filter button span { font-size: 14px; font-weight: 900; }
.hero-filter-row button.selected { border-color: #934336; color: #f6e4be; background: #8f4033; }
.hero-filter-row button.selected small { color: rgba(255, 236, 198, 0.75); }
.hero-filter-row button.faction-wei.selected { background: #536a78; }
.hero-filter-row button.faction-shu.selected { background: #637346; }
.hero-filter-row button.faction-wu.selected { background: #97483a; }
.hero-roster-filters > p { margin: 8px 0 0; color: rgba(67, 48, 36, 0.68); font: 12px/1.3 system-ui, sans-serif; text-align: right; }

.hero-filtered-list .hero-roster-card .system-copy > strong { font-size: 14px; }
.hero-filtered-list .hero-roster-card .system-copy > small { margin-top: 4px; font-size: 12px; line-height: 1.35; }
.hero-filtered-list .hero-card-actions { min-width: 82px; }
.hero-filtered-list .system-action { min-height: 44px; padding: 7px 6px; font-size: 12px; }
.hero-filtered-list .hero-roster-card.locked { min-height: 66px; align-items: center; padding-top: 8px; padding-bottom: 8px; opacity: 0.7; }
.hero-filtered-list .hero-roster-card.locked .system-tag { font-size: 12px; }

.hero-filter-empty {
  min-height: 170px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 20px;
  border: 1px dashed rgba(83, 56, 36, 0.24);
  color: #674536;
  text-align: center;
}
.hero-filter-empty span { width: 44px; height: 44px; display: grid; place-items: center; color: #efd6a8; background: #6a4c3e; font-size: 20px; font-weight: 900; }
.hero-filter-empty strong { font-size: 15px; }
.hero-filter-empty small { color: rgba(67, 48, 36, 0.64); font-size: 12px; }

.bond-summary { margin-bottom: 10px; }
.hero-bond-page .bond-card { min-height: 88px; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; padding: 12px; }
.hero-bond-page .bond-card > span { width: 42px; height: 42px; font-size: 20px; }
.hero-bond-page .bond-card strong { font-size: 14px; }
.hero-bond-page .bond-card small { margin-top: 4px; font: 12px/1.3 system-ui, sans-serif; }
.hero-bond-page .bond-card p { margin-top: 7px; font: 12px/1.45 system-ui, sans-serif; }
.hero-bond-page .bond-card > em { padding: 5px 7px; font: 12px/1 system-ui, sans-serif; }

.lineup-slots i { font-size: 11px; }
.lineup-slots em { font-size: 12px; }

/* Prototype 57.0 · weapon-vault filters and before/after power comparison */
.weapon-vault-filters {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid rgba(85, 55, 34, 0.17);
  background: rgba(255, 255, 255, 0.12);
}

.weapon-status-filter {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.weapon-status-filter button,
.weapon-quality-filter button {
  min-width: 0;
  min-height: 44px;
  padding: 6px 3px;
  border: 1px solid rgba(86, 55, 34, 0.16);
  color: #674536;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
}

.weapon-status-filter strong,
.weapon-status-filter small { display: block; }
.weapon-status-filter strong { font-size: 11px; }
.weapon-status-filter small { margin-top: 2px; color: rgba(72, 51, 38, 0.58); font-size: 12px; }

.weapon-quality-filter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 7px;
}

.weapon-quality-filter button { display: flex; align-items: center; justify-content: center; gap: 5px; }
.weapon-quality-filter button span { font-size: 13px; font-weight: 900; }
.weapon-status-filter button.selected,
.weapon-quality-filter button.selected { border-color: #934336; color: #f6e4be; background: #8f4033; }
.weapon-status-filter button.selected small { color: rgba(255, 236, 198, 0.75); }
.weapon-quality-filter .quality-green.selected { background: #4f7c55; }
.weapon-quality-filter .quality-blue.selected { background: #456e98; }
.weapon-quality-filter .quality-purple.selected { background: #74518d; }
.weapon-quality-filter .quality-gold.selected { background: #9d7228; }
.weapon-quality-filter .quality-red.selected { background: #9a3d35; }
.weapon-vault-filters > p { margin: 8px 0 0; color: rgba(67, 48, 36, 0.68); font: 12px/1.3 system-ui, sans-serif; text-align: right; }

.weapon-list .weapon-card .system-copy > strong { font-size: 14px; }
.weapon-list .hero-card-actions { min-width: 88px; }
.weapon-list .system-action { min-height: 44px; padding: 7px 6px; font-size: 12px; }

.weapon-compare-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 7px 0 5px;
  padding: 6px 7px;
  border: 1px solid rgba(83, 56, 36, 0.15);
  color: #674536;
  background: rgba(255, 255, 255, 0.17);
}
.weapon-compare-line b { font-size: 12px; }
.weapon-compare-line em { padding: 3px 5px; font: 800 12px/1 system-ui, sans-serif; font-style: normal; white-space: nowrap; }
.weapon-compare-line.positive em { color: #f1e3bd; background: #56764f; }
.weapon-compare-line.negative em { color: #f4dfc0; background: #8e453a; }
.weapon-compare-line.current em { color: #6d4c37; background: rgba(153, 111, 54, 0.15); }
.weapon-transfer-warning { margin-top: 5px !important; padding: 5px 7px; color: #873e34 !important; border-left: 3px solid #9c4939; background: rgba(158, 69, 54, 0.08); }
.weapon-filter-empty { grid-column: 1 / -1; }

.weapon-hero-tab { min-height: 48px; }

/* Prototype 59.0 · weapon traits and faction-directed recruitment */
.weapon-trait-line {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  padding: 7px 8px;
  border: 1px solid rgba(146, 84, 44, 0.24);
  color: #67402f;
  background: linear-gradient(135deg, rgba(204, 160, 79, 0.15), rgba(143, 62, 48, 0.08));
}

.weapon-trait-line > i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #f5ddb0;
  background: #7d4034;
  font: 900 15px/1 serif;
  font-style: normal;
  box-shadow: inset 0 0 0 2px rgba(235, 198, 126, 0.2);
}

.weapon-trait-line > span { min-width: 0; }
.weapon-trait-line b { display: block; font-size: 13px; line-height: 1.2; }
.weapon-trait-line em { display: block; margin-top: 3px; color: rgba(76, 48, 34, 0.72); font: 12px/1.35 system-ui, sans-serif; font-style: normal; }

.recruit-wish-picker {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid rgba(104, 64, 38, 0.2);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.17), rgba(195, 149, 78, 0.09));
}

.recruit-wish-picker > strong {
  display: block;
  margin-bottom: 8px;
  color: #674333;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.recruit-wish-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.recruit-wish-grid button {
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 4px;
  border: 1px solid rgba(91, 58, 35, 0.2);
  color: #684636;
  background: rgba(255, 255, 255, 0.22);
}

.recruit-wish-grid button span { font: 900 17px/1 serif; }
.recruit-wish-grid button b { font-size: 13px; }
.recruit-wish-grid button.selected { color: #f7e5bd; border-color: rgba(255, 229, 178, 0.35); box-shadow: inset 0 0 0 2px rgba(246, 217, 158, 0.12); }
.recruit-wish-grid .faction-all.selected { background: #78604a; }
.recruit-wish-grid .faction-wei.selected { background: #536a78; }
.recruit-wish-grid .faction-shu.selected { background: #637346; }
.recruit-wish-grid .faction-wu.selected { background: #97483a; }

.recruit-rule { font-size: 13px !important; line-height: 1.55 !important; }

.phone-frame[data-font-size="large"] .settings-row > div:first-child span,
.phone-frame[data-font-size="large"] .settings-unit-note span,
.phone-frame[data-font-size="large"] #tutorialText,
.phone-frame[data-font-size="large"] .system-copy small,
.phone-frame[data-font-size="large"] .chapter-card small { font-size: 14px !important; }
.phone-frame[data-font-size="large"] .status-card small,
.phone-frame[data-font-size="large"] .command-meta small { font-size: 13px !important; }

.phone-frame[data-quality="smooth"] .ink-cloud,
.phone-frame[data-quality="smooth"] .battlefield-wrap::after,
.phone-frame[data-quality="smooth"] .home-screen::after { display: none; }
.phone-frame[data-quality="smooth"] .hex-cell { filter: none; }
.phone-frame[data-quality="smooth"] .phone-frame,
.phone-frame[data-quality="smooth"] .campaign-banner { box-shadow: none; }
.phone-frame[data-motion="reduced"] *,
.phone-frame[data-motion="reduced"] *::before,
.phone-frame[data-motion="reduced"] *::after { scroll-behavior: auto !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }

@media (max-width: 390px) {
  .battle-title-copy h1 span { display: none; }
  .battle-title-copy .eyebrow { max-width: 205px; }
  .home-profile-actions { gap: 3px; }
  .home-round-button { width: 37px; height: 37px; }
  .settings-layout { grid-template-columns: 70px minmax(0, 1fr); }
  .settings-content { padding-inline: 11px; }
  .settings-row { grid-template-columns: 1fr; gap: 8px; }
  .settings-tabs { padding-inline: 5px; }
  .settings-tabs button { min-height: 64px; }
}

@media (max-height: 760px) {
  .home-scroll { padding-top: 11px; }
  .home-profile { padding-bottom: 8px; }
  .home-resources { margin-top: 7px; }
  .campaign-banner { min-height: 180px; padding-block: 13px; }
  .campaign-banner h2 { margin-top: 13px; font-size: 23px; }
  .home-section-title { margin-top: 10px; }
  .home-quick-grid button { min-height: 52px; }
}

/* Prototype 60.0 · mobile system sheets keep the exit control on screen */
@media (max-width: 760px) {
  .system-screen {
    padding: 0;
    place-items: stretch;
  }

  .system-scroll {
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    max-height: none;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  .system-scroll .system-head {
    position: relative;
    z-index: 12;
    top: auto;
    margin: 0;
    padding: max(14px, env(safe-area-inset-top)) 18px 12px;
    background: linear-gradient(180deg, #f0e3c4, #dfcda7);
    box-shadow: 0 7px 18px rgba(57, 38, 23, 0.18);
  }

  .system-head button {
    position: relative;
    z-index: 2;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-color: rgba(112, 54, 39, 0.34);
    color: #f6e3bc;
    background: #8f4033;
    box-shadow: 0 4px 12px rgba(91, 43, 33, 0.24);
    touch-action: manipulation;
  }

  .system-body {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 13px 18px calc(30px + env(safe-area-inset-bottom));
    scrollbar-width: none;
  }

  .system-body::-webkit-scrollbar { display: none; }
  .hero-system-tabs { top: 0; }
}
