@charset "utf-8";
:root {
  --forest-950: #2d271e;
  --forest-900: #44392b;
  --forest-800: #5e4a34;
  --forest-700: #776043;
  --forest-600: #8d7450;
  --grass: #73ad57;
  --cream: #f7e4b8;
  --cream-2: #eed19a;
  --ink: #362b20;
  --muted: #786b58;
  --yellow: #f2b84b;
  --yellow-2: #d9942e;
  --coral: #ff6d68;
  --sky: #66cadd;
  --line: rgba(72, 51, 29, 0.19);
  --shadow: 0 26px 72px rgba(30, 22, 13, 0.48);
  --soft-shadow: 0 8px 24px rgba(69, 45, 21, 0.17);
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  overflow: clip;
  background: #251f18;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

/* 全螢幕介面打開時鎖定底層頁面；可見畫面只留下其指定的一條捲軸。 */
body:has(.overlay:not([hidden])),
body:has(.progress-confirm-overlay:not([hidden])) {
  overflow: hidden !important;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.page-shell {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(0px, 1.5vw, 24px);
  overflow: hidden;
  overflow: clip;
  background:
    radial-gradient(circle at 13% 16%, rgba(237, 191, 112, 0.14), transparent 22%),
    radial-gradient(circle at 89% 86%, rgba(126, 164, 80, 0.13), transparent 24%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 12px),
    var(--forest-950);
}

.page-shell::before,
.page-shell::after {
  content: "";
  position: absolute;
  width: min(34vw, 520px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 42% 58% 64% 36% / 48% 38% 62% 52%;
  pointer-events: none;
}

.page-shell::before {
  top: -20%;
  left: -13%;
  transform: rotate(22deg);
}

.page-shell::after {
  right: -14%;
  bottom: -25%;
  transform: rotate(-18deg);
}

.game-frame {
  position: relative;
  z-index: 1;
  display: grid;
  /* 3:8 保留左側控制台；右側戰場寬度等於框高，960×960 Canvas 保持精確 1:1。 */
  grid-template-columns: minmax(0, 3fr) minmax(0, 8fr);
  width: min(calc(100vw - clamp(0px, 3vw, 48px)), calc((100vh - clamp(0px, 3vw, 48px)) * 1.375));
  width: min(calc(100vw - clamp(0px, 3vw, 48px)), calc((100dvh - clamp(0px, 3vw, 48px)) * 1.375));
  max-width: 1560px;
  aspect-ratio: 11 / 8;
  max-height: calc(100vh - clamp(0px, 3vw, 48px));
  max-height: calc(100dvh - clamp(0px, 3vw, 48px));
  border: 1px solid rgba(255, 244, 214, 0.28);
  border-radius: clamp(14px, 1.5vw, 24px);
  overflow: hidden;
  overflow: clip;
  background: var(--cream);
  box-shadow: var(--shadow), 0 0 0 7px rgba(246, 219, 163, 0.08), 0 12px 0 #17130f;
}

.battlefield {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  overflow: hidden;
  background: #67b85e;
  border-left: 3px solid #6f5738;
  box-shadow: inset 16px 0 28px rgba(54, 38, 18, 0.16);
}

.battlefield::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  border: 9px solid rgba(255, 244, 207, 0.12);
  border-left-color: rgba(57, 41, 23, 0.18);
  box-shadow: inset 0 -18px 30px rgba(47, 35, 20, 0.12), inset 0 10px 16px rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  filter: saturate(0.94) contrast(1.025) sepia(0.035);
}

.wave-action-card {
  position: static;
  display: flex;
  width: 100%;
  flex: 0 0 auto;
  align-items: stretch;
  gap: 7px;
}

.wave-action-card .primary-button--wave {
  width: auto;
  min-height: 48px;
  flex: 1 1 auto;
  border-color: rgba(111, 71, 26, 0.72);
  box-shadow:
    0 4px 0 #a76724,
    0 9px 24px rgba(42, 28, 14, 0.22),
    0 0 0 3px rgba(255, 248, 218, 0.35);
}

.wave-action-card .speed-button {
  width: 52px;
  height: auto;
  min-height: 48px;
}

.control-panel {
  position: relative;
  z-index: 2;
  grid-column: 1;
  grid-row: 1;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: clamp(7px, 0.85vh, 10px);
  padding: clamp(11px, 1.25vw, 17px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(44, 107, 84, 0.35) transparent;
  background:
    linear-gradient(90deg, rgba(119, 83, 40, 0.09), transparent 7%),
    linear-gradient(180deg, rgba(255, 250, 226, 0.84), transparent 20%),
    radial-gradient(circle at 0 100%, rgba(185, 130, 50, 0.13), transparent 30%),
    var(--cream);
  border-right: 1px solid rgba(72, 51, 29, 0.24);
  box-shadow: inset -8px 0 18px rgba(80, 55, 28, 0.08);
}

.control-panel::after {
  content: "";
  position: absolute;
  inset: auto -44px -44px auto;
  width: 140px;
  height: 140px;
  border: 28px solid rgba(69, 137, 94, 0.045);
  border-radius: 50%;
  pointer-events: none;
}

.panel-header,
.mini-brand,
.quick-controls,
.status-card,
.section-heading,
.tower-card,
.tower-card__top,
.selected-panel__heading,
.upgrade-button,
.round-controls,
.primary-button {
  display: flex;
  align-items: center;
}

.panel-header {
  order: 0;
  min-height: 46px;
  justify-content: space-between;
  gap: 10px;
}

.mini-brand {
  min-width: 0;
  gap: 10px;
}

.mini-brand__mark {
  position: relative;
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  place-items: center;
  border: 3px solid #604728;
  border-radius: 12px;
  background: linear-gradient(145deg, #ffd773, var(--yellow));
  box-shadow: 0 4px 0 #9b6728, inset 0 2px 0 rgba(255, 255, 255, 0.45);
}

.mini-brand__face {
  position: relative;
  z-index: 2;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 2px solid #604728;
  border-radius: 9px;
  background: #fff4d8;
  color: #604728;
  font-size: 13px;
  font-weight: 1000;
}

.mini-brand__plane {
  position: absolute;
  z-index: 3;
  right: -7px;
  top: -8px;
  transform: rotate(-35deg);
  color: #fff7e4;
  font-size: 20px;
  line-height: 1;
  text-shadow: 0 2px 0 #604728, 2px 0 0 #604728, -2px 0 0 #604728;
}

.mini-brand > div:last-child {
  display: grid;
  min-width: 0;
  line-height: 1.05;
}

.mini-brand strong {
  overflow: hidden;
  font-size: clamp(16px, 1.4vw, 21px);
  font-weight: 1000;
  letter-spacing: -0.05em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-brand > div > span {
  margin-top: 5px;
  color: var(--muted);
  font-size: clamp(9px, 0.74vw, 11px);
  font-weight: 750;
  letter-spacing: 0.06em;
}

.quick-controls {
  flex: 0 0 auto;
  gap: 6px;
}

.sound-setting {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  padding-right: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.52);
}

.sound-setting--dual {
  gap: 2px;
  padding-right: 4px;
}

.sound-setting .icon-button {
  flex: 0 0 auto;
  border-color: transparent;
}

.sound-volume-stack {
  display: grid;
  gap: 1px;
}

.sound-volume-control {
  display: grid;
  width: clamp(72px, 6.2vw, 86px);
  min-width: 0;
  grid-template-columns: 14px minmax(32px, 1fr) 25px;
  align-items: center;
  gap: 2px;
  color: var(--forest-700);
  cursor: pointer;
}

.sound-volume-control > span {
  font-size: 8px;
  font-weight: 950;
  line-height: 1;
  text-align: center;
}

.sound-volume-control input {
  width: 100%;
  height: 15px;
  margin: 0;
  accent-color: var(--forest-800);
  cursor: pointer;
}

.sound-volume-control input:focus-visible {
  outline: 2px solid #d58c23;
  outline-offset: 2px;
  border-radius: 999px;
}

.sound-volume-control output {
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.icon-button {
  position: relative;
  display: grid;
  width: clamp(36px, 3vw, 42px);
  aspect-ratio: 1;
  padding: 9px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--forest-800);
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.icon-button.is-active,
.icon-button[aria-pressed="true"] {
  background: var(--forest-900);
  color: #fff;
}

.icon-button.is-muted {
  background: #ffe7df;
  color: #a14842;
}

.icon-button.is-muted::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 3px;
  transform: rotate(-45deg);
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 2px #ffe7df;
}

.icon-button svg,
.restart-button svg,
.status-card__icon svg,
.primary-button svg,
.speed-button svg {
  width: 100%;
  height: 100%;
}

.status-grid {
  display: grid;
  order: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(5px, 0.6vw, 8px);
}

.status-card {
  min-width: 0;
  min-height: clamp(49px, 5.4vw, 65px);
  gap: clamp(5px, 0.6vw, 8px);
  padding: clamp(7px, 0.75vw, 10px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 3px 0 rgba(25, 54, 47, 0.045);
}

.status-card__icon {
  display: grid;
  width: clamp(24px, 2.4vw, 31px);
  aspect-ratio: 1;
  flex: 0 0 auto;
  padding: 6px;
  place-items: center;
  border-radius: 10px;
  background: var(--cream-2);
  color: var(--forest-800);
  font-size: clamp(9px, 0.8vw, 12px);
  font-weight: 1000;
}

.status-card--lives .status-card__icon {
  background: #ffe2de;
  color: var(--coral);
}

.status-card--money .status-card__icon {
  border: 2px solid #e89b2e;
  background: var(--yellow);
  color: var(--forest-900);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.38);
}

.status-card > span:last-child {
  display: grid;
  min-width: 0;
  line-height: 1;
}

.status-card small {
  overflow: hidden;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: clamp(8px, 0.66vw, 10px);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-card strong {
  font-size: clamp(16px, 1.5vw, 22px);
  font-weight: 1000;
  letter-spacing: -0.04em;
}

.status-card strong em {
  margin: 0 1px;
  color: #9bac9f;
  font-size: 0.65em;
  font-style: normal;
}

.section-heading {
  min-height: 31px;
  justify-content: space-between;
  gap: 8px;
}

.section-heading > div,
.selected-panel__heading > div {
  display: grid;
  gap: 1px;
}

.section-kicker,
.eyebrow {
  color: var(--forest-600);
  font-size: clamp(8px, 0.66vw, 10px);
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-heading h2,
.selected-panel h2 {
  margin: 0;
  font-size: clamp(14px, 1.2vw, 18px);
  font-weight: 950;
  letter-spacing: -0.03em;
}

.keyboard-tip {
  color: #8a9b91;
  font-size: clamp(8px, 0.65vw, 10px);
  font-weight: 700;
}

.wave-card {
  display: grid;
  order: 3;
  gap: 7px;
  padding: clamp(8px, 0.85vw, 12px);
  border: 1px solid rgba(59, 127, 91, 0.18);
  border-radius: 15px;
  background: rgba(232, 218, 172, 0.57);
}

.wave-number {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--forest-900);
  color: #fff;
  font-size: clamp(8px, 0.7vw, 10px);
  font-weight: 850;
  white-space: nowrap;
}

.enemy-preview {
  display: flex;
  min-height: 25px;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

.enemy-chip {
  display: inline-flex;
  min-width: 0;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid rgba(25, 54, 47, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #51685d;
  font-size: clamp(8px, 0.68vw, 10px);
  font-family: inherit;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  scroll-snap-align: start;
}

.enemy-chip:hover,
.enemy-chip.is-active,
.enemy-chip[aria-expanded="true"] {
  border-color: rgba(45, 111, 76, 0.42);
  background: #f1f7df;
  color: var(--forest-900);
}

.enemy-chip:focus-visible {
  outline: 2px solid var(--forest-700);
  outline-offset: 2px;
}

.enemy-chip i {
  position: relative;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border: 1.5px solid #7d3434;
  border-radius: 50% 50% 45% 45%;
  background: #f45f5c;
  box-shadow: inset 0 4px 0 rgba(53, 35, 25, 0.75);
}

.enemy-chip i::after {
  content: "";
  position: absolute;
  left: 2px;
  bottom: -6px;
  width: 8px;
  height: 6px;
  border: 1px solid currentColor;
  border-radius: 3px 3px 1px 1px;
  background: inherit;
}

/* 十種溫生各有自己的顏色，由 game.js 以 inline style 供給，這裡只留無色時的預設。 */

.enemy-remaining {
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--forest-700);
  font-size: clamp(8px, 0.68vw, 10px);
  font-weight: 850;
  white-space: nowrap;
}

.shop {
  display: grid;
  order: 2;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(102, 72, 38, 0.23);
  border-radius: 15px;
  background: rgba(255, 246, 217, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 4px 0 rgba(102, 72, 38, 0.08);
}

.tower-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 6px;
}

.tower-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  min-height: 84px;
  place-items: center;
  gap: 0;
  padding: 5px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-color: rgba(88, 61, 31, 0.2);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(250, 236, 199, 0.9));
  color: var(--ink);
  text-align: center;
  touch-action: manipulation;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(91, 60, 28, 0.18), inset 0 1px 0 #fff;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.tower-card::after {
  content: "";
  position: absolute;
  right: -21px;
  bottom: -24px;
  width: 55px;
  height: 55px;
  border: 10px solid rgba(125, 84, 35, 0.06);
  border-radius: 50%;
}

.tower-card:hover:not(:disabled) {
  transform: translateY(-2px) translateX(2px);
  border-color: rgba(136, 91, 36, 0.56);
  background: #fff8e5;
  box-shadow: -3px 5px 0 rgba(91, 60, 28, 0.2), 0 9px 20px rgba(58, 38, 18, 0.16);
}

.tower-card.is-selected,
.tower-card[aria-pressed="true"] {
  order: -1;
  grid-column: 1 / -1;
  grid-template-columns: 68px minmax(0, 1fr);
  min-height: 96px;
  align-items: stretch;
  gap: clamp(5px, 0.55vw, 8px);
  padding: 5px 8px 6px 6px;
  border-color: #327853;
  background: #f1f7d5;
  text-align: left;
  box-shadow: 0 0 0 3px rgba(50, 120, 83, 0.25), 0 5px 0 rgba(42, 92, 64, 0.24);
}

.tower-card.is-expanded,
.tower-card[aria-expanded="true"] {
  order: -1;
  grid-column: 1 / -1;
  grid-template-columns: 68px minmax(0, 1fr);
  min-height: 96px;
  align-items: stretch;
  gap: clamp(5px, 0.55vw, 8px);
  padding: 5px 8px 6px 6px;
  text-align: left;
}

.tower-card:disabled,
.tower-card.is-unaffordable {
  cursor: not-allowed;
  filter: saturate(0.55);
  opacity: 0.6;
}

.tower-card.is-loading {
  border-color: #d0922f;
  background: #fff5cf;
  box-shadow: 0 0 0 3px rgba(208, 146, 47, 0.2), 0 4px 0 rgba(91, 60, 28, 0.18);
}

.tower-card.is-loading .tower-portrait::after {
  content: "載入";
  position: absolute;
  z-index: 14;
  inset: auto 5px 5px;
  padding: 3px 4px;
  border-radius: 999px;
  background: rgba(55, 37, 20, 0.88);
  color: #fff8dc;
  font-size: 8px;
  font-weight: 950;
  line-height: 1;
  text-align: center;
}

.tower-portrait {
  position: relative;
  width: min(100%, 68px);
  min-width: 0;
  height: 74px;
  align-self: center;
  overflow: hidden;
  border: 1px solid rgba(76, 54, 29, 0.18);
  border-radius: 9px;
  background: linear-gradient(145deg, #d8e9b5, #a9cf87);
  box-shadow: inset 0 -8px 12px rgba(54, 91, 36, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.tower-card.is-selected .tower-portrait,
.tower-card[aria-pressed="true"] .tower-portrait,
.tower-card.is-expanded .tower-portrait,
.tower-card[aria-expanded="true"] .tower-portrait {
  width: 68px;
  min-width: 68px;
}

.tower-card.is-selected .tower-portrait::after,
.tower-card[aria-pressed="true"] .tower-portrait::after {
  content: "✓";
  position: absolute;
  z-index: 12;
  top: 3px;
  left: 3px;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 2px solid #fffbe9;
  border-radius: 50%;
  background: #327853;
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 1000;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(31, 76, 51, 0.28);
}

.portrait-head {
  position: absolute;
  z-index: 3;
  top: 7px;
  left: 50%;
  width: 25px;
  height: 24px;
  transform: translateX(-50%);
  border: 1.5px solid #4a3524;
  border-radius: 46% 46% 43% 43%;
  background: #efbc82;
}

.portrait-head::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 3px;
  width: 7px;
  height: 3px;
  border-bottom: 1.5px solid #754e36;
  border-radius: 50%;
}

.portrait-hair {
  position: absolute;
  z-index: 5;
  top: 5px;
  left: 50%;
  width: 27px;
  height: 11px;
  transform: translateX(-50%) rotate(-2deg);
  border-radius: 60% 52% 35% 24%;
  background: #24231f;
  box-shadow: -4px 5px 0 -2px #24231f, 7px 4px 0 -3px #24231f;
}

.portrait-glasses {
  position: absolute;
  z-index: 6;
  top: 16px;
  left: 50%;
  width: 22px;
  height: 8px;
  transform: translateX(-50%);
  border-right: 7px solid transparent;
  border-left: 7px solid transparent;
  box-shadow: inset 0 0 0 1.5px #24231f;
}

.portrait-glasses::before,
.portrait-glasses::after {
  content: "";
  position: absolute;
  top: 0;
  width: 8px;
  height: 7px;
  border: 1.5px solid #24231f;
  border-radius: 3px;
  background: rgba(179, 221, 232, 0.35);
}

.portrait-glasses::before { left: -6px; }
.portrait-glasses::after { right: -6px; }

.tower-card:not(.tower-card--radial):not(.tower-card--sword):not(.tower-card--blocker) .portrait-head {
  top: -1px;
  width: 38px;
  height: 40px;
  border: 0;
  border-radius: 0;
  background: url("assets/characters/小達/_共用/xiaoda-head.png?v=20260802151527") center / contain no-repeat;
  filter: drop-shadow(0 1px 0 rgba(45, 35, 24, 0.35));
}

.tower-card:not(.tower-card--radial):not(.tower-card--sword):not(.tower-card--blocker) .portrait-head::after,
.tower-card:not(.tower-card--radial):not(.tower-card--sword):not(.tower-card--blocker) .portrait-hair,
.tower-card:not(.tower-card--radial):not(.tower-card--sword):not(.tower-card--blocker) .portrait-glasses {
  display: none;
}

.tower-card:not(.tower-card--radial):not(.tower-card--sword):not(.tower-card--blocker) .tower-portrait::before {
  content: "";
  position: absolute;
  z-index: 7;
  bottom: 2px;
  left: 50%;
  width: auto;
  height: calc(100% - 4px);
  transform: translateX(-50%);
  background-repeat: no-repeat;
  filter: drop-shadow(0 1px 0 rgba(45, 35, 24, 0.28));
}

/*
 * 每張商店人像只顯示動作圖第一格的實際人物範圍。
 * 寬高比及背景座標均沿用原圖，不再把人物橫向拉闊塞滿選擇框。
 */
.tower-card.tower-card--dart .tower-portrait::before {
  aspect-ratio: 206 / 328;
  background-image: url("assets/characters/小達/飛紙小達/xiaoda-plane-sheet.png?v=20260802151527");
  background-size: 1724.272% 176.829%;
  background-position: 3.168% 76.191%;
}

.tower-card.tower-card--super .tower-portrait::before {
  aspect-ratio: 229 / 324;
  background-image: url("assets/characters/小達/超級小達/xiaoda-super-sheet.png?v=20260802151527");
  background-size: 1551.092% 179.012%;
  background-position: 2.166% 76.563%;
}

.tower-card.tower-card--cold .tower-portrait::before {
  aspect-ratio: 161 / 331;
  background-image: url("assets/characters/小達/魔法小達/xiaoda-magic-sheet.png?v=20260802151527");
  background-size: 2206.211% 175.227%;
  background-position: 4.600% 76.305%;
}

.tower-card.tower-card--paperball .tower-portrait::before {
  aspect-ratio: 176 / 392;
  background-image: url("assets/characters/小達/卷紙小達/xiaoda-paperball-sheet.png?v=20260802151527");
  background-size: 2018.182% 147.959%;
  background-position: 4.532% 68.085%;
}

/* 2026-07-30 使用者提供的正式人物圖：每張商店卡只取動作條第一格。 */
.tower-card.tower-card--sword .tower-portrait::before,
.tower-card.tower-card--blocker .tower-portrait::before {
  content: "";
  position: absolute;
  z-index: 7;
  bottom: 2px;
  left: 50%;
  width: auto;
  height: calc(100% - 4px);
  aspect-ratio: 444 / 580;
  transform: translateX(-50%);
  background-repeat: no-repeat;
  filter: drop-shadow(0 1px 0 rgba(45, 35, 24, 0.28));
}

.tower-card.tower-card--sword .tower-portrait::before {
  background-image: url("assets/characters/小達/神聖小達/xiaoda-sword-sheet.png?v=20260802151527");
  background-position: left top;
  background-size: 300% 100%;
}

.tower-card.tower-card--blocker .tower-portrait::before {
  background-image: url("assets/characters/小達/不可企及/xiaoda-blocker-sheet.png?v=20260802151527");
  background-position: left top;
  background-size: 600% 100%;
}

.tower-card--sword .portrait-head,
.tower-card--sword .portrait-body,
.tower-card--sword .portrait-hair,
.tower-card--sword .portrait-glasses,
.tower-card--sword .portrait-prop,
.tower-card--blocker .portrait-head,
.tower-card--blocker .portrait-body,
.tower-card--blocker .portrait-hair,
.tower-card--blocker .portrait-glasses,
.tower-card--blocker .portrait-prop {
  display: none;
}

.tower-card:not(.tower-card--radial):not(.tower-card--sword):not(.tower-card--blocker) .portrait-head,
.tower-card:not(.tower-card--radial):not(.tower-card--sword):not(.tower-card--blocker) .portrait-body {
  display: none;
}

.portrait-body {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: -6px;
  width: 31px;
  height: 25px;
  transform: translateX(-50%);
  border: 1.5px solid #4a3524;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(90deg, #f7f3e6 0 46%, #d6d1c2 47% 50%, #f7f3e6 51%);
  box-shadow: inset 0 -7px 0 #383735;
}

.portrait-prop {
  position: absolute;
  z-index: 8;
  right: 2px;
  bottom: 2px;
  color: #fff9e5;
  font-size: 15px;
  font-style: normal;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 1px 0 #4c3a29, 1px 0 0 #4c3a29, -1px 0 0 #4c3a29;
}

.portrait-prop--plane { transform: rotate(-27deg); }
.portrait-prop--wind {
  right: 2px;
  bottom: 12px;
  color: #eee1ff;
  font-size: 19px;
  transform: none;
  text-shadow: 0 0 4px #7e57c2, 0 1px 0 #493b30;
}

.tower-portrait--sword {
  background: linear-gradient(145deg, #f8edb7, #d7b756);
}

.tower-portrait--blocker {
  background: linear-gradient(145deg, #f4d1a0, #d9874a);
}

.portrait-prop--sword {
  right: 4px;
  bottom: 8px;
  display: grid;
  width: 18px;
  height: 36px;
  place-items: center;
  border: 1px solid #76551f;
  border-radius: 70% 20% 35% 20%;
  background: linear-gradient(90deg, #fff9df, #e7c85d);
  color: #6d4f1e;
  font-size: 9px;
  transform: rotate(24deg);
  text-shadow: none;
}

.portrait-prop--sign {
  right: 2px;
  bottom: 3px;
  display: grid;
  width: 24px;
  height: 28px;
  place-items: center;
  border: 2px solid #704523;
  border-radius: 4px 4px 7px 7px;
  background: #ed9337;
  color: #fff8e4;
  font-size: 10px;
  text-shadow: 0 1px 0 #7b3f25;
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
}
/* The action sheet's first frame already contains one correctly oriented plane. */
.tower-card--dart .portrait-prop--plane,
.tower-card--cold .portrait-prop--wind {
  display: none;
}

.tower-portrait--radial { background: linear-gradient(145deg, #f0c89b, #d8925f); }

.portrait-machine {
  position: absolute;
  z-index: 3;
  inset: 1px;
  display: block;
  width: auto;
  height: auto;
  transform: none;
  border: 0;
  border-radius: 0;
  background: url("assets/characters/小達/八方小達/xiaoda-radial.png?v=20260802151527") center / contain no-repeat;
  box-shadow: none;
}

.portrait-machine b { display: none; }

.tower-card--dart { border-left: 5px solid #58a26c; }
.tower-card--radial { border-left: 5px solid #c96857; }
.tower-card--cold { border-left: 5px solid #7e65bd; }
.tower-card--paperball { border-left: 5px solid #d4923e; }
.tower-card--super { border-left: 5px solid #8667bd; }
.tower-card--sword { border-left: 5px solid #d5a62d; }
.tower-card--blocker { border-left: 5px solid #cf6b38; }

.tower-card__copy {
  display: none;
  min-width: 0;
  align-content: center;
  gap: 4px;
}

.tower-card.is-selected .tower-card__copy,
.tower-card[aria-pressed="true"] .tower-card__copy,
.tower-card.is-expanded .tower-card__copy,
.tower-card[aria-expanded="true"] .tower-card__copy {
  display: grid;
}

.tower-card__top {
  min-width: 0;
  justify-content: space-between;
  gap: 4px;
}

.tower-card__top > strong {
  overflow: hidden;
  font-size: clamp(15px, 1.15vw, 17px);
  font-weight: 950;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-tag {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  color: #9a641e;
  font-size: clamp(13px, 0.96vw, 15px);
  font-weight: 950;
}

.tower-card__price {
  position: absolute;
  z-index: 20;
  top: 4px;
  right: 4px;
  min-height: 20px;
  padding: 2px 5px;
  border: 1px solid rgba(106, 69, 25, 0.24);
  border-radius: 999px;
  background: rgba(255, 250, 226, 0.96);
  box-shadow: 0 2px 5px rgba(70, 45, 18, 0.16);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.price-tag i {
  display: grid;
  min-width: 23px;
  height: 15px;
  padding: 0 2px;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--forest-900);
  font-size: 6px;
  font-style: normal;
}

.tower-card__summary {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: clamp(9px, 0.68vw, 11px);
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-card__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.tower-card__stats > span {
  display: grid;
  min-width: 0;
  gap: 1px;
  padding: 4px 5px;
  border: 1px solid rgba(61, 105, 72, 0.13);
  border-radius: 7px;
  background: rgba(239, 246, 223, 0.92);
}

.tower-card__stats small {
  overflow: hidden;
  color: #7e8069;
  font-size: clamp(8px, 0.58vw, 9px);
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-card__stats b {
  overflow: hidden;
  color: var(--forest-900);
  font-size: clamp(11px, 0.82vw, 13px);
  font-weight: 1000;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upgrade-section {
  display: grid;
  order: 4;
  gap: 7px;
}

.control-panel.has-tower-selection .upgrade-section {
  order: 2;
}

.upgrade-section__tip {
  padding: 4px 8px;
  border-radius: 999px;
  background: #e5f2dc;
  color: var(--forest-700);
  font-size: clamp(9px, 0.7vw, 11px);
  font-weight: 850;
  white-space: nowrap;
}

.selection-card {
  min-height: 82px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.58);
}

.empty-selection {
  display: flex;
  height: 100%;
  min-height: 82px;
  align-items: center;
  gap: 10px;
  padding: clamp(9px, 0.9vw, 13px);
  color: #8b9b92;
}

.empty-selection[hidden] { display: none; }

.empty-selection > span {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #edf0e8;
}

.empty-selection svg { width: 23px; height: 23px; }

.empty-selection > div { display: grid; gap: 3px; }
.empty-selection strong { color: #526a5e; font-size: clamp(12px, 0.94vw, 14px); }
.empty-selection small { color: #718278; font-size: clamp(10px, 0.76vw, 12px); line-height: 1.35; }

.selected-panel {
  display: grid;
  gap: 8px;
  padding: clamp(10px, 0.9vw, 13px);
}

.selected-panel[hidden] { display: none; }

.selected-panel__heading { justify-content: space-between; }
.selected-panel h2 { margin-top: 1px; font-size: clamp(13px, 1.05vw, 16px); }
.selected-panel h2 small { display: block; margin-top: 2px; color: var(--forest-600); font-size: clamp(9px, 0.68vw, 11px); }

.selected-pulse {
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #69b864;
  box-shadow: 0 0 0 3px rgba(95, 174, 93, 0.2);
}

.upgrade-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.selected-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.selected-stats span {
  padding: 4px 7px;
  border: 1px solid rgba(44, 107, 84, 0.13);
  border-radius: 8px;
  background: #f0f7ea;
  color: #536b5f;
  font-size: clamp(9px, 0.7vw, 11px);
  font-weight: 750;
}

.selected-stats b { color: var(--forest-800); font-size: 1.08em; }

.upgrade-button {
  min-width: 0;
  min-height: 48px;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf5;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.upgrade-button:hover:not(:disabled) { border-color: var(--forest-600); background: #fff; }
.upgrade-button:disabled { cursor: not-allowed; opacity: 0.48; }
.upgrade-button.is-unaffordable:not(:disabled) { border-color: rgba(189, 104, 51, 0.32); background: #fff8e8; }
.upgrade-button.is-unaffordable:not(:disabled) > b { color: #b45f35; }

.upgrade-button--final {
  border-color: rgba(186, 138, 41, 0.4);
  background: linear-gradient(100deg, #fff9df, #fffdf5);
}

.upgrade-button--final .upgrade-button__icon {
  background: #ffecad;
  color: #a66c13;
}

.upgrade-button__icon {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: #dff1d8;
  color: var(--forest-700);
  font-size: 15px;
  font-weight: 950;
}

.upgrade-button > span:nth-child(2) {
  display: grid;
  min-width: 0;
  flex: 1;
}

.upgrade-button strong {
  overflow: hidden;
  font-size: clamp(11px, 0.86vw, 13px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upgrade-button small { margin-top: 2px; color: var(--muted); font-size: clamp(11px, 0.82vw, 13px); line-height: 1.35; }
.upgrade-button > b { color: #a86d1b; font-size: clamp(10px, 0.76vw, 12px); white-space: nowrap; }

.sell-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  padding: 6px 9px;
  border: 0;
  border-radius: 8px;
  background: #f1eee2;
  color: #6f7c74;
  font-size: clamp(9px, 0.7vw, 11px);
  font-weight: 750;
  cursor: pointer;
}

.sell-button:hover { background: #ffe6df; color: #a94d45; }
.sell-button b { color: inherit; }

.panel-spacer { order: 5; flex: 1 1 auto; min-height: 0; }

.panel-footer {
  position: relative;
  z-index: 1;
  display: grid;
  order: 6;
  gap: 7px;
}

.round-controls { gap: 7px; }

.speed-button {
  display: grid;
  width: clamp(49px, 4.5vw, 62px);
  height: clamp(48px, 4.8vw, 62px);
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(25, 54, 47, 0.16);
  border-radius: 14px;
  background: #fff;
  color: var(--forest-800);
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(25, 54, 47, 0.08);
}

.speed-button:hover { transform: translateY(-1px); }
.speed-button svg { width: 20px; height: 17px; }
.speed-button span { margin-top: -5px; font-size: 9px; font-weight: 950; }

.primary-button {
  justify-content: center;
  gap: 10px;
  border: 1px solid #d98c26;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffca58, var(--yellow));
  color: var(--forest-950);
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 4px 0 #d68928, 0 8px 18px rgba(185, 110, 24, 0.2);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.03);
  box-shadow: 0 6px 0 #d68928, 0 11px 24px rgba(185, 110, 24, 0.23);
}

.primary-button:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #d68928, 0 5px 10px rgba(185, 110, 24, 0.16);
}

.primary-button:disabled {
  border-color: #aaa99d;
  background: #d9d8cc;
  color: #7a7a70;
  cursor: not-allowed;
  box-shadow: 0 3px 0 #aaa99d;
}

.primary-button--wave {
  min-width: 0;
  height: clamp(48px, 4.8vw, 62px);
  flex: 1;
  padding: 7px 14px;
  justify-content: space-between;
}

.primary-button--wave > span { display: grid; align-content: center; text-align: left; }
.primary-button--wave small { font-size: clamp(7px, 0.58vw, 9px); font-weight: 750; opacity: 0.62; }
.primary-button--wave strong { font-size: clamp(12px, 1.04vw, 15px); }
.primary-button--wave svg { width: 25px; height: 25px; }

/* 重新開始已經搬到頂部常駐控制列（側欄要捲動，放在底部等於玩家找不到）。
   用警示色與其他圖示鈕區分，避免誤按。 */
.icon-button--restart { color: #a5544c; }
.icon-button--restart:hover { background: #ffe7df; color: #8d3a33; }
.icon-button--restart:disabled { color: #b2bbb5; cursor: not-allowed; background: rgba(255, 255, 255, 0.4); }

.restart-control {
  position: relative;
  z-index: 35;
  flex: 0 0 auto;
}

.restart-control .icon-button--restart {
  z-index: 35;
}

.restart-control.is-open .icon-button--restart {
  transform: translateY(-1px);
  background: #ffe7df;
  color: #8d3a33;
  box-shadow: 0 5px 16px rgba(101, 52, 43, 0.2);
}

.restart-menu-backdrop {
  position: fixed;
  z-index: 34;
  inset: 0;
  background: rgba(32, 24, 16, 0.1);
}

.restart-menu {
  position: absolute;
  z-index: 36;
  top: calc(100% + 9px);
  right: 0;
  display: grid;
  width: min(226px, calc(100vw - 28px));
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(98, 70, 39, 0.34);
  border-radius: 15px;
  background: #fff8e5;
  box-shadow: 0 12px 30px rgba(44, 31, 18, 0.28), 0 3px 0 rgba(95, 66, 34, 0.12);
}

.restart-menu[hidden],
.restart-menu-backdrop[hidden] {
  display: none;
}

.restart-menu::before {
  position: absolute;
  top: -6px;
  right: 14px;
  width: 11px;
  height: 11px;
  transform: rotate(45deg);
  border-top: 1px solid rgba(98, 70, 39, 0.34);
  border-left: 1px solid rgba(98, 70, 39, 0.34);
  background: #fff8e5;
  content: "";
}

.restart-menu__option {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 54px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid rgba(48, 95, 71, 0.2);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--forest-900);
  cursor: pointer;
  text-align: left;
  transition: transform 130ms ease, border-color 130ms ease, background 130ms ease;
}

.restart-menu__option:hover,
.restart-menu__option:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(48, 95, 71, 0.48);
  outline: none;
  background: #fff;
}

.restart-menu__option--all {
  border-color: rgba(165, 84, 76, 0.25);
  color: #803d37;
}

.restart-menu__option--all:hover,
.restart-menu__option--all:focus-visible {
  border-color: rgba(165, 84, 76, 0.55);
  background: #fff4ee;
}

.restart-menu__badge {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: #e7f0df;
  color: var(--forest-800);
  font-size: 13px;
  font-weight: 1000;
}

.restart-menu__option--all .restart-menu__badge {
  background: #ffe2d9;
  color: #8d3a33;
}

.restart-menu__option > span:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.restart-menu__option strong {
  font-size: 13px;
  font-weight: 950;
  line-height: 1.1;
}

.restart-menu__option small {
  color: #748178;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.3;
}

.panel-footer > p {
  margin: 0;
  color: #92a097;
  font-size: clamp(6px, 0.53vw, 8px);
  font-weight: 700;
  text-align: center;
}

.panel-footer > p span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 3px;
  border-radius: 50%;
  background: #65b669;
  box-shadow: 0 0 0 2px rgba(101, 182, 105, 0.15);
}

.panel-footer > p i { margin: 0 4px; color: #c3c8be; font-style: normal; }

.tutorial-hint {
  position: absolute;
  z-index: 10;
  top: clamp(10px, 1.2vw, 18px);
  left: 50%;
  display: flex;
  max-width: calc(100% - 24px);
  align-items: center;
  padding: 9px 15px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: rgba(17, 52, 43, 0.9);
  color: #fff;
  font-size: clamp(9px, 0.8vw, 12px);
  font-weight: 800;
  box-shadow: 0 6px 20px rgba(9, 41, 32, 0.22);
  backdrop-filter: blur(8px);
  pointer-events: none;
  transition: opacity 250ms ease, transform 250ms ease;
}

.tutorial-hint.is-hidden {
  opacity: 0;
  transform: translate(-50%, -10px);
}

.tutorial-hint[hidden] { display: none; }

.message-toast {
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: clamp(16px, 2vw, 28px);
  max-width: calc(100% - 28px);
  padding: 10px 16px;
  transform: translate(-50%, 18px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background: rgba(20, 54, 46, 0.94);
  color: #fff;
  font-size: clamp(10px, 0.88vw, 13px);
  font-weight: 800;
  text-align: center;
  box-shadow: 0 12px 30px rgba(8, 39, 31, 0.26);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

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

.message-toast.is-error,
.message-toast[data-kind="danger"],
.message-toast[data-kind="warning"] { background: rgba(132, 52, 47, 0.96); }
.message-toast.is-success,
.message-toast[data-kind="success"] { background: rgba(31, 112, 71, 0.96); }

.character-info-card {
  position: absolute;
  z-index: 35;
  right: 10px;
  bottom: 10px;
  left: 10px;
  width: auto;
  max-width: none;
  max-height: calc(100% - 20px);
  overflow-y: auto;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background: rgba(255, 251, 238, 0.98);
  color: var(--ink);
  box-shadow: 0 9px 24px rgba(8, 35, 27, 0.16), 0 0 0 3px rgba(20, 65, 50, 0.06);
  pointer-events: auto;
  animation: character-info-in 180ms ease-out both;
}

.character-info-card[hidden] { display: none; }

@keyframes character-info-in {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.character-info-card__heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

.character-info-card__identity {
  min-width: 0;
}

.character-info-card__role {
  display: block;
  color: var(--forest-600);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.character-info-card h2 {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 1000;
  letter-spacing: -0.035em;
}

.character-info-card__header-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(72px, auto));
  gap: 6px;
}

.character-info-card__header-stats[hidden] {
  display: none;
}

.character-info-card__header-stats span {
  display: grid;
  min-height: 45px;
  align-content: center;
  gap: 1px;
  padding: 6px 8px;
  border: 1px solid rgba(25, 54, 47, 0.11);
  border-radius: 10px;
  background: #fff;
  color: #718178;
  font-size: 9px;
  font-weight: 800;
}

.character-info-card__header-stats b {
  color: var(--forest-900);
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.character-info-card__close {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid rgba(44, 107, 84, 0.2);
  border-radius: 999px;
  background: #e4f2db;
  color: var(--forest-700);
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.character-info-card > p {
  margin: 9px 0 0;
  color: #52675d;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.55;
}

.character-info-card.is-enemy-info > #characterInfoDescription {
  padding: 8px 10px;
  border-radius: 9px;
  background: #f1f6e5;
  color: #456248;
  font-weight: 850;
}

.character-info-card__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 11px;
}

.character-info-card__stats span {
  display: grid;
  gap: 1px;
  padding: 7px 8px;
  border: 1px solid rgba(25, 54, 47, 0.11);
  border-radius: 10px;
  background: #fff;
  color: #718178;
  font-size: 10px;
  font-weight: 750;
}

.character-info-card__stats b {
  color: var(--forest-900);
  font-size: 14px;
  font-weight: 950;
}

.character-info-card > .character-info-card__upgrade {
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: #7c5b24;
  font-size: 12px;
  font-weight: 800;
}

.character-info-card.is-enemy-info > .character-info-card__upgrade {
  display: none;
}

.overlay {
  position: absolute;
  z-index: 40;
  inset: 0;
  display: grid;
  padding: clamp(18px, 3vw, 46px);
  place-items: center;
  background: rgba(10, 39, 31, 0.62);
  backdrop-filter: blur(9px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease;
}

.overlay.is-visible,
.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.overlay[hidden] { display: none; }

.overlay--intro {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  align-items: center;
  justify-content: center;
  padding:
    calc(10px + env(safe-area-inset-top, 0px))
    calc(10px + env(safe-area-inset-right, 0px))
    calc(10px + env(safe-area-inset-bottom, 0px))
    calc(10px + env(safe-area-inset-left, 0px));
  overflow: hidden;
}

.overlay--result {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  align-items: flex-start;
  justify-content: center;
  padding:
    calc(16px + env(safe-area-inset-top, 0px))
    calc(16px + env(safe-area-inset-right, 0px))
    calc(16px + env(safe-area-inset-bottom, 0px))
    calc(16px + env(safe-area-inset-left, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.overlay--result .result-card {
  flex: 0 0 auto;
  margin-block: auto;
}

.progress-confirm-overlay {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  padding: 18px;
  place-items: center;
  background: rgba(10, 39, 31, 0.68);
  backdrop-filter: blur(9px);
}

.progress-confirm-overlay[hidden] { display: none; }

.progress-confirm-card {
  display: grid;
  width: min(440px, 100%);
  gap: 13px;
  padding: clamp(22px, 4vw, 34px);
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 24px;
  background: linear-gradient(145deg, #fffaf0, #f2ead9);
  color: #213b32;
  text-align: center;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.32);
}

.progress-confirm-card h2 {
  margin: 0;
  font-size: clamp(23px, 5vw, 32px);
  line-height: 1.12;
}

.progress-confirm-card > p:not(.eyebrow) {
  margin: 0;
  color: #5c6b62;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.progress-confirm-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 4px;
}

.progress-confirm-card__actions button {
  min-height: 51px;
  border: 0;
  border-radius: 13px;
  padding: 9px 10px;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 130ms ease, filter 130ms ease;
}

.progress-confirm-card__actions button:hover,
.progress-confirm-card__actions button:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.05);
  outline: 3px solid rgba(53, 133, 99, 0.28);
  outline-offset: 2px;
}

.progress-confirm-card__continue { background: linear-gradient(145deg, #4fae72, #287759); }
.progress-confirm-card__start { background: linear-gradient(145deg, #d97d5c, #a84a40); }

.intro-card {
  display: grid;
  grid-template-columns: minmax(250px, 0.88fr) minmax(310px, 1.12fr);
  width: min(850px, 100%);
  min-height: min(500px, 88%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: clamp(20px, 2vw, 30px);
  background: var(--cream);
  box-shadow: 0 34px 90px rgba(5, 28, 22, 0.4), 0 0 0 8px rgba(255, 255, 255, 0.08);
}

/* 主頁：由遊戲選擇、角色簡介及設定三個面板組成。 */
.intro-card--home {
  position: relative;
  display: block;
  width: min(656px, 100%);
  max-height: calc(100dvh - 24px);
  min-height: 0;
  padding: clamp(24px, 4vw, 42px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(145deg, #fffdf3, #e8f2dd);
}

.home-panel { display: grid; gap: 16px; }
.home-panel[hidden] { display: none; }
.home-panel--main { position: relative; padding-top: 14px; text-align: center; }
.pre-game-topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-height: 48px; }
.pre-game-shortcuts { display: flex; justify-content: flex-end; gap: 6px; }
.pre-game-shortcut {
  display: grid;
  width: 70px;
  min-height: 62px;
  padding: 7px 4px 6px;
  place-items: center;
  gap: 0;
  border: 1px solid rgba(49, 104, 65, .22);
  border-radius: 13px;
  background: #fff;
  color: var(--forest-900);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 3px 0 rgba(50, 91, 56, .14);
  transition: transform 130ms ease, filter 130ms ease;
}
.pre-game-shortcut:hover, .pre-game-shortcut:focus-visible { filter: brightness(1.05); outline: 3px solid rgba(49, 104, 65, .2); outline-offset: 2px; transform: translateY(-1px); }
.pre-game-shortcut__icon { display: grid; min-width: 28px; min-height: 28px; place-items: center; font-size: 27px; line-height: 1; }
.pre-game-shortcut__label { margin-top: 1px; font-size: 12px; white-space: nowrap; }
.pre-game-shortcut small { max-width: 100%; overflow: hidden; color: currentColor; font-size: 9px; font-weight: 850; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; opacity: .78; }
.pre-game-shortcut--achievements { border-color: rgba(148, 106, 38, .4); background: linear-gradient(145deg, #fff9df, #f0e4b6); color: #72501f; }
.pre-game-shortcut--talents { border-color: rgba(83, 70, 151, .4); background: linear-gradient(145deg, #f4f0ff, #ddd4f5); color: #513e91; }
.pre-game-shortcut--equipment { border-color: rgba(50, 107, 119, .42); background: linear-gradient(145deg, #e8fbfd, #c9e7e5); color: #23636d; }
.pre-game-shortcut--profile { border-color: rgba(44, 103, 91, .42); background: linear-gradient(145deg, #eef9ec, #cfe8d4); color: #285f4a; }
.pre-game-shortcut--profile,
.pre-game-shortcut--talent-path { width: 94px; margin-top: -5px; }
.pre-game-shortcut--profile { font-size: 32px; }
.pre-game-shortcut--profile .pre-game-shortcut__icon { font-size: 32px; }
.home-build-meta {
  position: absolute;
  z-index: 2;
  top: -14px;
  right: 0;
  display: grid;
  gap: 2px;
  max-width: calc(100% - 8px);
  color: #6f816f;
  font-size: clamp(8px, 0.72vw, 10px);
  font-weight: 800;
  line-height: 1.1;
  text-align: right;
  white-space: nowrap;
  pointer-events: none;
}
.home-build-meta span:first-child { color: #2b7359; font-weight: 950; }
.home-panel--achievements,
.home-panel--profile,
.home-panel--saves { gap: 12px; max-height: none; min-height: 0; overflow: visible; align-content: start; }
.home-panel h1 { margin: 0; color: var(--forest-950); font-size: clamp(46px, 9vw, 68px); line-height: 1; }
.home-panel h1 span { color: #2b8c69; }
.home-panel h2 { margin: 0; color: var(--forest-900); font-size: clamp(26px, 4vw, 38px); }
.home-panel--main > p:not(.eyebrow) { margin: 0; color: #5e7167; font-weight: 700; }
.home-main-actions { display: grid; gap: 10px; margin: 10px auto 0; width: min(390px, 100%); }
.home-menu-button,
.map-select-card {
  border: 1px solid rgba(49, 104, 65, 0.24);
  border-radius: 16px;
  background: #fff;
  color: var(--forest-900);
  cursor: pointer;
  font: inherit;
  font-weight: 950;
  box-shadow: 0 4px 0 rgba(50, 91, 56, 0.16);
}
.home-menu-button { min-height: 54px; font-size: 18px; }
.home-menu-button--play { border-color: #bd7626; background: linear-gradient(145deg, #f3c34d, #d88b28); color: #372514; }
.home-menu-button--continue {
  display: grid;
  min-height: 66px;
  place-content: center;
  gap: 2px;
  border-color: rgba(38, 120, 84, .46);
  background: linear-gradient(145deg, #e9f6d9, #cce7bd);
  color: #245b43;
}
.home-menu-button--continue[hidden] { display: none; }
.home-menu-button--continue:disabled { cursor: wait; opacity: .72; }
.home-menu-button--continue strong { font-size: 17px; }
.home-menu-button--continue small { color: #52705f; font-size: 11px; font-weight: 800; line-height: 1.3; }
.home-menu-button--achievements { border-color: rgba(148, 106, 38, .36); background: linear-gradient(145deg, #fff9df, #f0e4b6); color: #72501f; }
.home-menu-button--talents { border-color: rgba(83, 70, 151, .38); background: linear-gradient(145deg, #f4f0ff, #ddd4f5); color: #513e91; }
.home-menu-button--save { border-color: rgba(45, 105, 126, .4); background: linear-gradient(145deg, #edfaff, #cae8ee); color: #245f70; }
.home-menu-button:hover, .map-select-card:hover, .home-panel-back:hover { filter: brightness(1.04); transform: translateY(-1px); }
.home-panel-back { justify-self: start; border: 0; background: transparent; color: #2b7359; cursor: pointer; font: inherit; font-weight: 850; }
.map-select-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.map-select-card {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 142px;
  place-content: center;
  gap: 5px;
  padding: 14px;
  overflow: hidden;
  background-position: center;
  background-size: cover;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 7px rgba(12, 30, 22, .9);
}
.map-select-card::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(180deg, rgba(9,35,28,.12), rgba(9,35,28,.78)); }
.map-select-card[data-map-id="flood-bridge"] { background-image: url("assets/maps/洪水橋/hung-shui-kiu-background.png?v=20260802151527"); }
.map-select-card[data-map-id="ping-shan"] { background-image: url("assets/maps/屏山/ping-shan-background.png?v=20260802151527"); }
.map-select-card[data-map-id="dog-poop-park"] { background-image: url("assets/maps/狗屎公園/dog-shit-park-background.png?v=20260802151527"); }
.map-select-card[data-map-id="land-sports-meet"] { background-image: url("assets/maps/陸運會/athletics-meet-background.png?v=20260802151527"); }
.map-select-card[data-map-id="poison-cha-chaan-teng"] { background-image: url("assets/maps/毒撚茶餐廳/poison-cha-chaan-teng-background.png?v=20260802151527"); }
.map-select-card[data-map-id="valentines-day"] { background-image: url("assets/maps/情人節/valentines-day-background.png?v=20260802151527"); }
.map-select-card[data-map-id="jiangmen-staff"] { background-image: url("assets/maps/江門職員/jiangmen-staff-background.png?v=20260802151527"); }
.map-select-card[data-map-id="chen-siu-ming"] { background-image: url("assets/maps/陳小明/chen-siu-ming-background.png?v=20260802151527"); }
.map-select-card[data-map-id="dusk-time"] { background-image: url("assets/maps/黃昏時刻/dusk-time-background.png?v=20260802151527"); }
.map-select-card[data-map-id="grave-sweeping"] { background-image: url("assets/maps/拜山/grave-sweeping-background.png?v=20260802151527"); }
.map-select-card strong { font-size: 22px; }
.map-select-card small { color: #f5f7eb; font-size: 12px; font-weight: 800; }
.selected-map-label { margin: -8px 0 0; color: #2b7359; font-weight: 900; }
.save-manager-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.save-manager-heading h2 { margin: 0; }
.save-manager-heading p { margin: 5px 0 0; color: #60736a; font-size: 14px; font-weight: 750; line-height: 1.55; }
.save-manager-heading__mark {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 17px;
  background: linear-gradient(145deg, #bfe2ec, #7eb6c5);
  color: #164e61;
  font-size: 22px;
  font-weight: 950;
  box-shadow: 0 4px 0 rgba(35, 92, 108, .2);
}
.save-manager-includes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.save-manager-includes span {
  display: grid;
  min-height: 42px;
  place-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(44, 100, 91, .18);
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
  color: #315f51;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}
.save-manager-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.save-manager-action {
  display: grid;
  min-height: 82px;
  place-content: center;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(38, 103, 91, .3);
  border-radius: 15px;
  color: #214f42;
  cursor: pointer;
  font: inherit;
  text-align: center;
  box-shadow: 0 4px 0 rgba(50, 91, 56, .15);
}
.save-manager-action--export { background: linear-gradient(145deg, #e8f7df, #c9e7bf); }
.save-manager-action--import { background: linear-gradient(145deg, #e8f7fb, #c5e3ea); }
.save-manager-action strong { font-size: 16px; font-weight: 950; }
.save-manager-action small { color: inherit; font-size: 11px; font-weight: 800; line-height: 1.35; opacity: .8; }
.save-manager-action:hover, .save-manager-action:focus-visible { filter: brightness(1.04); outline: 3px solid rgba(43, 112, 91, .22); outline-offset: 2px; transform: translateY(-1px); }
.save-manager-action:disabled { cursor: wait; filter: grayscale(.2); opacity: .65; transform: none; }
.save-manager-warning { margin: 0; padding: 11px 12px; border-radius: 12px; background: rgba(203, 143, 48, .12); color: #75551f; font-size: 12px; font-weight: 800; line-height: 1.55; }
.save-manager-status { min-height: 22px; margin: 0; color: #526a5e; font-size: 13px; font-weight: 850; line-height: 1.45; }
.save-manager-status[data-state="success"] { color: #24704f; }
.save-manager-status[data-state="error"] { color: #a33e35; }
.save-manager-status[data-state="working"] { color: #326b7d; }
@media (max-width: 420px) {
  .save-manager-includes,
  .save-manager-actions { grid-template-columns: 1fr; }
}
.achievement-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.achievement-heading h2 { margin: 0; }
.achievement-summary { margin: 3px 0 0; color: #64766c; font-size: 13px; font-weight: 800; }
.achievement-heading__mark { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 15px; background: #f1c55d; color: #73501c; font-size: 25px; box-shadow: 0 4px 0 rgba(113, 74, 22, .2); }
.achievement-progress { height: 10px; overflow: hidden; border-radius: 999px; background: rgba(49, 104, 65, .14); }
.achievement-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2d8c68, #e0ad3b); transition: width .25s ease; }
.achievement-live { min-height: 18px; margin: 0; color: #2e785b; font-size: 12px; font-weight: 850; }
.achievement-list { display: grid; gap: 15px; }
.achievement-group { display: block; }
.achievement-group__toggle {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 11px;
  border: 1px solid rgba(49, 104, 65, .17);
  border-radius: 12px;
  background: rgba(255, 255, 255, .75);
  color: #2a6249;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  text-align: left;
  list-style: none;
  touch-action: manipulation;
}
.achievement-group__toggle::-webkit-details-marker { display: none; }
.achievement-group__toggle::after { content: "＋"; color: #6b8978; font-size: 19px; font-weight: 700; line-height: 1; }
.achievement-group[open] .achievement-group__toggle { border-color: rgba(49, 104, 65, .34); background: linear-gradient(145deg, #f8fff4, #e5f0da); }
.achievement-group[open] .achievement-group__toggle::after { content: "−"; }
.achievement-group__toggle:hover, .achievement-group__toggle:focus-visible { outline: 3px solid rgba(49, 104, 65, .16); outline-offset: 2px; filter: brightness(1.02); }
.achievement-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 7px; }
.achievement-card { display: grid; grid-template-columns: 29px minmax(0, 1fr); gap: 7px; min-width: 0; padding: 8px; border: 1px solid rgba(49, 104, 65, .16); border-radius: 13px; background: rgba(255, 255, 255, .78); }
.achievement-card.is-unlocked { border-color: rgba(180, 132, 35, .42); background: linear-gradient(145deg, #fffdf2, #f5edcf); }
.achievement-card.is-hidden-achievement { background: rgba(224, 229, 215, .6); }
.achievement-card__badge { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 9px; background: #dfe9da; color: #5b7662; font-size: 16px; font-weight: 950; }
.achievement-card.is-unlocked .achievement-card__badge { background: #e8bf55; color: #634617; }
.achievement-card__copy { display: grid; min-width: 0; gap: 2px; align-content: center; }
.achievement-card__copy strong { color: #28563f; font-size: 12px; line-height: 1.25; }
.achievement-card__copy small { color: #64766c; font-size: 10px; line-height: 1.32; }
.achievement-card__copy em { color: #7b897e; font-size: 9px; font-style: normal; font-weight: 800; }
.achievement-card.is-unlocked .achievement-card__copy em { color: #9a6d20; }
.achievement-card__progress { display: block; height: 5px; margin-top: 3px; overflow: hidden; border-radius: 999px; background: rgba(49, 104, 65, .14); }
.achievement-card__progress > span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3c966e, #e1b048); transition: width .22s ease; }
.achievement-card.is-unlocked .achievement-card__progress { background: rgba(164, 116, 31, .18); }
.achievement-card.is-unlocked .achievement-card__progress > span { background: linear-gradient(90deg, #d89b31, #f4d46c); }
.panel-bottom-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 5px 1px 2px; }
.panel-bottom-actions .home-panel-back { min-height: 36px; padding: 7px 11px; border: 1px solid rgba(49, 104, 65, .2); border-radius: 10px; background: rgba(255,255,255,.72); }
.panel-bottom-actions .home-panel-back:last-child { color: #556d5b; }

.profile-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.profile-heading h2 { margin: 0; }
.profile-heading p { max-width: 430px; margin: 5px 0 0; color: #637169; font-size: 13px; font-weight: 750; line-height: 1.45; }
.profile-heading__mark { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 16px; background: linear-gradient(145deg, #5f9f76, #285f4a); color: #fff; font-size: 25px; font-weight: 950; box-shadow: 0 4px 0 rgba(35, 82, 62, .24); }
.profile-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.profile-stat-card, .profile-completion-card, .profile-special-card, .profile-bonus-card, .profile-economy-card { display: grid; min-width: 0; gap: 3px; padding: 9px; border: 1px solid rgba(49, 104, 65, .17); border-radius: 13px; background: rgba(255, 255, 255, .76); }
.profile-stat-card { min-height: 65px; align-content: center; background: linear-gradient(145deg, #f8fff5, #e6f1df); }
.profile-stat-card strong, .profile-completion-card strong, .profile-special-card strong, .profile-bonus-card strong, .profile-economy-card strong { color: #5d7467; font-size: 10px; font-weight: 850; line-height: 1.2; }
.profile-stat-card b { color: #275e48; font-size: 18px; line-height: 1.05; }
.profile-tracking-note { margin: -3px 0 0; color: #768279; font-size: 10px; font-weight: 750; line-height: 1.35; }
.profile-section { display: grid; gap: 8px; padding-top: 2px; }
.profile-section h3 { margin: 0; color: #315f49; font-size: 14px; }
.profile-completion-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.profile-completion-card b, .profile-special-card b { color: #2e7054; font-size: 15px; line-height: 1.1; }
.profile-completion-card small, .profile-special-card small, .profile-bonus-card small, .profile-economy-card small { color: #718078; font-size: 10px; font-weight: 750; line-height: 1.35; }
.profile-special-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.profile-special-card { min-height: 82px; align-content: center; gap: 7px; }
.profile-special-card strong { color: #49685a; font-size: 14px; line-height: 1.25; }
.profile-special-card b { font-size: 20px; line-height: 1.15; }
.profile-bonus-list, .profile-economy-list { display: grid; gap: 7px; }
.profile-bonus-card { grid-template-columns: minmax(82px, .42fr) minmax(0, 1fr); align-items: center; }
.profile-bonus-card strong { color: #285f4a; font-size: 12px; }
.profile-bonus-card b { color: #537163; font-size: 11px; font-weight: 850; line-height: 1.35; }
.profile-economy-card { grid-template-columns: 76px minmax(0, 1fr); align-items: center; border-color: rgba(151, 111, 38, .22); background: linear-gradient(145deg, #fffdf3, #f4ecd4); }
.profile-economy-card strong { color: #86601f; }
.profile-economy-card b { color: #715827; font-size: 11px; line-height: 1.35; }
/* 達之路不可再建立內層捲動；intro-card--home 是此畫面的唯一垂直捲動容器。 */
.home-panel--talents { gap: 12px; max-height: none; min-height: 0; overflow: visible; align-content: start; }
.talent-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.talent-heading__copy { display: flex; min-width: 0; align-items: baseline; flex-wrap: wrap; gap: 5px 12px; }
.talent-heading h2 { margin: 0; }
.talent-intro { max-width: 450px; margin: 5px 0 0; color: #637169; font-size: 13px; font-weight: 750; line-height: 1.5; }
.talent-heading__mark { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 16px; background: linear-gradient(145deg, #7f6bc9, #4f3d91); color: #fffdf0; font-size: 25px; font-weight: 950; box-shadow: 0 4px 0 rgba(62, 45, 121, .24); }
.talent-resource-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.talent-resource-grid article { display: grid; min-width: 0; gap: 3px; padding: 9px 8px; border: 1px solid rgba(83, 70, 151, .18); border-radius: 12px; background: rgba(255, 255, 255, .7); text-align: center; }
.talent-resource-grid small { overflow: hidden; color: #737487; font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.talent-resource-grid strong { color: #4f3d91; font-size: 19px; line-height: 1; }
.talent-resource-grid__available { border-color: rgba(59, 125, 91, .34) !important; background: linear-gradient(145deg, #f5fff2, #ddf0d2) !important; }
.talent-resource-grid__available strong { color: #277652; }
.talent-reset-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; padding: 8px 9px; border: 1px solid rgba(83, 70, 151, .16); border-radius: 12px; background: rgba(255,255,255,.58); }
.talent-reset { min-height: 36px; padding: 6px 10px; border: 1px solid #6552ad; border-radius: 10px; background: #6552ad; color: #fff; cursor: pointer; font: inherit; font-size: 11px; font-weight: 900; line-height: 1.2; touch-action: manipulation; }
.talent-reset:hover:not(:disabled), .talent-reset:focus-visible:not(:disabled) { filter: brightness(1.08); outline: 3px solid rgba(83,70,151,.2); outline-offset: 2px; }
.talent-reset:disabled { border-color: rgba(73,93,81,.12); background: rgba(73,93,81,.1); color: #7a8780; cursor: not-allowed; }
.talent-reset-row small { color: #67736d; font-size: 10px; font-weight: 750; line-height: 1.35; }
.talent-completed { margin: 0; color: #4f3d91; font-size: 13px; font-weight: 900; }
.talent-rule { margin: -5px 0 0; color: #66766d; font-size: 12px; font-weight: 750; line-height: 1.45; }
.talent-live { min-height: 18px; margin: 0; color: #397458; font-size: 12px; font-weight: 850; }
.talent-path-list { display: grid; gap: 13px; }
.talent-route-overview { display: grid; gap: 9px; }
.talent-route-overview__label { margin: 0; color: #344e41; font-size: 15px; }
.talent-route-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.talent-route-card { --talent-main: #5979c8; --talent-soft: #e9efff; display: grid; grid-template-columns: 104px minmax(0, 1fr); min-width: 0; min-height: 139px; padding: 0; overflow: hidden; border: 1px solid color-mix(in srgb, var(--talent-main) 42%, white); border-radius: 15px; background: #ffffff; box-shadow: 0 3px 0 color-mix(in srgb, var(--talent-main) 14%, white); color: inherit; text-align: left; transition: transform 130ms ease, box-shadow 130ms ease; }
.talent-route-card:hover { box-shadow: 0 5px 0 color-mix(in srgb, var(--talent-main) 22%, white); transform: translateY(-1px); }
.talent-route-card__art-button { display: block; width: 100%; height: 100%; min-height: 0; padding: 0; overflow: hidden; border: 0; background: #253448; color: inherit; cursor: zoom-in; touch-action: manipulation; }
.talent-route-card__art-button:focus-visible, .talent-route-card__body:focus-visible { outline: 3px solid color-mix(in srgb, var(--talent-main) 30%, transparent); outline-offset: -3px; }
.talent-route-card__art { display: block; width: 104px; height: 139px; object-fit: cover; object-position: center; background: #253448; }
.talent-route-card__body { display: grid; width: 100%; min-width: 0; align-content: center; gap: 4px; padding: 12px 11px; border: 0; background: #ffffff; color: inherit; cursor: pointer; font: inherit; text-align: left; touch-action: manipulation; }
.talent-route-card__body:hover { background: color-mix(in srgb, var(--talent-soft) 42%, white); }
.talent-route-card__body strong { color: var(--talent-main); font-size: 16px; line-height: 1.18; }
.talent-route-card__body small { color: #627169; font-size: 11px; font-weight: 800; line-height: 1.3; }
.talent-route-card__body em { color: #3d6451; font-size: 11px; font-style: normal; font-weight: 900; }
.talent-route-card__next { overflow: hidden; color: #6a7a71; font-size: 10px; font-weight: 800; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.talent-path--band { --talent-main: #287d78; --talent-soft: #dff4e8; }
.talent-path--film { --talent-main: #ae6b34; --talent-soft: #fff0d8; }
.talent-path--legend { --talent-main: #6651ad; --talent-soft: #ebe5ff; }
.talent-path--story { --talent-main: #a15b3d; --talent-soft: #fff0e5; }
.talent-path-detail { --talent-main: #5979c8; --talent-soft: #e9efff; display: grid; gap: 10px; padding: 11px; border: 1px solid color-mix(in srgb, var(--talent-main) 34%, white); border-radius: 17px; background: #ffffff; box-shadow: 0 3px 0 color-mix(in srgb, var(--talent-main) 10%, white); }
.talent-route-detail__back { width: fit-content; padding: 0; border: 0; background: transparent; color: var(--talent-main); cursor: pointer; font: inherit; font-size: 12px; font-weight: 900; }
.talent-route-detail__back:hover, .talent-route-detail__back:focus-visible { color: color-mix(in srgb, var(--talent-main) 78%, black); outline: 2px solid color-mix(in srgb, var(--talent-main) 28%, transparent); outline-offset: 3px; }
.talent-route-detail__heading { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 9px; }
.talent-route-detail__icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 12px; background: var(--talent-main); color: #ffffff; font-size: 20px; font-weight: 950; }
.talent-route-detail__heading > span:last-child { display: grid; min-width: 0; gap: 2px; }
.talent-route-detail__heading strong { color: var(--talent-main); font-size: 18px; line-height: 1.16; }
.talent-route-detail__heading small { color: #69766f; font-size: 11px; font-weight: 800; line-height: 1.3; }
.talent-node-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.talent-node { display: grid; gap: 7px; padding: 9px; border: 1px solid color-mix(in srgb, var(--talent-main) 21%, white); border-radius: 13px; background: rgba(255, 255, 255, .78); }
.talent-node.is-locked { border-style: dashed; background: rgba(235, 237, 233, .64); opacity: .7; }
.talent-node.is-filled { border-color: color-mix(in srgb, var(--talent-main) 48%, white); background: linear-gradient(145deg, rgba(255,255,255,.96), color-mix(in srgb, var(--talent-soft) 66%, white)); }
.talent-node__heading { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 8px; }
.talent-node__number { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; background: color-mix(in srgb, var(--talent-main) 14%, white); color: var(--talent-main); font-size: 13px; font-weight: 950; }
.talent-node.is-filled .talent-node__number { background: var(--talent-main); color: #fff; }
.talent-node__heading > span:last-child { display: grid; min-width: 0; gap: 2px; }
.talent-node__heading strong { color: #314d3f; font-size: 13px; line-height: 1.3; }
.talent-node__heading small { color: #6a7c71; font-size: 10px; font-weight: 800; line-height: 1.25; }
.talent-node.is-filled .talent-node__heading small { color: var(--talent-main); }
.talent-node__levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.talent-level { display: grid; min-width: 0; min-height: 33px; place-content: center; padding: 3px 4px; border-radius: 8px; background: rgba(68, 96, 77, .08); color: #738178; font-size: 9px; font-weight: 850; line-height: 1.18; text-align: center; }
.talent-level.is-earned { background: color-mix(in srgb, var(--talent-main) 17%, white); color: var(--talent-main); }
.talent-level.is-next { outline: 2px solid color-mix(in srgb, var(--talent-main) 52%, white); outline-offset: 1px; }
.talent-node__action { width: 100%; min-height: 39px; border: 1px solid var(--talent-main); border-radius: 10px; background: var(--talent-main); color: #fff; cursor: pointer; font: inherit; font-size: 12px; font-weight: 900; line-height: 1.2; transition: transform 130ms ease, filter 130ms ease; }
.talent-node__action:hover:not(:disabled), .talent-node__action:focus-visible:not(:disabled) { filter: brightness(1.08); outline: 3px solid color-mix(in srgb, var(--talent-main) 25%, transparent); outline-offset: 2px; transform: translateY(-1px); }
.talent-node__action:disabled { border-color: rgba(73, 93, 81, .12); background: rgba(73, 93, 81, .1); color: #7a8780; cursor: not-allowed; }
.home-panel--equipment { gap: 12px; max-height: none; min-height: 0; overflow: visible; align-content: start; }
.equipment-heading { display: flex; align-items: stretch; justify-content: space-between; gap: 12px; }
.equipment-heading h2 { margin: 0; }
.equipment-intro { max-width: 450px; margin: 5px 0 0; color: #637169; font-size: 13px; font-weight: 750; line-height: 1.5; }
.equipment-heading__cover { display: block; width: 74px; min-height: 92px; flex: 0 0 auto; padding: 0; overflow: hidden; border: 2px solid rgba(52, 105, 119, .34); border-radius: 16px; background: #172932; box-shadow: 0 4px 0 rgba(27, 73, 84, .19); cursor: zoom-in; touch-action: manipulation; }
.equipment-heading__cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 43%; }
.equipment-heading__cover:hover, .equipment-heading__cover:focus-visible { border-color: #4f9dab; outline: 3px solid rgba(73, 145, 158, .22); outline-offset: 2px; }
.equipment-resource-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.equipment-resource-grid article { display: grid; min-width: 0; gap: 3px; padding: 9px 8px; border: 1px solid rgba(38, 100, 108, .18); border-radius: 12px; background: rgba(255, 255, 255, .72); text-align: center; }
.equipment-resource-grid small { overflow: hidden; color: #6a7a77; font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.equipment-resource-grid strong { color: #245f68; font-size: 19px; line-height: 1; }
.equipment-resource-grid__available { border-color: rgba(56, 133, 96, .34) !important; background: linear-gradient(145deg, #f5fff2, #ddf0d2) !important; }
.equipment-resource-grid__available strong { color: #277652; }
.equipment-stone-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 9px; border: 1px solid rgba(91, 74, 158, .25); border-radius: 15px; background: linear-gradient(140deg, #f6f2ff, #e1edf0); }
.equipment-stone-card__icon { display: grid; width: 42px; height: 42px; padding: 0; place-items: center; overflow: hidden; border: 0; border-radius: 13px; background: radial-gradient(circle at 34% 28%, #fff 0 8%, #c8c4ff 9% 22%, #7862c7 39%, #3f2b88 100%); box-shadow: inset 0 0 0 2px rgba(255,255,255,.36), 0 3px 0 rgba(58, 44, 124, .15); cursor: zoom-in; touch-action: manipulation; }
.equipment-stone-card__icon img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(31, 18, 79, .28)); }
.equipment-stone-card__icon:hover, .equipment-stone-card__icon:focus-visible { outline: 3px solid rgba(92, 74, 171, .26); outline-offset: 2px; transform: translateY(-1px); }
.equipment-stone-card__copy { display: grid; min-width: 0; gap: 2px; }
.equipment-stone-card__copy strong { color: #463780; font-size: 13px; }
.equipment-stone-card__copy small { color: #657171; font-size: 10px; font-weight: 800; line-height: 1.25; }
.equipment-stone-card__copy b { color: #4e3d98; font-size: 13px; }
.equipment-stone-card > button:not(.equipment-stone-card__icon), .equipment-detail__action { min-height: 38px; border: 1px solid #5c4aab; border-radius: 10px; background: linear-gradient(145deg, #7964c8, #4a388f); color: #fff; cursor: pointer; font: inherit; font-size: 11px; font-weight: 900; line-height: 1.2; }
.equipment-stone-card > button:not(.equipment-stone-card__icon) { max-width: 148px; padding: 6px 9px; }
.equipment-stone-card > button:not(.equipment-stone-card__icon):hover:not(:disabled), .equipment-stone-card > button:not(.equipment-stone-card__icon):focus-visible:not(:disabled), .equipment-detail__action:hover:not(:disabled), .equipment-detail__action:focus-visible:not(:disabled) { filter: brightness(1.08); outline: 3px solid rgba(86, 68, 163, .22); outline-offset: 2px; transform: translateY(-1px); }
.equipment-stone-card > button:not(.equipment-stone-card__icon):disabled, .equipment-detail__action:disabled { border-color: rgba(73, 93, 81, .12); background: rgba(73, 93, 81, .1); color: #7a8780; cursor: not-allowed; }
.equipment-completed { margin: 0; color: #2d6670; font-size: 13px; font-weight: 900; }
.equipment-rule { margin: -5px 0 0; color: #66766d; font-size: 12px; font-weight: 750; line-height: 1.45; }
.equipment-live { min-height: 18px; margin: 0; color: #397458; font-size: 12px; font-weight: 850; }
.equipment-slot-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.equipment-slot { --equipment-main: #587d81; display: grid; min-width: 0; min-height: 116px; grid-template-rows: minmax(0, 1fr) auto; gap: 7px; padding: 8px; place-items: center; border: 1px solid color-mix(in srgb, var(--equipment-main) 25%, white); border-radius: 16px; background: linear-gradient(145deg, #fff, color-mix(in srgb, var(--equipment-main) 9%, white)); color: #5f716e; font: inherit; text-align: center; transition: transform 130ms ease, filter 130ms ease, box-shadow 130ms ease; }
.equipment-slot:hover { filter: brightness(1.03); transform: translateY(-1px); }
.equipment-slot.is-selected { border-color: var(--equipment-main); box-shadow: 0 3px 0 color-mix(in srgb, var(--equipment-main) 30%, white); }
.equipment-slot.is-owned { color: var(--equipment-main); }
.equipment-slot__icon { display: grid; width: clamp(64px, 10vw, 108px); height: clamp(64px, 10vw, 108px); padding: 0; place-items: center; overflow: hidden; border: 0; border-radius: 18px; background: color-mix(in srgb, var(--equipment-main) 13%, white); color: inherit; cursor: zoom-in; touch-action: manipulation; }
.equipment-slot__art { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 1px color-mix(in srgb, var(--equipment-main) 26%, transparent)); }
.equipment-slot__icon:hover .equipment-slot__art, .equipment-slot__icon:focus-visible .equipment-slot__art { transform: scale(1.04); }
.equipment-slot__icon:focus-visible, .equipment-slot__open:focus-visible { outline: 3px solid color-mix(in srgb, var(--equipment-main) 28%, transparent); outline-offset: 2px; }
.equipment-slot__open { display: grid; width: 100%; min-height: 34px; gap: 1px; padding: 4px 6px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--equipment-main) 12%, white); color: var(--equipment-main); cursor: pointer; font: inherit; line-height: 1.15; text-align: center; touch-action: manipulation; }
.equipment-slot__open:hover { background: color-mix(in srgb, var(--equipment-main) 21%, white); }
.equipment-slot__open strong { font-size: 12px; }
.equipment-slot__open small { color: #687971; font-size: 9px; font-weight: 850; }
.equipment-slot--weapon { --equipment-main: #3b8cba; }
.equipment-slot--head { --equipment-main: #bf8a28; }
.equipment-slot--top { --equipment-main: #9c5961; }
.equipment-slot--pants { --equipment-main: #586b99; }
.equipment-slot--shoes { --equipment-main: #388a79; }
.equipment-slot--decoration { --equipment-main: #8462af; }
.equipment-slot--ring { --equipment-main: #7f5e9f; }
.equipment-detail { --equipment-main: #587d81; position: relative; display: grid; gap: 10px; padding: 12px; border: 1px solid color-mix(in srgb, var(--equipment-main) 28%, white); border-radius: 18px; background: linear-gradient(145deg, #fff, color-mix(in srgb, var(--equipment-main) 8%, white)); box-shadow: 0 3px 0 color-mix(in srgb, var(--equipment-main) 10%, white); }
.equipment-detail__close { justify-self: end; min-height: 31px; padding: 4px 8px; border: 0; border-radius: 8px; background: color-mix(in srgb, var(--equipment-main) 11%, white); color: var(--equipment-main); cursor: pointer; font: inherit; font-size: 10px; font-weight: 900; touch-action: manipulation; }
.equipment-detail__close:hover, .equipment-detail__close:focus-visible { outline: 3px solid color-mix(in srgb, var(--equipment-main) 23%, transparent); outline-offset: 2px; }
.equipment-detail__hero { display: grid; grid-template-columns: minmax(126px, .85fr) minmax(0, 1.15fr); align-items: center; gap: 13px; }
.equipment-detail__hero-icon { display: grid; width: min(100%, 180px); aspect-ratio: 1; padding: 0; justify-self: center; place-items: center; overflow: hidden; border: 0; border-radius: 22px; background: radial-gradient(circle at 37% 28%, #fff, color-mix(in srgb, var(--equipment-main) 17%, white) 53%, color-mix(in srgb, var(--equipment-main) 31%, white)); color: inherit; cursor: zoom-in; touch-action: manipulation; }
.equipment-detail__hero-art { display: block; width: 94%; height: 94%; object-fit: contain; filter: drop-shadow(0 8px 5px color-mix(in srgb, var(--equipment-main) 35%, transparent)); }
.equipment-detail__hero-icon:hover .equipment-detail__hero-art, .equipment-detail__hero-icon:focus-visible .equipment-detail__hero-art { transform: scale(1.025); }
.equipment-detail__hero-icon:focus-visible { outline: 3px solid color-mix(in srgb, var(--equipment-main) 30%, transparent); outline-offset: 3px; }
.equipment-detail__hero > span:last-child { display: grid; min-width: 0; gap: 4px; }
.equipment-detail__hero strong { color: var(--equipment-main); font-size: 21px; line-height: 1.1; }
.equipment-detail__hero small { color: #69766f; font-size: 12px; font-weight: 850; line-height: 1.3; }
.equipment-detail__hero p { margin: 1px 0 0; color: #617169; font-size: 11px; font-weight: 750; line-height: 1.4; }
.equipment-level-list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.equipment-level { display: grid; grid-template-columns: 35px 52px minmax(0, 1fr); align-items: center; gap: 8px; padding: 7px; border: 1px solid rgba(73, 93, 81, .11); border-radius: 10px; background: rgba(255,255,255,.64); color: #748079; }
.equipment-level.is-unlocked { border-color: color-mix(in srgb, var(--equipment-main) 25%, white); color: var(--equipment-main); }
.equipment-level.is-current { border-color: var(--equipment-main); background: color-mix(in srgb, var(--equipment-main) 12%, white); box-shadow: inset 3px 0 0 var(--equipment-main); }
.equipment-level > b { display: grid; min-height: 28px; place-items: center; border-radius: 8px; background: rgba(68, 96, 77, .08); color: inherit; font-size: 11px; }
.equipment-level.is-unlocked > b { background: color-mix(in srgb, var(--equipment-main) 16%, white); }
.equipment-level__art-trigger { display: grid; width: 52px; height: 52px; padding: 0; place-items: center; border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: zoom-in; touch-action: manipulation; }
.equipment-level__art { display: block; width: 52px; height: 52px; object-fit: contain; filter: grayscale(.48) opacity(.64); }
.equipment-level.is-unlocked .equipment-level__art { filter: drop-shadow(0 2px 1px color-mix(in srgb, var(--equipment-main) 24%, transparent)); }
.equipment-level__art-trigger:hover .equipment-level__art, .equipment-level__art-trigger:focus-visible .equipment-level__art { transform: scale(1.06); }
.equipment-level__art-trigger:focus-visible { outline: 3px solid color-mix(in srgb, var(--equipment-main) 28%, transparent); outline-offset: 2px; }
.equipment-level > span { display: grid; min-width: 0; gap: 1px; }
.equipment-level strong { color: #314d3f; font-size: 12px; line-height: 1.18; }
.equipment-level.is-unlocked strong { color: var(--equipment-main); }
.equipment-level small { color: #738077; font-size: 10px; font-weight: 800; line-height: 1.25; }
.equipment-detail__action { width: 100%; padding: 7px 9px; border-color: var(--equipment-main); background: var(--equipment-main); }
.pre-game-shortcut--benefits { border-color: rgba(121, 74, 134, .42); background: linear-gradient(145deg, #fff1f6, #ead8f5); color: #6b3c79; }
.home-panel--benefits, .home-panel--bloodline, .home-panel--benefit-tuning { gap: 12px; max-height: none; min-height: 0; overflow: visible; align-content: start; }
.benefits-heading, .bloodline-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.benefits-heading h2, .bloodline-heading h2 { margin: 0; }
.benefits-heading p, .bloodline-heading p { max-width: 460px; margin: 5px 0 0; color: #637169; font-size: 13px; font-weight: 750; line-height: 1.5; }
.benefits-heading__mark, .bloodline-heading__mark { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 16px; color: #fff; font-size: 25px; font-weight: 950; }
.benefits-heading__mark { background: linear-gradient(145deg, #8c5aaa, #50377e); box-shadow: 0 4px 0 rgba(74, 47, 110, .24); }
.bloodline-heading__mark { background: linear-gradient(145deg, #b75069, #713753); box-shadow: 0 4px 0 rgba(99, 42, 63, .24); }
.benefits-resource-card { display: grid; grid-template-columns: minmax(114px, auto) minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 11px; border: 1px solid rgba(100, 65, 129, .22); border-radius: 15px; background: linear-gradient(145deg, #faf6ff, #eee5f5); }
.benefits-resource-card > span { display: grid; gap: 2px; }
.benefits-resource-card small { color: #686879; font-size: 10px; font-weight: 800; line-height: 1.35; }
.benefits-resource-card > span small { color: #70517f; }
.benefits-resource-card strong { color: #563a80; font-size: 22px; line-height: 1; }
.benefits-live, .bloodline-live { min-height: 18px; margin: 0; color: #397458; font-size: 12px; font-weight: 850; }
.benefits-summary-card, .benefit-tuning-summary-card { display: grid; gap: 10px; padding: 12px; border: 1px solid rgba(83, 70, 151, .26); border-radius: 17px; background: linear-gradient(145deg, #faf8ff, #ece7f7); }
.benefits-summary-card__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.benefits-summary-card__heading > div { display: grid; min-width: 0; gap: 3px; }
.benefits-summary-card__heading .eyebrow { margin: 0; color: #6552ad; font-size: 9px; }
.benefits-summary-card h3, .benefit-tuning-summary-card h3 { margin: 0; color: #4d3c87; font-size: 16px; }
.benefits-summary-card__heading p:last-child { margin: 0; color: #69756f; font-size: 10px; font-weight: 750; line-height: 1.4; }
.benefit-tuning-open { flex: 0 0 auto; min-height: 42px; padding: 7px 10px; border: 1px solid #6552ad; border-radius: 11px; background: linear-gradient(145deg, #7c66c2, #4e3c8a); color: #fff; cursor: pointer; font: inherit; font-size: 11px; font-weight: 900; line-height: 1.25; touch-action: manipulation; }
.benefit-tuning-open:hover, .benefit-tuning-open:focus-visible { filter: brightness(1.08); outline: 3px solid rgba(101,82,173,.22); outline-offset: 2px; }
.benefits-summary-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.benefit-balance-system { display: grid; min-width: 0; gap: 7px; padding: 9px; border: 1px solid rgba(92, 76, 138, .18); border-radius: 13px; background: rgba(255,255,255,.72); }
.benefit-balance-system--talent { border-color: rgba(83,70,151,.28); }
.benefit-balance-system--equipment { border-color: rgba(38,115,128,.28); }
.benefit-balance-system--bloodline { border-color: rgba(158,67,90,.28); }
.benefit-balance-system__heading { display: grid; gap: 2px; }
.benefit-balance-system__heading strong { color: #4d3c87; font-size: 12px; line-height: 1.2; }
.benefit-balance-system--equipment .benefit-balance-system__heading strong { color: #267380; }
.benefit-balance-system--bloodline .benefit-balance-system__heading strong { color: #933d56; }
.benefit-balance-system--unified .benefit-balance-system__heading strong { color: #4d3c87; }
.benefit-balance-system__heading small, .benefit-balance-system__spend { margin: 0; color: #6a7570; font-size: 9px; font-weight: 800; line-height: 1.3; }
.benefit-balance-comparison-list { display: grid; gap: 5px; }
.benefit-balance-comparison { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 4px; padding: 5px; border-radius: 8px; background: rgba(89,72,135,.055); }
.benefit-balance-comparison span { min-width: 0; color: #5f6e67; font-size: 9px; font-weight: 800; line-height: 1.32; overflow-wrap: anywhere; }
.benefit-balance-comparison span::before { display: block; margin-bottom: 1px; color: #83798f; content: attr(data-balance-label); font-size: 8px; font-weight: 900; }
.benefit-balance-comparison__after { color: #3d7357 !important; }
.benefit-balance-comparison b { align-self: center; color: #81768b; font-size: 11px; }
.benefit-balance-current-list { display: grid; gap: 5px; }
.benefit-balance-current { margin: 0; padding: 6px 7px; border-radius: 8px; background: rgba(89,72,135,.055); color: #3d7357; font-size: 10px; font-weight: 850; line-height: 1.35; overflow-wrap: anywhere; }
.benefit-balance-empty { margin: 0; color: #738078; font-size: 10px; font-weight: 750; line-height: 1.35; }
.benefit-tuning-note { display: grid; gap: 3px; padding: 10px 11px; border: 1px solid rgba(83,70,151,.24); border-radius: 14px; background: linear-gradient(145deg, #f4f1ff, #e8e0fa); }
.benefit-tuning-note strong { color: #4f3d91; font-size: 12px; }
.benefit-tuning-note small { color: #68736d; font-size: 10px; font-weight: 750; line-height: 1.4; }
.benefit-tuning-list { display: grid; gap: 10px; }
.benefit-tuning-system { display: grid; min-width: 0; gap: 8px; padding: 10px; border: 1px solid rgba(83,70,151,.2); border-radius: 16px; background: rgba(255,255,255,.75); }
.benefit-tuning-system--equipment { border-color: rgba(38,115,128,.25); }
.benefit-tuning-system--bloodline { border-color: rgba(158,67,90,.25); }
.benefit-tuning-system__heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.benefit-tuning-system__heading h3 { margin: 0; color: #4f3d91; font-size: 15px; }
.benefit-tuning-system--equipment .benefit-tuning-system__heading h3 { color: #267380; }
.benefit-tuning-system--bloodline .benefit-tuning-system__heading h3 { color: #933d56; }
.benefit-tuning-system__heading small { color: #6d7872; font-size: 10px; font-weight: 800; }
.benefit-tuning-group { min-width: 0; border: 1px solid rgba(77,60,135,.14); border-radius: 11px; background: rgba(255,255,255,.66); overflow: clip; }
.benefit-tuning-group summary { min-height: 42px; padding: 10px; color: #53437f; cursor: pointer; font-size: 11px; font-weight: 900; line-height: 1.25; touch-action: manipulation; }
.benefit-tuning-system--equipment .benefit-tuning-group summary { color: #267380; }
.benefit-tuning-system--bloodline .benefit-tuning-group summary { color: #933d56; }
.benefit-tuning-group[open] summary { border-bottom: 1px solid rgba(77,60,135,.11); background: rgba(91,73,147,.06); }
.benefit-tuning-row { display: grid; gap: 7px; padding: 9px; border-bottom: 1px solid rgba(77,60,135,.09); }
.benefit-tuning-row:last-child { border-bottom: 0; }
.benefit-tuning-row > strong { color: #536a5e; font-size: 11px; line-height: 1.35; }
.benefit-tuning-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.benefit-tuning-field { display: grid; min-width: 0; gap: 3px; padding: 7px; border: 1px solid rgba(77,60,135,.12); border-radius: 9px; background: #fff; }
.benefit-tuning-field > span { color: #65716b; font-size: 9px; font-weight: 850; line-height: 1.25; }
.benefit-tuning-field input { width: 100%; min-height: 44px; padding: 7px; border: 1px solid rgba(83,70,151,.36); border-radius: 8px; background: #fcfbff; color: #4f3d91; font: inherit; font-size: 13px; font-weight: 900; }
.benefit-tuning-field input:focus-visible { outline: 3px solid rgba(101,82,173,.22); outline-offset: 1px; }
.benefit-tuning-field small { color: #7b8580; font-size: 8px; font-weight: 750; line-height: 1.25; }
.benefit-tuning-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; position: sticky; bottom: 0; padding: 9px; border: 1px solid rgba(83,70,151,.2); border-radius: 14px; background: rgba(250,248,255,.94); backdrop-filter: blur(8px); }
.benefit-tuning-actions button { min-height: 44px; padding: 7px 9px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font: inherit; font-size: 11px; font-weight: 900; line-height: 1.25; touch-action: manipulation; }
.benefit-tuning-reset { border-color: #80633e !important; background: #f3e3bc; color: #745522; }
.benefit-tuning-cancel { border-color: rgba(85,105,95,.28) !important; background: #edf2ee; color: #5f7268; }
.benefit-tuning-apply { border-color: #5e4aa1 !important; background: linear-gradient(145deg, #8067c8, #503d92); color: #fff; }
.benefit-tuning-actions button:hover, .benefit-tuning-actions button:focus-visible { filter: brightness(1.06); outline: 3px solid rgba(83,70,151,.2); outline-offset: 2px; }
.benefit-card-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.benefit-card { --benefit-main: #6c558e; --benefit-soft: #f2ecfb; display: grid; min-width: 0; min-height: 112px; grid-template-columns: 96px minmax(0, 1fr); align-items: stretch; gap: 11px; padding: 8px; border: 1px solid color-mix(in srgb, var(--benefit-main) 32%, white); border-radius: 17px; background: linear-gradient(145deg, #fff, var(--benefit-soft)); color: var(--benefit-main); box-shadow: 0 3px 0 color-mix(in srgb, var(--benefit-main) 14%, white); }
.benefit-card:has(.benefit-card__body:hover), .benefit-card:has(.benefit-card__body:focus-visible) { filter: brightness(1.025); }
.benefit-card__art-button { display: block; width: 96px; height: 96px; align-self: center; padding: 0; overflow: hidden; border: 1px solid color-mix(in srgb, var(--benefit-main) 36%, white); border-radius: 13px; background: color-mix(in srgb, var(--benefit-main) 16%, white); box-shadow: inset 0 0 0 1px rgba(255,255,255,.24); cursor: zoom-in; }
.benefit-card__art-button:hover, .benefit-card__art-button:focus-visible { filter: brightness(1.07); outline: 3px solid color-mix(in srgb, var(--benefit-main) 28%, transparent); outline-offset: 2px; }
.benefit-card__art { display: block; width: 100%; height: 100%; object-fit: cover; }
.benefit-card__body { display: grid; min-width: 0; min-height: 100%; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 4px 4px 4px 2px; border: 0; border-radius: 12px; background: transparent; color: inherit; cursor: pointer; font: inherit; text-align: left; touch-action: manipulation; transition: transform 130ms ease, filter 130ms ease; }
.benefit-card__body:hover, .benefit-card__body:focus-visible { outline: 3px solid color-mix(in srgb, var(--benefit-main) 20%, transparent); outline-offset: 2px; transform: translateY(-1px); }
.benefit-card__copy { display: grid; min-width: 0; align-content: center; gap: 4px; }
.benefit-card__copy strong { color: var(--benefit-main); font-size: 17px; line-height: 1.15; }
.benefit-card__copy small { color: #61716b; font-size: 11px; font-weight: 800; line-height: 1.38; }
.benefit-card__copy em { color: color-mix(in srgb, var(--benefit-main) 78%, #273d34); font-size: 11px; font-style: normal; font-weight: 900; line-height: 1.35; }
.benefit-card__arrow { align-self: end; justify-self: end; color: var(--benefit-main); font-size: 30px; font-weight: 600; line-height: .65; }
.benefit-card--talents { --benefit-main: #57449b; --benefit-soft: #f0edff; }
.benefit-card--equipment { --benefit-main: #267380; --benefit-soft: #e8f8f7; }
.benefit-card--bloodline { --benefit-main: #9e435a; --benefit-soft: #fff0f2; }
.benefits-exchange-card { display: grid; gap: 10px; padding: 12px; border: 1px solid rgba(152, 102, 43, .3); border-radius: 17px; background: linear-gradient(145deg, #fffdf6, #f7ecd7); }
.benefits-exchange-card__heading { display: grid; gap: 3px; }
.benefits-exchange-card__heading .eyebrow { margin: 0; color: #916223; font-size: 9px; }
.benefits-exchange-card__heading h3 { margin: 0; color: #76501e; font-size: 16px; }
.benefits-exchange-card__heading > p:last-child { margin: 0; color: #716b5b; font-size: 11px; font-weight: 750; line-height: 1.4; }
.benefits-exchange-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.benefits-exchange-grid article { display: grid; min-width: 0; gap: 3px; padding: 8px 6px; border: 1px solid rgba(151, 110, 40, .2); border-radius: 11px; background: rgba(255,255,255,.66); text-align: center; }
.benefits-exchange-grid small { overflow: hidden; color: #786e5c; font-size: 9px; font-weight: 800; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.benefits-exchange-grid strong { color: #8a5d20; font-size: 17px; line-height: 1; }
.benefits-exchange-button { width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid #a4712d; border-radius: 11px; background: linear-gradient(145deg, #c99543, #8b5e20); color: #fff; cursor: pointer; font: inherit; font-size: 12px; font-weight: 900; line-height: 1.25; touch-action: manipulation; }
.benefits-exchange-button:hover:not(:disabled), .benefits-exchange-button:focus-visible:not(:disabled) { filter: brightness(1.08); outline: 3px solid rgba(157,105,35,.22); outline-offset: 2px; transform: translateY(-1px); }
.benefits-exchange-button:disabled { border-color: rgba(73,93,81,.12); background: rgba(73,93,81,.1); color: #7a8780; cursor: not-allowed; }
.bloodline-resource-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bloodline-resource-grid article { display: grid; min-width: 0; gap: 3px; padding: 9px 7px; border: 1px solid rgba(144, 57, 79, .22); border-radius: 12px; background: rgba(255,255,255,.72); text-align: center; }
.bloodline-resource-grid small { overflow: hidden; color: #7e6b70; font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.bloodline-resource-grid strong { color: #8e3b54; font-size: 19px; line-height: 1; }
.bloodline-resource-grid__available { border-color: rgba(56, 133, 96, .34) !important; background: linear-gradient(145deg, #f5fff2, #ddf0d2) !important; }
.bloodline-resource-grid__available strong { color: #277652; }
.bloodline-completed { margin: 0; color: #8e3b54; font-size: 13px; font-weight: 900; }
.bloodline-rule { margin: -5px 0 0; color: #66766d; font-size: 12px; font-weight: 750; line-height: 1.45; }
.bloodline-node-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.bloodline-node { --bloodline-main: #9e435a; display: grid; min-width: 0; gap: 8px; padding: 10px; border: 1px solid color-mix(in srgb, var(--bloodline-main) 26%, white); border-radius: 16px; background: linear-gradient(145deg, #fff, color-mix(in srgb, var(--bloodline-main) 8%, white)); }
.bloodline-node.is-open { border-color: color-mix(in srgb, var(--bloodline-main) 48%, white); box-shadow: 0 3px 0 color-mix(in srgb, var(--bloodline-main) 12%, white); }
.bloodline-node.is-filled { background: linear-gradient(145deg, #fffaf7, color-mix(in srgb, var(--bloodline-main) 14%, white)); }
.bloodline-node__heading { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 8px; }
.bloodline-node__icon { display: grid; width: 44px; height: 44px; padding: 3px; place-items: center; overflow: hidden; border: 0; border-radius: 13px; background: color-mix(in srgb, var(--bloodline-main) 15%, white); box-shadow: inset 0 0 0 1px rgba(255,255,255,.42); cursor: zoom-in; }
.bloodline-node__icon:hover, .bloodline-node__icon:focus-visible { filter: brightness(1.07); outline: 3px solid color-mix(in srgb, var(--bloodline-main) 26%, transparent); outline-offset: 2px; }
.bloodline-node__icon-art { display: block; width: 100%; height: 100%; object-fit: contain; }
.bloodline-node__heading > span:last-child { display: grid; min-width: 0; gap: 2px; }
.bloodline-node__heading strong { color: #623343; font-size: 13px; line-height: 1.15; }
.bloodline-node__heading small { color: var(--bloodline-main); font-size: 10px; font-weight: 900; line-height: 1.25; }
.bloodline-node > p { min-height: 33px; margin: 0; color: #68756f; font-size: 10px; font-weight: 750; line-height: 1.35; }
.bloodline-node__preview { display: grid; gap: 3px; padding: 6px 7px; border: 1px solid color-mix(in srgb, var(--bloodline-main) 19%, white); border-radius: 9px; background: color-mix(in srgb, var(--bloodline-main) 7%, white); }
.bloodline-node__preview small { color: #5e6d66; font-size: 9px; font-weight: 850; line-height: 1.35; }
.bloodline-node__preview small:last-child { color: var(--bloodline-main); }
.bloodline-node__levels { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
.bloodline-level { display: grid; min-width: 0; min-height: 20px; place-items: center; border-radius: 5px; background: rgba(105, 81, 88, .09); color: #80767a; font-size: 8px; font-weight: 850; }
.bloodline-level.is-earned { background: color-mix(in srgb, var(--bloodline-main) 20%, white); color: var(--bloodline-main); }
.bloodline-level.is-next { outline: 2px solid color-mix(in srgb, var(--bloodline-main) 55%, white); outline-offset: 1px; }
.bloodline-node__action { width: 100%; min-height: 39px; padding: 6px 8px; border: 1px solid var(--bloodline-main); border-radius: 10px; background: var(--bloodline-main); color: #fff; cursor: pointer; font: inherit; font-size: 11px; font-weight: 900; line-height: 1.25; touch-action: manipulation; }
.bloodline-node__action:hover:not(:disabled), .bloodline-node__action:focus-visible:not(:disabled) { filter: brightness(1.08); outline: 3px solid color-mix(in srgb, var(--bloodline-main) 24%, transparent); outline-offset: 2px; transform: translateY(-1px); }
.bloodline-node__action:disabled { border-color: rgba(73,93,81,.12); background: rgba(73,93,81,.1); color: #7a8780; cursor: not-allowed; }

/* 增益的三項封面及六個血脈圖示都是獨立素材；不再使用看不清的整張介面底圖。 */
.benefit-native-content { display: grid; min-width: 0; gap: 12px; }

@media (min-width: 760px) {
  .intro-card--home.has-wide-benefit-panel {
    width: min(1040px, calc(100vw - 40px));
    max-width: none;
  }
  .home-panel--benefits .benefit-card { min-height: 134px; grid-template-columns: 118px minmax(0, 1fr); gap: 14px; padding: 8px 15px 8px 8px; }
  .home-panel--benefits .benefit-card__art-button { width: 118px; height: 118px; border-radius: 15px; }
  .home-panel--benefits .benefit-card__copy strong { font-size: 19px; }
  .home-panel--benefits .benefit-card__copy small,
  .home-panel--benefits .benefit-card__copy em { font-size: 12px; }
  .home-panel--bloodline #bloodlineList { display: block; }
  .home-panel--bloodline #bloodlineList > .bloodline-node-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-panel--benefit-tuning .benefit-tuning-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .home-panel--benefit-tuning .benefit-tuning-system { height: fit-content; }
  .home-panel--benefit-tuning .benefit-tuning-system--bloodline { grid-column: 1 / -1; }
  /* 外層 homePanelScroller 是唯一桌面縱向捲動容器，避免數值修改器再生成第二條捲軸。 */
  .home-panel--benefit-tuning { max-height: none; overflow: visible; }
}

@media (max-width: 759px) {
  /* 手機只保留外層主頁滾動，避免增益／血脈卡再次產生內層捲動條。 */
  .home-panel--benefits,
  .home-panel--bloodline,
  .home-panel--benefit-tuning { max-height: none; overflow: visible; }
  /* 手機同樣把三項逐格直排，左邊封面不會被縮成看不清的小符號。 */
  .home-panel--benefits .benefit-card-grid { grid-template-columns: 1fr; }
  .home-panel--benefits .benefit-card {
    min-height: 104px;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
  }
  .home-panel--benefits .benefit-card__art-button { width: 88px; height: 88px; border-radius: 12px; }
  .home-panel--benefits .benefit-card__arrow { align-self: end; }
  .home-panel--bloodline #bloodlineList { display: block; }
  .benefits-summary-list { grid-template-columns: 1fr; }
  .benefits-summary-card__heading { align-items: stretch; flex-direction: column; }
  .benefit-tuning-open { width: 100%; }
  .home-panel--benefit-tuning .benefit-tuning-list { grid-template-columns: 1fr; }
  .benefit-tuning-field-grid { grid-template-columns: 1fr; }
  .benefit-tuning-actions { grid-template-columns: 1fr; }
}

@media (min-width: 390px) and (max-width: 759px) {
  /* 每張血脈現在固定顯示每級、滿級、單位；手機保持單欄才不會把 0.05 秒等數字壓到看不清。 */
  .home-panel--bloodline #bloodlineList > .bloodline-node-grid { grid-template-columns: 1fr; gap: 8px; }
  .home-panel--bloodline .bloodline-node { gap: 7px; padding: 8px; }
  .home-panel--bloodline .bloodline-node__heading { grid-template-columns: 38px minmax(0, 1fr); gap: 6px; }
  .home-panel--bloodline .bloodline-node__icon { width: 38px; height: 38px; border-radius: 10px; }
  .home-panel--bloodline .bloodline-node > p { min-height: 0; font-size: 9px; }
  .home-panel--bloodline .bloodline-node__action { min-height: 38px; font-size: 10px; }
}
@media (min-width: 700px) {
  .talent-route-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 359px) {
  .talent-route-card { grid-template-columns: 92px minmax(0, 1fr); min-height: 123px; }
  .talent-route-card__art { width: 92px; height: 123px; }
  .talent-route-card__body { padding: 9px; }
}
.about-play-summary { margin: 0; color: #5e7167; font-size: 13px; font-weight: 700; line-height: 1.55; }
.about-author {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid rgba(49, 104, 65, .2);
  border-radius: 14px;
  background: rgba(255, 255, 255, .7);
  color: #486457;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.5;
}
.about-author strong { color: var(--forest-900); font-size: 15px; }
.about-open-hint { margin: -5px 0 0; color: #2e785b; font-size: 13px; font-weight: 850; line-height: 1.45; }
.about-section { display: grid; gap: 8px; }
.about-section h3 { margin: 0; color: var(--forest-900); font-size: 16px; }
.about-section-note { margin: -3px 0 0; color: #68786e; font-size: 11px; font-weight: 750; line-height: 1.4; }
.about-character-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
.about-character-card { display: grid; min-width: 0; align-content: end; }
.about-character-image {
  display: grid;
  width: 100%;
  min-height: 158px;
  padding: 0;
  place-items: end center;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: zoom-in;
}
.about-character-image img {
  display: block;
  width: 100%;
  height: 158px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 7px 5px rgba(23, 48, 34, .17));
  transition: transform .18s ease, filter .18s ease;
}
.about-character-image:hover img,
.about-character-image:focus-visible img { transform: translateY(-3px) scale(1.035); filter: drop-shadow(0 10px 7px rgba(23, 48, 34, .24)); }
.about-character-image:focus-visible { outline: 3px solid #e7a935; outline-offset: 3px; }
.about-character-copy {
  display: grid;
  min-height: 57px;
  gap: 3px;
  padding: 8px 9px;
  border: 1px solid rgba(49, 104, 65, .18);
  border-radius: 12px;
  background: rgba(255,255,255,.78);
}
.about-character-card--boss .about-character-copy { border-color: rgba(66, 57, 79, .34); background: rgba(242, 239, 248, .9); }
.about-character-card strong { color: var(--forest-900); font-size: 12px; line-height: 1.25; }
.about-character-card small { color: #64766c; font-size: 10px; font-weight: 700; line-height: 1.35; }
.credits { color: #5e7167; font-size: 13px; line-height: 1.55; }
.credits { margin: 0; padding-top: 4px; font-weight: 750; }
.home-panel--about .about-character-image {
  position: relative;
  min-height: 136px;
  padding: 7px 7px 31px;
  overflow: hidden;
  border: 1px solid rgba(49, 104, 65, .18);
  border-radius: 15px;
  background: rgba(255, 255, 255, .68);
}
.home-panel--about .about-character-image img { height: 98px; }
.home-panel--about .about-character-image::after {
  content: attr(data-character-name);
  position: absolute;
  right: 6px;
  bottom: 6px;
  left: 6px;
  padding: 4px 5px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  color: var(--forest-900);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-panel--about .about-character-copy { display: none; }
.home-panel .intro-music-control { grid-template-columns: 90px minmax(110px, 1fr) 42px; margin: 0; }

.character-gallery-overlay {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  padding: 18px;
  place-items: center;
  background: rgba(8, 24, 17, .82);
  backdrop-filter: blur(8px);
}
.character-gallery-overlay[hidden] { display: none; }
.character-gallery {
  display: grid;
  width: min(820px, 100%);
  max-height: calc(100dvh - 36px);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 22px;
  background: #f8f8ed;
  box-shadow: 0 28px 80px rgba(0,0,0,.48);
}
.character-gallery__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 15px; border-bottom: 1px solid rgba(49,104,65,.15); }
.character-gallery__header h2 { margin: 0; color: var(--forest-900); font-size: 19px; }
.character-gallery__close { min-width: 64px; min-height: 42px; border: 0; border-radius: 11px; background: #2f7658; color: #fff; cursor: pointer; font: inherit; font-weight: 900; }
.character-gallery__description {
  max-height: none;
  margin: 0;
  padding: 10px 15px;
  overflow: visible;
  border-bottom: 1px solid rgba(49,104,65,.15);
  color: #50645a;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.5;
  overscroll-behavior: auto;
}
.character-gallery__viewport {
  display: block;
  min-height: min(62dvh, 560px);
  padding: 18px;
  overflow: auto;
  overscroll-behavior: contain;
  background: radial-gradient(circle at center, #fff 0 38%, #e8efdf 100%);
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}
.character-gallery__viewport.is-zoomed { cursor: grab; }
.character-gallery__viewport.is-panning { cursor: grabbing; user-select: none; }
.character-gallery__stage { display: grid; min-width: 100%; min-height: 100%; place-items: center; }
.character-gallery__image { display: block; max-width: none; max-height: none; object-fit: contain; transition: width .12s ease, height .12s ease; filter: drop-shadow(0 12px 9px rgba(17, 42, 29, .22)); }
.character-gallery__controls { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 11px 14px max(11px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(49,104,65,.15); }
.character-gallery__controls button { min-width: 46px; min-height: 44px; border: 1px solid rgba(49,104,65,.22); border-radius: 11px; background: #fff; color: var(--forest-900); cursor: pointer; font: inherit; font-size: 18px; font-weight: 950; touch-action: manipulation; }
.character-gallery__controls button:last-child { padding-inline: 13px; font-size: 13px; }
.character-gallery__controls output { min-width: 58px; color: var(--forest-900); text-align: center; font-weight: 900; }
body.has-character-gallery { overflow: hidden; }

@media (max-width: 620px) {
  .intro-card--home { padding: 24px 18px; }
  .home-panel--main { padding-top: 12px; }
  .home-build-meta { top: -12px; font-size: 8px; }
  .pre-game-topbar { gap: 6px; }
  .pre-game-shortcuts { gap: 4px; }
  .pre-game-shortcut { width: 59px; min-height: 54px; border-radius: 12px; }
  .pre-game-shortcut--profile,
  .pre-game-shortcut--talent-path { width: 59px; margin-top: 0; }
  .pre-game-shortcut--profile { font-size: inherit; }
  .pre-game-shortcut__icon { min-width: 23px; min-height: 23px; font-size: 23px; }
  .pre-game-shortcut__label { font-size: 10px; }
  .pre-game-shortcut small { font-size: 8px; }
  .home-menu-button--continue { min-height: 72px; gap: 3px; }
  .home-menu-button--continue strong { font-size: 18px; }
  .home-menu-button--continue small { font-size: 12px; line-height: 1.35; }
  .map-select-grid { grid-template-columns: 1fr; }
  .map-select-card { min-height: 96px; }
  .game-mode-section { margin-top: 13px; }
  .game-mode-section__heading { align-items: flex-start; flex-direction: column; gap: 2px; }
  .special-mode-grid { grid-template-columns: 1fr; gap: 8px; }
  .achievement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .achievement-card { padding: 7px; }
  .profile-special-list { grid-template-columns: 1fr; }
  .special-mode-card { grid-template-columns: 74px minmax(0, 1fr); min-height: 82px; }
  .equipment-resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .equipment-slot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .equipment-slot { min-height: 138px; }
  .equipment-slot__icon { width: clamp(82px, 25vw, 126px); height: clamp(82px, 25vw, 126px); }
  .equipment-stone-card { grid-template-columns: 39px minmax(0, 1fr); }
  .equipment-stone-card__icon { width: 39px; height: 39px; }
  .equipment-stone-card > button:not(.equipment-stone-card__icon) { grid-column: 1 / -1; max-width: none; width: 100%; }
  .benefit-card-grid { grid-template-columns: 1fr; }
  .benefit-card { min-height: 105px; grid-template-columns: 48px minmax(0, 1fr) auto; grid-template-rows: 1fr; align-items: center; }
  .benefit-card__icon { width: 48px; height: 48px; }
  .benefit-card__arrow { align-self: end; }
  .benefits-exchange-grid, .bloodline-resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bloodline-node-grid { grid-template-columns: 1fr; }
  .about-character-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 8px; }
  .about-character-image { min-height: 142px; }
  .about-character-image img { height: 142px; }
  .character-gallery-overlay { padding: 0; place-items: stretch; }
  .character-gallery { width: 100%; max-height: 100dvh; border: 0; border-radius: 0; }
  .character-gallery__viewport { min-height: 0; padding: 10px; }
  .character-gallery__stage { min-width: 100%; min-height: 100%; }
  .character-gallery__controls { gap: 7px; }
}

@media (max-width: 420px) {
  .achievement-grid { grid-template-columns: 1fr; }
  .home-panel--achievements,
  .home-panel--profile,
  .home-panel--talents,
  .home-panel--equipment,
  .home-panel--benefits,
  .home-panel--bloodline { max-height: none; }
  .talent-resource-grid { gap: 6px; }
  .talent-resource-grid article { padding-inline: 5px; }
  .talent-resource-grid strong { font-size: 17px; }
  .talent-level { font-size: 8px; }
  .equipment-resource-grid { gap: 6px; }
  .equipment-resource-grid article { padding-inline: 5px; }
  .equipment-resource-grid strong { font-size: 17px; }
  .benefits-resource-card { grid-template-columns: 1fr; gap: 5px; }
  .benefits-exchange-grid { gap: 6px; }
  .bloodline-resource-grid { gap: 6px; }
  .bloodline-resource-grid article { padding-inline: 5px; }
  .bloodline-resource-grid strong { font-size: 17px; }
  .talent-reset-row { grid-template-columns: 1fr; gap: 6px; }
  .equipment-detail__hero { grid-template-columns: 1fr; text-align: center; }
  .equipment-detail__hero > span:last-child { justify-items: center; }
  .profile-summary-grid, .profile-completion-grid { grid-template-columns: 1fr; }
  .profile-bonus-card, .profile-economy-card { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 390px) {
  .about-character-grid { grid-template-columns: 1fr; }
  .about-character-image { min-height: 190px; }
  .about-character-image img { height: 190px; }
  .about-character-copy { min-height: 0; }
}

.intro-art {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  background:
    radial-gradient(circle at 25% 22%, rgba(255, 255, 255, 0.7) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 13%, rgba(255, 255, 255, 0.56) 0 3px, transparent 4px),
    linear-gradient(150deg, #75d7c5, #4bb38f 58%, #319375);
}

.intro-art::before {
  content: "";
  position: absolute;
  right: -22%;
  bottom: -16%;
  width: 145%;
  height: 59%;
  transform: rotate(-8deg) skewX(-7deg);
  border: 5px solid rgba(66, 67, 35, 0.28);
  border-radius: 36% 42% 0 0;
  background: linear-gradient(155deg, #8bc866, #5ca34f);
  box-shadow: inset 0 19px 0 rgba(255, 255, 255, 0.13), 0 14px 0 #376e3b;
}

.wind-ring {
  position: absolute;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-left-color: transparent;
  border-radius: 50%;
}

.wind-ring--one { top: 24px; left: -64px; width: 210px; height: 210px; transform: rotate(22deg); }
.wind-ring--two { right: -52px; bottom: 88px; width: 170px; height: 170px; transform: rotate(-38deg); }

.intro-path {
  position: absolute;
  z-index: 1;
  left: -15%;
  bottom: 12%;
  width: 145%;
  height: 68px;
  transform: rotate(-8deg) skewX(-20deg);
  border: 4px solid rgba(73, 64, 48, 0.35);
  background: repeating-linear-gradient(90deg, #b8aa91 0 42px, #aa9b82 43px 46px);
  box-shadow: inset 0 8px 0 rgba(255, 255, 255, 0.16), 0 10px 0 rgba(67, 70, 40, 0.25);
}

.intro-xiaoda {
  position: absolute;
  z-index: 5;
  width: 116px;
  aspect-ratio: 444 / 580;
  transform-origin: center bottom;
  background: url("assets/characters/小達/飛紙小達/xiaoda-plane-sheet.png?v=20260802151527") left top / 800% 100% no-repeat;
  filter: drop-shadow(15px 16px 0 rgba(28, 65, 39, 0.2));
}

.intro-xiaoda--lead { z-index: 7; left: 50%; bottom: 1%; width: 190px; transform: translateX(-50%); }
.intro-xiaoda--magic {
  z-index: 6;
  left: -2%;
  bottom: 2%;
  width: 126px;
  transform: rotate(-5deg);
  background-image: url("assets/characters/小達/魔法小達/xiaoda-magic-sheet.png?v=20260802151527");
}
.intro-xiaoda--paperball {
  z-index: 6;
  right: -3%;
  bottom: 1%;
  width: 130px;
  transform: rotate(5deg);
  background-image: url("assets/characters/小達/卷紙小達/xiaoda-paperball-sheet.png?v=20260802151527");
}
.intro-xiaoda--super {
  z-index: 5;
  top: 4%;
  left: 4%;
  width: 104px;
  transform: rotate(-4deg);
  background-image: url("assets/characters/小達/超級小達/xiaoda-super-sheet.png?v=20260802151527");
}

.intro-xiaoda::after,
.intro-wensheng::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: 1%;
  width: 72%;
  height: 9%;
  transform: translateX(-50%) skewX(-24deg);
  border-radius: 50%;
  background: rgba(34, 58, 34, 0.28);
}

.intro-xiaoda__head {
  position: absolute;
  z-index: 5;
  top: 4px;
  left: 50%;
  width: 118px;
  height: 122px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 0;
  background: url("assets/characters/小達/_共用/xiaoda-head.png?v=20260802151527") center / contain no-repeat;
  filter: drop-shadow(0 4px 0 rgba(52, 42, 34, 0.28));
}

.intro-xiaoda__hair,
.intro-xiaoda__glasses,
.intro-xiaoda__smile {
  display: none;
}

.intro-xiaoda__hair {
  position: absolute;
  z-index: 2;
  top: -8px;
  left: -6px;
  width: 106px;
  height: 43px;
  transform: rotate(-2deg);
  border-radius: 64% 52% 28% 26%;
  background: #24231f;
  box-shadow: 3px 16px 0 -8px #24231f, 72px 14px 0 -9px #24231f;
}

.intro-xiaoda__glasses {
  position: absolute;
  z-index: 3;
  top: 39px;
  left: 50%;
  width: 19px;
  height: 5px;
  transform: translateX(-50%);
  background: #282b2b;
}

.intro-xiaoda__glasses::before,
.intro-xiaoda__glasses::after {
  content: "";
  position: absolute;
  top: -9px;
  width: 29px;
  height: 23px;
  border: 5px solid #282b2b;
  border-radius: 9px;
  background: rgba(183, 225, 232, 0.34);
  box-shadow: inset 4px 3px 0 rgba(255, 255, 255, 0.32);
}

.intro-xiaoda__glasses::before { right: 10px; }
.intro-xiaoda__glasses::after { left: 10px; }

.intro-xiaoda__smile {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 12px;
  width: 22px;
  height: 10px;
  transform: translateX(-50%);
  border-bottom: 3px solid #754b37;
  border-radius: 0 0 50% 50%;
}

.intro-xiaoda__body {
  position: absolute;
  z-index: 3;
  top: 92px;
  left: 50%;
  width: 100px;
  height: 91px;
  transform: translateX(-50%);
  border: 5px solid #342a22;
  border-radius: 18px 18px 10px 10px;
  background: linear-gradient(90deg, #fffdf2 0 48%, #d8d5c8 49% 52%, #fffdf2 53%);
  box-shadow: inset -8px -5px 0 rgba(91, 76, 57, 0.09);
}

.intro-xiaoda__body::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 25px;
  border-width: 16px 20px 0;
  border-style: solid;
  border-color: #d5e3eb transparent transparent;
}

.intro-xiaoda__arm {
  position: absolute;
  z-index: 4;
  right: 1px;
  top: 118px;
  width: 64px;
  height: 25px;
  transform: rotate(-20deg);
  transform-origin: left center;
  border: 5px solid #342a22;
  border-radius: 13px 18px 18px 13px;
  background: #fffdf2;
}

.intro-xiaoda__leg {
  position: absolute;
  z-index: 2;
  bottom: 0;
  width: 35px;
  height: 68px;
  border: 5px solid #342a22;
  border-radius: 8px 8px 12px 12px;
  background: #282b2c;
}

.intro-xiaoda__leg--left { left: 37px; transform: rotate(3deg); }
.intro-xiaoda__leg--right { right: 37px; transform: rotate(-3deg); }

.intro-paper-plane {
  display: none;
}

.intro-wensheng {
  position: absolute;
  z-index: 4;
  width: 112px;
  aspect-ratio: 4 / 3;
  background: url("assets/characters/溫生/01-原裝溫生/wensheng-sprite.png?v=20260802151527") center / contain no-repeat;
  filter: drop-shadow(10px 10px 0 rgba(28, 65, 39, 0.16));
}

.intro-wensheng--origin { top: 4%; right: -4%; width: 126px; transform: rotate(5deg); }
.intro-wensheng--guitar {
  top: 24%;
  right: 1%;
  width: 116px;
  transform: rotate(3deg);
  background-image: url("assets/characters/溫生/05-吉他溫生/wensheng-sprite.png?v=20260802151527");
}
.intro-wensheng--demon {
  top: 3%;
  left: 33%;
  width: 116px;
  transform: translateX(-50%) rotate(-3deg);
  background-image: url("assets/characters/溫生/07-鬼滅之溫/wensheng-sprite.png?v=20260802151527");
}
.intro-wensheng--plank {
  top: 25%;
  left: -5%;
  width: 132px;
  transform: rotate(-4deg);
  background-image: url("assets/characters/溫生/10-平板支溫/wensheng-sprite.png?v=20260802151527");
}

.intro-wensheng__head {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 50%;
  display: grid;
  width: 58px;
  height: 57px;
  place-items: center;
  transform: translateX(-50%);
  border: 4px solid #342a22;
  border-radius: 48% 48% 44% 44%;
  background: #efbd87;
  box-shadow: inset 0 16px 0 #34312b;
}

.intro-wensheng__head i {
  margin-top: 13px;
  color: #71503a;
  font-size: 14px;
  font-style: normal;
  font-weight: 1000;
}

.intro-wensheng__body {
  position: absolute;
  z-index: 2;
  top: 51px;
  left: 50%;
  width: 70px;
  height: 63px;
  transform: translateX(-50%);
  border: 4px solid #342a22;
  border-radius: 15px 15px 7px 7px;
  background: var(--enemy-shirt);
  box-shadow: inset -7px -7px 0 rgba(60, 40, 28, 0.12);
}

.intro-wensheng__leg {
  position: absolute;
  z-index: 1;
  bottom: 0;
  width: 22px;
  height: 38px;
  border: 4px solid #342a22;
  border-radius: 5px 5px 8px 8px;
  background: #343536;
}

.intro-wensheng__leg--left { left: 17px; }
.intro-wensheng__leg--right { right: 17px; }

.intro-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 4vw, 54px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
}

.eyebrow > span {
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--yellow-2);
}

.eyebrow--center { justify-content: center; }

.intro-copy h1 {
  margin: 6px 0 10px;
  color: var(--forest-950);
  font-size: clamp(42px, 5vw, 72px);
  font-weight: 1000;
  letter-spacing: -0.085em;
  line-height: 1;
}

.intro-copy h1 span { color: #2b8c69; }

.intro-lead {
  max-width: 430px;
  margin: 0;
  color: #5e7167;
  font-size: clamp(12px, 1.2vw, 17px);
  font-weight: 650;
  line-height: 1.7;
}

.intro-steps {
  display: grid;
  gap: 8px;
  margin: clamp(14px, 2vw, 25px) 0;
}

.intro-step {
  display: flex;
  align-items: center;
  gap: 11px;
}

.intro-step > strong {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(38, 111, 81, 0.2);
  border-radius: 10px;
  background: #e7f3dc;
  color: var(--forest-700);
  font-size: 12px;
  font-weight: 1000;
}

.intro-step > span { display: grid; gap: 1px; }
.intro-step b { font-size: clamp(10px, 1vw, 14px); }
.intro-step small { color: #7e8d84; font-size: clamp(8px, 0.78vw, 11px); }

.primary-button--large {
  width: 100%;
  min-height: clamp(49px, 4.8vw, 62px);
  padding: 11px 18px;
  font-size: clamp(13px, 1.2vw, 17px);
}

.primary-button--large svg { width: 22px; height: 22px; }

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

.game-mode-section { display: grid; gap: 9px; margin-top: 16px; }
.game-mode-section--normal { padding-bottom: 15px; border-bottom: 1px solid rgba(49, 104, 65, .2); }
.game-mode-section--special { margin-top: 15px; }
.game-mode-section__heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.game-mode-section__heading h3 { margin: 0; color: var(--forest-900); font-size: 18px; }
.game-mode-section__heading p { margin: 0; color: #64766c; font-size: 12px; font-weight: 750; }
.special-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.special-mode-card { display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: stretch; min-height: 92px; padding: 0; overflow: hidden; border: 1px solid rgba(49, 104, 65, .26); border-radius: 14px; background: #fff; color: var(--forest-900); cursor: pointer; text-align: left; box-shadow: 0 4px 0 rgba(50, 91, 56, .13); transition: transform 150ms ease, filter 150ms ease; }
.special-mode-card:hover, .special-mode-card:focus-visible { transform: translateY(-1px); filter: brightness(1.035); }
.special-mode-card:focus-visible { outline: 3px solid #d88b28; outline-offset: 2px; }
.special-mode-cover { position: relative; display: grid; place-items: center; overflow: hidden; color: #fff; background: linear-gradient(145deg, #506c66, #1d3f3a); }
.special-mode-cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.special-mode-copy { display: grid; align-content: center; gap: 4px; padding: 9px 10px; }
.special-mode-copy > b { font-size: 15px; font-weight: 950; }
.special-mode-copy small { color: #607268; font-size: 11px; font-weight: 750; line-height: 1.35; }
.special-mode-card--missing .special-mode-cover { color: #ee6257; background: linear-gradient(145deg, #383f46, #151c23); }
.special-mode-card--unemployed .special-mode-cover { color: #f5c44e; background: linear-gradient(145deg, #6d6d6c, #34383a); }
.special-mode-card--eight .special-mode-cover { color: #86d9e5; background: linear-gradient(145deg, #285370, #15354f); }
.special-mode-card--speed .special-mode-cover { color: #ffb554; background: linear-gradient(145deg, #80382e, #402423); }
.special-mode-card--grey .special-mode-cover { color: #cdd1d2; background: linear-gradient(145deg, #778088, #343a40); }
.special-mode-card--sword .special-mode-cover { color: #f5df8c; background: linear-gradient(145deg, #654971, #2e263d); }
.special-mode-card--killer .special-mode-cover { color: #f07398; background: linear-gradient(145deg, #4e1d3a, #18152c); }
.special-mode-card--crazy .special-mode-cover { color: #59d4ff; background: linear-gradient(145deg, #275f88, #1d283f); }
.special-mode-card--killer .special-mode-cover img,
.special-mode-card--crazy .special-mode-cover img { object-position: center 58%; }

.tower-card.is-mode-disabled { filter: grayscale(1); opacity: .42; }
.tower-card.is-missing-xiaoda::before {
  content: "×";
  position: absolute;
  z-index: 8;
  inset: 50% auto auto 50%;
  color: #e02424;
  font-size: clamp(52px, 6vw, 78px);
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 2px 0 #fff, 0 0 10px rgba(255, 255, 255, .9);
  transform: translate(-50%, -52%) rotate(-8deg);
  pointer-events: none;
}

@media (max-width: 620px) {
  .special-mode-grid { grid-template-columns: 1fr; gap: 8px; }
  .special-mode-card { grid-template-columns: 74px minmax(0, 1fr); min-height: 82px; }
}

.difficulty-button {
  display: flex;
  min-width: 0;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid rgba(66, 55, 35, 0.32);
  border-radius: 15px;
  color: #fff;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 5px 0 rgba(60, 45, 25, 0.25);
  transition: transform 150ms ease, filter 150ms ease;
}

.difficulty-button:hover { transform: translateY(-1px); filter: brightness(1.04); }
.difficulty-button:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(60, 45, 25, 0.25); }
.difficulty-button--easy { background: linear-gradient(145deg, #5bbf75, #318a62); }
.difficulty-button--hard { background: linear-gradient(145deg, #e47751, #b84c3f); }

.difficulty-button > span { display: grid; min-width: 0; gap: 2px; }
.difficulty-button b { font-size: clamp(13px, 1.2vw, 17px); font-weight: 1000; }
.difficulty-button small { font-size: clamp(8px, 0.72vw, 10px); font-weight: 750; opacity: 0.9; }
.difficulty-button svg { width: 20px; height: 20px; flex: 0 0 auto; }

.intro-music-control {
  display: grid;
  width: 100%;
  grid-template-columns: auto minmax(110px, 1fr) 34px;
  align-items: center;
  gap: 9px;
  margin-top: 11px;
  padding: 8px 11px;
  border: 1px solid rgba(38, 111, 81, 0.18);
  border-radius: 12px;
  background: rgba(231, 243, 220, 0.72);
  color: var(--forest-700);
  cursor: pointer;
}

.intro-music-control > span {
  font-size: clamp(9px, 0.82vw, 12px);
  font-weight: 900;
  white-space: nowrap;
}

.intro-music-control > span b {
  color: #2b8c69;
  font-size: 14px;
}

.intro-music-control input {
  width: 100%;
  height: 18px;
  margin: 0;
  accent-color: var(--forest-800);
  cursor: pointer;
}

.intro-music-control input:focus-visible {
  outline: 2px solid #d58c23;
  outline-offset: 2px;
  border-radius: 999px;
}

.intro-music-control output {
  font-size: 10px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.offline-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 13px 0 0;
  color: #8a978e;
  font-size: clamp(7px, 0.68vw, 10px);
  font-weight: 650;
}

.offline-note svg { width: 13px; height: 13px; }

.result-card {
  width: min(470px, 100%);
  padding: clamp(27px, 4vw, 48px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 25px;
  background: var(--cream);
  text-align: center;
  box-shadow: 0 28px 80px rgba(5, 28, 22, 0.42), 0 0 0 8px rgba(255, 255, 255, 0.08);
}

.result-badge {
  display: grid;
  width: 66px;
  height: 66px;
  margin: 0 auto 14px;
  place-items: center;
  border: 4px solid var(--forest-900);
  border-radius: 50%;
  background: var(--yellow);
  color: var(--forest-900);
  font-size: 30px;
  box-shadow: 0 5px 0 #d48d2d;
}

.result-card h2 {
  margin: 5px 0 8px;
  font-size: clamp(29px, 3.4vw, 46px);
  font-weight: 1000;
  letter-spacing: -0.06em;
}

.result-card > p:not(.eyebrow) {
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(10px, 1vw, 14px);
  line-height: 1.65;
}

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

.result-stat {
  display: grid;
  gap: 3px;
  padding: 11px 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf5;
}

.result-stat--waves {
  grid-column: 1 / -1;
  padding: 16px 8px;
  border-color: rgba(72, 119, 76, 0.38);
  background: linear-gradient(180deg, #f2f7df, #e1edc8);
  box-shadow: inset 0 1px 0 #fff, 0 4px 0 rgba(66, 103, 62, 0.12);
}

.result-stats strong { font-size: clamp(16px, 1.8vw, 24px); }
.result-stats small { color: var(--muted); font-size: clamp(7px, 0.68vw, 10px); }
.result-stat--waves strong { color: var(--forest-900); font-size: clamp(28px, 4vw, 46px); line-height: 1; }
.result-stat--waves small { color: var(--forest-700); font-size: clamp(11px, 1vw, 14px); font-weight: 900; }

.result-actions { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 8px; }
.result-actions button { min-height: 48px; padding: 9px 14px; }

.secondary-button {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--forest-800);
  font-weight: 850;
  cursor: pointer;
}

.secondary-button:hover { background: #eef6e9; }

.noscript-message {
  position: fixed;
  z-index: 100;
  inset: 20px;
  display: grid;
  place-items: center;
  padding: 20px;
  border-radius: 18px;
  background: #fff3ce;
  color: #6f361f;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 1100px), (max-height: 620px), (max-aspect-ratio: 11 / 7.1) {
  html,
  body { overflow: auto; }

  .page-shell {
    display: block;
    min-height: 100dvh;
    padding: 0;
    overflow: clip;
  }

  .game-frame {
    display: flex;
    width: min(960px, 100%);
    max-width: none;
    max-height: none;
    min-height: 100dvh;
    margin: 0 auto;
    flex-direction: column;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
  }

  .battlefield {
    width: 100%;
    aspect-ratio: 1;
    flex: 0 0 auto;
    border-left: 0;
    border-bottom: 3px solid #6f5738;
  }

  .control-panel {
    min-height: 680px;
    overflow: visible;
    overscroll-behavior-y: auto;
    border-top: 1px solid var(--line);
    border-left: 0;
    border-right: 0;
  }

  .panel-spacer { display: none; }

  .tower-card { min-height: 84px; }

  .intro-card {
    grid-template-columns: minmax(190px, 0.75fr) minmax(280px, 1.25fr);
  }
}

@media (max-width: 620px) {
  .overlay { padding: 12px; }
  .overlay--intro {
    padding:
      calc(7px + env(safe-area-inset-top, 0px))
      calc(7px + env(safe-area-inset-right, 0px))
      calc(7px + env(safe-area-inset-bottom, 0px))
      calc(7px + env(safe-area-inset-left, 0px));
  }

  .overlay--result {
    padding:
      calc(10px + env(safe-area-inset-top, 0px))
      calc(10px + env(safe-area-inset-right, 0px))
      calc(10px + env(safe-area-inset-bottom, 0px))
      calc(10px + env(safe-area-inset-left, 0px));
  }

  .overlay--result .result-card {
    width: min(430px, 100%);
    padding: 16px;
    border-radius: 20px;
  }

  .overlay--result .result-badge {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    font-size: 23px;
    box-shadow: 0 4px 0 #d48d2d;
  }

  .overlay--result .result-card h2 {
    margin: 3px 0 5px;
    font-size: clamp(26px, 9vw, 36px);
  }

  .overlay--result .result-card > p:not(.eyebrow) {
    font-size: 12px;
    line-height: 1.45;
  }

  .overlay--result .result-stats {
    gap: 6px;
    margin: 12px 0;
  }

  .overlay--result .result-stat {
    padding: 8px 4px;
    border-radius: 10px;
  }

  .overlay--result .result-stat--waves {
    padding: 10px 6px;
  }

  .overlay--result .result-stat--waves strong {
    font-size: clamp(25px, 9vw, 36px);
  }

  .overlay--result .result-actions {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .overlay--result .result-actions button {
    min-height: 44px;
    padding: 8px 10px;
  }

  .wave-action-card .primary-button--wave {
    min-height: 52px;
    height: 52px;
    padding: 7px 14px;
  }

  .intro-card {
    display: grid;
    width: min(460px, 100%);
    height: 100%;
    min-height: 0;
    max-height: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(145px, 42%) minmax(0, 58%);
    grid-auto-flow: row;
    overflow: hidden;
  }

  .intro-art {
    min-height: 0;
    height: 100%;
  }

  .intro-xiaoda--lead { bottom: -6%; width: 126px; }
  .intro-xiaoda--magic { left: 4%; bottom: -7%; width: 84px; }
  .intro-xiaoda--paperball { right: 2%; bottom: -7%; width: 86px; }
  .intro-xiaoda--super { top: 1%; left: 2%; width: 72px; }

  .intro-wensheng--origin { top: 1%; right: 1%; width: 88px; }
  .intro-wensheng--guitar { top: 25%; right: 4%; width: 78px; }
  .intro-wensheng--demon { top: 1%; left: 34%; width: 80px; }
  .intro-wensheng--plank { top: 25%; left: -2%; width: 90px; }

  .intro-copy {
    min-height: 0;
    justify-content: center;
    padding: clamp(10px, 2.4vh, 18px);
  }
  .intro-copy h1 { margin: 3px 0 5px; font-size: clamp(32px, 10vw, 42px); }
  .intro-lead { font-size: 11px; line-height: 1.35; }
  .intro-steps { grid-template-columns: repeat(3, 1fr); gap: 5px; margin: clamp(7px, 1.5vh, 12px) 0; }
  .intro-step { align-items: flex-start; gap: 5px; }
  .intro-step > strong { width: 24px; height: 24px; border-radius: 8px; }
  .intro-step small { display: none; }
  .difficulty-actions { gap: 6px; }
  .difficulty-button { min-height: 52px; padding: 8px 9px; border-radius: 12px; }
  .difficulty-button b { font-size: 13px; }
  .difficulty-button small { font-size: 8px; }
  .difficulty-button svg { width: 17px; height: 17px; }
  .intro-music-control { margin-top: 7px; padding: 5px 8px; }
  .offline-note { margin-top: 5px; font-size: 8px; }

  .control-panel { padding: 14px; }
  .sound-volume-control { width: 72px; }
  .status-card { padding: 8px; }
  .status-card__icon { display: none; }
  .tower-list { grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); }
  .tower-card { min-height: 84px; }
  .selection-card { min-height: 84px; }
}

/*
 * 手機直向模式：完整 1:1 戰場佔滿螢幕寬度，控制列自然接在下方，
 * 全頁只使用一個垂直捲動容器，避免內外兩條捲軸互相搶操作。
 */
@media (max-width: 620px) and (orientation: portrait) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
  }

  .page-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .game-frame {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  .battlefield {
    width: 100%;
    min-height: auto;
    align-self: stretch;
    flex: 0 0 auto;
    aspect-ratio: 1;
    border-right: 1px solid rgba(111, 87, 56, 0.28);
    border-left: 1px solid rgba(111, 87, 56, 0.28);
  }

  #gameCanvas {
    touch-action: none;
  }

  .control-panel {
    min-height: 0;
    flex: 0 0 auto;
    gap: 4px;
    padding:
      6px
      calc(7px + env(safe-area-inset-right, 0px))
      calc(6px + env(safe-area-inset-bottom, 0px))
      calc(7px + env(safe-area-inset-left, 0px));
    overflow: visible;
  }

  .panel-header {
    min-height: 32px;
    height: 32px;
    gap: 4px;
  }

  .mini-brand {
    gap: 4px;
  }

  .mini-brand__mark {
    width: 31px;
    height: 31px;
    border-width: 2px;
    border-radius: 9px;
    box-shadow: 0 2px 0 #9b6728, inset 0 1px 0 rgba(255, 255, 255, 0.45);
  }

  .mini-brand__face {
    width: 22px;
    height: 22px;
    border-width: 1px;
    border-radius: 6px;
    font-size: 10px;
  }

  .mini-brand__plane {
    right: -5px;
    top: -5px;
    font-size: 14px;
  }

  .quick-controls {
    gap: 3px;
  }

  .sound-setting {
    height: 32px;
    gap: 1px;
    padding-right: 3px;
    border-radius: 10px;
  }

  .sound-setting .icon-button,
  .quick-controls > .icon-button,
  .restart-control > .icon-button {
    width: 31px;
    height: 31px;
    padding: 7px;
    border-radius: 10px;
  }

  .sound-volume-stack {
    gap: 0;
  }

  .sound-volume-control {
    width: 61px;
    grid-template-columns: 10px minmax(25px, 1fr) 21px;
    gap: 1px;
  }

  .sound-volume-control > span,
  .sound-volume-control output {
    font-size: 7px;
  }

  .sound-volume-control input {
    height: 12px;
  }

  .wave-action-card {
    gap: 4px;
  }

  .wave-action-card .primary-button--wave {
    min-height: 36px;
    height: 36px;
    padding: 4px 10px;
    border-radius: 10px;
    box-shadow: 0 2px 0 #a76724, 0 4px 12px rgba(42, 28, 14, 0.18);
  }

  .primary-button--wave small {
    font-size: 7px;
  }

  .primary-button--wave strong {
    font-size: 13px;
  }

  .wave-action-card .speed-button {
    width: 43px;
    min-height: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .wave-action-card .speed-button svg {
    width: 16px;
    height: 16px;
  }

  .wave-action-card .speed-button span {
    font-size: 10px;
  }

  .status-grid {
    gap: 4px;
  }

  .status-card {
    min-height: 38px;
    padding: 4px 6px;
    border-radius: 9px;
  }

  .status-card small {
    margin-bottom: 2px;
    font-size: 7px;
  }

  .status-card strong {
    font-size: 17px;
  }

  .shop {
    gap: 3px;
    padding: 4px;
    border-radius: 10px;
  }

  .section-heading {
    min-height: 19px;
  }

  .section-kicker {
    display: none;
  }

  .section-heading h2,
  .selected-panel h2 {
    font-size: 12px;
  }

  .keyboard-tip,
  .upgrade-section__tip {
    font-size: 7px;
  }

  .upgrade-section__tip {
    padding: 2px 5px;
  }

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

  .tower-card,
  .tower-card.is-selected,
  .tower-card[aria-pressed="true"],
  .tower-card.is-expanded,
  .tower-card[aria-expanded="true"] {
    grid-column: auto;
    grid-template-columns: minmax(0, 1fr);
    min-height: 54px;
    height: 54px;
    gap: 0;
    padding: 2px;
    border-left-width: 3px;
    border-radius: 8px;
    text-align: center;
  }

  .tower-card.is-selected,
  .tower-card[aria-pressed="true"] {
    box-shadow: 0 0 0 2px rgba(50, 120, 83, 0.25);
  }

  .tower-card__copy,
  .tower-card.is-selected .tower-card__copy,
  .tower-card[aria-pressed="true"] .tower-card__copy,
  .tower-card.is-expanded .tower-card__copy,
  .tower-card[aria-expanded="true"] .tower-card__copy {
    display: none;
  }

  .tower-portrait,
  .tower-card.is-selected .tower-portrait,
  .tower-card[aria-pressed="true"] .tower-portrait,
  .tower-card.is-expanded .tower-portrait,
  .tower-card[aria-expanded="true"] .tower-portrait {
    width: 100%;
    min-width: 0;
    height: 48px;
    border-radius: 6px;
  }

  .tower-card.is-selected .tower-portrait::after,
  .tower-card[aria-pressed="true"] .tower-portrait::after {
    top: 1px;
    left: 1px;
    width: 15px;
    height: 15px;
    border-width: 1px;
    font-size: 9px;
  }

  .tower-card__price {
    top: 2px;
    right: 2px;
    min-height: 15px;
    gap: 1px;
    padding: 1px 3px;
    border-radius: 5px;
    font-size: 8px;
    line-height: 1;
  }

  .tower-card__price i {
    min-width: 17px;
    height: 10px;
    padding: 0 1px;
    font-size: 5px;
  }

  .wave-card {
    gap: 2px;
    padding: 4px 5px;
    border-radius: 9px;
  }

  .wave-card .section-heading {
    min-height: 17px;
  }

  .wave-number {
    padding: 2px 6px;
    font-size: 7px;
  }

  .enemy-preview {
    min-height: 20px;
  }

  .enemy-chip {
    gap: 3px;
    padding: 3px 6px;
    font-size: 7px;
  }

  .enemy-chip i {
    width: 9px;
    height: 9px;
  }

  .enemy-chip i::after {
    left: 1px;
    bottom: -4px;
    width: 6px;
    height: 4px;
  }

  .upgrade-section {
    gap: 2px;
  }

  .selection-card {
    min-height: 34px;
    border-radius: 9px;
  }

  .empty-selection {
    min-height: 34px;
    gap: 6px;
    padding: 4px 7px;
  }

  .empty-selection > span {
    width: 25px;
    height: 25px;
  }

  .empty-selection svg {
    width: 17px;
    height: 17px;
  }

  .empty-selection strong {
    font-size: 10px;
  }

  .empty-selection small {
    display: none;
  }

  .selected-panel {
    gap: 3px;
    padding: 4px 6px;
  }

  .selected-panel h2 small {
    display: inline;
    margin: 0 0 0 4px;
    font-size: 7px;
  }

  .selected-stats {
    display: none;
  }

  .upgrade-list {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .upgrade-button--final {
    grid-column: 1 / -1;
  }

  .upgrade-button {
    min-height: 47px;
    gap: 4px;
    align-items: flex-start;
    padding: 5px 6px;
    border-radius: 7px;
  }

  .upgrade-button__icon { display: none; }

  .upgrade-button strong,
  .upgrade-button > b {
    font-size: 12px;
  }

  .upgrade-button small {
    display: block;
    margin-top: 2px;
    color: #64756c;
    font-size: 11px;
    font-weight: 750;
    line-height: 1.3;
  }

  .character-info-card {
    right: 7px;
    bottom: calc(7px + env(safe-area-inset-bottom, 0px));
    left: 7px;
    max-height: calc(100% - 14px);
    padding: 12px;
    border-radius: 12px;
  }

  .character-info-card__heading {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 5px;
  }

  .character-info-card__role {
    font-size: 11px;
    line-height: 1.15;
  }

  .character-info-card h2 {
    font-size: 20px;
    line-height: 1.08;
  }

  .character-info-card__header-stats {
    grid-template-columns: repeat(2, minmax(54px, 1fr));
    gap: 4px;
  }

  .character-info-card__header-stats span {
    min-height: 40px;
    padding: 5px 6px;
    border-radius: 8px;
    font-size: 9px;
  }

  .character-info-card__header-stats b {
    font-size: 13px;
  }

  .character-info-card__close {
    padding: 5px 7px;
    font-size: 10px;
  }

  .character-info-card > p {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.35;
  }

  .character-info-card__stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-top: 7px;
  }

  .character-info-card__stats span {
    padding: 7px;
    border-radius: 7px;
    font-size: 10px;
  }

  .character-info-card__stats b {
    font-size: 15px;
  }

  .character-info-card > .character-info-card__upgrade {
    padding-top: 6px;
    font-size: 11px;
    line-height: 1.35;
  }

  .sell-button {
    min-height: 44px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .control-panel.has-tower-selection .wave-card {
    display: none;
  }

  .panel-spacer,
  .panel-footer {
    display: none;
  }
}

@media (max-width: 460px) {
  .mini-brand > div:last-child { display: none; }
}

@media (max-width: 620px) and (max-height: 650px) {
  .intro-card { grid-template-rows: minmax(120px, 38%) minmax(0, 62%); }
  .intro-lead,
  .offline-note { display: none; }
  .intro-steps { margin: 5px 0; }
  .intro-music-control { margin-top: 5px; }
}

/* 手機主頁面板本身必須是滾動容器；不可被上面的遊戲版型覆蓋成 hidden。 */
@media (max-width: 620px) {
  .intro-card.intro-card--home {
    display: block;
    width: min(620px, 100%);
    height: auto;
    min-height: 0;
    max-height: calc(100dvh - 14px);
    grid-template: none;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }

  .home-panel--about { gap: 14px; }
  .home-panel--about .about-character-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px 9px;
  }
  .home-panel--about .about-character-image { min-height: 130px; }
  .home-panel--about .about-character-image img { height: 92px; }
  .home-panel--about .about-character-image::after { font-size: 12px; }
  .about-author { padding: 12px 13px; font-size: 14px; }
  .about-open-hint { font-size: 13px; }

  #difficultyPanel { gap: 20px; }
  #difficultyPanel > h2 { font-size: clamp(31px, 9vw, 38px); }
  #difficultyPanel .game-mode-section { gap: 12px; margin-top: 18px; }
  #difficultyPanel .game-mode-section__heading h3 { font-size: 21px; }
  #difficultyPanel .game-mode-section__heading p { font-size: 14px; line-height: 1.45; }
  #difficultyPanel .difficulty-button { min-height: 80px; }
  #difficultyPanel .difficulty-button b { font-size: 18px; }
  #difficultyPanel .difficulty-button small { font-size: 12px; line-height: 1.35; }
  #difficultyPanel .special-mode-card { grid-template-columns: 90px minmax(0, 1fr); min-height: 98px; }
  #difficultyPanel .special-mode-copy { gap: 5px; padding: 11px 12px; }
  #difficultyPanel .special-mode-copy > b { font-size: 18px; }
  #difficultyPanel .special-mode-copy small { font-size: 13px; line-height: 1.42; }

  .character-gallery__description { max-height: none; font-size: 14px; }
  .character-gallery__stage { min-width: 100%; min-height: 100%; }
}

/* 覆蓋較早的窄螢幕面板高度：增益／血脈只讓外層主頁滾動，避免雙重滾動條。 */
@media (max-width: 420px) {
  .home-panel--benefits,
  .home-panel--bloodline {
    max-height: none;
    overflow: visible;
  }
}

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

/* 達之路：單一大型點選頁；節點內容由 game.js 動態生成。 */
.home-panel--talents {
  width: min(760px, 100%);
  max-height: none;
  gap: 18px;
  padding: clamp(18px, 3vw, 32px);
  background: linear-gradient(160deg, #fffdf5 0%, #f1edff 100%);
}

.home-panel--talents .home-panel-back,
.talent-reset,
.talent-category-card,
.talent-path-list button {
  min-height: 52px;
  font-size: 18px;
  font-weight: 800;
  touch-action: manipulation;
}

.talent-heading { align-items: center; }
.talent-heading h2 { font-size: clamp(34px, 5vw, 52px); line-height: 1; }
.talent-intro { margin: 8px 0 0; color: #4e5872; font-size: 19px; font-weight: 700; }
.talent-heading__mark { width: 70px; height: 70px; border-radius: 22px; font-size: 36px; }

.talent-category-grid {
  display: grid;
  width: min(520px, 100%);
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  justify-self: center;
}

.talent-category-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 2px solid #b9afd9;
  border-radius: 18px;
  background: #fff;
  color: #312663;
  cursor: pointer;
  font-size: inherit;
  line-height: 1.25;
  text-align: left;
  box-shadow: 0 4px 0 rgba(79, 61, 145, .18);
}
.talent-category-card__cover { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: #edf0f5; }
.talent-category-card__copy { display: grid; gap: 6px; padding: 14px 16px 16px; text-align: left; }
.talent-category-card__copy strong { color: inherit; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.1; }
.talent-category-card__copy > span { color: #5f6381; font-size: 16px; font-weight: 700; line-height: 1.35; }
.talent-category-card--stage { border-color: #8dc3ad; color: #1f654f; }
.talent-category-card--effects { border-color: #e2b579; color: #85501f; }
.talent-category-card:focus-visible,
.talent-reset:focus-visible,
.home-panel--talents .home-panel-back:focus-visible,
.talent-path-list button:focus-visible { outline: 4px solid #2e88de; outline-offset: 3px; }

.talent-resource-grid { gap: 10px; }
.talent-resource-grid article { min-height: 84px; padding: 13px 8px; border-width: 2px; }
.talent-resource-grid small { font-size: 15px; }
.talent-resource-grid strong { font-size: clamp(28px, 4vw, 38px); }
.talent-reset-row { grid-template-columns: minmax(220px, auto) minmax(0, 1fr); gap: 12px; padding: 12px; }
.talent-reset { min-height: 52px; padding: 10px 16px; font-size: 18px; }
.talent-reset-row small { font-size: 15px; font-weight: 750; }
.talent-completed { font-size: 20px; }
.talent-live { min-height: 24px; font-size: 17px; }

.talent-path-list--vertical { display: grid; grid-template-columns: 1fr; gap: 16px; }
.talent-path-list--vertical > * { min-width: 0; }
.talent-path-list--vertical .talent-path { grid-template-columns: 1fr; }
.talent-path-list--vertical .talent-path-node { min-height: 72px; }
.talent-path-list--vertical .talent-route-card__body,
.talent-path-list--vertical .talent-node {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.3;
}
.talent-path-list--vertical .talent-node__action {
  display: grid;
  gap: 12px;
  min-height: 0;
  padding: 16px;
  font-size: 18px;
  line-height: 1.45;
}
.talent-path-list--vertical .talent-node__action p {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}
.talent-path-list--vertical .talent-node__action button {
  min-height: 60px;
  padding: 10px 14px;
  border: 2px solid #fff;
  border-radius: 13px;
  background: #fff;
  color: #2b2964;
  font-size: 18px;
  font-weight: 900;
}

@media (max-width: 620px) {
  .home-panel--talents { max-height: none; gap: 14px; padding: 18px 14px; }
  .home-panel--talents .home-panel-back,
  .talent-reset,
  .talent-category-card,
  .talent-path-list button { min-height: 52px; font-size: 17px; }
  .talent-heading h2 { font-size: 38px; }
  .talent-intro { font-size: 17px; }
  .talent-heading__mark { width: 58px; height: 58px; border-radius: 18px; font-size: 30px; }
  .talent-category-grid { gap: 12px; }
  .talent-category-card__copy { padding: 12px 14px 14px; }
  .talent-category-card__copy strong { font-size: 22px; }
  .talent-category-card__copy > span { font-size: 16px; }
  .talent-resource-grid article { min-height: 76px; padding: 10px 4px; }
  .talent-resource-grid small { font-size: 13px; }
  .talent-resource-grid strong { font-size: 28px; }
  .talent-reset-row { grid-template-columns: 1fr; }
  .talent-reset-row small { font-size: 14px; }
  .talent-completed { font-size: 18px; }
  .talent-path-list--vertical .talent-route-card__body,
  .talent-path-list--vertical .talent-node { font-size: 18px; }
  .talent-path-list--vertical .talent-node__action p { font-size: 17px; }
  .talent-path-list--vertical .talent-node__action button { min-height: 56px; font-size: 17px; }
}

/* v75 達之路裝備：三類各五件保持平排，小圖不建立任何內層捲軸。 */
.home-panel--talents {
  width: min(900px, 100%);
  max-height: none;
  overflow: visible;
  gap: 14px;
  padding: clamp(16px, 2.4vw, 26px);
}
.talent-heading h2 { font-size: clamp(30px, 4vw, 42px); }
.talent-intro { max-width: 650px; font-size: 16px; }
.talent-heading__mark { width: 58px; height: 58px; border-radius: 18px; font-size: 30px; }
.talent-resource-grid article { min-height: 70px; padding: 10px 7px; }
.talent-resource-grid small { font-size: 13px; }
.talent-resource-grid strong { font-size: clamp(24px, 3vw, 32px); }

.talent-exchange-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, auto);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 2px solid rgba(154, 105, 31, .24);
  border-radius: 15px;
  background: linear-gradient(145deg, #fffdf4, #f5e8c8);
}
.talent-exchange-card > div { display: grid; min-width: 0; gap: 3px; }
.talent-exchange-card small { color: #8b652b; font-size: 12px; font-weight: 900; }
.talent-exchange-card h3 { margin: 0; color: #74511e; font-size: 17px; }
.talent-exchange-card p { margin: 0; color: #675a42; font-size: 13px; font-weight: 750; }
.talent-exchange-card button {
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid #946322;
  border-radius: 11px;
  background: linear-gradient(145deg, #c18b39, #86591e);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
}
.talent-exchange-card button:disabled { border-color: #c9c3b5; background: #e3dfd5; color: #817d74; cursor: not-allowed; }

.talent-total-effects {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 2px solid rgba(50, 114, 79, .2);
  border-radius: 15px;
  background: linear-gradient(145deg, #fbfff9, #e7f3e4);
}
.talent-total-effects h3 { margin: 0; color: #285f46; font-size: 18px; }
.talent-total-effects__list { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.talent-total-effect {
  padding: 6px 9px;
  border: 1px solid rgba(43, 111, 76, .22);
  border-radius: 999px;
  background: #fff;
  color: #315f49;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
}
.talent-total-effects__empty { margin: 0; color: #607468; font-size: 13px; font-weight: 750; }

.talent-path-list { display: grid; min-width: 0; gap: 12px; overflow: visible; }
.talent-equipment-category {
  --equipment-main: #386f83;
  --equipment-soft: #e9f4f6;
  display: grid;
  min-width: 0;
  gap: 9px;
  padding: 12px;
  border: 2px solid color-mix(in srgb, var(--equipment-main) 28%, white);
  border-radius: 16px;
  background: color-mix(in srgb, var(--equipment-soft) 56%, white);
}
.talent-equipment-category--accessory { --equipment-main: #8a5c27; --equipment-soft: #fff1d9; }
.talent-equipment-category--charm { --equipment-main: #6d4e9f; --equipment-soft: #f0e9ff; }
.talent-equipment-category__heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.talent-equipment-category__heading h3 { margin: 0; color: var(--equipment-main); font-size: 21px; }
.talent-equipment-category__heading p { margin: 0; color: #65726c; font-size: 12px; font-weight: 750; text-align: right; }
.talent-equipment-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; min-width: 0; }
.talent-path-list .talent-equipment-card {
  display: grid;
  min-width: 0;
  min-height: 0;
  align-content: start;
  justify-items: center;
  gap: 3px;
  padding: 7px 5px;
  border: 2px solid color-mix(in srgb, var(--equipment-main) 20%, white);
  border-radius: 12px;
  background: #fff;
  color: #4e5d56;
  cursor: pointer;
  font: inherit;
  line-height: 1.15;
  text-align: center;
}
.talent-path-list .talent-equipment-card:hover,
.talent-path-list .talent-equipment-card:focus-visible,
.talent-path-list .talent-equipment-card.is-selected { border-color: var(--equipment-main); outline: none; box-shadow: 0 3px 0 color-mix(in srgb, var(--equipment-main) 25%, white); transform: translateY(-1px); }
.talent-path-list .talent-equipment-card.is-owned { background: linear-gradient(145deg, #fff, color-mix(in srgb, var(--equipment-soft) 70%, white)); color: var(--equipment-main); }
.talent-path-list .talent-equipment-card.is-locked { opacity: .58; }
.talent-equipment-card__art-box { display: grid; width: min(72px, 100%); aspect-ratio: 1; place-items: center; overflow: hidden; border-radius: 10px; background: color-mix(in srgb, var(--equipment-soft) 72%, white); }
.talent-equipment-card__art { display: block; width: 100%; height: 100%; object-fit: contain; }
.talent-equipment-card small { color: var(--equipment-main); font-size: 11px; font-weight: 950; }
.talent-equipment-card strong { display: -webkit-box; overflow: hidden; color: inherit; font-size: 12px; font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.talent-equipment-card em { color: #63736b; font-size: 10px; font-style: normal; font-weight: 800; }
.talent-equipment-card.is-owned em { color: #28704b; }

.talent-equipment-detail {
  position: relative;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) minmax(180px, auto);
  align-items: center;
  gap: 12px;
  margin-top: 2px;
  padding: 12px 42px 12px 12px;
  border: 2px solid color-mix(in srgb, var(--equipment-main) 38%, white);
  border-radius: 14px;
  background: #fff;
}
.talent-equipment-detail__art-button { display: grid; width: 86px; height: 86px; padding: 0; place-items: center; overflow: hidden; border: 0; border-radius: 11px; background: var(--equipment-soft); cursor: zoom-in; }
.talent-equipment-detail__art-button:hover,
.talent-equipment-detail__art-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--equipment-main) 42%, white); outline-offset: 2px; }
.talent-equipment-detail__art-button img { display: block; width: 100%; height: 100%; object-fit: contain; }
.talent-equipment-detail__copy { display: grid; min-width: 0; gap: 4px; }
.talent-equipment-detail__copy h4 { margin: 0; color: var(--equipment-main); font-size: 17px; }
.talent-equipment-detail__copy p { margin: 0; color: #53645b; font-size: 13px; font-weight: 700; line-height: 1.4; }
.talent-equipment-detail__copy .talent-equipment-detail__effect { color: #244f3b; font-weight: 900; }
.talent-path-list .talent-equipment-detail__action {
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--equipment-main);
  border-radius: 11px;
  background: var(--equipment-main);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
}
.talent-path-list .talent-equipment-detail__action:disabled { border-color: #c8cfca; background: #e7ebe8; color: #738079; cursor: not-allowed; }
.talent-path-list .talent-equipment-detail__close { position: absolute; top: 7px; right: 7px; width: 30px; min-height: 30px; padding: 0; border: 0; border-radius: 50%; background: #edf0ee; color: #4a5851; cursor: pointer; font: inherit; font-size: 21px; font-weight: 900; line-height: 1; }

@media (max-width: 620px) {
  .home-panel--talents { gap: 11px; padding: 16px 12px; }
  .talent-heading h2 { font-size: 34px; }
  .talent-intro { font-size: 15px; }
  .talent-exchange-card { grid-template-columns: 1fr; gap: 8px; }
  .talent-exchange-card button { width: 100%; }
  .talent-equipment-category { gap: 7px; padding: 9px 7px; }
  .talent-equipment-category__heading { align-items: flex-start; flex-direction: column; gap: 1px; }
  .talent-equipment-category__heading h3 { font-size: 19px; }
  .talent-equipment-category__heading p { font-size: 11px; text-align: left; }
  .talent-equipment-grid { gap: 4px; }
  .talent-path-list .talent-equipment-card { min-height: 0; gap: 2px; padding: 5px 2px; font-size: 10px; }
  .talent-equipment-card__art-box { width: min(48px, 100%); border-radius: 8px; }
  .talent-equipment-card small { font-size: 9px; }
  .talent-equipment-card strong { font-size: 9px; line-height: 1.16; }
  .talent-equipment-card em { font-size: 8px; }
  .talent-equipment-detail { grid-template-columns: 66px minmax(0, 1fr); gap: 9px; padding: 10px 38px 10px 10px; }
  .talent-equipment-detail__art-button { width: 66px; height: 66px; }
  .talent-equipment-detail__copy h4 { font-size: 15px; }
  .talent-equipment-detail__copy p { font-size: 12px; }
  .talent-path-list .talent-equipment-detail__action { grid-column: 1 / -1; width: 100%; min-height: 44px; font-size: 13px; }
}
