/* ワールドマップ・エリアマップ（地図・ノード・情報カード・下の操作）。 */

.mapscr { background: #0b1030; }
.map-view { position: absolute; inset: 0; overflow: hidden; }
.map-blur { position: absolute; inset: -40px; filter: blur(18px) brightness(.55) saturate(1.2); transform: scale(1.1); }
.map-canvas {
  --top-h: clamp(46px, 9vh, 84px);
  position: absolute; left: 50%; top: calc(var(--top-h) + (100% - var(--top-h)) / 2); transform: translate(-50%, -50%);
  height: calc(100% - var(--top-h)); width: min(100%, calc((100vh - var(--top-h)) * 16 / 9)); max-height: calc(100vw * 9 / 16);
  aspect-ratio: 16 / 9; border-radius: 10px; box-shadow: 0 0 0 3px rgba(255,255,255,.5), 0 20px 50px rgba(0,0,0,.5);
  background-size: cover !important; background-position: center !important;
}
.map-canvas::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(10, 16, 48, .35)); }
.map-roads { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.road { stroke: rgba(255, 255, 255, .85); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 2 14; filter: drop-shadow(0 2px 0 rgba(0,0,0,.35)); }
.road.is-done { stroke: #ffd36b; stroke-dasharray: none; stroke-width: 5; opacity: .9; }

/* ノード */
.node { --ns: clamp(40px, 7.4vh, 78px); position: absolute; width: var(--ns); height: var(--ns); transform: translate(-50%, -50%); padding: 0; border: 0; background: none; cursor: pointer; z-index: 2; }
.node-ring { position: absolute; inset: -8%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #e6ecff 60%, #b7c4ee); border: var(--bw) solid var(--c-line); box-shadow: 0 5px 0 var(--c-line), 0 8px 14px rgba(0,0,0,.4); transition: transform .15s; }
.node-icon { position: absolute; inset: 8%; display: grid; place-items: center; }
.node-icon img, .node-icon .ph { width: 100%; height: 100%; object-fit: contain; font-size: calc(var(--ns) * .32); }
.node:hover .node-ring { transform: scale(1.1); }
.node:active .node-ring { transform: scale(.95) translateY(3px); box-shadow: 0 2px 0 var(--c-line); }
.node-name { position: absolute; left: 50%; top: calc(108% + var(--lg, 6px)); transform: translateX(-50%); white-space: nowrap; padding: .1em .6em; border-radius: 6px;
  background: rgba(16, 22, 58, .88); color: #fff; font: 800 clamp(10px, .55vw + .7vh, 17px)/1.3 var(--font-ui); border: 2px solid rgba(255,255,255,.8); pointer-events: none; }
.node--boss .node-ring { background: radial-gradient(circle at 35% 30%, #fff5c8, #ffcc33 60%, #e09000); }
.node--elite .node-ring { background: radial-gradient(circle at 35% 30%, #ffd0d0, #ff6262 60%, #c41c1c); }
.node--special .node-ring { background: radial-gradient(circle at 35% 30%, #f0dcff, #b47aff 60%, #6a2fd0); }
.node--story .node-ring, .node--event .node-ring, .node--ground .node-ring { background: radial-gradient(circle at 35% 30%, #fff, #ffe9a8 60%, #ffbe3a); }
.node--daily .node-ring { background: radial-gradient(circle at 35% 30%, #fff, #ffd0e4 60%, #ff7aae); }
.node--battle .node-ring, .node--kira .node-ring { background: radial-gradient(circle at 35% 30%, #fff, #cfe8ff 60%, #6fb2ff); }
.node--kira .node-ring { background: radial-gradient(circle at 35% 30%, #fff, #fff5b0 50%, #a6f0ff); animation: kira 2s linear infinite; }
@keyframes kira { 50% { filter: hue-rotate(60deg) brightness(1.15); } }
.node.is-cleared .node-ring { filter: grayscale(.85) brightness(.9); }
.node.is-cleared .node-icon { opacity: .6; }
/* 終えた1回きりのノード（見返すだけ）は小さく・名札なしで描く（混んだ地図で今の目的地を読みやすく。選ぶと名札が出る） */
.node.is-cleared { --ns: clamp(28px, 5.2vh, 54px); z-index: 1; }
.node.is-cleared .node-name { display: none; }
.node.is-cleared.is-sel .node-name, .node.is-cleared:hover .node-name { display: block; }
.node.is-cleared .node-clear { right: -24%; bottom: -18%; }
.node-clear { position: absolute; right: -18%; bottom: -12%; width: 52%; height: 52%; transform: rotate(-12deg); }
.node-clear img, .node-clear .ph { width: 100%; height: 100%; }
.node.is-target .node-ring { animation: node-glow 1.2s ease-in-out infinite; }
@keyframes node-glow { 0%, 100% { box-shadow: 0 5px 0 var(--c-line), 0 0 0 0 rgba(255, 210, 60, .9); } 50% { box-shadow: 0 5px 0 var(--c-line), 0 0 0 14px rgba(255, 210, 60, 0); } }
.node-next { position: absolute; left: 50%; bottom: 112%; transform: translateX(-50%); padding: .1em .55em; border-radius: 6px; white-space: nowrap;
  background: var(--c-danger); color: #fff; font: 400 clamp(10px, .5vw + .6vh, 16px) var(--font-title); border: 2px solid #fff; box-shadow: 0 3px 0 var(--c-line); animation: next-bounce .8s ease-in-out infinite; pointer-events: none; }
.node-next::after { content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--c-danger); }
@keyframes next-bounce { 50% { transform: translate(-50%, -6px); } }
.node.is-sel .node-ring { transform: scale(1.15); box-shadow: 0 5px 0 var(--c-line), 0 0 0 5px #fff, 0 0 0 9px var(--c-accent); }
.node.is-fresh { animation: node-fresh .9s cubic-bezier(.2, 1.6, .4, 1) .3s backwards; }
.node.is-fresh::before { content: ''; position: absolute; inset: -60%; border-radius: 50%; background: repeating-conic-gradient(rgba(255, 230, 120, .7) 0 12deg, transparent 12deg 30deg); animation: fresh-burst 1.4s .3s ease-out forwards; opacity: 0; pointer-events: none; }
@keyframes node-fresh { from { transform: translate(-50%, -50%) scale(0) rotate(-180deg); } }
@keyframes fresh-burst { 0% { opacity: 1; transform: scale(.2) rotate(0); } 100% { opacity: 0; transform: scale(1.4) rotate(90deg); } }
.node.is-from .node-ring { box-shadow: 0 5px 0 var(--c-line), 0 0 0 4px rgba(255,255,255,.8); }

/* 情報カード */
.node-card { position: absolute; z-index: 10; right: calc(var(--safe-r) + 12px); bottom: calc(var(--safe-b) + clamp(64px, 12vh, 100px)); width: min(40vw, 460px); pointer-events: none; opacity: 0; transform: translateX(30px); transition: .22s cubic-bezier(.2, .9, .3, 1); }
.node-card.is-left { right: auto; left: calc(var(--safe-l) + 12px); transform: translateX(-30px); }
.node-card.is-on { opacity: 1; transform: none; pointer-events: auto; }
.node-card-in { padding: clamp(10px, 1.6vh, 20px) clamp(12px, 1.2vw, 22px); }
.node-card-head { display: flex; align-items: center; gap: .6em; padding-right: 2.4em; }
.node-card-icon { flex: none; width: clamp(36px, 6vh, 56px); aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--c-line); background: #fff; display: grid; place-items: center; overflow: hidden; }
.node-card-icon img, .node-card-icon .ph { width: 80%; height: 80%; object-fit: contain; }
.node-card-kind { font-size: var(--fs-xs); font-weight: 800; color: var(--c-accent); }
.node-card-name { font: 400 var(--fs-l)/1.2 var(--font-title); }
.node-card-x { position: absolute; right: 8px; top: 8px; width: 36px; height: 36px; min-width: 36px; min-height: 36px; font-size: var(--fs-m); }
.node-card-lines { margin: .5em 0; padding-left: 1.2em; font-size: var(--fs-s); font-weight: 700; color: var(--c-text-dim); }
.node-card-enemies { display: flex; gap: 8px; flex-wrap: wrap; margin: .4em 0; }
.node-enemy { display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--c-panel-2); border: 2px solid var(--c-line); font-size: var(--fs-xs); font-weight: 800; }
.node-enemy-face { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; border: 2px solid var(--c-line); background: #fff; }
.node-enemy-face img, .node-enemy-face .ph { width: 100%; height: 100%; object-fit: cover; font-size: 14px; }
.node-enemy-lv { color: var(--c-danger); }
.node-card-rec { font-size: var(--fs-s); font-weight: 800; margin: .3em 0; }
.node-card-rec .ok { color: var(--c-ok); } .node-card-rec .ng { color: var(--c-danger); }
.node-card-btns { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: .5em; }

/* 上のバー */
.map-top { position: absolute; z-index: 8; left: 0; right: 0; top: 0; height: clamp(46px, 9vh, 84px); display: flex; align-items: center; gap: var(--gap);
  padding: 0 calc(var(--safe-r) + 12px) 0 calc(var(--safe-l) + 12px);
  background: linear-gradient(180deg, rgba(10, 16, 48, .95), rgba(10, 16, 48, .75)); border-bottom: 3px solid rgba(255,255,255,.85); color: #fff; }
.map-top::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; background: var(--ruler-ticks); filter: invert(1); opacity: .4; background-size: 100% 100%; }
.map-place { flex: 1; min-width: 0; }
.map-place-name { font: 400 var(--fs-l)/1.1 var(--font-title); letter-spacing: .04em; text-shadow: 0 3px 0 var(--c-accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-place-sub { font-size: var(--fs-xs); font-weight: 700; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-hero { display: flex; align-items: center; gap: 6px; }
.map-hero-face { width: clamp(32px, 6vh, 54px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 3px solid #fff; background: var(--c-accent); }
.map-hero-face img, .map-hero-face .ph { width: 100%; height: 100%; object-fit: cover; }
.map-hero-lv { display: flex; align-items: baseline; gap: 2px; } .map-hero-lv b { font-size: var(--fs-l); color: var(--c-accent-hi); }
.map-money, .chip { display: flex; align-items: center; gap: 4px; padding: .2em .8em .2em .3em; border-radius: 999px; background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.6); white-space: nowrap; }
.map-money b, .chip b { font-size: var(--fs-m); color: var(--c-gold); }
.map-money small, .chip small { font-size: var(--fs-xs); opacity: .8; }
.chip-ic { display: inline-grid; width: 1.6em; height: 1.6em; } .chip-ic img, .chip-ic .ph { width: 100%; height: 100%; object-fit: contain; font-size: 9px; border-radius: 50%; }

/* 次の目的地 */
.map-guide { position: absolute; z-index: 7; left: calc(var(--safe-l) + 12px); top: calc(clamp(46px, 9vh, 84px) + 10px); display: flex; align-items: center; gap: .5em; padding: .3em 1em .3em .3em; border-radius: 999px;
  background: rgba(255, 255, 255, .95); border: 3px solid var(--c-line); box-shadow: var(--shadow-s); cursor: pointer; font-family: var(--font-ui); max-width: 46vw; animation: telop-in .5s .3s backwards; }
.map-guide-tag { padding: .2em .7em; border-radius: 999px; background: var(--c-danger); color: #fff; font: 800 var(--fs-xs) var(--font-ui); white-space: nowrap; }
.map-guide-name { font-weight: 900; font-size: var(--fs-s); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 下の操作 */
.map-dock { position: absolute; z-index: 9; left: calc(var(--safe-l) + 10px); bottom: calc(var(--safe-b) + 10px); display: flex; gap: 8px; }
.map-dock-btn { flex-direction: column; gap: 0; padding: .25em .7em; min-width: clamp(54px, 9vh, 86px); height: clamp(50px, 10vh, 84px); border-radius: 14px; font-size: var(--fs-xs); }
.map-dock-btn img, .map-dock-btn .ph { width: clamp(22px, 4.4vh, 40px); height: clamp(22px, 4.4vh, 40px); object-fit: contain; font-size: 10px; border-radius: 8px; }
.map-dock-btn--main { --b-bg: linear-gradient(180deg, #ffb347, #ff6a2b 55%, #f04a1a); --b-fg: #fff; --b-edge: #b8320c; }

/* ワールドマップ */
.map-canvas--world { }
.apin { position: absolute; transform: translate(-50%, -100%); border: 0; background: none; padding: 0; cursor: pointer; z-index: 2; }
.apin-dot { width: clamp(20px, 3.4vh, 34px); height: clamp(20px, 3.4vh, 34px); margin: 0 auto; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c-accent); border: 3px solid #fff; box-shadow: 0 4px 0 var(--c-line); }
.apin-label { position: absolute; left: 50%; bottom: 120%; transform: translateX(-50%); white-space: nowrap; padding: .15em .8em; border-radius: 8px; background: #fff; border: 3px solid var(--c-line);
  font: 400 clamp(12px, .8vw + .6vh, 22px) var(--font-title); color: var(--c-text); box-shadow: 0 4px 0 var(--c-line); }
.apin-label em { font-style: normal; color: #fff; background: var(--c-danger); border-radius: 50%; display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; margin-left: .3em; font-size: .8em; }
.apin.is-target .apin-dot { animation: node-glow 1.2s ease-in-out infinite; background: var(--c-danger); }
.apin:hover .apin-label { transform: translateX(-50%) translateY(-3px); }
.apin-here { position: absolute; left: 60%; top: -10%; width: clamp(26px, 5vh, 46px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 3px solid #fff; animation: float-y 1.6s ease-in-out infinite; }
.apin-here img, .apin-here .ph { width: 100%; height: 100%; object-fit: cover; }
.world-tabs { position: absolute; z-index: 8; left: 50%; top: calc(clamp(46px, 9vh, 84px) + 8px); transform: translateX(-50%); display: flex; gap: 6px; }
.world-tab { padding: .3em 1.2em; border-radius: 999px; border: 3px solid var(--c-line); background: #fff; font: 800 var(--fs-s) var(--font-ui); cursor: pointer; }
.world-tab.is-on { background: var(--c-accent); color: #fff; }
.world-tab { position: relative; }
.world-tab-mark { position: absolute; top: -10px; right: -6px; min-width: 1.5em; height: 1.5em; display: grid; place-items: center; border-radius: 999px; background: var(--c-danger); color: #fff; border: 2px solid #fff; font: 900 var(--fs-xs)/1 var(--font-ui); font-style: normal; animation: tab-mark 1s ease-in-out infinite alternate; }
@keyframes tab-mark { to { transform: translateY(-3px) scale(1.08); } }
.world-list { position: absolute; z-index: 8; right: calc(var(--safe-r) + 10px); top: calc(clamp(46px, 9vh, 84px) + 10px); width: min(26vw, 300px); max-height: 60vh; overflow: auto; padding: 8px; }
.world-list-head { font: 400 var(--fs-s) var(--font-title); margin: 0 4px 6px; color: var(--c-ice); }
.world-list-row { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: .5em .8em; margin-bottom: 4px; border-radius: 10px; border: 2px solid rgba(255,255,255,.4); background: rgba(255,255,255,.06); color: #fff; font: 800 var(--fs-s) var(--font-ui); cursor: pointer; text-align: left; }
.world-list-row:hover { background: rgba(255,255,255,.18); }
.world-list-row em { font-style: normal; font-size: var(--fs-xs); background: var(--c-danger); padding: .1em .5em; border-radius: 6px; }

@media (max-height: 500px) {
  .node-card { width: min(46vw, 400px); bottom: calc(var(--safe-b) + 58px); }
  .node-card-in { padding: 8px 12px; }
  .node-card-lines { margin: .2em 0; }
  .map-dock-btn { height: 46px; min-width: 50px; }
  .world-list { max-height: 50vh; }
}

/* 名札の逃がし（area.js の layoutLabels が at-* を付ける。--lg は名札とノードのすき間） */
.node-name.at-above { top: auto; bottom: calc(108% + var(--lg, 6px)); }
.node-name.at-right { left: calc(108% + var(--lg, 6px)); top: 50%; transform: translateY(-50%); }
.node-name.at-left { left: auto; right: calc(108% + var(--lg, 6px)); top: 50%; transform: translateY(-50%); }
.node-name.is-crowded { opacity: .82; }
.node:hover .node-name, .node.is-sel .node-name { z-index: 3; opacity: 1; }
.node:hover, .node.is-sel { z-index: 4; }
