/* Shared visual layer for the five existing game screens. */
:root {
  --bg: #eef2ef;
  --paper: #fafcfb;
  --paper-2: #eef2ef;
  --panel: #fafcfb;
  --ink: #253c36;
  --muted: #657870;
  --line: #ced9d2;
  --accent: #aa5147;
  --accent-2: #2b6356;
  --jade: #2b6356;
  --gold: #a78951;
  --red: #aa5147;
  --shadow: rgba(24, 55, 44, .09);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0;
}

button, input, select, textarea, a { font: inherit; letter-spacing: 0; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, .return-link, .map-return-link {
  transition: background-color .18s, border-color .18s, box-shadow .18s, color .18s;
}
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 4px;
}
button:disabled { opacity: .5; cursor: not-allowed; }
button:hover { filter: none; }
select, input, textarea {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}
* { scrollbar-width: thin; scrollbar-color: #a7bcb0 transparent; }
h1, h2, .name, .stick-text, .wheel-item strong, .wheel-core strong, .gate-door strong {
  font-family: "STZhongsong", "Noto Serif SC", "SimSun", serif;
  letter-spacing: 0;
}
.map-app, .town-app, .sect-app, .dungeon-app, .app {
  width: min(1680px, calc(100% - 64px));
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 0 32px;
}
.topbar, .town-header, .sect-header, .dungeon-header, .hero {
  min-height: 118px;
  padding: 22px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
.topbar h1, .town-header h1, .sect-header h1, .dungeon-header h1, .hero h1 {
  font-size: 32px;
  line-height: 1.3;
  margin: 0;
}
.eyebrow, .topbar .eyebrow, .hero .eyebrow {
  font-size: 11px;
  color: var(--accent);
  margin: 0 0 7px;
}
.hero { position: relative; display: block; }
.hero-actions { position: absolute; right: 0; bottom: 24px; margin: 0; }
.return-link, .map-return-link, button.ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  border-radius: 4px;
  box-shadow: none;
  padding: 9px 16px;
}
.return-link:hover, .map-return-link:hover, button.ghost:hover {
  background: #e0e9e3;
  border-color: #8da899;
}
.panel, .map-stage, .lot-area, .wheel-panel, .gate-panel, .feature-panel, .action-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  min-width: 0;
}
.panel h2 { font-size: 18px; margin: 0 0 18px; }
.status-pill {
  min-width: 0;
  border: 1px solid #bfd1c5;
  background: #e3eee7;
  color: #315c47;
  padding: 9px 16px;
  font-size: 12px;
}

/* Atlas: keep the original artwork, give it the space of an actual map. */
.page-map .layout { grid-template-columns: 218px minmax(0, 1fr) 236px; gap: 26px; }
.page-map .panel { padding: 0 0 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.page-map .browser-grid { grid-template-columns: 1fr; gap: 20px; }
.page-map .browser-grid h3 { color: var(--accent); font-size: 12px; margin-bottom: 8px; }
.page-map .list { max-height: 190px; gap: 2px; }
.page-map .list button {
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  padding: 8px 10px;
  line-height: 1.6;
  font-size: 12px;
}
.page-map .list button:hover { background: #e4ece6; }
.page-map .list button.active { background: #dbe8df; border-left-color: var(--jade); color: #245241; }
.page-map .crumb { border: 0; padding: 3px 6px; background: #e2eae4; font-size: 11px; }
.page-map .field { gap: 8px; }
.map-stage { padding: 0; min-height: 0; }
.stage-head { min-height: 100px; padding: 0 0 16px; gap: 16px; }
.stage-head h2 { font-size: 23px; }
.stage-head p { font-size: 12px; line-height: 1.8; max-width: 580px; }
#centerCurrentBtn { flex-shrink: 0; font-size: 12px; padding: 7px 10px; border: 1px solid var(--line); background: transparent; }
.region-canvas, .region-canvas.county-canvas {
  min-height: 680px;
  margin-top: 0;
  border: 1px solid #b9c5b7;
  background: linear-gradient(#f0f5ef38, #f0f5ef38), url("../../assets/map/底图2.png") center / cover;
  box-shadow: none;
  isolation: isolate;
}
.region-canvas::before, .region-canvas.county-canvas::before { background: none; }
.region-canvas.county-canvas::after { border-color: #7c8d722e; }
.region-node.map-node {
  width: 140px;
  min-height: 88px;
  padding: 14px 8px;
  border: 1px solid #658775;
  border-top: 3px solid #416956;
  border-radius: 3px;
  background: #f8faf1ed;
  box-shadow: 0 6px 14px #29403415;
}
.region-node.map-node .name { font-size: 21px; }
.region-node.map-node .meta { color: #68745e; font-size: 11px; }
.region-node.map-node:hover { background: #fffef5; border-color: #aa5147; box-shadow: 0 8px 20px #29403422; }
.region-node.image-node {
  width: min(190px, 35%);
  height: 190px;
  min-height: 190px;
  background: transparent;
  border: 0;
}
.region-node.image-node img { height: 142px; flex-shrink: 0; filter: drop-shadow(0 7px 6px #223a3333); }
.region-node.image-node::before, .region-node.image-node::after { content: none; }
.region-node.image-node .node-caption {
  max-width: 100%;
  min-width: 96px;
  margin: 4px 0 0;
  padding: 4px 10px;
  border: 1px solid #829782;
  background: #f6f9efed;
  box-shadow: 0 2px 5px #20362b16;
  border-radius: 3px;
}
.region-node.image-node.current .node-caption { background: #295b49; border-color: #295b49; color: #fff; }
.region-node.image-node.current .meta { color: #d2e2d4; }
.region-node.image-node.selected:not(.current) .node-caption { border-color: #ad5247; box-shadow: 0 0 0 2px #ad524733; }
.region-node.image-node:hover img { filter: drop-shadow(0 9px 7px #223a334d); }
.county-canvas .edge { background: #607059; opacity: .35; height: 1px; }
.county-canvas .edge.route { background: #ae5947; height: 3px; opacity: .85; box-shadow: none; }
.sect-node {
  top: 18px; right: 18px; width: 154px; min-height: 0;
  padding: 10px 12px; border: 1px solid #74937d; border-radius: 3px;
  background: #edf3e8f0; box-shadow: none; z-index: 3;
}
.sect-seal { width: 23px; height: 23px; line-height: 23px; border-radius: 2px; }
.sect-node strong { font-size: 13px; }
.sect-node span:not(.sect-seal) { font-size: 10px; }
.route-strip { padding: 12px 0; margin-top: 0; }
.route-step { border: 0; background: #e1eae3; font-size: 11px; }
.page-map .detail { font-size: 12px; line-height: 2; min-height: 0; }
.page-map .detail strong { display: inline-block; font-size: 18px; margin-bottom: 8px; }
.neighbor { background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 10px 0; font-size: 12px; }
.neighbor.enterable { background: transparent; color: var(--jade); }
.progress { height: 5px; border: 0; background: #dbe3dc; }
.progress div { background: var(--jade); }
.movement-line { flex-wrap: wrap; font-size: 11px; }
.move-actions button { padding: 10px 6px; border: 1px solid #bccdbf; background: transparent; font-size: 12px; border-radius: 3px; }
#moveBtn { background: var(--jade); border-color: var(--jade); color: #fff; }

/* Destination screens retain their distinct physical motifs. */
.town-layout, .sect-layout, .dungeon-layout { grid-template-columns: minmax(0, 1fr) 310px; gap: 40px; }
.town-header p, .sect-header p, .dungeon-header p { margin-bottom: 0; }
.lot-area, .wheel-panel, .gate-panel { min-height: 600px; padding: 0; }
.lot-backdrop {
  min-height: 600px;
  border: 0;
  background: linear-gradient(#edf4efc9, #edf4efe6), url("../../assets/map/底图2.png") center / cover;
}
.lot-title { padding: 22px 26px; border-bottom: 1px solid #8aa38b33; }
.stick-rack { min-height: 455px; padding: 48px 20px 80px; gap: 18px; flex-wrap: nowrap; }
.fortune-stick {
  flex: 0 1 80px;
  min-width: 0;
  height: 328px;
  border: 1px solid #53645233;
  border-radius: 40px 40px 5px 5px;
  box-shadow: 0 10px 15px #29423418, inset 0 0 0 4px #ffffff40;
}
.fortune-stick:nth-child(1) { background: #d4e0cc; color: #375340; }
.fortune-stick:nth-child(2) { background: #eee0b3; color: #6a5529; }
.fortune-stick:nth-child(3) { background: #e8c4b7; color: #783f39; }
.fortune-stick:nth-child(4) { background: #bbd7d5; color: #305d5d; }
.fortune-stick:nth-child(5) { background: #c5cee0; color: #4a5677; }
.fortune-stick:nth-child(6) { background: #d8d0b9; color: #62583c; }
.fortune-stick.active, .fortune-stick:hover { box-shadow: 0 16px 20px #29423420, inset 0 0 0 4px #ffffff80; }
.stick-text { font-size: 22px; }
.lot-box { bottom: 52px; height: 54px; border-radius: 4px; background: #3c6657; border: 1px solid #224b3e; box-shadow: 0 12px 20px #29423420; pointer-events: none; }
.lot-box span { height: 2px; background: #bdc9a866; top: 24px; }
.feature-panel, .action-panel { padding: 30px 0 0 28px; border-left: 1px solid var(--line); }
.panel-kicker { font-size: 11px; color: var(--accent); }
.feature-panel h2, .action-panel h2 { font-size: 28px; margin-top: 16px; }
.feature-panel p, .action-panel p { font-size: 13px; line-height: 1.9; }
.feature-tags span { border: 0; background: #dfeae2; color: #416653; border-radius: 2px; }
#enterFeatureBtn, #featureBtn, #actionBtn { border: 1px solid var(--line); background: #e1e8e2; color: #64776a; border-radius: 4px; }
.wheel-panel { background: linear-gradient(#edf4efbf, #edf4efd9), url("../../assets/map/底图2.png") center / cover; }
.wheel {
  width: min(530px, 92%);
  background: #e5ede1b3;
  border: 1px solid #8eaa95;
  box-shadow: inset 0 0 0 16px #edf3e6, inset 0 0 0 17px #98af94;
}
.wheel::before { inset: 24%; width: auto; height: auto; border: 1px dashed #6c8b6f80; border-radius: 50%; background: none; transform: none; }
.wheel::after { content: none; }
.wheel-core { width: 132px; height: 132px; background: #2e5a49; border: 6px double #91ac8d; box-shadow: none; color: #f4f7eb; }
.wheel-core strong { font-size: 16px; max-width: 110px; }
.wheel-core span { background: transparent; border: 1px solid #b7c9a2; border-radius: 2px; width: 28px; height: 28px; line-height: 28px; font-size: 13px; }
.wheel-item { width: 130px; min-height: 84px; border-radius: 4px; border-color: #acbfaa; background: #f7faf0; box-shadow: 0 4px 12px #27433212; }
.wheel-item.active, .wheel-item:hover { background: #fff; border-color: #a95246; box-shadow: 0 0 0 3px #a9524614; }
.item-library { top: 7%; }
.item-training { right: 8%; bottom: 17%; }
.item-hall { left: 8%; bottom: 17%; }
.gate-panel { position: relative; background: linear-gradient(#edf4ef77, #edf4efb3), url("../../assets/map/底图2.png") center / cover; }
.dungeon-art { width: 92%; height: 480px; object-fit: contain; filter: drop-shadow(0 20px 15px #213b352b); }
.gate-panel.has-art .gate { display: none; }
.gate { width: min(460px, 85%); }
.dungeon-action { border: 0; border-left: 3px solid transparent; border-bottom: 1px solid var(--line); background: transparent; border-radius: 0; box-shadow: none; padding: 18px 16px; }
.dungeon-action strong { font-size: 16px; }
.dungeon-action span { font-size: 12px; }
.dungeon-action.active, .dungeon-action:hover { background: #ddeae1; border-left-color: var(--jade); box-shadow: none; }

/* Battle: use the element colors as information, with calmer chrome. */
.page-battle .bg { background: none; }
.page-battle .grid { grid-template-columns: 300px minmax(0, 1fr); gap: 28px; }
.page-battle .panel { padding: 20px 0; border-top: 1px solid var(--line); }
.page-battle .grid > .panel { border-top: 0; }
.page-battle button { border-radius: 4px; background: var(--jade); }
.page-battle button.ghost { background: #e1e9e3; }
.page-battle .btn-row button { font-size: 12px; }
.page-battle .row > select { width: auto; flex: 1 1 120px; }
.page-battle .row > label { max-width: 100%; }
.page-battle .deck-wrap { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; }
.page-battle .deck-wrap > div { min-width: 0; overflow-x: auto; }
.page-battle table { border: 0; background: #fafcfb; }
.page-battle th { background: #e1eae4; font-weight: 500; white-space: nowrap; }
.page-battle td { border-bottom-color: var(--line); }
.page-battle .pool { background: transparent; border: 0; border-radius: 0; padding: 0 8px 0 0; max-height: 380px; }
.page-battle .card-row { background: #fafcfb; border: 1px solid #d7e1da; border-radius: 4px; padding: 12px; margin-bottom: 8px; }
.page-battle .card-row:hover { border-color: #839f90; }
.page-battle .card-row button { flex-shrink: 0; font-size: 12px; }
.page-battle .card-meta { line-height: 1.7; }
.page-battle .arena { margin-top: 24px; }
.battle-status { border: 0; border-left: 3px solid #648574; border-radius: 0; background: #e1ebe4; padding: 12px 16px; }
.arena-stage-vertical { padding: 20px; background: linear-gradient(#f3f7f0df, #f3f7f0df), url("../../assets/map/底图2.png") center / cover; border: 1px solid #c4d2c4; border-radius: 4px; }
.team-panel, .team-panel.enemy, .team-panel.ally { border-radius: 4px; background: #fbfdf9e8; border: 1px solid #c7d6cb; box-shadow: none; }
.team-panel.enemy { border-left: 3px solid #b87369; }
.team-panel.ally { border-left: 3px solid #5b8a74; }
.team-panel::before { background: none; }
.unit-avatar { border-radius: 4px; border-color: #aebfae; letter-spacing: 0; box-shadow: inset 0 0 0 4px #ffffff26; }
.arena-divider { border-radius: 0; background: transparent; border-color: #78917c4d; }
.center-fx { font-family: "SimSun", serif; color: var(--accent); }
.orbit-card { border-radius: 4px; box-shadow: 0 3px 5px #20372d1f; border-color: #9cae9e; }
.orbit-card.fire { background: #f4e0d9; --card-energy: #bd6956; }
.orbit-card.water { background: #dbeaf0; --card-energy: #4a90ad; }
.orbit-card.wood { background: #dfebd9; --card-energy: #659251; }
.orbit-card.metal { background: #eeead8; --card-energy: #a9994b; }
.orbit-card.earth { background: #e9dfd1; --card-energy: #9a7a55; }
.orbit-card .card-name { font-family: "SimSun", serif; font-size: 18px; line-height: 1.4; }
.orbit-card .cooldown-mask { background: var(--card-energy, #679978); border: 0; box-shadow: 0 0 5px var(--card-energy, #679978); animation: none; }
.orbit-card .cooldown-mask::before { content: none; }
.card-top-badge, .card-bottom-badge { border-radius: 3px; box-shadow: none; }
.tech-chip, .unit-state-chip, .dot-pool-chip, .s-card { border-radius: 4px; }
.live-log { background: #f8fbf9; border-color: var(--line); border-radius: 4px; }
.guide-modal { border-radius: 6px; background: #f7faf7; }
.guide-head { background: #e2ece4; }
.guide-card, .guide-nav-item { border-radius: 4px; box-shadow: none; }
.guide-nav-item.active { background: #dce9df; border-color: #96ad9a; }
.arena-tooltip { border-radius: 5px; }

@media (max-width: 1250px) {
  .page-map .layout { grid-template-columns: 190px minmax(0, 1fr); }
  .page-map .inspector { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .page-battle .deck-wrap { grid-template-columns: minmax(0, 1fr); }
  .town-layout, .sect-layout, .dungeon-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; }
  .stick-rack { gap: 12px; }
  .feature-panel, .action-panel { padding-left: 20px; }
}
@media (max-width: 900px) {
  .town-layout, .sect-layout, .dungeon-layout, .page-battle .grid { grid-template-columns: minmax(0, 1fr); }
  .feature-panel, .action-panel { padding: 24px 0; border-left: 0; border-top: 1px solid var(--line); }
  .page-battle .unit-top { grid-template-columns: 96px minmax(0, 1fr); }
  .unit-avatar, .unit-avatar-wrap { width: 96px; height: 96px; }
  .unit-techniques { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .map-app, .town-app, .sect-app, .dungeon-app, .app { width: calc(100% - 28px); }
  .topbar, .town-header, .sect-header, .dungeon-header, .hero { min-height: 100px; margin-bottom: 18px; gap: 14px; }
  .hero-actions { position: static; margin-top: 16px; }
  .page-map .layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .page-map .map-stage { grid-row: 1; }
  .page-map .inspector { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .page-map .browser-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stage-head { flex-wrap: wrap; min-height: 0; }
  .region-canvas, .region-canvas.county-canvas { min-height: 630px; }
  .region-node.map-node { width: 28%; min-height: 100px; padding: 10px 4px; }
  .region-node.map-node .name { font-size: 16px; }
  .region-node.map-node .meta { font-size: 10px; overflow-wrap: anywhere; }
  .region-node.image-node { width: 40%; height: 174px; min-height: 174px; }
  .region-node.image-node img { height: 120px; }
  .region-node.image-node .name { font-size: 13px; }
  .sect-node { top: 12px; right: 12px; width: 134px; }
  .lot-area, .wheel-panel, .gate-panel { min-height: 420px; }
  .lot-backdrop { min-height: 620px; }
  .stick-rack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 16px; padding: 36px 24px 90px; }
  .fortune-stick { width: 100%; height: 200px; border-radius: 30px 30px 4px 4px; }
  .fortune-stick.active { transform: translateY(-8px); }
  .fortune-stick:hover { transform: translateY(-4px); }
  .stick-text { font-size: 18px; }
  .lot-box { bottom: 20px; }
  .wheel { width: 96%; }
  .wheel-core { width: 96px; height: 96px; gap: 4px; }
  .wheel-core strong { max-width: 76px; font-size: 12px; }
  .wheel-item { width: 88px; min-height: 68px; padding: 8px 4px; }
  .wheel-item strong { font-size: 16px; margin-bottom: 2px; }
  .wheel-item span { font-size: 11px; }
  .item-library { top: 4%; }
  .item-hall { left: 6%; bottom: 15%; }
  .item-training { right: 6%; bottom: 15%; }
  .dungeon-art { height: 370px; }
  .gate { height: 380px; }
  .gate-door { width: 65%; height: 260px; padding: 20px; }
  .gate-door span { max-width: 100%; }
  .arena-stage-vertical { padding: 8px; }
  .page-battle .unit-top { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; }
  .unit-avatar, .unit-avatar-wrap { width: 76px; height: 86px; font-size: 12px; }
  .unit-orbit { overflow-x: auto; padding-bottom: 8px; }
  .orbit-card { flex-shrink: 0; min-width: 86px; }
  .page-battle .guide-body { grid-template-columns: 1fr; overflow: auto; }
  .guide-nav { max-height: 170px; border-bottom: 1px solid var(--line); }
  .guide-content { overflow: visible; padding: 16px; }
  .guide-head { padding: 16px; }
  .guide-head h2 { font-size: 22px; }
  .guide-kv { grid-template-columns: 90px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
