:root {
  --ink: #0c1218;
  --slate: #152028;
  --panel: #1b2832;
  --fog: #2a3a46;
  --line: rgba(90, 170, 230, 0.22);
  --copper: #2f7ec4; /* accent */
  --brass: #6eb0e8; /* soft accent */
  --mist: #9aadb8;
  --bone: #ebe4d8;
  --danger: #d45a48;
  --heal: #5cba84;
  --r1: #9aa0a6;
  --r2: #8a9aaa;
  --r3: #5a9a6a;
  --r4: #4a8aca;
  --r5: #d4a020;
  --font-brand: "Unbounded", system-ui, sans-serif;
  --font-ui: "Sora", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
}

body {
  background-color: var(--ink);
  background-image:
    linear-gradient(180deg, rgba(8, 12, 16, 0.72) 0%, rgba(8, 12, 16, 0.55) 45%, rgba(6, 10, 14, 0.78) 100%),
    url("../sprites/world/bg-creep-road.png");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
  image-rendering: pixelated;
  min-height: 100dvh;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

#boot {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 0.75rem;
  padding: 2rem;
}

/* ID display rules beat [hidden] unless we force this */
#boot[hidden],
#app[hidden],
#toast[hidden] {
  display: none !important;
}

.boot-brand {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: clamp(2.8rem, 12vw, 5rem);
  letter-spacing: 0.06em;
  background: linear-gradient(120deg, var(--bone), var(--brass) 45%, var(--copper));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: brandIn 1.1s ease both;
}

.boot-sub {
  margin: 0;
  color: var(--mist);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.75rem;
  animation: fadeUp 0.8s 0.3s ease both;
}

.boot-bar {
  width: min(220px, 60vw);
  height: 3px;
  margin: 0.5rem auto 0;
  background: var(--fog);
  overflow: hidden;
  animation: fadeUp 0.8s 0.45s ease both;
}

.boot-bar span {
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
  animation: loadSlide 1.2s ease-in-out infinite;
}

@keyframes brandIn {
  from { opacity: 0; letter-spacing: 0.3em; filter: blur(6px); }
  to { opacity: 1; letter-spacing: 0.06em; filter: blur(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes loadSlide {
  from { transform: translateX(-120%); }
  to { transform: translateX(280%); }
}
@keyframes pulseSoft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
@keyframes shakeHit {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes glowStar {
  from { filter: brightness(0.6); transform: scale(0.85); }
  to { filter: brightness(1.15); transform: scale(1); }
}

#app {
  max-width: 920px;
  margin: 0 auto;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding-bottom: 0.5rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem 0.5rem;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(12, 18, 24, 0.92), rgba(12, 18, 24, 0.55) 70%, transparent);
}

.brand {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: var(--brass);
}

.resources {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.settings-btn {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mist);
  background: rgba(27, 40, 50, 0.75);
  border: 1px solid var(--line);
  padding: 0.28rem 0.55rem;
  cursor: pointer;
}
.settings-btn:hover {
  color: var(--bone);
  border-color: var(--brass);
}

.res {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--mist);
  background: rgba(27, 40, 50, 0.75);
  border: 1px solid var(--line);
  padding: 0.28rem 0.55rem;
}

.res-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mist);
}

.res b { color: var(--bone); font-weight: 600; font-variant-numeric: tabular-nums; }

.res-icon {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
  display: block;
}

.res.energy {
  border-color: rgba(92, 186, 132, 0.35);
}
.res.energy .res-icon { color: #7fd49a; }
.res.energy .res-label { color: #8fd4a8; }

.res.gil {
  border-color: rgba(110, 176, 232, 0.35);
}
.res.gil .res-icon { color: #d4b45a; }
.res.gil .res-label { color: #c9b56a; }

.res.celest {
  border-color: rgba(120, 170, 220, 0.4);
}
.res.celest .res-icon { color: #7eb6e0; }
.res.celest .res-label { color: #a8d0f0; }

@media (max-width: 520px) {
  .res {
    padding: 0.25rem 0.4rem;
    gap: 0.3rem;
  }
  .res-label {
    font-size: 0.58rem;
  }
  .res-icon {
    width: 0.85rem;
    height: 0.85rem;
  }
}

#main {
  padding: 0.5rem 1rem 1.25rem;
  animation: riseIn 0.45s ease both;
}

.dock {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  padding: 0.45rem 0.6rem 0.75rem;
  border-top: 1px solid var(--line);
  background: rgba(12, 18, 24, 0.88);
  backdrop-filter: blur(12px);
  position: sticky;
  bottom: 0;
}

.dock button {
  padding: 0.65rem 0.2rem;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mist);
  border-bottom: 2px solid transparent;
}

.dock button:hover,
.dock button.active {
  color: var(--brass);
  border-bottom-color: var(--copper);
}

/* Screens */
.hero-home {
  min-height: min(62vh, 520px);
  display: grid;
  align-content: end;
  gap: 0.85rem;
  padding: 2.5rem 0 1.5rem;
  position: relative;
}

.hero-home::before {
  content: "";
  position: absolute;
  inset: 0 -1rem;
  background:
    linear-gradient(180deg, transparent 20%, rgba(12, 18, 24, 0.55) 70%, var(--ink)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath fill='none' stroke='%236eb0e8' stroke-opacity='0.1' stroke-width='1' d='M0 80h160M80 0v160M20 20l120 120M140 20L20 140'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 80% 55% at 70% 35%, rgba(47, 126, 196, 0.28), transparent 60%);
  z-index: -1;
  animation: pulseSoft 6s ease-in-out infinite;
}

.hero-home .mark {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: clamp(3rem, 14vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  color: var(--bone);
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
  animation: brandIn 0.9s ease both;
}

.hero-home p {
  max-width: 28rem;
  margin: 0;
  color: var(--mist);
  font-size: 1rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.35rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--line);
  background: rgba(27, 40, 50, 0.85);
  color: var(--bone);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.btn:hover { border-color: var(--brass); transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(135deg, #1e5a96, var(--copper) 40%, #5aa8e0);
  border-color: transparent;
  color: #071018;
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.cost-celest {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  vertical-align: middle;
}
.cost-celest b,
.cost-gil b {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cost-gil {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  vertical-align: middle;
  color: #d4b45a;
}
.cost-icon {
  width: 0.95em;
  height: 0.95em;
  display: inline-block;
  vertical-align: -0.12em;
  flex-shrink: 0;
}
.cost-icon.celest {
  color: #8ec4ee;
}
.cost-icon.gil {
  color: #d4b45a;
}
.btn.primary .cost-icon.celest {
  color: #0a2a44;
}
.btn.primary .cost-gil,
.btn.primary .cost-icon.gil {
  color: #1a1408;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.5rem 0 1rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-brand);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.section-head p {
  margin: 0.25rem 0 0;
  color: var(--mist);
  font-size: 0.85rem;
}

.grid {
  display: grid;
  gap: 0.75rem;
}

.grid.units { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grid.quests { grid-template-columns: 1fr; }
.grid.shop { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.unit-tile {
  text-align: left;
  padding: 0.85rem;
  background: linear-gradient(160deg, rgba(27, 40, 50, 0.95), rgba(18, 28, 36, 0.9));
  border: 1px solid var(--line);
  border-left-width: 3px;
  transition: transform 0.15s, border-color 0.2s;
  animation: riseIn 0.4s ease both;
}

.unit-tile:hover { transform: translateY(-2px); border-color: rgba(212, 165, 116, 0.4); }

.unit-tile .name {
  font-weight: 600;
  font-size: 0.95rem;
}

.unit-tile .meta {
  color: var(--mist);
  font-size: 0.72rem;
  margin-top: 0.2rem;
}

.stars { letter-spacing: 0.05em; font-size: 0.7rem; }
.stars.r1 { color: var(--r1); }
.stars.r2 { color: var(--r2); }
.stars.r3 { color: var(--r3); }
.stars.r4 { color: var(--r4); }
.stars.r5 { color: var(--r5); }

.quest-row {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  background: rgba(27, 40, 50, 0.8);
  border: 1px solid var(--line);
  text-align: left;
  animation: riseIn 0.35s ease both;
}

.quest-row.locked { opacity: 0.45; }

.quest-row.cleared {
  background: linear-gradient(135deg, rgba(28, 72, 52, 0.92), rgba(22, 48, 40, 0.88));
  border-color: rgba(92, 186, 132, 0.55);
  box-shadow: inset 3px 0 0 var(--heal);
}

.quest-row.cleared .chapter {
  color: #9ee0b4;
  font-weight: 700;
}

.quest-row.cleared h3 {
  color: #d8f5e4;
}

.quest-row .top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.quest-row h3 {
  margin: 0;
  font-size: 1.05rem;
  font-family: var(--font-brand);
  font-weight: 600;
}

.quest-row .chapter {
  color: var(--brass);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.muted { color: var(--mist); font-size: 0.85rem; }

.elem-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  vertical-align: middle;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.elem-icon {
  width: 0.95em;
  height: 0.95em;
  display: inline-block;
  vertical-align: -0.12em;
  flex-shrink: 0;
}
.elem-fire { color: #e07040; }
.elem-ice { color: #7ec8e8; }
.elem-lightning { color: #e8d060; }
.elem-earth { color: #c0a060; }
.elem-dark { color: #9a7ad0; }
.elem-light { color: #f0e0a0; }
.elem-wind { color: #8fd4a8; }
.elem-water { color: #5a9ec8; }
.elem-neutral { color: var(--mist); }

.party-slots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.party-slot {
  min-height: 88px;
  border: 1px dashed rgba(154, 173, 184, 0.35);
  background: rgba(21, 32, 40, 0.7);
  padding: 0.5rem;
  font-size: 0.75rem;
  text-align: center;
}

.party-slot.filled {
  border-style: solid;
  border-color: var(--line);
  border-left-width: 3px;
}

.party-slot.selected {
  border-style: solid;
  border-color: var(--brass);
  background: rgba(74, 140, 190, 0.22);
  box-shadow:
    0 0 0 2px rgba(110, 176, 232, 0.55),
    0 0 16px 4px rgba(74, 160, 230, 0.35);
  color: var(--bone);
  transform: translateY(-2px);
}

.detail {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  background: rgba(27, 40, 50, 0.85);
  border: 1px solid var(--line);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}

.stat-grid span {
  background: rgba(12, 18, 24, 0.55);
  padding: 0.4rem;
  font-size: 0.75rem;
  text-align: center;
}

.stat-grid b { display: block; color: var(--brass); font-size: 0.9rem; }

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  font-size: 0.72rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--line);
  color: var(--mist);
}

/* Battle */
.battle {
  display: grid;
  gap: 0.85rem;
}

.battle-field {
  display: grid;
  gap: 1rem;
  padding: 1rem 0.25rem;
  min-height: 220px;
}

.fighters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.fighters.enemies { justify-content: center; }
.fighters.allies { justify-content: center; }

.sprite {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  image-rendering: pixelated;
  background: #0a1014;
}

.sprite--tile {
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 0.5rem;
  border: 1px solid var(--line);
}

.sprite--hero {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  border: 1px solid var(--line);
}

.sprite--party {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.35rem;
  border: 1px solid var(--line);
}

.sprite--fighter {
  width: 72px;
  height: 72px;
  margin: 0 auto 0.35rem;
  border: 1px solid rgba(255,255,255,0.06);
}

.sprite--shop {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border: 1px solid var(--line);
}

.sprite--item-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
}

.shop-row {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  text-align: left;
}

.shop-row__body {
  flex: 1;
  min-width: 0;
}

.shop-row__body h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.shop-price {
  margin-top: 0.25rem;
}

.shop-row__body .btn {
  margin-top: 0.45rem;
}

.item-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.detail-hero {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

@keyframes turnGlow {
  0%, 100% {
    box-shadow:
      0 0 0 2px rgba(110, 176, 232, 0.95),
      0 0 14px 4px rgba(74, 160, 230, 0.55),
      0 0 28px 8px rgba(47, 126, 196, 0.35);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(190, 230, 255, 1),
      0 0 22px 8px rgba(110, 190, 255, 0.75),
      0 0 40px 14px rgba(74, 160, 230, 0.45);
  }
}

.fighter {
  position: relative;
  width: 110px;
  padding: 0.55rem;
  background: rgba(27, 40, 50, 0.9);
  border: 1px solid var(--line);
  border-top-width: 3px;
  text-align: center;
  font-size: 0.72rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.fighter.active {
  z-index: 2;
  transform: translateY(-4px) scale(1.06);
  border-color: var(--brass);
  background: rgba(32, 52, 72, 0.96);
  outline: none;
  animation: turnGlow 1.35s ease-in-out infinite;
}

.fighter.active .sprite--fighter {
  filter: drop-shadow(0 0 6px rgba(140, 210, 255, 0.85));
}

.fighter-turn {
  position: absolute;
  top: -0.55rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.1rem 0.4rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0c1218;
  background: linear-gradient(180deg, #d7efff, var(--brass));
  border: 1px solid rgba(255, 255, 255, 0.35);
  white-space: nowrap;
  pointer-events: none;
}

.fighter.dead { opacity: 0.35; filter: grayscale(0.8); }
.fighter.hit { animation: shakeHit 0.35s ease; }

.fighter .fname {
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar {
  height: 5px;
  background: #0a1014;
  margin-top: 0.35rem;
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  width: 0;
  transition: width 0.3s ease;
}

.bar.hp > i { background: linear-gradient(90deg, #8a3030, var(--danger)); }
.bar.mp > i { background: linear-gradient(90deg, #2a5080, #4a90c8); }
.bar.lb > i { background: linear-gradient(90deg, #8a6020, var(--brass)); }
.bar.trust > i { background: linear-gradient(90deg, #1e5a96, var(--copper)); }

.chip.locked {
  opacity: 0.55;
  border-style: dashed;
}

.chain-banner {
  text-align: center;
  font-family: var(--font-brand);
  color: var(--brass);
  letter-spacing: 0.1em;
  min-height: 1.4rem;
  font-size: 0.9rem;
}

.battle-log {
  max-height: 110px;
  overflow: auto;
  font-size: 0.78rem;
  color: var(--mist);
  padding: 0.55rem 0.7rem;
  background: rgba(10, 16, 20, 0.65);
  border: 1px solid var(--line);
}

.battle-log .heal { color: var(--heal); }
.battle-log .damage { color: #e88878; }
.battle-log .system { color: var(--brass); }

.battle-actions {
  display: grid;
  gap: 0.55rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.target-hint {
  font-size: 0.78rem;
  color: var(--brass);
  min-height: 1.2rem;
}

.summon-stage {
  min-height: 50vh;
  display: grid;
  place-content: center;
  gap: 1.25rem;
  text-align: center;
}

.summon-stage h2 {
  font-family: var(--font-brand);
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  margin: 0;
}

.summon-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.summon-card {
  width: 120px;
  padding: 1rem 0.6rem;
  border: 1px solid var(--line);
  background: rgba(27, 40, 50, 0.95);
  animation: glowStar 0.55s ease both;
}

.summon-card .stars { font-size: 0.85rem; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 5.5rem;
  transform: translateX(-50%);
  background: rgba(27, 40, 50, 0.95);
  border: 1px solid var(--brass);
  color: var(--bone);
  padding: 0.65rem 1rem;
  z-index: 50;
  max-width: min(90vw, 420px);
  text-align: center;
  animation: riseIn 0.25s ease;
}

.home-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.55rem;
  margin-top: 1.5rem;
}

.home-links button {
  padding: 1rem 0.75rem;
  text-align: left;
  background: rgba(27, 40, 50, 0.7);
  border: 1px solid var(--line);
}

.home-links button strong {
  display: block;
  font-family: var(--font-brand);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: var(--brass);
}

.home-links button span {
  color: var(--mist);
  font-size: 0.75rem;
}

.esper-tile {
  text-align: left;
  padding: 1rem;
  background: linear-gradient(160deg, rgba(30, 55, 80, 0.95), rgba(18, 28, 36, 0.9));
  border: 1px solid var(--line);
  border-top: 3px solid var(--copper);
  animation: riseIn 0.4s ease both;
}

.esper-tile.locked { opacity: 0.45; }

.world-map-screen {
  display: grid;
  gap: 0.85rem;
}

.world-map {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 280px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(12, 18, 24, 0.15), rgba(12, 18, 24, 0.55)),
    var(--map-image) center / cover no-repeat;
  overflow: hidden;
  animation: riseIn 0.45s ease both;
}

.map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.map-path {
  fill: none;
  stroke-width: 0.9;
  stroke-linecap: round;
  stroke-dasharray: 2 1.5;
}

.map-path.locked { stroke: rgba(154, 173, 184, 0.25); }
.map-path.active {
  stroke: rgba(110, 176, 232, 0.75);
  stroke-dasharray: none;
  animation: pathPulse 2.8s ease-in-out infinite;
}
.map-path.complete {
  stroke: rgba(92, 186, 132, 0.85);
  stroke-dasharray: none;
}

@keyframes pathPulse {
  0%, 100% { stroke-opacity: 0.55; }
  50% { stroke-opacity: 1; }
}

.map-region {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
  text-align: center;
  color: rgba(235, 228, 216, 0.7);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.map-region strong {
  display: block;
  font-family: var(--font-brand);
  font-size: clamp(0.7rem, 2.2vw, 0.95rem);
  letter-spacing: 0.06em;
  color: var(--brass);
}

.map-region__ch {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mist);
}

.map-camp,
.map-node {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 3;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

.map-camp__dot,
.map-node__pin {
  display: block;
  width: 14px;
  height: 14px;
  margin: 0 auto;
  border-radius: 50%;
  border: 2px solid var(--bone);
  background: var(--copper);
  box-shadow: 0 0 0 4px rgba(47, 126, 196, 0.2);
}

.map-camp__label,
.map-node__label {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.68rem;
  white-space: nowrap;
  color: var(--bone);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
}

.map-node.open .map-node__pin {
  background: var(--brass);
  animation: pulseSoft 2s ease-in-out infinite;
}

.map-node.cleared .map-node__pin {
  background: var(--heal);
  box-shadow: 0 0 0 4px rgba(92, 186, 132, 0.25);
}

.map-node.locked { opacity: 0.45; cursor: not-allowed; }
.map-node.locked .map-node__pin {
  background: #405060;
  border-color: #708090;
  box-shadow: none;
}

.map-node.selected .map-node__pin {
  outline: 2px solid var(--bone);
  outline-offset: 3px;
}

.map-node:not(:disabled):hover .map-node__pin {
  transform: scale(1.15);
}

.map-panel {
  padding: 1rem;
  background: rgba(27, 40, 50, 0.9);
  border: 1px solid var(--line);
  animation: riseIn 0.3s ease both;
}

.map-panel h3 {
  margin: 0.2rem 0 0.45rem;
  font-family: var(--font-brand);
  font-size: 1.15rem;
}

.map-panel .chapter {
  color: var(--brass);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 600px) {
  .party-slots { grid-template-columns: repeat(3, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dock { grid-template-columns: repeat(4, 1fr); }
  .fighter { width: 88px; }
  .world-map {
    aspect-ratio: 4 / 5;
    min-height: 340px;
  }
  .map-node__label { font-size: 0.58rem; }
}

.settings-panel {
  display: grid;
  gap: 1.25rem;
  max-width: 34rem;
}

.settings-block {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  background: rgba(16, 24, 32, 0.55);
}

.settings-block h3 {
  margin: 0 0 0.85rem;
  font-family: var(--font-brand);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brass);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  color: var(--bone);
  font-size: 0.92rem;
}

.settings-row--stack {
  flex-direction: column;
  align-items: stretch;
}

.settings-row input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--brass);
}

.settings-row input[type="range"] {
  width: 100%;
  accent-color: var(--brass);
}

.settings-row b {
  font-weight: 600;
  color: var(--mist);
}

.settings-hint {
  margin: 0 0 0.9rem;
  font-size: 0.8rem;
  line-height: 1.4;
}

.settings-actions {
  flex-wrap: wrap;
}

.btn.danger {
  border-color: #8a3a3a;
  color: #f0b0a8;
}
.btn.danger:hover {
  border-color: #c05050;
  color: #fff;
}
.btn.danger:disabled {
  opacity: 0.45;
}
