:root {
  color-scheme: dark;
  --ink: #080614;
  --ink-soft: #100b21;
  --panel: rgba(22, 17, 40, 0.94);
  --panel-soft: rgba(34, 25, 57, 0.88);
  --panel-bright: #201a35;
  --line: rgba(129, 103, 205, 0.28);
  --line-strong: rgba(111, 211, 222, 0.42);
  --gold: #f3c856;
  --gold-soft: #ffe4a0;
  --cyan: #62d9de;
  --blue: #5d9ee8;
  --violet: #ac70ff;
  --red: #ee5361;
  --green: #64d074;
  --text: #f2ecff;
  --muted: #aaa4be;
  --subtle: #77718b;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
  --round: 18px;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-width: 320px; min-height: 100%; background: var(--ink); }

body { color: var(--text); overflow-x: hidden; }

button, input, textarea { font: inherit; }

button { color: inherit; }

button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

button[disabled] { cursor: not-allowed; opacity: 0.5; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-root { min-height: 100svh; }

.start-screen {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 32px;
  overflow: hidden;
  isolation: isolate;
  background: #090715 url("./assets/cover-horizontal.webp") center / cover no-repeat;
}

.start-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 36%, rgba(43, 237, 221, 0.12), transparent 28%),
    linear-gradient(90deg, rgba(4, 4, 14, 0.78), rgba(4, 4, 14, 0.12) 48%, rgba(4, 4, 14, 0.72));
}

.start-screen::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 38%;
  z-index: -1;
  background: linear-gradient(transparent, rgba(5, 4, 13, 0.94));
}

.start-card {
  width: min(430px, 100%);
  margin-left: min(48vw, 560px);
  padding: 34px 34px 30px;
  text-align: center;
  border: 1px solid rgba(95, 222, 224, 0.34);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(12, 11, 30, 0.78), rgba(20, 13, 38, 0.93));
  box-shadow: 0 0 0 1px rgba(250, 206, 93, 0.06), 0 26px 70px rgba(0, 0, 0, 0.5), 0 0 48px rgba(75, 198, 218, 0.11);
  backdrop-filter: blur(12px);
  animation: float-card 8s ease-in-out infinite;
}

.seal {
  width: 116px;
  height: 116px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(253, 207, 91, 0.08), 0 0 36px rgba(253, 207, 91, 0.32);
}

.start-card h1 {
  margin: 24px 0 8px;
  color: var(--gold-soft);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 500;
  letter-spacing: 0.12em;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(105, 56, 26, 0.8), 0 0 24px rgba(247, 201, 80, 0.2);
}

.start-motto {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  color: var(--cyan);
  font-size: 1.05rem;
}

.start-motto::before, .start-motto::after {
  content: "";
  width: 50px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan));
}

.start-motto::after { transform: scaleX(-1); }

.start-copy {
  margin: 34px 0 28px;
  color: #b2adc1;
  font-size: 0.98rem;
  line-height: 1.8;
}

.start-button, .primary-button {
  min-height: 50px;
  padding: 0 30px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(100deg, #35b4d2, #9762f0);
  box-shadow: 0 8px 24px rgba(84, 153, 231, 0.28);
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}

.start-button { width: 100%; font-size: 1.1rem; letter-spacing: .08em; }

.start-button:hover, .primary-button:hover { filter: brightness(1.1); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(84, 153, 231, 0.38); }

.start-note { margin: 18px 0 0; color: var(--subtle); font-size: .82rem; }

.game-shell {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  max-width: 1440px;
  margin: 0 auto;
  background: var(--ink);
}

.top-hud {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 92px;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(75, 183, 205, 0.19);
  background: linear-gradient(180deg, rgba(17, 16, 38, .99), rgba(11, 9, 25, .96));
  box-shadow: 0 9px 26px rgba(0, 0, 0, .18);
}

.player-head { display: flex; align-items: center; gap: 12px; min-width: 0; }

.mini-seal {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid rgba(244, 198, 85, .56);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 18px rgba(87, 221, 218, .16);
}

.player-name { color: var(--gold); font-size: 1.2rem; line-height: 1.1; white-space: nowrap; }

.player-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(242, 196, 74, .4);
  border-radius: 8px;
  color: #e4bb55;
  background: rgba(116, 80, 22, .18);
  font-size: .78rem;
  white-space: nowrap;
}

.badge.green { color: var(--green); border-color: rgba(99, 212, 116, .46); background: rgba(20, 98, 52, .18); }
.badge.violet { color: #ef9de8; border-color: rgba(232, 107, 215, .42); background: rgba(145, 44, 126, .17); }

.hud-right { display: flex; align-items: center; gap: 18px; }

.vitals { min-width: 170px; }

.hp-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: var(--green); font-size: .83rem; }

.heart { color: #f13e5c; font-size: 1.25rem; line-height: 1; }

.hp-track { width: 110px; height: 9px; overflow: hidden; border-radius: 999px; background: rgba(73, 65, 85, .68); }

.hp-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3dae64, #69d25e); transition: width .35s ease; }

.resource-pills { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

.resource-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(239, 190, 78, .37);
  border-radius: 999px;
  color: var(--gold-soft);
  background: rgba(61, 45, 16, .44);
  font-size: .86rem;
}

.resource-pill.stamina { color: #8fe8e6; border-color: rgba(98, 217, 222, .36); background: rgba(14, 71, 73, .3); }

.game-main { position: relative; flex: 1; min-height: 0; overflow: hidden; }

.screen-view { height: 100%; overflow: auto; scrollbar-color: #4d436e #100c20; scrollbar-width: thin; }

.screen-view::-webkit-scrollbar { width: 8px; height: 8px; }
.screen-view::-webkit-scrollbar-thumb { background: #4d436e; border-radius: 999px; }
.screen-view::-webkit-scrollbar-track { background: #100c20; }

.bottom-nav {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  min-height: 78px;
  border-top: 1px solid rgba(75, 183, 205, .18);
  background: rgba(10, 8, 24, .98);
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  color: #777284;
  background: transparent;
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}

.nav-item:hover { color: #d7ceef; background: rgba(75, 64, 117, .16); }
.nav-item.active { color: var(--cyan); background: linear-gradient(180deg, rgba(30, 39, 70, .06), rgba(28, 62, 89, .28)); }
.nav-item.active::before { content: ""; position: absolute; top: -1px; left: 26%; right: 26%; height: 3px; border-radius: 0 0 5px 5px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); }
.nav-icon { font-size: 1.58rem; line-height: 1; filter: saturate(.82); }
.nav-label { font-size: .86rem; }
.nav-badge { position: absolute; top: 10px; margin-left: 32px; display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 999px; color: white; background: #ef4753; font-size: .7rem; }

.nav-item.explore .nav-icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin-top: -23px;
  border: 2px solid rgba(172, 112, 255, .85);
  border-radius: 50%;
  background: #1a1138;
  box-shadow: 0 0 0 7px #0a0818, 0 0 26px rgba(120, 89, 237, .44);
}
.nav-item.explore .nav-label { margin-top: -1px; }
.nav-item.explore.active .nav-icon { border-color: var(--gold); box-shadow: 0 0 0 7px #0a0818, 0 0 28px rgba(244, 201, 79, .4); }

.map-screen { position: relative; height: 100%; min-height: 540px; overflow: hidden; }

.map-stage {
  position: relative;
  min-height: max(540px, calc(100svh - 172px));
  overflow: hidden;
  background: #111021 url("./assets/map-desktop.webp") center / cover no-repeat;
}

.map-stage.alt { background-image: url("./assets/map-alt.webp"); }

.map-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 7, 22, .4) 0%, transparent 20%, transparent 66%, rgba(8, 6, 19, .76) 100%);
  pointer-events: none;
}

.map-topline {
  position: absolute;
  z-index: 2;
  top: 16px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  pointer-events: none;
}

.map-title { margin: 0; color: #ffda68; font-size: 1.4rem; font-weight: 500; text-shadow: 0 2px 8px #0a0716; }
.map-subtitle { margin: 5px 0 0; color: rgba(247, 244, 255, .76); font-size: .86rem; }

.glass-button, .ghost-button, .chip, .side-button, .icon-button {
  border: 1px solid rgba(165, 144, 223, .28);
  border-radius: 999px;
  color: #d7d0e9;
  background: rgba(20, 16, 40, .72);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background .2s ease, transform .2s ease;
}

.glass-button:hover, .ghost-button:hover, .chip:hover, .side-button:hover, .icon-button:hover { color: white; border-color: rgba(98, 217, 222, .58); background: rgba(25, 25, 55, .9); transform: translateY(-1px); }

.glass-button { min-height: 36px; padding: 0 14px; pointer-events: auto; }
.glass-button.on { color: var(--cyan); border-color: rgba(98, 217, 222, .58); }

.map-node {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 1px solid rgba(248, 215, 130, .65);
  border-radius: 50%;
  color: #fff1b0;
  background: rgba(13, 10, 30, .52);
  box-shadow: 0 0 0 4px rgba(6, 6, 18, .28), 0 0 24px rgba(249, 199, 75, .28);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.map-node::after { content: ""; position: absolute; inset: -9px; border: 1px solid rgba(117, 224, 224, .28); border-radius: 50%; animation: node-ring 3s ease-out infinite; }
.map-node:hover { transform: translate(-50%, -50%) scale(1.1); border-color: var(--cyan); box-shadow: 0 0 0 5px rgba(24, 193, 197, .22), 0 0 30px rgba(98, 217, 222, .6); }
.map-node.locked { color: #bab2c6; border-color: rgba(183, 177, 193, .36); background: rgba(24, 19, 39, .62); box-shadow: 0 0 0 4px rgba(5, 4, 16, .28), 0 0 15px rgba(10, 8, 24, .5); }
.map-node.locked::after { border-color: rgba(183, 177, 193, .15); animation: none; }
.map-node.selected { border-color: var(--gold); background: rgba(119, 78, 19, .7); box-shadow: 0 0 0 6px rgba(245, 195, 78, .2), 0 0 32px rgba(245, 195, 78, .62); }
.node-symbol { font-size: 1.34rem; line-height: 1; }
.node-hint { position: absolute; top: 53px; min-width: 100px; color: #fff2c1; font-size: .78rem; text-shadow: 0 2px 6px #000; white-space: nowrap; }
.map-node.locked .node-hint { color: #d4cedc; }

.n-town { left: 64%; top: 72%; }
.n-forest { left: 35%; top: 77%; }
.n-ancient { left: 49%; top: 76%; }
.n-marsh { left: 26%; top: 55%; }
.n-volcano { left: 44%; top: 52%; }
.n-thunder { left: 64%; top: 49%; }
.n-ice { left: 81%; top: 55%; }
.n-sea { left: 23%; top: 36%; }
.n-cloud { left: 75%; top: 35%; }
.n-star { left: 28%; top: 64%; }

.map-chat {
  position: absolute;
  z-index: 3;
  left: 20px;
  bottom: 175px;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 2px solid rgba(105, 221, 226, .75);
  border-radius: 50%;
  color: #bdf8ff;
  background: linear-gradient(145deg, #42c5dd, #5d4fb9);
  box-shadow: 0 0 24px rgba(52, 196, 220, .42);
  cursor: pointer;
  font-size: 1.55rem;
}

.zone-sheet {
  position: absolute;
  z-index: 3;
  right: 20px;
  bottom: 20px;
  width: min(450px, calc(100% - 106px));
  padding: 17px 18px 16px;
  border: 1px solid rgba(210, 174, 77, .36);
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(14, 11, 29, .82), rgba(34, 22, 49, .9));
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.zone-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.zone-title { margin: 0; color: var(--gold-soft); font-size: 1.23rem; font-weight: 500; }
.zone-kicker { margin: 5px 0 0; color: var(--muted); font-size: .84rem; }
.zone-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 13px 0; }
.stat-pill { padding: 5px 9px; border-radius: 8px; color: #d8d1ed; background: rgba(255,255,255,.08); font-size: .8rem; }
.stat-pill.safe { color: #9be8a6; background: rgba(48, 141, 73, .2); }
.stat-pill.warn { color: #ffb5a8; background: rgba(169, 54, 59, .22); }
.zone-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.zone-actions button { flex: 1 1 125px; min-height: 40px; }
.primary-button { min-height: 42px; padding: 0 16px; }
.primary-button.gold { color: #2a1a05; background: linear-gradient(100deg, #efbe4f, #ffdf88); box-shadow: 0 7px 20px rgba(236, 181, 66, .21); }
.primary-button.red { background: linear-gradient(100deg, #b63f49, #e26056); }
.ghost-button { min-height: 42px; padding: 0 16px; }
.cost { display: block; margin-top: 2px; color: #8b839b; font-size: .7rem; }

.panel-page { padding: 24px clamp(16px, 3vw, 38px) 34px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.eyebrow { margin: 0 0 6px; color: var(--cyan); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; }
.page-heading h2 { margin: 0; color: var(--gold); font-size: clamp(1.55rem, 3vw, 2rem); font-weight: 500; }
.page-heading p { margin: 6px 0 0; color: var(--muted); font-size: .92rem; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.section-panel {
  border: 1px solid var(--line);
  border-radius: var(--round);
  background: linear-gradient(145deg, rgba(29, 21, 50, .94), rgba(17, 13, 31, .96));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .16);
}

.market-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); gap: 16px; }
.market-main { padding: 17px; }
.market-side { padding: 18px; }
.tabs { display: flex; gap: 7px; padding: 5px; border: 1px solid rgba(166, 134, 223, .18); border-radius: 13px; background: rgba(8, 6, 18, .48); }
.tab-button { flex: 1; min-height: 38px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; }
.tab-button.active { color: #251700; background: linear-gradient(100deg, #edbb4b, #f4d57a); }
.market-banner { position: relative; min-height: 118px; margin: 15px 0; overflow: hidden; display: flex; align-items: end; padding: 18px; border: 1px solid rgba(101, 222, 221, .32); border-radius: 16px; background: #151127 url("./assets/map-desktop.webp") center 52% / cover; }
.market-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 8, 20, .85), rgba(12, 8, 26, .3)); }
.market-banner > div { position: relative; z-index: 1; }
.market-banner h3 { margin: 0; color: var(--gold-soft); font-size: 1.45rem; font-weight: 500; }
.market-banner p { margin: 5px 0 0; color: #d0c6d7; font-size: .88rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
.chip { min-height: 33px; padding: 0 12px; font-size: .82rem; }
.chip.active { color: #2b1b06; border-color: transparent; background: var(--gold); }
.search-box { width: 100%; min-height: 42px; padding: 0 13px; border: 1px solid rgba(163, 150, 192, .33); border-radius: 10px; color: var(--text); background: rgba(8, 7, 18, .64); }
.search-box::placeholder, .text-input::placeholder { color: #77728a; }
.offer-list { display: grid; gap: 9px; margin-top: 15px; }
.offer-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid rgba(147, 120, 209, .2); border-radius: 13px; background: rgba(30, 23, 48, .76); }
.item-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.07); font-size: 1.5rem; }
.offer-title { color: #ede6fc; font-size: .96rem; }
.offer-meta { margin-top: 4px; color: var(--subtle); font-size: .78rem; }
.offer-price { display: flex; align-items: center; gap: 7px; color: var(--gold); font-size: .9rem; }
.buy-button { min-height: 34px; padding: 0 11px; border: 1px solid rgba(99, 207, 220, .36); border-radius: 8px; color: var(--cyan); background: rgba(21, 91, 104, .18); cursor: pointer; }
.buy-button:hover { background: rgba(29, 120, 133, .32); }
.balance-card { padding: 16px; border: 1px solid rgba(241, 190, 68, .29); border-radius: 14px; background: rgba(68, 47, 12, .23); }
.balance-label { color: var(--muted); font-size: .8rem; }
.balance-value { margin-top: 5px; color: var(--gold-soft); font-size: 1.55rem; }
.side-title { margin: 20px 0 10px; color: var(--gold); font-size: 1rem; font-weight: 500; }
.side-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.side-list li { display: flex; justify-content: space-between; gap: 8px; padding: 9px 0; border-bottom: 1px solid rgba(145, 123, 194, .16); color: var(--muted); font-size: .86rem; }
.side-list strong { color: #e9e2f7; font-weight: 400; }
.stall-form { display: grid; gap: 9px; margin-top: 13px; }
.text-input, .text-area, .select-input { min-height: 42px; width: 100%; padding: 0 12px; border: 1px solid rgba(160, 144, 196, .3); border-radius: 10px; color: var(--text); background: rgba(7, 6, 17, .65); }
.text-area { min-height: 76px; padding-top: 10px; resize: vertical; }

.alchemy-banner { position: relative; min-height: 132px; display: flex; align-items: end; padding: 19px; margin-bottom: 14px; overflow: hidden; border: 1px solid rgba(162, 104, 226, .4); border-radius: 17px; background: #171027 url("./assets/alchemy-strip.webp") center / cover; }
.alchemy-banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12, 8, 25, .82), rgba(40, 20, 51, .42)); }
.alchemy-banner > div { position: relative; z-index: 1; }
.alchemy-banner h3 { margin: 0; color: #f5dd9c; font-size: 1.5rem; font-weight: 500; }
.alchemy-banner p { margin: 5px 0 0; color: #b4a7c5; font-size: .86rem; }
.recipe-grid { display: grid; gap: 10px; }
.recipe-card { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid rgba(144, 110, 213, .24); border-radius: 14px; background: rgba(28, 21, 47, .85); }
.recipe-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; color: #ffd776; background: rgba(119, 61, 116, .32); font-size: 1.85rem; }
.recipe-name { color: #ede6fb; font-size: 1rem; }
.recipe-desc { margin-top: 4px; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.ingredients { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.ingredient { padding: 4px 7px; border-radius: 6px; color: #b9b0cc; background: rgba(255,255,255,.07); font-size: .73rem; }
.ingredient.missing { color: #ff8b8f; background: rgba(169, 53, 61, .18); }
.craft-button { min-width: 83px; min-height: 38px; padding: 0 10px; border: 1px solid rgba(164, 111, 232, .5); border-radius: 9px; color: #e9d2ff; background: rgba(106, 53, 163, .28); cursor: pointer; }
.craft-button.ready { color: #2d1c03; border-color: transparent; background: linear-gradient(100deg, #eab84a, #f5d984); }
.craft-progress { margin-top: 10px; }
.progress-row { display: flex; justify-content: space-between; margin-bottom: 5px; color: var(--muted); font-size: .75rem; }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.09); }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #48ced4, #a163ff); transition: width .4s linear; }

.inventory-layout { display: grid; grid-template-columns: minmax(260px, .75fr) minmax(0, 1.25fr); gap: 16px; }
.equipment-panel { padding: 18px; }
.equip-title { margin: 0 0 14px; color: var(--gold); font-size: 1.1rem; font-weight: 500; }
.equip-slots { display: grid; gap: 10px; }
.equip-slot { display: flex; align-items: center; gap: 12px; min-height: 74px; padding: 9px 12px; border: 1px solid rgba(155, 133, 208, .26); border-radius: 13px; background: rgba(21, 17, 37, .7); }
.equip-symbol { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; color: #a8c9ff; background: rgba(69, 97, 156, .19); font-size: 1.72rem; }
.equip-slot.weapon .equip-symbol { color: #ff9086; background: rgba(151, 55, 57, .18); }
.equip-slot.ornament .equip-symbol { color: #d19dff; background: rgba(117, 57, 158, .2); }
.equip-label { color: var(--muted); font-size: .82rem; }
.equip-name { margin-top: 3px; color: #eee7fb; font-size: .96rem; }
.equip-empty { color: var(--subtle); }
.inventory-panel { padding: 18px; }
.inventory-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.inventory-count { color: var(--muted); font-size: .88rem; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 9px; }
.item-card { display: grid; grid-template-columns: 45px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 74px; padding: 9px; border: 1px solid rgba(143, 117, 205, .2); border-radius: 12px; color: inherit; text-align: left; background: rgba(30, 23, 49, .75); cursor: pointer; }
.item-card:hover { border-color: rgba(98, 217, 222, .54); background: rgba(35, 30, 62, .88); }
.item-card .item-icon { width: 45px; height: 45px; }
.item-name { color: #ece7f8; font-size: .86rem; }
.item-rarity { display: inline-block; margin-top: 3px; color: var(--subtle); font-size: .72rem; }
.item-qty { align-self: end; color: var(--gold); font-size: .9rem; }

.profile-layout { display: grid; grid-template-columns: 192px minmax(0, 1fr); gap: 16px; }
.profile-rail { align-self: start; display: grid; gap: 5px; padding: 9px; border: 1px solid var(--line); border-radius: 16px; background: rgba(25, 18, 43, .88); }
.profile-nav-button { min-height: 43px; border: 0; border-radius: 10px; color: var(--muted); text-align: left; background: transparent; cursor: pointer; }
.profile-nav-button:hover { color: white; background: rgba(93, 158, 232, .12); }
.profile-nav-button.active { color: var(--gold-soft); background: linear-gradient(90deg, rgba(104, 62, 165, .54), rgba(104, 62, 165, .13)); }
.profile-content { min-width: 0; }
.profile-hero { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 20px; border: 1px solid rgba(100, 211, 221, .34); border-radius: var(--round); background: radial-gradient(circle at 18% 50%, rgba(64, 181, 203, .14), transparent 32%), linear-gradient(145deg, #1b263d, #171329 70%); }
.profile-avatar { width: 105px; height: 105px; object-fit: cover; border-radius: 50%; border: 2px solid rgba(245, 201, 87, .65); box-shadow: 0 0 26px rgba(246, 201, 87, .24); }
.profile-hero h3 { margin: 0; color: #ffe5a2; font-size: 1.55rem; font-weight: 500; }
.profile-hero p { margin: 7px 0 0; color: var(--muted); font-size: .9rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.progress-card { margin-top: 13px; padding: 14px 16px; border: 1px solid rgba(143, 117, 207, .22); border-radius: 14px; background: rgba(26, 20, 44, .84); }
.progress-card .progress-row { font-size: .83rem; }
.progress-card .progress-track { height: 10px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-top: 13px; }
.small-stat { padding: 13px; border: 1px solid rgba(145, 123, 197, .2); border-radius: 12px; background: rgba(28, 22, 48, .78); }
.small-stat span { display: block; color: var(--muted); font-size: .77rem; }
.small-stat strong { display: block; margin-top: 5px; color: var(--gold-soft); font-size: 1.03rem; font-weight: 500; }
.journal { margin-top: 13px; padding: 16px; border: 1px solid rgba(145, 123, 197, .2); border-radius: 14px; background: rgba(20, 15, 35, .84); }
.journal h4 { margin: 0 0 10px; color: var(--gold); font-weight: 500; }
.journal-list { display: grid; gap: 8px; max-height: 180px; overflow: auto; }
.journal-entry { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(145, 123, 197, .14); color: var(--muted); font-size: .82rem; }
.journal-entry time { flex: 0 0 auto; color: var(--subtle); }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.skill-card { padding: 15px; border: 1px solid rgba(137, 110, 199, .25); border-radius: 14px; background: rgba(28, 21, 49, .8); }
.skill-card h4 { margin: 0; color: #eee4ff; font-weight: 500; }
.skill-card p { min-height: 42px; margin: 8px 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.skill-card .level { color: var(--cyan); font-size: .78rem; }
.skill-card button { width: 100%; margin-top: 12px; min-height: 35px; }
.heart-panel { padding: 20px; border: 1px solid rgba(241, 190, 76, .3); border-radius: 16px; background: linear-gradient(135deg, rgba(85, 47, 20, .25), rgba(28, 19, 47, .8)); }
.heart-panel h3 { margin: 0; color: var(--gold); font-size: 1.25rem; font-weight: 500; }
.heart-panel p { color: var(--muted); line-height: 1.7; }
.heart-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.heart-choice { min-height: 40px; padding: 0 15px; border: 1px solid rgba(237, 183, 69, .3); border-radius: 999px; color: #e8d3a2; background: rgba(80, 51, 16, .3); cursor: pointer; }
.heart-choice.active { color: #2d1b05; background: var(--gold); }
.mail-card { padding: 16px; border: 1px solid rgba(102, 155, 232, .35); border-radius: 14px; background: rgba(28, 37, 72, .43); }
.mail-card h3 { margin: 0; color: #a9ceff; font-weight: 500; }
.mail-card p { color: var(--muted); line-height: 1.6; }
.mail-list { display: grid; gap: 9px; margin-top: 12px; }
.mail-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border: 1px solid rgba(140, 121, 194, .2); border-radius: 10px; background: rgba(25, 19, 44, .72); }
.mail-row strong { display: block; color: #eee4fc; font-size: .9rem; font-weight: 400; }
.mail-row small { display: block; margin-top: 4px; color: var(--subtle); }

.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(3, 2, 10, .78); backdrop-filter: blur(7px); }
.modal-card { width: min(680px, 100%); max-height: min(86svh, 760px); overflow: auto; padding: 22px; border: 1px solid rgba(155, 135, 211, .42); border-radius: 20px; background: linear-gradient(145deg, #292c42, #171329 58%); box-shadow: 0 26px 90px rgba(0, 0, 0, .56); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 13px; border-bottom: 1px solid rgba(215, 207, 239, .13); }
.modal-head h2 { margin: 0; color: #f2e8ff; font-size: 1.32rem; font-weight: 500; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; font-size: 1.25rem; }
.modal-body { padding-top: 16px; }
.battle-scene { position: relative; overflow: hidden; min-height: 390px; padding: 18px; border: 1px solid rgba(239, 91, 76, .4); border-radius: 15px; background: #1b0c16 center / cover no-repeat; }
.battle-scene::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 6, 20, .26), rgba(20, 6, 16, .86)); }
.battle-scene > * { position: relative; z-index: 1; }
.battle-kicker { color: #ff9b85; font-size: .8rem; letter-spacing: .14em; }
.battle-enemy { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 54px; padding: 15px; border: 1px solid rgba(245, 114, 97, .42); border-radius: 14px; background: rgba(65, 20, 28, .65); }
.battle-enemy h3 { margin: 0; color: #ffe0c2; font-size: 1.38rem; font-weight: 500; }
.battle-enemy p { margin: 5px 0 0; color: #e6ae9e; font-size: .82rem; }
.enemy-mark { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid rgba(253, 130, 112, .5); border-radius: 50%; background: rgba(34, 7, 18, .72); font-size: 2rem; }
.battle-hp { margin-top: 12px; }
.battle-hp .progress-track { height: 10px; background: rgba(36, 4, 12, .76); }
.battle-hp .progress-fill { background: linear-gradient(90deg, #e04a4c, #ff9b58); }
.battle-log { min-height: 48px; margin: 14px 0; padding: 11px 12px; border-radius: 10px; color: #f0d8d2; background: rgba(13, 7, 18, .62); font-size: .86rem; line-height: 1.5; }
.battle-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.battle-actions button { min-height: 44px; }
.battle-result { display: grid; place-items: center; min-height: 310px; text-align: center; }
.battle-result strong { display: block; margin-top: 12px; color: var(--gold-soft); font-size: 1.6rem; font-weight: 500; }
.battle-result p { color: var(--muted); line-height: 1.7; }
.mail-detail { margin-top: 12px; padding: 15px; border-radius: 13px; background: rgba(20, 14, 39, .72); }
.mail-detail h3 { margin: 0; color: var(--gold-soft); font-weight: 500; }
.mail-detail p { color: #ded6e9; line-height: 1.7; }
.reward-list { display: grid; gap: 7px; margin-top: 10px; }
.reward { display: flex; justify-content: space-between; padding: 8px 11px; border-radius: 8px; color: #ded6e9; background: rgba(255,255,255,.06); }
.reward strong { color: var(--gold); font-weight: 500; }
.chat-drawer { position: fixed; z-index: 15; right: 18px; bottom: 92px; width: min(360px, calc(100% - 36px)); padding: 14px; border: 1px solid rgba(93, 207, 224, .44); border-radius: 18px; background: rgba(18, 15, 37, .96); box-shadow: var(--shadow); }
.chat-drawer h3 { margin: 0; color: var(--cyan); font-size: 1rem; font-weight: 500; }
.chat-messages { display: grid; gap: 8px; max-height: 190px; margin: 12px 0; overflow: auto; }
.chat-msg { max-width: 88%; padding: 8px 10px; border-radius: 10px; color: #ded7ec; background: rgba(255,255,255,.08); font-size: .82rem; line-height: 1.45; }
.chat-msg.me { justify-self: end; color: #e5faff; background: rgba(31, 119, 145, .35); }
.chat-form { display: flex; gap: 7px; }
.chat-form input { min-width: 0; flex: 1; min-height: 37px; padding: 0 10px; border: 1px solid rgba(157, 138, 205, .3); border-radius: 9px; color: white; background: rgba(7, 5, 16, .6); }
.chat-form button { min-height: 37px; padding: 0 11px; border: 0; border-radius: 9px; color: #1d1908; background: var(--gold); cursor: pointer; }
.toast-stack { position: fixed; z-index: 30; top: 106px; right: 20px; display: grid; gap: 8px; width: min(330px, calc(100% - 40px)); pointer-events: none; }
.toast { padding: 11px 13px; border: 1px solid rgba(94, 212, 221, .4); border-left: 4px solid var(--cyan); border-radius: 10px; color: #ece8f6; background: rgba(37, 38, 59, .96); box-shadow: var(--shadow); font-size: .83rem; animation: toast-in .25s ease both; }
.toast.gold { border-left-color: var(--gold); }
.toast.red { border-left-color: var(--red); }

.empty-state { padding: 32px 18px; border: 1px dashed rgba(148, 127, 194, .28); border-radius: 14px; color: var(--muted); text-align: center; }
.muted { color: var(--muted); }
.gold-text { color: var(--gold); }
.cyan-text { color: var(--cyan); }
.danger-text { color: var(--red); }

@keyframes float-card { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes node-ring { 0% { opacity: .58; transform: scale(.82); } 70%, 100% { opacity: 0; transform: scale(1.34); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }

@media (max-width: 900px) {
  .market-layout, .inventory-layout, .profile-layout { grid-template-columns: 1fr; }
  .profile-rail { display: flex; overflow-x: auto; padding: 6px; }
  .profile-nav-button { flex: 0 0 auto; min-width: 95px; text-align: center; }
  .market-side { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; align-items: start; }
  .market-side .side-title { margin-top: 0; }
}

@media (max-width: 640px) {
  .start-screen { padding: 16px; align-items: end; background-image: url("./assets/cover-vertical.webp"); background-position: center top; }
  .start-screen::before { background: linear-gradient(180deg, rgba(4,4,14,.08) 0%, rgba(4,4,14,.18) 34%, rgba(4,4,14,.92) 86%); }
  .start-card { margin: 0 0 5vh; padding: 26px 22px 22px; border-radius: 22px; }
  .seal { width: 88px; height: 88px; }
  .start-card h1 { margin-top: 15px; font-size: 2.35rem; }
  .start-copy { margin: 20px 0; font-size: .88rem; }
  .top-hud { min-height: 78px; padding: 10px 12px; gap: 9px; }
  .mini-seal { width: 40px; height: 40px; }
  .player-name { font-size: 1rem; }
  .player-badges { margin-top: 4px; gap: 3px; }
  .badge { min-height: 21px; padding: 0 6px; font-size: .7rem; }
  .hud-right { gap: 7px; }
  .vitals { min-width: 0; }
  .hp-row { gap: 5px; font-size: .72rem; }
  .hp-track { width: 65px; height: 7px; }
  .resource-pills { gap: 4px; margin-top: 5px; }
  .resource-pill { min-height: 26px; padding: 0 6px; font-size: .7rem; }
  .resource-pill.stamina { display: none; }
  .bottom-nav { min-height: 70px; }
  .nav-icon { font-size: 1.35rem; }
  .nav-label { font-size: .72rem; }
  .nav-badge { top: 6px; margin-left: 24px; min-width: 18px; height: 18px; font-size: .62rem; }
  .nav-item.explore .nav-icon { width: 58px; height: 58px; margin-top: -20px; }
  .map-stage { min-height: calc(100svh - 148px); background-image: url("./assets/map-vertical.webp"); background-position: center top; }
  .map-stage.alt { background-image: url("./assets/map-alt.webp"); }
  .map-topline { top: 12px; left: 13px; right: 13px; }
  .map-title { font-size: 1.1rem; }
  .map-subtitle { font-size: .75rem; }
  .glass-button { min-height: 32px; padding: 0 9px; font-size: .75rem; }
  .map-node { width: 42px; height: 42px; }
  .node-symbol { font-size: 1.05rem; }
  .node-hint { top: 45px; min-width: 80px; font-size: .68rem; }
  .n-town { left: 57%; top: 79%; }
  .n-forest { left: 26%; top: 77%; }
  .n-ancient { left: 42%; top: 76%; }
  .n-marsh { left: 24%; top: 58%; }
  .n-volcano { left: 46%; top: 58%; }
  .n-thunder { left: 65%; top: 54%; }
  .n-ice { left: 83%; top: 60%; }
  .n-sea { left: 20%; top: 35%; }
  .n-cloud { left: 79%; top: 34%; }
  .n-star { left: 27%; top: 67%; }
  .map-chat { left: 12px; bottom: 220px; width: 50px; height: 50px; font-size: 1.3rem; }
  .zone-sheet { right: 11px; bottom: 12px; width: calc(100% - 74px); padding: 12px; }
  .zone-title { font-size: 1rem; }
  .zone-kicker { font-size: .73rem; }
  .zone-stats { gap: 5px; margin: 9px 0; }
  .stat-pill { padding: 4px 6px; font-size: .68rem; }
  .zone-actions button { min-height: 36px; font-size: .8rem; }
  .battle-scene { min-height: 365px; padding: 13px; }
  .battle-enemy { margin-top: 32px; }
  .battle-enemy h3 { font-size: 1.08rem; }
  .enemy-mark { width: 52px; height: 52px; font-size: 1.55rem; }
  .battle-actions { grid-template-columns: 1fr; }
  .panel-page { padding: 17px 12px 25px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 13px; }
  .page-heading h2 { font-size: 1.45rem; }
  .page-heading p { font-size: .8rem; }
  .heading-actions { justify-content: flex-start; }
  .market-side { display: block; }
  .market-main, .market-side, .equipment-panel, .inventory-panel { padding: 13px; }
  .market-banner { min-height: 105px; margin: 11px 0; padding: 13px; }
  .market-banner h3, .alchemy-banner h3 { font-size: 1.18rem; }
  .market-banner p, .alchemy-banner p { font-size: .75rem; }
  .offer-card { grid-template-columns: 38px minmax(0, 1fr); gap: 8px; }
  .offer-card > .offer-price { grid-column: 2; justify-content: space-between; }
  .recipe-card { grid-template-columns: 42px minmax(0, 1fr); gap: 9px; }
  .recipe-icon { width: 42px; height: 42px; font-size: 1.45rem; }
  .recipe-card > .craft-button { grid-column: 2; justify-self: start; min-width: 100px; }
  .item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .item-card { grid-template-columns: 35px minmax(0, 1fr) auto; min-height: 64px; padding: 7px; gap: 6px; }
  .item-card .item-icon { width: 35px; height: 35px; font-size: 1.1rem; }
  .item-name { font-size: .76rem; }
  .item-rarity { font-size: .66rem; }
  .item-qty { font-size: .75rem; }
  .profile-hero { grid-template-columns: 66px minmax(0, 1fr); gap: 11px; padding: 13px; }
  .profile-avatar { width: 64px; height: 64px; }
  .profile-hero h3 { font-size: 1.16rem; }
  .profile-hero p { margin-top: 4px; font-size: .76rem; }
  .hero-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .small-stat { padding: 10px; }
  .small-stat strong { font-size: .93rem; }
  .modal-card { padding: 16px; border-radius: 16px; }
  .chat-drawer { right: 10px; bottom: 78px; width: calc(100% - 20px); }
  .toast-stack { top: 88px; right: 12px; width: calc(100% - 24px); }
}

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

.authentic-start .start-kicker {
  margin: 18px 0 0;
  color: var(--cyan);
  font-size: .72rem;
  letter-spacing: .16em;
}

.start-highlights {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 18px;
}

.start-highlights span {
  padding: 5px 9px;
  border: 1px solid rgba(106, 208, 218, .24);
  border-radius: 999px;
  color: #b3e9e8;
  background: rgba(23, 93, 101, .18);
  font-size: .72rem;
}

.start-demo {
  width: 100%;
  margin-top: 9px;
}

.authentic-map {
  background-image: url("./assets/map-authentic.webp");
  background-position: center 42%;
  background-size: cover;
}

.authentic-map.demon {
  background-image: url("./assets/map-demon.webp");
  background-position: center;
}

.authentic-map::before {
  background: linear-gradient(180deg, rgba(9, 7, 22, .35), transparent 18%, transparent 54%, rgba(8, 6, 19, .87) 100%);
}

.authentic-map.demon::before {
  background: linear-gradient(180deg, rgba(24, 3, 25, .5), transparent 20%, transparent 52%, rgba(13, 3, 18, .91) 100%);
}

.map-extra-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.side-button {
  min-height: 34px;
  padding: 0 11px;
  font-size: .78rem;
}

.map-note {
  margin-left: auto;
  font-size: .72rem;
}

.craft-panel {
  padding: 17px;
}

.craft-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 5px;
  border: 1px solid rgba(166, 134, 223, .18);
  border-radius: 13px;
  background: rgba(8, 6, 18, .48);
}

.craft-switch .tab-button {
  min-height: 40px;
}

.alchemy-banner.authentic-scene {
  background-position: center;
  background-size: cover;
}

.alchemy-banner.alchemy-scene {
  background-image: url("./assets/alchemy-scene.webp");
}

.alchemy-banner.forge-scene {
  background-image: url("./assets/forge-scene.webp");
}

.market-banner.market-scene {
  background-image: url("./assets/market-scene.webp");
  background-position: center;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.equipment-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 14px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, .045);
  font-size: .82rem;
}

.equipment-summary strong {
  color: var(--gold-soft);
  font-weight: 500;
}

.attribute-panel {
  margin-top: 13px;
  padding: 0 16px 16px;
  border: 1px solid rgba(145, 123, 197, .2);
  border-radius: 14px;
  background: rgba(20, 15, 35, .84);
}

.attribute-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.attribute-grid > div {
  display: grid;
  gap: 4px;
  padding: 10px 8px;
  border: 1px solid rgba(137, 117, 192, .2);
  border-radius: 10px;
  text-align: center;
  background: rgba(255, 255, 255, .045);
}

.attribute-grid span, .attribute-grid small {
  color: var(--muted);
  font-size: .72rem;
}

.attribute-grid strong {
  color: var(--gold-soft);
  font-size: 1.15rem;
  font-weight: 500;
}

.skill-icon {
  float: right;
  font-size: 1.7rem;
  filter: drop-shadow(0 0 10px rgba(98, 217, 222, .22));
}

.beast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 11px;
}

.beast-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(137, 110, 199, .25);
  border-radius: 14px;
  background: rgba(28, 21, 49, .8);
}

.beast-card img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 13px;
  border: 1px solid rgba(245, 201, 87, .4);
}

.beast-card h3 {
  margin: 3px 0 6px;
  color: var(--gold-soft);
  font-size: 1rem;
  font-weight: 500;
}

.beast-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .77rem;
}

.beast-card button {
  width: 100%;
  margin-top: 9px;
}

.equipment-detail, .tribulation-panel {
  padding: 18px;
}

.detail-list {
  display: grid;
  gap: 8px;
}

.detail-list > div {
  display: grid;
  grid-template-columns: 75px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(145, 123, 194, .15);
}

.detail-list span {
  color: var(--muted);
}

.detail-list strong {
  color: var(--gold-soft);
  font-weight: 500;
}

.detail-list small {
  grid-column: 2;
  color: var(--subtle);
  line-height: 1.5;
}

.tribulation-panel {
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 80% 10%, rgba(98, 217, 222, .12), transparent 30%), linear-gradient(145deg, rgba(38, 29, 66, .95), rgba(16, 12, 30, .96));
}

.tribulation-panel h3 {
  margin: 0;
  color: var(--gold);
  font-size: 1.3rem;
  font-weight: 500;
}

.tribulation-panel p {
  color: var(--muted);
  line-height: 1.8;
}

.tribulation-panel .progress-track {
  margin: 15px 0;
}

.tribulation-panel button {
  margin-right: 7px;
}

.tribulation-visual {
  float: right;
  color: #8ee4f3;
  font-size: 4rem;
  opacity: .8;
  text-shadow: 0 0 26px rgba(98, 217, 222, .5);
}

.special-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.special-card {
  min-height: 170px;
  padding: 18px;
}

.special-card h3 {
  margin: 0;
  color: var(--gold-soft);
  font-size: 1.05rem;
  font-weight: 500;
}

.special-card p {
  min-height: 44px;
  color: var(--muted);
  line-height: 1.6;
  font-size: .82rem;
}

.small-modal {
  width: min(480px, 100%);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.item-modal-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .055);
}

.item-modal-hero p {
  margin: 4px 0;
  color: var(--muted);
  line-height: 1.6;
}

.item-modal-hero .item-icon {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  font-size: 1.9rem;
}

.modal-submit {
  width: 100%;
  margin-top: 11px;
}

.awakening-backdrop {
  background: radial-gradient(circle at 50% 35%, rgba(77, 181, 211, .16), rgba(3, 2, 10, .86) 58%);
}

.awakening-modal {
  width: min(560px, 100%);
  text-align: center;
}

.awakening-modal .modal-head {
  justify-content: center;
  text-align: center;
}

.awakening-modal .eyebrow {
  margin-bottom: 5px;
}

.awakening-modal .modal-body > p {
  color: var(--muted);
  line-height: 1.8;
}

.awakening-orb {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin: 22px auto;
  border: 1px solid rgba(247, 201, 80, .65);
  border-radius: 50%;
  color: var(--gold-soft);
  background: radial-gradient(circle, rgba(83, 204, 222, .35), rgba(92, 45, 143, .4));
  box-shadow: 0 0 40px rgba(98, 217, 222, .25), inset 0 0 28px rgba(255, 226, 121, .16);
  font-size: 3.5rem;
}

.awakening-modal .primary-button {
  min-width: 220px;
}

.awakening-modal .ghost-button {
  display: block;
  margin: 17px auto 0;
}

.awakening-result {
  margin: 16px auto;
  padding: 14px;
  border: 1px solid rgba(242, 196, 74, .32);
  border-radius: 13px;
  color: var(--gold-soft);
  background: rgba(95, 64, 13, .21);
}

.draw-result.attribute-grid {
  margin: 17px 0;
}

.enemy-mark-image {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border: 1px solid rgba(253, 130, 112, .5);
  border-radius: 50%;
  background: rgba(34, 7, 18, .72);
}

.battle-player-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
  color: #bcebed;
  font-size: .78rem;
}

.battle-result-image {
  width: 105px;
  height: 105px;
  object-fit: cover;
  border: 2px solid rgba(245, 201, 87, .6);
  border-radius: 50%;
  box-shadow: 0 0 28px rgba(245, 201, 87, .24);
}

.ranking-list {
  display: grid;
  gap: 9px;
  margin-top: 15px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(147, 120, 209, .2);
  border-radius: 13px;
  background: rgba(30, 23, 48, .76);
}

.rank-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--gold-soft);
  background: rgba(202, 145, 46, .2);
}

.ranking-row strong, .ranking-row small {
  display: block;
}

.ranking-row strong {
  color: #eee7fb;
  font-weight: 500;
}

.ranking-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: .75rem;
}

.rank-score {
  color: var(--gold);
  font-size: .85rem;
}

.sect-grid {
  display: grid;
  gap: 9px;
}

.sect-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 11px;
  padding: 12px;
  border: 1px solid rgba(143, 117, 205, .22);
  border-radius: 13px;
  background: rgba(30, 23, 49, .74);
}

.sect-card.current {
  border-color: rgba(98, 217, 222, .55);
  background: rgba(27, 73, 81, .2);
}

.sect-icon, .garden-icon, .special-icon {
  display: grid;
  place-items: center;
  font-size: 1.75rem;
}

.sect-card h3, .garden-card h3 {
  margin: 0;
  color: var(--gold-soft);
  font-size: 1rem;
  font-weight: 500;
}

.sect-card p, .sect-card small, .garden-card p {
  display: block;
  margin: 5px 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: .77rem;
}

.sect-card button, .garden-card button {
  min-height: 34px;
  margin-top: 6px;
}

.garden-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 11px;
}

.garden-card {
  padding: 15px;
  border: 1px solid rgba(143, 117, 205, .22);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(27, 52, 55, .4), rgba(29, 22, 50, .82));
}

.garden-icon {
  justify-content: start;
  margin-bottom: 9px;
}

.special-list {
  display: grid;
  gap: 9px;
}

.special-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(143, 117, 205, .2);
  border-radius: 12px;
  background: rgba(30, 23, 49, .72);
}

.special-row strong, .special-row small {
  display: block;
}

.special-row strong {
  color: #eee7fb;
  font-weight: 500;
}

.special-row small {
  margin: 4px 0 7px;
  color: var(--muted);
  font-size: .74rem;
}

.special-row .progress-track {
  height: 6px;
}

.side-actions {
  display: grid;
  gap: 7px;
}

@media (max-width: 640px) {
  .attribute-grid { grid-template-columns: repeat(5, minmax(42px, 1fr)); gap: 4px; }
  .attribute-grid > div { padding: 8px 3px; }
  .attribute-grid strong { font-size: .97rem; }
  .attribute-grid span, .attribute-grid small { font-size: .62rem; }
  .map-note { width: 100%; margin-left: 0; }
  .battle-player-line { flex-direction: column; gap: 4px; }
  .ranking-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .ranking-row .buy-button { grid-column: 2 / -1; justify-self: start; }
  .special-row { grid-template-columns: 34px minmax(0, 1fr); }
  .special-row .buy-button { grid-column: 2; justify-self: start; }
  .enemy-mark-image { width: 54px; height: 54px; }
}

/* Source-map parity: the original world map is a tall painted atlas with
   irregular region hit areas.  Keep the art visible and let the SVG layer
   provide the actual accessible, clickable boundaries. */
.game-main { display: flex; flex-direction: column; min-height: 0; }
.game-main > .screen-view { flex: 1 1 auto; height: auto; min-height: 0; }

.source-map-screen {
  position: relative;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #05040d;
}

.map-stage.source-map-stage {
  position: absolute;
  inset: 0;
  height: auto;
  min-height: 0;
  overflow: hidden;
  background: #070511;
  isolation: isolate;
}

.map-stage.source-map-stage::before {
  z-index: 5;
  background:
    linear-gradient(180deg, rgba(7, 5, 18, .48), transparent 16%, transparent 70%, rgba(7, 5, 18, .55)),
    radial-gradient(circle at 50% 45%, transparent 46%, rgba(5, 3, 13, .24) 100%);
}

.map-viewport {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  background: #080612;
  cursor: grab;
  touch-action: none;
}

.map-viewport.dragging { cursor: grabbing; }

.map-pan-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transform-origin: top left;
  will-change: transform;
  transition: transform .25s ease;
}

.map-viewport.dragging .map-pan-layer { transition: none; }

.map-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 765 / 1373;
  overflow: visible;
}

.map-image {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
  -webkit-user-drag: none;
}

.map-loading {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 226, 158, .88);
  background: rgba(7, 5, 17, .72);
  font-size: .86rem;
  letter-spacing: .08em;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s ease;
}

.map-canvas.ready .map-loading { opacity: 0; visibility: hidden; }
.map-canvas.failed .map-loading { color: #ffb5ad; background: rgba(25, 7, 17, .86); }

.world-map-polygons {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.map-region-hit { pointer-events: all; cursor: pointer; outline: none; }

.region-polygon {
  fill: rgba(59, 207, 211, .025);
  stroke: rgba(115, 231, 225, .08);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  transition: fill .2s ease, stroke .2s ease, filter .2s ease;
}

.region-edge {
  fill: none;
  stroke: rgba(246, 211, 101, .13);
  stroke-width: 1.4;
  stroke-dasharray: 5 8;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
  transition: stroke .2s ease, opacity .2s ease;
}

.map-region-hit:hover .region-polygon,
.map-region-hit:focus-visible .region-polygon {
  fill: rgba(98, 217, 222, .2);
  stroke: rgba(153, 249, 241, .9);
  filter: drop-shadow(0 0 7px rgba(98, 217, 222, .72));
}

.map-region-hit:hover .region-edge,
.map-region-hit:focus-visible .region-edge { stroke: rgba(255, 228, 142, .92); }

.map-region-hit.selected .region-polygon {
  fill: rgba(246, 193, 67, .13);
  stroke: rgba(255, 224, 126, .72);
  filter: drop-shadow(0 0 8px rgba(249, 196, 73, .46));
}

.map-region-hit.selected .region-edge { stroke: rgba(255, 229, 147, .84); }

.map-region-hit.locked .region-polygon {
  fill: rgba(20, 17, 32, .025);
  stroke: rgba(196, 192, 206, .08);
}

.map-region-hit.locked .region-edge { stroke: rgba(207, 200, 215, .07); }

.map-overlay-layer {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
}

.map-lock-label,
.map-selected-label {
  position: absolute;
  display: grid;
  justify-items: center;
  min-width: 92px;
  padding: 4px 8px;
  border: 1px solid rgba(218, 205, 225, .17);
  border-radius: 9px;
  color: rgba(238, 230, 244, .76);
  background: rgba(8, 6, 17, .45);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
  transform: translate(-50%, -50%);
  text-align: center;
  text-shadow: 0 1px 6px #06040e;
  white-space: nowrap;
}

.map-lock-label { color: rgba(233, 226, 240, .62); }
.map-lock-icon { display: block; font-size: 1.05rem; line-height: 1; filter: grayscale(.25); }
.map-lock-label span:last-child { margin-top: 2px; font-size: .7rem; }

.map-selected-label {
  border-color: rgba(255, 218, 98, .62);
  color: #fff0b3;
  background: rgba(57, 38, 17, .68);
  box-shadow: 0 0 22px rgba(246, 195, 74, .26);
  animation: map-label-pulse 2.8s ease-in-out infinite;
}

.map-selected-label span { font-size: .82rem; }
.map-selected-label small { margin-top: 2px; color: rgba(255, 242, 199, .72); font-size: .66rem; }

.map-topline {
  z-index: 8;
  top: 12px;
  left: 16px;
  right: 16px;
  align-items: center;
  pointer-events: none;
}

.map-caption {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border: 1px solid rgba(243, 200, 86, .35);
  border-radius: 999px;
  color: #ffe39a;
  background: rgba(12, 9, 26, .58);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  font-size: .82rem;
  letter-spacing: .38em;
  text-shadow: 0 2px 7px #06030d;
}

.map-caption-line { width: 22px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.map-caption-line.reverse { transform: scaleX(-1); }

.map-control-cluster {
  display: flex;
  align-items: center;
  gap: 5px;
  pointer-events: auto;
}

.map-control,
.map-zoom-readout {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border: 1px solid rgba(242, 201, 93, .34);
  border-radius: 9px;
  color: #ffe6a0;
  background: rgba(15, 11, 31, .72);
  box-shadow: 0 5px 16px rgba(0, 0, 0, .18);
}

.map-control { padding: 0; cursor: pointer; font-size: 1.1rem; }
.map-control:hover { border-color: var(--cyan); color: white; background: rgba(28, 45, 66, .82); }
.map-zoom-readout { min-width: 44px; padding: 0 5px; color: #d8d0e8; font-size: .72rem; }
.map-control-cluster .glass-button { min-height: 34px; padding: 0 10px; }

.map-instruction {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 12px;
  padding: 7px 12px;
  border: 1px solid rgba(171, 157, 211, .24);
  border-radius: 999px;
  color: rgba(236, 229, 245, .76);
  background: rgba(8, 6, 17, .57);
  transform: translateX(-50%);
  font-size: .73rem;
  pointer-events: none;
  white-space: nowrap;
}

.map-chat {
  z-index: 8;
  left: 17px;
  bottom: 16px;
  width: 54px;
  height: 54px;
}

.map-scale-hint {
  position: absolute;
  z-index: 8;
  right: 17px;
  bottom: 15px;
  display: grid;
  gap: 2px;
  min-width: 142px;
  padding: 8px 11px;
  border: 1px solid rgba(166, 145, 222, .24);
  border-radius: 11px;
  background: rgba(9, 7, 20, .6);
  box-shadow: 0 7px 20px rgba(0, 0, 0, .2);
  text-align: right;
  pointer-events: none;
}

.map-scale-hint span,
.map-scale-hint small { color: rgba(220, 213, 230, .62); font-size: .67rem; }
.map-scale-hint strong { color: var(--gold-soft); font-size: .88rem; font-weight: 500; }
.map-alt-note { position: absolute; z-index: 4; top: 50%; left: 50%; padding: 12px 18px; border: 1px solid rgba(241, 196, 75, .42); border-radius: 12px; color: var(--gold-soft); background: rgba(11, 8, 22, .56); transform: translate(-50%, -50%); pointer-events: none; }

.location-backdrop {
  z-index: 24;
  padding: clamp(10px, 2.5vw, 28px);
  background: rgba(3, 2, 10, .86);
  backdrop-filter: blur(10px);
}

.location-modal {
  display: flex;
  flex-direction: column;
  width: min(980px, 96vw);
  height: min(90svh, 850px);
  min-height: min(540px, calc(100svh - 24px));
  overflow: hidden;
  border: 1px solid rgba(245, 204, 93, .48);
  border-radius: 22px;
  background: linear-gradient(150deg, #27233b, #110d20 68%);
  box-shadow: 0 30px 110px rgba(0, 0, 0, .7), 0 0 45px rgba(82, 205, 215, .13);
  animation: location-fly-in .42s cubic-bezier(.2, .8, .25, 1) both;
}

.location-cover {
  position: relative;
  display: flex;
  flex: 1 1 52%;
  min-height: 275px;
  overflow: hidden;
  background-position: center;
  background-size: cover;
}

.location-cover-image { position: absolute; z-index: 0; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; }
.location-cover-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 5, 18, .22), rgba(7, 4, 15, .84) 88%), linear-gradient(90deg, rgba(7, 4, 15, .54), transparent 62%); }
.location-cover-loading { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; color: rgba(255, 226, 158, .88); background: rgba(7, 5, 17, .58); font-size: .84rem; letter-spacing: .08em; pointer-events: none; transition: opacity .22s ease, visibility .22s ease; }
.location-cover.ready .location-cover-loading { opacity: 0; visibility: hidden; }
.location-cover.failed .location-cover-loading { color: #ffb5ad; background: rgba(25, 7, 17, .86); }
.location-cover-top { position: absolute; z-index: 3; top: 14px; left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.location-back { min-height: 36px; padding: 0 13px; border: 1px solid rgba(234, 217, 164, .32); border-radius: 999px; color: #ffe8aa; background: rgba(11, 8, 22, .54); cursor: pointer; }
.location-back:hover { border-color: var(--cyan); color: white; }
.location-route { color: rgba(245, 239, 223, .72); font-size: .74rem; letter-spacing: .08em; text-shadow: 0 2px 8px #000; }
.location-close { pointer-events: auto; }
.location-hero-copy { position: relative; z-index: 3; align-self: flex-end; padding: 30px 32px 26px; }
.location-kicker { color: #83e7e5; font-size: .76rem; letter-spacing: .13em; }
.location-hero-copy h2 { margin: 8px 0 5px; color: #ffe6a0; font-size: clamp(2rem, 6vw, 3.3rem); font-weight: 500; letter-spacing: .08em; text-shadow: 0 3px 15px #000; }
.location-hero-copy p { max-width: 680px; margin: 0; color: rgba(242, 235, 243, .82); font-size: .91rem; line-height: 1.65; }

.location-body { flex: 0 0 auto; padding: 17px 23px 20px; background: linear-gradient(180deg, rgba(27, 21, 46, .98), rgba(14, 10, 26, .98)); }
.location-stat-row { display: flex; flex-wrap: wrap; gap: 7px; }
.location-stat { padding: 6px 9px; border: 1px solid rgba(150, 131, 198, .28); border-radius: 8px; color: #d8d0e6; background: rgba(255, 255, 255, .055); font-size: .75rem; }
.location-stat.safe { color: #9be9a5; border-color: rgba(96, 208, 115, .34); background: rgba(35, 118, 58, .18); }
.location-stat.warn { color: #ffb6ac; border-color: rgba(236, 83, 97, .35); background: rgba(148, 44, 57, .18); }
.location-open-state, .location-locked-state { margin: 12px 0 10px; padding: 9px 11px; border-radius: 9px; font-size: .78rem; }
.location-open-state { color: #a9ebcf; background: rgba(32, 128, 102, .16); }
.location-locked-state { color: #ffb7ad; background: rgba(146, 44, 56, .2); }
.open-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #65d67d; box-shadow: 0 0 10px rgba(101, 214, 125, .8); }
.location-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.location-action-button { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; column-gap: 8px; min-height: 63px; padding: 9px 11px; border: 1px solid rgba(151, 137, 196, .34); border-radius: 13px; color: #eee6f4; background: rgba(39, 29, 64, .8); cursor: pointer; text-align: left; transition: transform .2s ease, border-color .2s ease, filter .2s ease; }
.location-action-button:hover:not([disabled]) { transform: translateY(-2px); border-color: rgba(98, 217, 222, .7); filter: brightness(1.08); }
.location-action-button > span { grid-row: 1 / span 2; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: rgba(255, 255, 255, .08); font-size: 1.1rem; }
.location-action-button strong { color: #ffe4a0; font-size: .88rem; font-weight: 500; }
.location-action-button small { color: var(--muted); font-size: .67rem; }
.location-action-button.gold { border-color: rgba(239, 190, 74, .42); background: linear-gradient(145deg, rgba(91, 62, 20, .64), rgba(41, 27, 53, .84)); }
.location-action-button.green { border-color: rgba(100, 208, 116, .38); background: linear-gradient(145deg, rgba(29, 83, 55, .58), rgba(30, 29, 54, .84)); }
.location-action-button.blue { border-color: rgba(93, 158, 232, .43); background: linear-gradient(145deg, rgba(32, 65, 107, .58), rgba(30, 25, 55, .84)); }
.location-action-button.red { border-color: rgba(238, 83, 97, .43); background: linear-gradient(145deg, rgba(102, 37, 46, .58), rgba(38, 22, 49, .84)); }
.location-lore { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 13px; padding-top: 12px; border-top: 1px solid rgba(177, 158, 211, .16); }
.location-lore > div { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.lore-mark { color: var(--gold); font-size: 1.25rem; }
.location-lore strong { color: #e9d9a9; font-size: .8rem; font-weight: 500; }
.location-lore p { margin: 3px 0 0; color: var(--subtle); font-size: .7rem; line-height: 1.45; }
.location-lore .ghost-button { flex: 0 0 auto; min-height: 36px; padding: 0 12px; }

@keyframes location-fly-in {
  from { opacity: 0; transform: translate3d(0, 40px, 0) scale(.94); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes map-label-pulse {
  0%, 100% { box-shadow: 0 0 18px rgba(246, 195, 74, .22); }
  50% { box-shadow: 0 0 30px rgba(246, 195, 74, .46); }
}

@media (max-width: 760px) {
  .map-caption { padding: 7px 10px; font-size: .72rem; letter-spacing: .24em; }
  .map-control-cluster { gap: 3px; }
  .map-control, .map-zoom-readout { min-width: 30px; height: 30px; }
  .map-control-cluster .glass-button { min-height: 30px; padding: 0 7px; font-size: .7rem; }
  .map-control-cluster .glass-button:last-child { display: none; }
  .map-instruction { bottom: 9px; max-width: calc(100% - 130px); overflow: hidden; text-overflow: ellipsis; font-size: .64rem; }
  .map-chat { bottom: 9px; width: 47px; height: 47px; font-size: 1.3rem; }
  .map-scale-hint { right: 9px; bottom: 9px; min-width: 112px; padding: 6px 8px; }
  .map-scale-hint span, .map-scale-hint small { font-size: .6rem; }
  .map-scale-hint strong { font-size: .76rem; }
  .location-modal { width: 96vw; height: min(92svh, 760px); min-height: min(480px, calc(100svh - 18px)); border-radius: 17px; }
  .location-cover { min-height: 220px; }
  .location-cover-top { top: 9px; left: 10px; right: 10px; }
  .location-hero-copy { padding: 20px 18px 18px; }
  .location-hero-copy h2 { font-size: clamp(1.8rem, 10vw, 2.6rem); }
  .location-hero-copy p { font-size: .78rem; }
  .location-body { padding: 12px 13px 14px; }
  .location-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .location-action-button { min-height: 58px; padding: 8px; }
  .location-lore { align-items: flex-start; }
  .location-lore p { max-width: 180px; }
  .location-lore .ghost-button { font-size: .73rem; }
}

@media (prefers-reduced-motion: reduce) {
  .map-selected-label, .location-modal { animation: none; }
}

/* -------------------------------------------------------------------------
   Smooth route changes and the source-inspired full-screen battle renderer.
   The original battle scripts use staged motion (intro -> cast -> attack ->
   hit -> round end), so keep each phase as a cheap CSS animation and let JS
   only swap the phase at the timing boundaries.
   ------------------------------------------------------------------------- */

#app { height: 100svh; min-height: 100svh; overflow: hidden; }

.game-shell { height: 100svh; overflow: hidden; }

.route-enter .game-main,
.route-enter .top-hud,
.route-enter .bottom-nav {
  animation: route-enter .28s cubic-bezier(.2, .78, .25, 1) both;
}

@supports (view-transition-name: root) {
  #app { view-transition-name: xiuxian-app; }
  ::view-transition-old(xiuxian-app) { animation: route-old .16s ease both; }
  ::view-transition-new(xiuxian-app) { animation: route-new .28s cubic-bezier(.2, .78, .25, 1) both; }
}

@keyframes route-enter {
  from { opacity: .18; transform: translate3d(0, 8px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes route-old {
  to { opacity: 0; transform: translate3d(0, -8px, 0) scale(.994); }
}

@keyframes route-new {
  from { opacity: 0; transform: translate3d(0, 10px, 0) scale(1.006); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.map-pan-layer {
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0) scale(1);
}

.map-node { pointer-events: auto; }

.battle-backdrop {
  z-index: 40;
  display: grid;
  place-items: stretch;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(2, 2, 9, .78);
  backdrop-filter: blur(9px) saturate(.82);
}

.battle-modal {
  position: relative;
  width: 100vw;
  max-width: none;
  height: 100svh;
  max-height: none;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #0a0715;
  box-shadow: none;
  animation: battle-modal-enter .46s cubic-bezier(.17, .82, .24, 1) both;
}

.battle-scene {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background-color: #11091a;
  background-position: center;
  background-size: cover;
  isolation: isolate;
}

.battle-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(8, 6, 22, .64) 0%, rgba(12, 5, 20, .08) 24%, rgba(15, 5, 16, .08) 58%, rgba(4, 3, 12, .86) 100%),
    radial-gradient(ellipse at 50% 48%, transparent 24%, rgba(4, 2, 12, .58) 100%);
  pointer-events: none;
}

.battle-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: .42;
  background:
    linear-gradient(115deg, transparent 0 42%, rgba(106, 233, 220, .08) 48%, transparent 54%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 4px);
  mix-blend-mode: screen;
  pointer-events: none;
}

.battle-scene > * { position: absolute; }

.battle-atmosphere {
  inset: -18%;
  z-index: 1;
  opacity: .5;
  background:
    radial-gradient(circle at 22% 55%, rgba(74, 194, 213, .17), transparent 25%),
    radial-gradient(circle at 78% 47%, rgba(238, 85, 119, .22), transparent 28%),
    radial-gradient(circle at 50% 25%, rgba(167, 115, 255, .12), transparent 36%);
  animation: battle-atmosphere 8s ease-in-out infinite alternate;
  pointer-events: none;
}

.battle-vignette {
  inset: 0;
  z-index: 2;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, .54);
  pointer-events: none;
}

.battle-topbar {
  top: clamp(16px, 6.2vh, 72px);
  right: clamp(14px, 4vw, 58px);
  left: clamp(14px, 4vw, 58px);
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: clamp(8px, 2vw, 30px);
  pointer-events: none;
}

.battle-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  filter: drop-shadow(0 5px 14px rgba(0,0,0,.58));
}

.battle-status-enemy { justify-content: flex-end; text-align: right; }

.battle-status-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: clamp(52px, 6.2vw, 84px);
  height: clamp(52px, 6.2vw, 84px);
  overflow: hidden;
  border: 2px solid rgba(250, 218, 142, .74);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(58, 30, 74, .88), rgba(8, 5, 18, .92));
  box-shadow: 0 0 0 3px rgba(12, 8, 27, .58), 0 0 26px rgba(245, 196, 80, .18);
}

.battle-status-enemy .battle-status-avatar {
  border-color: rgba(249, 117, 119, .8);
  box-shadow: 0 0 0 3px rgba(12, 8, 27, .58), 0 0 26px rgba(240, 75, 107, .25);
}

.battle-status-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.battle-status-copy { min-width: 90px; padding-top: 1px; }
.battle-status-name { color: #ffe6a5; font-size: clamp(.82rem, 1.45vw, 1.08rem); font-weight: 600; white-space: nowrap; }
.battle-status-enemy .battle-status-name { color: #ffc0b0; }
.battle-status-realm { margin-top: 2px; color: rgba(233, 222, 239, .66); font-size: clamp(.62rem, .94vw, .75rem); white-space: nowrap; }

.battle-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: clamp(118px, 13vw, 190px);
  margin-top: 5px;
  color: rgba(245, 237, 239, .78);
  font-size: clamp(.58rem, .84vw, .7rem);
  white-space: nowrap;
}

.battle-bar span {
  display: block;
  flex: 1 1 auto;
  min-width: 48px;
  height: 7px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 99px;
  background: rgba(5, 4, 15, .78);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.55);
}

.battle-bar span i { display: block; height: 100%; border-radius: inherit; transition: width .32s ease; }
.battle-bar.hp span i { background: linear-gradient(90deg, #2ea95d, #81dc72); box-shadow: 0 0 9px rgba(90, 220, 106, .45); }
.battle-bar.qi span i { background: linear-gradient(90deg, #267ecb, #68e1ea); box-shadow: 0 0 9px rgba(81, 210, 239, .4); }
.battle-status-enemy .battle-bar.hp span i { background: linear-gradient(90deg, #c6384d, #ff9561); box-shadow: 0 0 9px rgba(255, 87, 92, .42); }
.battle-status-enemy .battle-bar.qi span i { background: linear-gradient(90deg, #5c3bc5, #bf7aff); }
.battle-status-enemy .battle-bar { flex-direction: row-reverse; }

.battle-round {
  display: grid;
  justify-items: center;
  min-width: clamp(92px, 12vw, 170px);
  padding-top: 3px;
  text-align: center;
  text-shadow: 0 3px 10px #000;
}

.battle-round > span { color: #ffe5a2; font-size: clamp(.82rem, 1.45vw, 1.08rem); letter-spacing: .1em; }
.battle-round strong { min-height: 20px; margin-top: 5px; color: #8fe7e4; font-size: clamp(.72rem, 1.1vw, .9rem); font-weight: 500; }
.battle-round small { max-width: 160px; margin-top: 2px; color: rgba(234, 222, 240, .68); font-size: clamp(.58rem, .82vw, .7rem); }

.battle-arena {
  inset: 24% 0 25%;
  z-index: 4;
  overflow: hidden;
  perspective: 800px;
}

.arena-horizon {
  top: 24%;
  right: 4%;
  bottom: 3%;
  left: 4%;
  border-top: 1px solid rgba(130, 225, 219, .14);
  background: radial-gradient(ellipse at 50% 70%, rgba(72, 197, 204, .16), transparent 54%);
  transform: perspective(460px) rotateX(55deg) scale(1.22);
  transform-origin: center bottom;
  pointer-events: none;
}

.battle-ground {
  bottom: 9%;
  width: 27%;
  height: 15%;
  border-radius: 50%;
  opacity: .64;
  background: radial-gradient(ellipse, rgba(19, 223, 203, .22), rgba(19, 223, 203, .04) 48%, transparent 72%);
  filter: blur(2px);
  pointer-events: none;
}

.player-ground { left: 8%; }
.enemy-ground { right: 8%; background: radial-gradient(ellipse, rgba(250, 83, 100, .2), rgba(250, 83, 100, .04) 48%, transparent 72%); }

.battle-unit {
  position: absolute;
  bottom: 8%;
  display: grid;
  place-items: end center;
  width: min(30vw, 260px);
  height: 82%;
  transform: translateX(-50%);
  transform-origin: center bottom;
  will-change: transform, opacity, filter;
}

.battle-unit-player { left: 24%; }
.battle-unit-enemy { left: 76%; }

.battle-unit img {
  position: relative;
  z-index: 3;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 18px 16px rgba(0,0,0,.62));
  user-select: none;
  -webkit-user-drag: none;
  animation: battle-idle-breathe 2.6s ease-in-out infinite;
}

.battle-unit-enemy img { filter: drop-shadow(0 18px 16px rgba(0,0,0,.68)) saturate(1.12); }

.unit-aura {
  position: absolute;
  z-index: 1;
  bottom: 11%;
  width: 76%;
  height: 62%;
  border-radius: 50%;
  opacity: .32;
  background: radial-gradient(ellipse, rgba(75, 230, 219, .34), transparent 66%);
  filter: blur(10px);
  animation: unit-aura 2.8s ease-in-out infinite alternate;
}

.battle-unit-enemy .unit-aura { background: radial-gradient(ellipse, rgba(247, 73, 98, .36), transparent 66%); }
.unit-shadow { position: absolute; z-index: 2; bottom: 7%; width: 63%; height: 9%; border-radius: 50%; background: rgba(0,0,0,.58); filter: blur(7px); }

.battle-vs {
  position: absolute;
  top: 49%;
  left: 50%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: clamp(34px, 5vw, 58px);
  height: clamp(34px, 5vw, 58px);
  border: 1px solid rgba(255, 224, 150, .44);
  border-radius: 50%;
  color: rgba(255, 232, 178, .9);
  background: rgba(15, 9, 30, .38);
  box-shadow: 0 0 25px rgba(246, 192, 75, .17);
  font-size: clamp(1rem, 2vw, 1.55rem);
  transform: translate(-50%, -50%);
  animation: vs-pulse 2.4s ease-in-out infinite;
}

.battle-skill-banner {
  top: 47%;
  left: 50%;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.5vw, 18px);
  min-width: min(74vw, 560px);
  padding: 9px 18px;
  border-top: 1px solid rgba(249, 214, 139, .32);
  border-bottom: 1px solid rgba(249, 214, 139, .25);
  color: #ffe7a7;
  background: linear-gradient(90deg, transparent, rgba(28, 12, 45, .75) 16%, rgba(28, 12, 45, .86) 84%, transparent);
  text-shadow: 0 2px 8px #000;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.battle-skill-banner strong { font-size: clamp(.9rem, 1.9vw, 1.35rem); font-weight: 500; letter-spacing: .12em; white-space: nowrap; }
.battle-skill-banner small { position: absolute; top: calc(100% + 6px); color: rgba(237, 226, 237, .68); font-size: clamp(.6rem, .9vw, .72rem); white-space: nowrap; }
.skill-banner-line { display: block; width: clamp(20px, 8vw, 100px); height: 1px; background: linear-gradient(90deg, transparent, rgba(246, 207, 117, .7)); }
.skill-banner-line.reverse { transform: scaleX(-1); }
.battle-phase-intro .battle-skill-banner, .battle-phase-idle .battle-skill-banner { opacity: .58; }
.battle-phase-idle .battle-skill-banner strong { font-size: clamp(.7rem, 1.2vw, .86rem); letter-spacing: .08em; }
.battle-phase-result .battle-skill-banner { display: none; }

.battle-effect-layer {
  inset: 0;
  z-index: 12;
  overflow: hidden;
  pointer-events: none;
}

.battle-projectile {
  position: absolute;
  top: 53%;
  width: clamp(14px, 2vw, 25px);
  height: clamp(14px, 2vw, 25px);
  border: 2px solid rgba(199, 255, 255, .92);
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 12%, #74f0ed 34%, rgba(37, 182, 224, .4) 60%, transparent 72%);
  box-shadow: 0 0 12px #5be8ef, 0 0 30px rgba(75, 204, 255, .7);
}

.battle-projectile::before,
.battle-projectile::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(143, 245, 241, .82));
  transform: translateY(-50%);
}

.battle-projectile::before { right: 72%; }
.battle-projectile::after { right: 72%; width: 44px; opacity: .55; transform: translateY(-50%) rotate(22deg); transform-origin: right center; }
.player-projectile { left: 28%; animation: projectile-player .56s cubic-bezier(.2,.65,.35,1) both; }
.enemy-projectile { right: 28%; border-color: rgba(255, 206, 193, .94); background: radial-gradient(circle, #fff 0 12%, #ff896f 34%, rgba(236, 51, 104, .45) 60%, transparent 72%); box-shadow: 0 0 12px #ff8972, 0 0 30px rgba(255, 69, 118, .72); animation: projectile-enemy .56s cubic-bezier(.2,.65,.35,1) both; }
.enemy-projectile::before, .enemy-projectile::after { right: auto; left: 72%; background: linear-gradient(270deg, transparent, rgba(255, 177, 148, .82)); }

.battle-impact {
  position: absolute;
  top: 53%;
  left: 76%;
  width: 92px;
  height: 92px;
  transform: translate(-50%, -50%);
  animation: impact-pop .52s cubic-bezier(.17,.84,.28,1) both;
}

.player-impact { left: 24%; }
.battle-impact b { position: absolute; inset: 0; display: grid; place-items: center; color: #fff7c9; font-size: 2.2rem; text-shadow: 0 0 18px #ffdb74; animation: impact-core .52s ease-out both; }
.battle-impact i { position: absolute; top: 50%; left: 50%; width: 3px; height: 45px; border-radius: 4px; background: linear-gradient(#fff, #ff815f 62%, transparent); transform-origin: center bottom; }
.battle-impact i:nth-child(1) { transform: translate(-50%, -50%) rotate(0deg); }
.battle-impact i:nth-child(2) { transform: translate(-50%, -50%) rotate(72deg); }
.battle-impact i:nth-child(3) { transform: translate(-50%, -50%) rotate(144deg); }
.battle-impact i:nth-child(4) { transform: translate(-50%, -50%) rotate(216deg); }

.battle-damage-float {
  position: absolute;
  top: 43%;
  left: 76%;
  z-index: 6;
  color: #ff8671;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 4vw, 3.1rem);
  font-weight: 700;
  letter-spacing: .04em;
  text-shadow: 0 2px 0 #5d111d, 0 0 18px rgba(255, 74, 73, .72);
  transform: translate(-50%, -50%);
  animation: damage-float .9s cubic-bezier(.16,.78,.25,1) both;
}

.battle-damage-float.on-player { left: 24%; color: #ffb3a4; }
.battle-damage-float.critical { color: #fff0b5; font-size: clamp(1.65rem, 4.4vw, 3.4rem); text-shadow: 0 2px 0 #8a271c, 0 0 24px rgba(255, 186, 72, .8); }

.battle-flash { inset: 0; background: rgba(255, 247, 226, .88); opacity: 0; pointer-events: none; }
.battle-phase-enemy-hit .battle-flash, .battle-phase-player-hit .battle-flash { animation: hit-flash .52s ease-out both; }
.battle-shake { inset: 0; opacity: 0; pointer-events: none; }
.battle-phase-enemy-hit .battle-shake, .battle-phase-player-hit .battle-shake { animation: screen-shake .42s ease-out both; }

.battle-controls {
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 15;
  height: 29%;
  min-height: 184px;
  pointer-events: none;
}

.battle-logline {
  position: absolute;
  right: 14px;
  bottom: clamp(126px, 19vh, 178px);
  left: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 28px;
  color: rgba(244, 234, 228, .88);
  font-size: clamp(.68rem, 1.05vw, .83rem);
  text-align: center;
  text-shadow: 0 2px 8px #000;
}

.battle-logline > span:last-child { max-width: min(90vw, 650px); }
.log-dot { display: block; width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--gold); box-shadow: 0 0 9px rgba(244, 200, 86, .82); }

.battle-action-dock {
  position: absolute;
  right: 50%;
  bottom: 45px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: min(650px, calc(100% - 24px));
  transform: translateX(50%);
  pointer-events: auto;
}

.battle-action-button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  min-height: 55px;
  padding: 7px 9px;
  border: 1px solid rgba(191, 161, 220, .35);
  border-radius: 12px;
  color: #eee6f4;
  background: rgba(20, 14, 39, .86);
  box-shadow: 0 8px 25px rgba(0,0,0,.28);
  cursor: pointer;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, filter .18s ease;
}

.battle-action-button:hover:not([disabled]) { border-color: rgba(247, 211, 128, .75); background: rgba(47, 30, 67, .93); filter: brightness(1.1); transform: translateY(-2px); }
.battle-action-button[disabled] { filter: grayscale(.34); cursor: wait; }
.battle-action-button .action-glyph { grid-row: 1 / span 2; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: #ffe6a5; background: rgba(255,255,255,.08); font-size: 1.05rem; }
.battle-action-button strong { color: #ffe7aa; font-size: clamp(.72rem, 1vw, .84rem); font-weight: 500; }
.battle-action-button small { color: rgba(225, 215, 231, .62); font-size: clamp(.57rem, .8vw, .66rem); white-space: nowrap; }
.battle-action-button.attack { border-color: rgba(243, 104, 99, .45); }
.battle-action-button.attack .action-glyph { color: #ff9e8c; background: rgba(162, 40, 52, .34); }
.battle-action-button.skill { border-color: rgba(116, 153, 245, .5); }
.battle-action-button.skill .action-glyph { color: #9dd8ff; background: rgba(35, 96, 174, .34); }
.battle-action-button.guard { border-color: rgba(99, 211, 184, .4); }
.battle-action-button.guard .action-glyph { color: #9ee8d3; background: rgba(30, 124, 104, .34); }
.battle-action-button.flee { border-color: rgba(178, 135, 238, .4); }
.battle-action-button.flee .action-glyph { color: #d2b1ff; background: rgba(105, 57, 172, .32); }

.battle-exit {
  position: absolute;
  bottom: 10px;
  left: 50%;
  min-height: 27px;
  padding: 0 15px;
  border: 1px solid rgba(239, 91, 105, .72);
  border-radius: 999px;
  color: rgba(255, 178, 172, .92);
  background: rgba(63, 16, 31, .5);
  cursor: pointer;
  font-size: .7rem;
  transform: translateX(-50%);
  pointer-events: auto;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.battle-exit:hover { color: #fff; border-color: #ff9b8c; background: rgba(128, 26, 43, .76); }

.battle-result-screen {
  inset: 0;
  z-index: 20;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 28px;
  text-align: center;
  background: radial-gradient(circle at center, rgba(39, 23, 65, .56), rgba(4, 3, 14, .88) 65%);
  animation: result-screen-in .6s cubic-bezier(.16,.8,.25,1) both;
  pointer-events: auto;
}

.result-rays { position: absolute; top: 50%; left: 50%; width: min(80vw, 700px); height: min(80vw, 700px); border-radius: 50%; opacity: .45; background: repeating-conic-gradient(from 0deg, rgba(255,220,137,.16) 0 5deg, transparent 5deg 19deg); transform: translate(-50%, -50%); animation: result-rays 16s linear infinite; }
.result-emblem { position: relative; display: grid; place-items: center; width: 88px; height: 88px; border: 1px solid rgba(255, 221, 145, .62); border-radius: 50%; color: #ffe7a2; background: rgba(68, 44, 102, .48); box-shadow: 0 0 36px rgba(255, 203, 88, .3), inset 0 0 28px rgba(255,255,255,.08); font-size: 2.8rem; animation: result-emblem 1.2s ease-in-out infinite alternate; }
.battle-result-lose .result-emblem { color: #ff9d94; border-color: rgba(255, 125, 119, .62); box-shadow: 0 0 36px rgba(255, 83, 83, .28); }
.battle-result-flee .result-emblem { color: #b9c5ff; border-color: rgba(156, 177, 255, .62); }
.result-kicker { position: relative; margin-top: 20px; color: #8fe2e0; font-size: .68rem; letter-spacing: .2em; }
.battle-result-screen h2 { position: relative; margin: 8px 0 0; color: #ffe4a0; font-size: clamp(2rem, 6vw, 3.8rem); font-weight: 500; letter-spacing: .12em; text-shadow: 0 5px 24px rgba(255, 192, 80, .24); }
.battle-result-lose .battle-result-screen h2 { color: #ffb0a5; }
.result-caption { position: relative; margin: 8px 0 0; color: rgba(241, 231, 239, .72); font-size: .83rem; }
.result-log { position: relative; max-width: min(640px, 88vw); margin: 22px 0; color: #e8dcea; font-size: .92rem; line-height: 1.75; white-space: pre-line; }
.result-return { position: relative; min-width: 160px; }

@keyframes battle-modal-enter { from { opacity: 0; transform: scale(1.035); } to { opacity: 1; transform: scale(1); } }
@keyframes battle-atmosphere { from { transform: translate3d(-2%, 1%, 0) scale(1); } to { transform: translate3d(2%, -1%, 0) scale(1.08); } }
@keyframes battle-idle-breathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-5px) scale(1.008); } }
@keyframes unit-aura { from { opacity: .2; transform: scale(.92); } to { opacity: .48; transform: scale(1.08); } }
@keyframes vs-pulse { 0%, 100% { opacity: .55; transform: translate(-50%, -50%) scale(.94); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); } }
@keyframes battle-intro-player { from { opacity: 0; transform: translateX(-50%) translateX(-15vw) scale(.88); } to { opacity: 1; transform: translateX(-50%) translateX(0) scale(1); } }
@keyframes battle-intro-enemy { from { opacity: 0; transform: translateX(-50%) translateX(15vw) scale(.88); } to { opacity: 1; transform: translateX(-50%) translateX(0) scale(1); } }
@keyframes battle-charge { 0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 18px 16px rgba(0,0,0,.62)); } 45% { transform: translateY(-7px) scale(1.035); filter: drop-shadow(0 0 28px rgba(105, 237, 229, .68)); } }
@keyframes battle-charge-enemy { 0%, 100% { transform: translateY(0) scale(1); } 45% { transform: translateY(-7px) scale(1.045); filter: drop-shadow(0 0 30px rgba(255, 83, 91, .76)); } }
@keyframes battle-slash { 0% { transform: translateX(0) rotate(0); filter: brightness(1); } 20% { transform: translateX(-2vw) rotate(-4deg); } 55% { transform: translateX(14vw) rotate(7deg); filter: brightness(1.5) drop-shadow(0 0 20px rgba(94, 232, 231, .8)); } 72% { transform: translateX(14vw) rotate(7deg); } 100% { transform: translateX(0) rotate(0); filter: brightness(1); } }
@keyframes battle-rush { 0% { transform: translateX(0) scale(1); } 25% { transform: translateX(-2vw) scale(.96); } 62% { transform: translateX(14vw) scale(1.06); filter: brightness(1.55) drop-shadow(0 0 22px rgba(111, 222, 255, .82)); } 76% { transform: translateX(12vw) scale(1.02); } 100% { transform: translateX(0) scale(1); } }
@keyframes battle-range { 0%, 100% { transform: translateY(0) scale(1); } 26% { transform: translateY(-6px) scale(1.05); filter: brightness(1.55) drop-shadow(0 0 30px rgba(91, 214, 255, .92)); } 58% { transform: translateY(0) scale(1); } }
@keyframes battle-aoe { 0%, 100% { transform: translateY(0) scale(1); } 36% { transform: translateY(-22px) scale(1.08); } 64% { transform: translateY(7px) scale(.94, 1.08); filter: brightness(1.65) drop-shadow(0 0 26px rgba(255, 163, 90, .82)); } }
@keyframes battle-enemy-rush { 0% { transform: translateX(0) scale(1); } 25% { transform: translateX(2vw) scale(.96); } 62% { transform: translateX(-14vw) scale(1.06); filter: brightness(1.52) drop-shadow(0 0 22px rgba(255, 107, 101, .88)); } 76% { transform: translateX(-12vw) scale(1.02); } 100% { transform: translateX(0) scale(1); } }
@keyframes battle-hit { 0%, 100% { transform: translateX(0); filter: brightness(1); } 18% { transform: translateX(-9px) rotate(-2deg); filter: brightness(2) saturate(.45); } 34% { transform: translateX(8px) rotate(2deg); } 52% { transform: translateX(-5px); } }
@keyframes battle-death { 0% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: .15; transform: translateY(28px) scale(.72) rotate(-5deg); filter: grayscale(1) blur(2px); } }
@keyframes projectile-player { from { opacity: 0; transform: translate3d(0, 0, 0) scale(.4); } 15% { opacity: 1; } to { opacity: 1; transform: translate3d(46vw, -1vh, 0) scale(1.16); } }
@keyframes projectile-enemy { from { opacity: 0; transform: translate3d(0, 0, 0) scale(.4); } 15% { opacity: 1; } to { opacity: 1; transform: translate3d(-46vw, 1vh, 0) scale(1.16); } }
@keyframes impact-pop { from { opacity: 0; transform: translate(-50%, -50%) scale(.15) rotate(-20deg); } 35% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -50%) scale(1.22) rotate(18deg); } }
@keyframes impact-core { from { opacity: 0; transform: scale(.2) rotate(-45deg); } 35% { opacity: 1; transform: scale(1.15) rotate(8deg); } to { opacity: 0; transform: scale(.8) rotate(45deg); } }
@keyframes damage-float { from { opacity: 0; transform: translate(-50%, 8px) scale(.65); } 18% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -72px) scale(1.05); } }
@keyframes hit-flash { 0%, 100% { opacity: 0; } 18% { opacity: .72; } 33% { opacity: 0; } 48% { opacity: .28; } 70% { opacity: 0; } }
@keyframes screen-shake { 0%, 100% { opacity: 0; transform: translate3d(0,0,0); } 18% { opacity: .5; transform: translate3d(-5px, 1px, 0); } 34% { opacity: .42; transform: translate3d(6px, -2px, 0); } 52% { opacity: .26; transform: translate3d(-3px, 1px, 0); } }
@keyframes result-screen-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes result-rays { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes result-emblem { from { transform: scale(.96); } to { transform: scale(1.06); } }

.battle-phase-intro .battle-unit-player { animation: battle-intro-player .8s cubic-bezier(.16,.82,.24,1) both; }
.battle-phase-intro .battle-unit-enemy { animation: battle-intro-enemy .8s cubic-bezier(.16,.82,.24,1) .05s both; }
.battle-phase-player-cast .battle-unit-player img { animation: battle-charge .42s ease-in-out both; }
.battle-phase-player-cast.battle-motion-buff .battle-unit-player img { animation: battle-range .42s ease-in-out both; filter: drop-shadow(0 0 25px rgba(90, 220, 182, .75)); }
.battle-phase-player-attack.battle-motion-slash .battle-unit-player img { animation: battle-slash .56s cubic-bezier(.17,.82,.24,1) both; }
.battle-phase-player-attack.battle-motion-rush .battle-unit-player img { animation: battle-rush .56s cubic-bezier(.17,.82,.24,1) both; }
.battle-phase-player-attack.battle-motion-range .battle-unit-player img { animation: battle-range .56s ease-in-out both; }
.battle-phase-player-attack.battle-motion-aoe .battle-unit-player img { animation: battle-aoe .56s ease-in-out both; }
.battle-phase-enemy-cast .battle-unit-enemy img { animation: battle-charge-enemy .42s ease-in-out both; }
.battle-phase-enemy-attack .battle-unit-enemy img { animation: battle-enemy-rush .56s cubic-bezier(.17,.82,.24,1) both; }
.battle-phase-enemy-hit .battle-unit-enemy img, .battle-phase-player-hit .battle-unit-player img { animation: battle-hit .52s ease-out both; }
.battle-result-win .battle-unit-enemy img { animation: battle-death .8s ease-out both; }

@media (max-width: 760px) {
  .battle-topbar { top: 12px; right: 10px; left: 10px; gap: 4px; }
  .battle-status { gap: 5px; }
  .battle-status-avatar { width: 44px; height: 44px; border-width: 1px; }
  .battle-status-copy { min-width: 0; }
  .battle-status-name { max-width: 112px; overflow: hidden; text-overflow: ellipsis; font-size: .72rem; }
  .battle-status-realm { font-size: .56rem; }
  .battle-bar { min-width: 82px; gap: 3px; margin-top: 3px; font-size: .51rem; }
  .battle-bar span { height: 5px; min-width: 30px; }
  .battle-round { min-width: 69px; padding-top: 1px; }
  .battle-round > span { font-size: .68rem; letter-spacing: .04em; }
  .battle-round strong { margin-top: 3px; font-size: .6rem; }
  .battle-round small { max-width: 74px; overflow: hidden; text-overflow: ellipsis; font-size: .5rem; white-space: nowrap; }
  .battle-arena { inset: 23% 0 28%; }
  .battle-unit { width: 42vw; height: 79%; }
  .battle-unit-player { left: 24%; }
  .battle-unit-enemy { left: 76%; }
  .battle-vs { top: 48%; }
  .battle-skill-banner { top: 45%; min-width: 86vw; padding: 7px 8px; gap: 6px; }
  .battle-skill-banner strong { font-size: .86rem; }
  .skill-banner-line { width: 12vw; }
  .battle-controls { height: 31%; min-height: 198px; }
  .battle-logline { bottom: 151px; font-size: .62rem; }
  .battle-action-dock { bottom: 43px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: calc(100% - 22px); }
  .battle-action-button { min-height: 47px; grid-template-columns: 27px minmax(0,1fr); padding: 5px 7px; border-radius: 10px; }
  .battle-action-button .action-glyph { width: 24px; height: 24px; font-size: .85rem; }
  .battle-action-button strong { font-size: .68rem; }
  .battle-action-button small { font-size: .53rem; }
  .battle-exit { bottom: 7px; min-height: 25px; font-size: .65rem; }
  .battle-damage-float { top: 41%; }
  .battle-impact { width: 70px; height: 70px; }
  .battle-impact i { height: 34px; }
  .result-emblem { width: 74px; height: 74px; font-size: 2.2rem; }
  .result-kicker { margin-top: 14px; font-size: .58rem; }
  .battle-result-screen h2 { font-size: 2.25rem; }
  .result-log { margin: 16px 0; font-size: .78rem; }
}

@media (prefers-reduced-motion: reduce) {
  .route-enter .game-main, .route-enter .top-hud, .route-enter .bottom-nav,
  .battle-modal, .battle-atmosphere, .battle-unit img, .unit-aura,
  .battle-vs, .battle-result-screen, .result-rays, .result-emblem,
  .battle-projectile, .battle-impact, .battle-damage-float,
  .battle-flash, .battle-shake { animation: none !important; }
  .battle-phase-enemy-hit .battle-flash, .battle-phase-player-hit .battle-flash { opacity: .22; }
}

/* Additional motion variants used by the enemy skill pool. */
@keyframes battle-enemy-range { 0%, 100% { transform: translateY(0) scale(1); } 26% { transform: translateY(-6px) scale(1.06); filter: brightness(1.58) drop-shadow(0 0 30px rgba(255, 125, 101, .9)); } 58% { transform: translateY(0) scale(1); } }
@keyframes battle-enemy-aoe { 0%, 100% { transform: translateY(0) scale(1); } 36% { transform: translateY(-22px) scale(1.08); } 64% { transform: translateY(7px) scale(.94, 1.08); filter: brightness(1.65) drop-shadow(0 0 26px rgba(255, 91, 101, .86)); } }
.battle-phase-enemy-attack.battle-motion-slash .battle-unit-enemy img { animation: battle-enemy-rush .56s cubic-bezier(.17,.82,.24,1) both; }
.battle-phase-enemy-attack.battle-motion-rush .battle-unit-enemy img { animation: battle-enemy-rush .56s cubic-bezier(.17,.82,.24,1) both; }
.battle-phase-enemy-attack.battle-motion-range .battle-unit-enemy img { animation: battle-enemy-range .56s ease-in-out both; }
.battle-phase-enemy-attack.battle-motion-aoe .battle-unit-enemy img { animation: battle-enemy-aoe .56s ease-in-out both; }
.battle-result-lose .battle-unit-player img { animation: battle-death .8s ease-out both; }
.battle-phase-round-end .battle-skill-banner { opacity: .66; }

/* Low-cost battle motion: keep the full-screen duel responsive while
   retaining the original cast, dash, hit and impact beats. */
.battle-backdrop { backdrop-filter: none; }
.battle-status { filter: none; }
.battle-unit { will-change: transform, opacity; }
.battle-unit img, .battle-unit-enemy img { filter: none; will-change: transform, opacity; transform: translateZ(0); }
.battle-phase-player-cast.battle-motion-buff .battle-unit-player img { filter: none; }
.battle-action-button[disabled] { filter: none; opacity: .58; }

@keyframes battle-charge { 0%, 100% { transform: translateY(0) scale(1); } 45% { transform: translateY(-7px) scale(1.035); } }
@keyframes battle-charge-enemy { 0%, 100% { transform: translateY(0) scale(1); } 45% { transform: translateY(-7px) scale(1.045); } }
@keyframes battle-slash { 0% { transform: translateX(0) rotate(0); } 20% { transform: translateX(-2vw) rotate(-4deg); } 55% { transform: translateX(14vw) rotate(7deg); } 72% { transform: translateX(14vw) rotate(7deg); } 100% { transform: translateX(0) rotate(0); } }
@keyframes battle-rush { 0% { transform: translateX(0) scale(1); } 25% { transform: translateX(-2vw) scale(.96); } 62% { transform: translateX(14vw) scale(1.06); } 76% { transform: translateX(12vw) scale(1.02); } 100% { transform: translateX(0) scale(1); } }
@keyframes battle-range { 0%, 100% { transform: translateY(0) scale(1); } 26% { transform: translateY(-6px) scale(1.05); } 58% { transform: translateY(0) scale(1); } }
@keyframes battle-aoe { 0%, 100% { transform: translateY(0) scale(1); } 36% { transform: translateY(-22px) scale(1.08); } 64% { transform: translateY(7px) scale(.94, 1.08); } }
@keyframes battle-enemy-rush { 0% { transform: translateX(0) scale(1); } 25% { transform: translateX(2vw) scale(.96); } 62% { transform: translateX(-14vw) scale(1.06); } 76% { transform: translateX(-12vw) scale(1.02); } 100% { transform: translateX(0) scale(1); } }
@keyframes battle-enemy-range { 0%, 100% { transform: translateY(0) scale(1); } 26% { transform: translateY(-6px) scale(1.06); } 58% { transform: translateY(0) scale(1); } }
@keyframes battle-enemy-aoe { 0%, 100% { transform: translateY(0) scale(1); } 36% { transform: translateY(-22px) scale(1.08); } 64% { transform: translateY(7px) scale(.94, 1.08); } }
@keyframes battle-hit { 0%, 100% { transform: translateX(0); } 18% { transform: translateX(-9px) rotate(-2deg); } 34% { transform: translateX(8px) rotate(2deg); } 52% { transform: translateX(-5px); } }
