﻿@charset "utf-8";

@font-face {
  font-family: en;
  src: url(/client/public/fonts/inconsolata.woff)
}

@font-face {
  font-family: sym;
  src: url(/client/public/fonts/symmingliu.woff)
}

@font-face {
  font-family: huninn;
  src: url(/font/jf-openhuninn-2.0.ttf)
}

@font-face {
  font-family: zh;
  src: local("Microsoft JhengHei"), local("MingLiU_HKSCS")
}

:root {
  --bg: #0a0e0b;
  --panel: #0c140e;
  --panel2:#0e1a11;
  --line: #1f3325;
  --txt: #cfe0d2;
  --dim: #6f8a78;
  --accent: #64e544;
  --gold: #c8a24a;
  --mapbg: #070b08
}

/* SSR 區域概覽(SEO/AEO):原始 HTML 可見;JS 進場後隱藏改顯示互動 app(漸進增強,非 cloaking) */
#seo-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 18px 60px;
  color: var(--txt);
  line-height: 1.7
}

#seo-content h1 {
  color: var(--gold);
  font-size: 22px;
  margin: .2em 0 .1em
}

#seo-content h2 {
  color: var(--gold);
  font-size: 17px;
  margin: 1.5em 0 .4em
}

#seo-content a {
  color: var(--gold);
  text-decoration: none
}

#seo-content a:hover {
  text-decoration: underline
}

#seo-content ul {
  padding-left: 1.2em;
  margin: .4em 0
}

#seo-content .muted {
  color: var(--dim);
  font-size: 13px
}

html.js #seo-content {
  display: none
}

html:not(.js) body {
  overflow: auto;
  display: block
}

html:not(.js) #sidebar, html:not(.js) #main {
  display: none
}

/* scrollbar(沿用 library 頁風格:深底 + 淡綠 thumb) */
::-webkit-scrollbar {
  width: 7px;
  height: 7px
}

::-webkit-scrollbar-button {
  background: #060b07;
  border-radius: 0
}

::-webkit-scrollbar-track-piece {
  background: #060b07
}

::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background-color: rgb(202 255 167 / 29%);
  border: 1px solid #060b07
}

::-webkit-scrollbar-track {
  box-shadow: transparent
}

html {
  scrollbar-width: thin;
  scrollbar-color: rgb(202 255 167 / 29%) #060b07
}

* {
  box-sizing: border-box
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden
}

body {
  background: var(--bg);
  color: var(--txt);
  font-family: huninn, zh, sans-serif;
  display: flex;
  flex-direction: row;
  background-image: url("/image/leaf.jpg");
}

/* UI 縮放:依螢幕高度整體放大介面(JS 設 --ui);地圖渲染區 #mapgrid / 世界總覽 #worldSvg 本就有縮放,排除 */
#sidebar, header, #banner, #toolbar, #right, #roomcard {
  zoom: var(--ui, 1)
}

/* header(現位於 main 頂端,只跨主區寬度) */
header {
  height: 54px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;  /*background: var(--panel);*/
  position: relative;
  z-index: 40;      /* 搜尋下拉要浮在世界總覽(#world z-index:30)之上 */

  /*border-bottom: 1px solid var(--line)*/
}

#logo {
  margin: 10px 0;
}

#logo a {
  text-decoration: none;
  font-family: huninn, zh;
  font-weight: bold;
  letter-spacing: 2px;
  color: var(--gold);
  font-size: 18px;
  white-space: nowrap;
  padding: 14px 16px;
}

#logo small {
  display: block;  /*font-size: 9px;
  letter-spacing: 3px;*/
  font-size: 13px;
  color: #bbbbbb;
  text-align: center;
  font-weight: normal;
}

.hdr-search {
  flex: 1;
  position: relative;
  max-width: 520px
}

#search {
  width: 100%;
  background: #0a120c;
  border: 1px solid var(--line);
  color: var(--txt);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 15px
}

.hbtn {
  background: transparent;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  background-image: url('/image/filter-btn.png');
  background-size: 400% 113%;
  background-position: 100% 0%;
  color: #ccc;
  border: none;
  width: 60px;
}

.hbtn:hover {
  color: var(--txt);
  border-color: var(--accent)
}

#hamburger {
  display: none
}

/* sidebar(左欄全高:LOGO + 區域總覽) */
#sidebar {
  width: 230px;
  flex: 0 0 auto;  /*background: var(--panel);*/

  /*border-right: 1px solid var(--line);*/
  display: flex;
  flex-direction: column;
  min-height: 0
}

/* 世界總覽入口:導覽欄頂端,在 #areaTree 捲動區之外→永遠置頂可見 */
#sidebar #worldBtn {
  flex: 0 0 auto;
  display: block;
  width: 100%;
  font-family: inherit;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--gold);
  font-size: 20px;
  text-align: left;
  padding: 10px 8px 10px;
}

#sidebar #worldBtn:hover {
  color: #e6c468;
}

body.world-open #sidebar #worldBtn {
  color: gold;
  text-shadow: 2px 2px 4px #666666;
}

#areaTree {
  flex: 1;
  overflow: auto;
  padding: 0 8px 8px
}

.land {
  font-size: 20px;
  color: var(--gold);
  padding: 10px 8px 4px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px
}

.land:hover {
  color: #e6c468
}

.land .cv {
  font-size: 10px;
  color: var(--dim);
  transition: transform .15s ease
}

.land.collapsed .cv {
  transform: rotate(-90deg)
}

.land .tg {
  margin-left: auto;
  font-size: 10px;
  font-weight: bold;
  color: white;
  font-family: en, sym, huninn, zh;
  background: #006666;
  border-radius: 100px;
  padding: 1px 2px;
}

.land .tg::after {
  content: "\ff0d"        /* 全形－(展開);用 Unicode 跳脫碼避免 CSS 編碼被誤判成 Latin-1 → ï¼ 亂碼 */
}

.land.collapsed .tg::after {
  content: "\ff0b"        /* 全形＋(收合) */
}

.landgrp.hide {
  display: none
}

.favhead {
  font-size: 20px;
  color: var(--gold);
  font-weight: bold;
  padding: 12px 8px 4px;
  user-select: none
}

.grpitem {
  padding: 4px 10px 4px 22px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--dim)
}

.grpitem:hover {
  background: #16271a;
  color: var(--txt)
}

.grpitem.on {
  background: #1d3a23;
  color: #fff
}

.areaitem {
  padding: 6px 10px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--txt);
  display: flex;
  justify-content: space-between;
  align-items: center
}

.areaitem:hover {
  background: #16271a
}

.areaitem.on {
  background: #36754377;
  color: #fff;
  backdrop-filter: blur(5px);
}

.areaitem .q {
  font-size: 11px;
  color: var(--gold)
}

#randomBtn {
  margin: 8px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  font-size: 14px
}

#randomBtn:hover {
  color: var(--accent);
  border-color: var(--accent)
}

/* main */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0
}

/* banner */
#banner {
  flex: 0 0 auto;
  position: relative;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background: var(--panel2);
  border-radius: 10px 0 0 0;
}

#bannerImg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;  /*opacity: .5*/
  border-radius: 10px 0 0 0;
  transition: opacity .35s ease;
}

#banner .veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #000000bb 40%, #00000000 80%);
  border-radius: 10px 0 0 0;
}

#banner .body {
  position: relative;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 7px
}

#banner h1 {
  margin: 0;
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 10px
}

#banner .star {
  cursor: pointer;
  color: var(--dim);
  font-size: 18px
}

#banner .star.on {
  color: var(--gold)
}

#banner .desc {
  font-size: 13px;
  color: #b6c8ba;
  max-width: 680px;
  line-height: 1.6;
  min-height: 18px
}

#banner .desc a {
  color: var(--gold);
  text-decoration: none;
  font-weight: bold
}

#banner .desc a:hover {
  text-decoration: underline
}

#banner .chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px
}

#banner .chip {
  background: #10231599;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 12px;
  font-size: 13px;
  cursor: pointer
}

#banner .chip:hover {
  border-color: var(--accent);
  color: #fff
}

#banner .chip.on {
  border-color: var(--accent);
  background: #16271a
}

#banner .chip b {
  color: var(--gold);
  font-size: 15px
}

#chipPanel {
  position: fixed;
  z-index: 50;
  display: none;
  width: 300px;
  max-height: 56vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 8px 28px #000a;
  font-size: 13px
}

#chipPanel.show {
  display: block
}

#chipPanel h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--dim)
}

#chipPanel .row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 6px;
  border-radius: 6px
}

#chipPanel .row.clk {
  cursor: pointer
}

#chipPanel .row.clk:hover {
  background: #16271a
}

#chipPanel .row.nomap {
  color: var(--dim);
  margin-top: 4px;
  border-top: 1px dashed #2a3a30;
  border-radius: 0;
  cursor: default
}

#chipPanel .row.nomap .n {
  color: var(--dim)
}

#chipPanel .row .n {
  color: var(--gold);
  flex: 0 0 auto
}

#chipPanel .qz {
  padding: 4px 6px
}

#chipPanel .qz .df {
  color: var(--dim);
  font-size: 11px;
  margin-left: 6px
}

#chipPanel .none {
  color: #4a5e50;
  padding: 4px 6px
}

#pf .pfrow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  font-size: 13px
}

#pf .pfk {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 4px;
  background: #1d3a23;
  color: #fff;
  font-size: 12px
}

#pf .pfval {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

#pf .pfval.none {

  /*color: #4a5e50*/
}

#pf .pfx {
  cursor: pointer;
  color: var(--dim);
  font-size: 11px
}

#pf .pfx:hover {
  color: var(--accent)
}

.pfgo {
  display: flex;
  gap: 6px;
  margin-top: 2px
}

#pf #pfGo {
  flex: 1;
  background: #0d1b11;
  color: var(--txt);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  font-size: 13px
}

#pf #pfGo:hover {
  background: #16271a
}

#pfClear {
  flex: 0 0 auto;
  background: transparent;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px
}

#pfClear:hover:not(:disabled) {
  color: #ffb4b4;
  border-color: #5a2a2a
}

#pfClear:disabled {
  opacity: .4;
  cursor: not-allowed;
}

#pfResult {
  margin-top: 8px;
  font-size: 13px
}

#pfResult .copy {
  cursor: pointer;
  color: var(--gold);
  font-size: 12px;
  float: right
}

#pfResult .copy:hover {
  text-decoration: underline
}

#pfResult .cmd {
  clear: both;
  background: #0c140e;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--accent);
  word-break: break-all;
  font-size: 12px;
  margin: 4px 0 6px
}

#pfResult .cmd b {
  color: var(--dim);
  font-weight: normal
}

#pfResult .step {
  padding: 3px 6px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  gap: 6px
}

#pfResult .step:hover {
  background: #16271a
}

#pfResult .step .md {
  color: var(--accent);
  flex: 0 0 auto
}

#pfResult .step .rg {
  color: var(--gold);
  font-size: 11px
}

#pfResult .none {
  color: #4a5e50
}

#mapgrid .onpath {
  border-radius: 2px;
  filter: brightness(1) drop-shadow(0px 0px 3px white);
  font-weight: bold;
  color: #41ffc5;
}

#roomcard .pfbtns {
  display: flex;
  gap: 6px;
  margin-top: 10px
}

#roomcard .pfbtns button {
  flex: 1;
  background: #0d1b11;
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px;
  cursor: pointer;
  font-size: 12px
}

#roomcard .pfbtns button:hover {
  border-color: var(--accent);
  color: #fff
}

#world {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: var(--bg);
  display: none
}

#world.show {
  display: block
}

#worldSvg {
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  font-family: en, sym, huninn, zh
}

#worldSvg.drag {
  cursor: grabbing
}

#worldHint {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 2;
  color: var(--dim);
  font-size: 12px;
  background: #0a0e0bcc;
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none
}

#worldStats {
  position: absolute;
  left: 12px;
  top: 10px;
  z-index: 2;
  color: var(--dim);
  font-size: 13px;
  background: #0a0e0bcc;
  padding: 5px 12px;
  border-radius: 6px;
  pointer-events: none
}

#worldStats span {
  color: var(--gold)
}

#worldClose {
  position: absolute;
  right: 12px;
  top: 10px;
  z-index: 2;
  background: #0c140ecc;
  border: 1px solid var(--line);
  color: var(--txt);
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 13px
}

#worldClose:hover {
  border-color: var(--accent)
}

/* ── 大陸名 label 覆蓋層 ─────────────────────────────────
 與 #worldSvg 同尺寸、同座標系,套用相同 wcam transform(JS applyWLabelCam)
 → 跟著地圖一起平移/縮放。pointer-events 預設關閉,不擋 SVG 節點點擊。 */
#worldLabels {
  position: absolute;
  inset: 0;
  z-index: 1;                 /* 浮在 SVG 之上、控制列(z-index:2)之下 */
  transform-origin: 0 0;      /* 與 SVG #wg 一致:左上為原點 */
  pointer-events: none;
  overflow: visible
}

/* 單一大陸 label:left/top = 世界座標(錨點),自身 translate(-50%,-50%) 置中 */
#worldLabels .wlabel {
  position: absolute;
  transform: translate(-50%, -50%) scale(0.8);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  white-space: nowrap;
  text-align: center
}

/* 緞帶外框(ASCII 裝飾層):等寬字繪製,與文字分層;隨 overlay 一起縮放 */
#worldLabels .wlabel-art {
  margin: 0;
  font-family: en, sym, huninn, zh;
  font-size: 14px;
  line-height: 13px;
  letter-spacing: 0px;
  white-space: pre;
  color: var(--gold);
  text-shadow: 0 0 6px #ffcf6a66, 0 0 2px #ffcf6acc   /* 線條光暈 */ ;
  text-align: left;
}

#worldLabels .zambara .wlabel-art {
  text-shadow: 0 0 6px #ffcf6a66, 0 0 2px #ffcf6acc   /* 線條光暈 */ ;
  color: green;
}

#worldLabels .simara .wlabel-art {
  text-shadow: 0 0 6px #ffcf6a66, 0 0 2px #ffcf6acc   /* 線條光暈 */ ;
  color: #e47855;
}

/* 文字層:絕對定位罩住緞帶「中段文字區」,內部 flex 置中。
 top/bottom = 上緣/下緣裝飾高度(微調旋鈕);left/right 內縮避開燕尾。 */
#worldLabels .wlabel-inner {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 30px;                          /* 上緣裝飾 ~2 行(2×15px) */
  bottom: 15px;                       /* 下緣 ~1 行 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none
}

/* 中文標題:大字(~2.25 行高)。text-indent = letter-spacing 補回尾端字距讓視覺置中 */
#worldLabels .wlabel-cn {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: .28em;
  text-indent: .28em;
  color: #ffe9b0;
  text-shadow: 0 0 12px #ffcf6aaa, 0 2px 6px #000d   /* 標題光暈 */ ;
  margin-top: 10px;
}

/* 英文標題:小字(~1 行高) */
#worldLabels .wlabel-en {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .42em;
  text-indent: .42em;
  text-transform: uppercase;
  color: #f1e4bed8;
  text-shadow: 0 0 8px #ffcf6a88, 0 1px 4px #000c;
}

#worldLabels .zambara .wlabel-cn {
  color: #46db46;
}

#worldLabels .zambara .wlabel-en {
  color: #bfcbbf;
}

#worldLabels .simara .wlabel-cn {
  color: #ffde8a;
}

#worldLabels .simara .wlabel-en {
  color: #bfcbbf;
}

/* 排列模式:label 可拖曳;強制顯示全部 5 槽(連未開放的也能預先擺位) */
#worldLabels.editing .wlabel {
  pointer-events: auto;
  cursor: move;
  display: block !important;
  outline: 1px dashed #ffffff55;
  outline-offset: 6px
}

/* 未開放的大陸:預設用 CSS 隱藏;開放後把對應 id 從這條移除即顯示 */
#wlabel-3, #wlabel-4, #wlabel-5 {
  display: none
}

/* 小地圖(右下角):JS 依「目前是否看得到全世界」自動顯示;📌 可釘選常駐 */
#worldMini {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: none;
  padding: 6px;
  background: #0a0e0bd9;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px #0008
}

#worldMini.show {
  display: block
}

#wmSvg {
  display: block;
  cursor: crosshair;
  border-radius: 4px;
  background: #070b08
}

#wmRect {
  fill: #c8a24a26;
  stroke: var(--gold);
  stroke-width: 1.4;
  pointer-events: none
}

#wmPin {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  padding: 0;
  line-height: 1;
  font-size: 11px;
  cursor: pointer;
  color: var(--dim);
  background: #0c140e;
  border: 1px solid var(--line);
  border-radius: 50%
}

#wmPin.on {
  color: var(--gold);
  border-color: var(--gold)
}

/* 大陸快速跳轉(頂端置中):一鍵 zoom 到某大陸,或回全世界 */
#worldJump {
  position: absolute;
  left: 12px;
  top: 46px;          /* 在 #worldStats(top:10px) 下方,左側垂直排列 */
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px
}

#worldJump button {
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  color: var(--txt);
  background: #0c140ecc;
  border: 1px solid var(--line);
  border-left: 3px solid var(--bc, var(--line));
  border-radius: 6px
}

#worldJump button:hover {
  border-color: var(--accent)
}

/* 節點收藏 ★ 徽章(左上角,對稱於右上 β) */
#worldSvg .wn .wfav {
  fill: gold;
  font-size: 17px;
  text-anchor: middle;
  text-shadow: 0 0 5px white;
}

/* 區域預覽卡(僅 hover 裝置;position:fixed 跟指標,pointer-events:none 不擋點擊) */
#wpreview {
  position: fixed;
  z-index: 50;
  width: 220px;
  background: #0c140ef2;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 28px #000a;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(.96);
  transform-origin: top left;
  transition: opacity .15s ease, transform .15s cubic-bezier(.2, .8, .3, 1), visibility 0s linear .15s
}

#wpreview.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2, .8, .3, 1), visibility 0s
}

@media (prefers-reduced-motion:reduce) {
  #wpreview {
    transition: none;
    transform: none
  }

}

#wpreview .wp-img {
  height: 92px;
  background-size: cover;
  background-position: center;
  background-color: #070b08;
  border-bottom: 1px solid var(--line)
}

#wpreview .wp-body {
  padding: 8px 11px 10px
}

#wpreview .wp-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--txt)
}

#wpreview .wp-star {
  color: var(--gold)
}

#wpreview .wp-land {
  font-size: 11px;
  margin: 2px 0 7px;
}

#wpreview .wp-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--txt)
}

#wpreview .wp-go {
  margin-top: 8px;
  font-size: 11px;
  color: var(--dim)
}

/* 排列模式工具列(只在 localStorage.devmode='on' 顯示) */
#worldEdit {
  position: absolute;
  right: 12px;
  top: 50px;
  z-index: 2;
  display: none;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end
}

#worldEdit button {
  background: #0c140ecc;
  border: 1px solid var(--line);
  color: var(--txt);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 12px
}

#worldEdit button:hover {
  border-color: var(--accent)
}

#worldEdit #wEditBtn.on {
  border-color: var(--accent);
  color: var(--accent)
}

#worldEdit #wExport, #worldEdit #wReset {
  display: none
}

#worldSvg.editing .wn {
  cursor: move
}

#worldSvg .wn text {
  font-family: en, sym, huninn, zh;
  font-size: 15px;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  white-space: pre
}

#worldSvg .wn .bk {
  fill: var(--bg)
}

#worldSvg .wn .nm {
  fill: var(--bc);          /* 名稱用大陸本色 */
  font-weight: bold
}

#worldSvg .wn .fr {
  fill: var(--bc);          /* 4 行 ASCII 外框:本色、細、半透明,不搶名稱 */
  fill-opacity: .75;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1px;
}

#worldSvg .wn {
  cursor: pointer
}

#worldSvg .wn:hover .fr {
  fill-opacity: .85
}

#worldSvg .wn:hover .nm {
  fill: #fff
}

#worldSvg .wn .pin {
  font-size: 26px;
  fill: var(--bc);
  fill-opacity: .95;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: translate(13px, -15px) rotate(10deg) translateY(-4px) translateX(3px);  /* 起始:最終位置再往右上偏移(動畫時歸零→滑向左下釘入) */
  transition: opacity .1s ease, transform .18s cubic-bezier(.3, .8, .3, 1.1);
}

#worldSvg .wn:hover .pin, #worldSvg .wn.cur .pin {
  opacity: 1;
  transform: rotate(10deg) translateY(-4px) translateX(3px);
}

#worldSvg .wn.cur .pin {
  fill: var(--accent);
  fill-opacity: 1
}

#wgrid line {
  stroke: rgba(255, 255, 255, .06);
  stroke-width: 1;
  pointer-events: none;
}

#worldSvg .we {
  stroke: #3a5142;
  stroke-width: 2;
  stroke-opacity: .75;
  fill: none
}

#worldSvg .we.t {
  stroke: #3670dd;
  stroke-opacity: .85;
  stroke-dasharray: 10 5
}

#worldSvg .wn.cur .fr, #worldSvg .wn.cur .nm {
  fill: var(--accent);
  fill-opacity: 1
}

#worldSvg .dim {
  opacity: .18
}

body.world-open #banner, body.world-open #toolbar, body.world-open #right {
  display: none;
  background: url("/client/public/image/bg.jpg");
}

/* 世界總覽:乾淨全區接管,不顯示特定區域抬頭 */
#bannerToggle {
  position: absolute;
  right: 14px;
  top: 12px;
  z-index: 2;
  background: #0c140ecc;
  border: 1px solid var(--line);
  color: var(--dim);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 12px
}

body.banner-collapsed #banner .body {
  padding: 8px 20px
}

body.banner-collapsed #banner .desc, body.banner-collapsed #banner .chips {
  display: none
}

/* toolbar */
#toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  font-size: 14px
}

#toolbar button {
  background: #0d1b11;
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 13px
}

#toolbar button:disabled {
  opacity: .4;
  cursor: not-allowed;
}

#crumb {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap
}

#crumb .c {
  color: var(--gold);
}

#crumb .cur {
  font-weight: bold
}

#crumb .cur.room {
  cursor: pointer;
  text-decoration: underline dotted #5a7a62;
  text-underline-offset: 3px
}

#crumb .cur.room:hover {
  color: var(--gold)
}

#crumb .sep {
  color: #3a5142
}

/* map row */
#maprow {
  flex: 1;
  display: flex;
  min-height: 0
}

#mapbox {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: rgba(0, 0, 0, 0.8);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none
}

#mapbox.drag {
  cursor: grabbing
}

#mapgrid {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  white-space: pre;
  line-height: 1;
  font-size: 22px;
  font-family: en, sym, huninn, zh !important;
  color: var(--txt);
}

/* 房間點源粒子層:純螢幕覆蓋,粒子每幀依格子的螢幕位置生成,不擋互動 */
#mapfx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden
}

#mapfx .mpfx {
  position: absolute;
  left: 0;
  top: 0;
  line-height: 1;
  will-change: transform, opacity;
  font-family: en, sym, huninn, zh
}

/* ── 手電筒/火把遮罩（暗室區域 >70%，由 JS 動態切換）────────────────── */
#torchOverlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 1.2s ease;
  background: radial-gradient(circle at var(--tx, 50%) var(--ty, 50%), rgba(255, 160, 30, 0.04)   0%, rgba(255, 130, 10, 0.07)   calc(var(--tr, 80px) * 0.75), rgba(255, 80, 0, var(--tg, 0.28)) var(--tr, 80px), rgba(12, 5, 0, 0.68)     calc(var(--tr, 80px) * 2.0), rgba(5, 2, 0, 0.96)     calc(var(--tr, 80px) * 3.5));
}

#torchOverlay.active {
  opacity: 1;
}

#mapgrid span {
  cursor: default
}

/* 地形底色(第一層:per-room 旗標,極淡不搶 glyph;放在 .nav:hover 之前讓 hover 底色能覆蓋) */
#mapgrid .t-grass {
  background: rgba(95, 170, 90, .10)
}

#mapgrid .t-water {
  background: rgba(70, 130, 220, .15)
}

#mapgrid .t-dark {
  background: rgba(18, 18, 24, .38)
}

#mapgrid .t-poison {
  background: rgba(165, 90, 195, .14)
}

#mapgrid .t-desert {
  background: rgba(217, 184, 120, .16)
}

/* 植被房:有 set("landscapes") → 右上角疊一棵小樹 */
#mapgrid .veg {
  display: inline-block;
  position: relative;
}

#mapgrid .veg::after {
  content: attr(data-veg);
  position: absolute;
  font-size: 0.5em;
  top: 0.5em;
  right: 0.4em;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}

/* 迷宮房:看得見地貌但無走廊(路徑須自行探索) → 微淡 + 虛線框示意 */
#mapgrid .maze {
  opacity: .72;
  outline: 1px dashed rgba(210, 180, 120, .5);
  outline-offset: -2px
}

#mapgrid .nav {
  cursor: pointer;
  transition: background .12s ease, text-shadow .12s ease
}

#mapgrid .nav:hover {
  background: #1d3324;
  text-shadow: 0 0 6px var(--accent)
}

#mapgrid .focus {
  outline: 4px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
  animation: focusBreath 1.8s ease-in-out infinite   /* 目前所在房:磷光呼吸 */
}

/* 尋路起點/終點:格子右上角插小旗 */
#mapgrid .pfstart, #mapgrid .pfend {
  position: relative
}

#mapgrid .pfstart::before, #mapgrid .pfend::after {
  content: '⚑';
  position: absolute;
  top: -.5em;
  right: -.32em;       /* 預設都在右上角(不同格各一面,不會重疊) */
  font-size: .62em;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 0 2px #000, 0 0 5px currentColor
}

#mapgrid .pfstart::before {
  color: #4ce04c       /* 起點:綠旗 */
}

#mapgrid .pfend::after {
  color: #ff5a4d       /* 終點:紅旗 */
}

#mapgrid .pfstart.pfend::before {
  left: 0.1em;        /* 起終點同格→起點旗移左上角(旗桿在左,靠右一點像插在格子裡) */
  right: auto
}

/* 起終點若在路徑上:只取消會洗白旗子的 brightness 濾鏡,不加額外光暈 */
#mapgrid .pfstart.onpath, #mapgrid .pfend.onpath {
  filter: none
}

@keyframes focusBreath {

  /* spread 撐到 outline 外緣(~8px),光暈在框線外側暈開 */
  0%, 100% {
    box-shadow: 0 0 5px 7px rgba(100, 229, 68, .16)
  }

  50% {
    box-shadow: 0 0 14px 9px rgba(100, 229, 68, .4)
  }

}

#mapgrid .portal {
  cursor: pointer;
  color: #5bedf6
}

#mapgrid .portal:hover {
  filter: brightness(1.4)
}

/* 傳送/換層/進出口 glyph(◎▲▼◆＊) idle 呼吸:用 color 漸變(原色→與白50%混合→原色)提升醒目度。
 各圖示色碼不同→各自 keyframes(filter 提亮對這些深色碼效果有限,故改色相) */
#mapgrid .portal, #mapgrid .HIC {
  animation: breathPortal 1s ease-in-out infinite   /* ◎ 跨區傳送 / 港 航線端點(同為 #5bedf6) */
}

#mapgrid .tp.HIM {
  animation: breathHIM 1s ease-in-out infinite       /* ▲▼◆ 換樓層 #f100e4 */
}

#mapgrid .tp.RED {
  animation: breathRED 1s ease-in-out infinite       /* ＊ 進出口 #bf1b00 */
}

/* hover:停止呼吸(已被注意到),交給 .nav:hover / .portal:hover 的高亮接手 */
#mapgrid .tp:hover, #mapgrid .portal:hover, #mapgrid .HIC:hover {
  animation: none
}

@keyframes breathPortal {
  0%, 100% {
    color: #5bedf6
  }

  50% {
    color: #adf6fb
  }

}

@keyframes breathHIM {
  0%, 100% {
    color: #f100e4
  }

  50% {
    color: #f880f2
  }

}

@keyframes breathRED {
  0%, 100% {
    color: #bf1b00
  }

  50% {
    color: #df8d80
  }

}

.cor {
  color: #52705c;
  font-weight: bold;
}

.q {
  color: #6e6e6e
}

.WHT {
  color: #ccc
}

.HIW {
  color: #fff
}

.GRAY {
  color: #6e6e6e
}

.RED {
  color: #bf1b00
}

.HIR {
  color: #ff193f
}

.GRN {
  color: #00ac00
}

.HIG {
  color: #64e544
}

.HIY {
  color: #f3df00
}

.MAG {
  color: #a501a7
}

.HIM {
  color: #f100e4
}

.CYN {
  color: #01a894
}

.HIC {
  color: #5bedf6
}

.HIB {
  color: #3670dd
}

.YEL {
  color: #999900
}

.BLU {
  color: #0033ff
}

.zc {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 5
}

.zc button {
  width: 34px;
  height: 34px;
  font-size: 18px;
  background: #0d1b11dd;
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer
}

#coord {
  display: none;          /* 玩家用不到座標,隱藏 */
  position: absolute;
  left: 14px;
  top: 14px;
  background: #0c140ecc;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 12px;
  color: var(--dim);
  font-family: en
}

/* 浮動房間卡 */
#roomcard {
  --bh: 26px;                 /* 上/下邊框條高度,依 border-top/bottom.png 實際比例調 */
  --bpad: 18px;               /* body 左右內距,需大於 border-mid.png 側框寬度避免文字壓到框 */
  position: absolute;
  right: 18px;
  top: 18px;
  width: 260px;
  padding: 0;
  display: none;
  z-index: 8;
  font-size: 14px;
  filter: drop-shadow(0 8px 24px #000a);   /* 用 drop-shadow 跟隨圖片透明形狀,不畫成矩形 */
  backdrop-filter: brightness(0.2);
}

#roomcard .rc-top {
  height: var(--bh);
  background: url('/image/border-top.png') no-repeat center top;
  background-size: 100% 105%
}

#roomcard .rc-body {
  background: url('/image/border-mid.png') repeat-y center;
  background-size: 100% auto;
  padding: 4px var(--bpad)
}

#roomcard .rc-bottom {
  height: var(--bh);
  background: url('/image/border-bottom.png') no-repeat center bottom;
  background-size: 100% 100%
}

#roomcard .x {
  display: none;
  position: absolute;
  right: 10px;
  top: 8px;
  cursor: pointer;
  color: var(--dim)
}

#roomcard .rname {
  font-size: 18px;
  font-weight: bold;
  color: #fff
}

#roomcard .rsub {
  font-size: 11px;
  color: #999999;
  margin: 2px 0 8px
}

#roomcard .rfile {
  font-size: 11px;
  color: #7c958a;
  font-family: en;
  word-break: break-all;
  margin: -4px 0 8px;
  cursor: text;
  user-select: text
}

#roomcard .sec {
  font-size: 12px;
  color: var(--txt);
  border-top: 1px solid var(--line);
  padding-top: 6px;
  margin-top: 8px
}

#roomcard .npc {
  padding: 3px 0;
  display: flex;
  justify-content: space-between
}

#roomcard .npc .lv {
  color: var(--dim);
  font-size: 11px
}

#roomcard .none {
  color: #999999;
  padding: 2px 0
}

#roomcard .ex {
  display: block;
  width: 100%;
  text-align: left;
  margin: 4px 0;
  background: #0d1b11;
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 9px;
  cursor: pointer;
  font-size: 13px
}

#roomcard .ex:hover {
  background: #1d3324
}

#roomcard .ex.off {
  color: #6e7d72;
  cursor: not-allowed
}

#roomcard .ex .md {
  color: #f100e4;
  font-weight: bold
}

#roomcard .ex .rg {
  color: #5bedf6;
  font-size: 11px
}

/* 右側面板 */
#right {
  width: 230px;
  flex: 0 0 auto;
  background: var(--panel);
  border-left: 1px solid var(--line);
  overflow: auto;
  padding: 12px 14px;
  font-size: 14px
}

#right.hidden {
  display: none
}

#rightClose {
  display: none;
  position: absolute;
  top: 8px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  z-index: 2
}

#right h3 {
  font-size: 13px;
  color: var(--dim);
  margin: 14px 0 7px;
  border-top: 1px solid var(--line);
  padding-top: 10px
}

#right h3:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0
}

.leg {
  font-size: 15px;
  line-height: 1.95;
  font-family: en, sym, huninn, zh
}

.leg b {
  display: inline-block;
  width: 1.5em;
  text-align: center
}

.ctl {
  font-size: 13px;
  color: #9fb2c5;
  line-height: 1.85
}

#guide .ctl {
  font-size: 20px;
}

#guide a {
  color: var(--gold);
}

#pf input {
  width: 100%;
  background: #0a120c;
  border: 1px solid var(--line);
  color: var(--txt);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 13px;
  margin: 3px 0
}

#pf .go {
  width: 100%;
  background: #16301c;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 7px;
  cursor: not-allowed;
  margin-top: 5px;
  opacity: .6
}

#pf .note {
  font-size: 11px;
  color: var(--dim);
  margin-top: 6px
}

/* 搜尋 dropdown */
#results {
  position: absolute;
  left: 0;
  top: 46px;
  width: 100%;
  max-height: 60vh;
  overflow: auto;
  z-index: 30;
  background: #0c160fF7;
  border: 1px solid var(--accent);
  border-radius: 10px;
  box-shadow: 0 8px 28px #000a;
  display: none
}

/* ?find= 進入時:外框綠~白~綠閃爍,引導使用者先點搜尋結果;一般頁內搜尋不掛此 class */
@keyframes findFlash {
  0%, 100% {
    border-color: var(--accent);
    box-shadow: 0 8px 28px #000a, 0 0 0 0 transparent
  }

  50% {
    border-color: #fff;
    box-shadow: 0 8px 28px #000a, 0 0 12px 1px #ffffff88
  }

}

#results.find-flash {
  animation: findFlash 1s ease-in-out infinite
}

#stabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #0c160f
}

#stabs span {
  font-size: 13px;
  padding: 4px 11px;
  border-radius: 14px;
  border: 1px solid var(--line);
  color: var(--dim);
  cursor: pointer
}

#stabs span.on {
  background: var(--accent);
  color: #06140a;
  border-color: var(--accent)
}

#rlist .grp {
  font-size: 11px;
  color: var(--dim);
  padding: 6px 12px 2px
}

#rlist .ri {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  cursor: pointer
}

#rlist .ri:hover {
  background: #1d3324
}

#rlist .ri.sel {
  background: #234a30;
  box-shadow: inset 2px 0 var(--accent)   /* 鍵盤選取(↑↓)高亮 */
}

#rlist .ri .ty {
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 5px;
  color: var(--dim)
}

#rlist .ri .ripf {
  display: inline-flex;
  gap: 6px;
  flex: none;
  padding-left: 8px;
  opacity: 0;
  transition: opacity .12s
}

#rlist .ri:hover .ripf, #rlist .ri.sel .ripf {
  opacity: 1            /* 滑入/鍵盤選取該列才顯示設點小旗,平時不干擾 */
}

#rlist .ripf b {
  font-weight: normal;
  cursor: pointer;
  color: #5d7a66
}

#rlist .ripf b[data-pf="start"]:hover {
  color: #4ce04c
}

#rlist .ripf b[data-pf="end"]:hover {
  color: #ff5a4d
}

#rlist .none {
  padding: 10px 12px;
  color: var(--dim);
  font-size: 13px
}

/* misc */
#tip {
  position: fixed;
  pointer-events: none;
  background: #0b140dee;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  color: #e6eef7;
  display: none;
  z-index: 50
}

#tip small {
  color: var(--dim)
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  background: #1a0f0fdd;
  border: 1px solid #5a2a2a;
  color: #ffb4b4;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  display: none;
  z-index: 60
}

#spin {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--dim);
  display: none
}

.modal {
  position: fixed;
  inset: 0;
  background: #040806dd;
  z-index: 80;
  display: none;
  padding: 5vh 20px;
  overflow: auto
}

.modal .panel {
  max-width: 640px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 22px 26px
}

.modal .x {
  float: right;
  cursor: pointer;
  color: var(--dim);
  font-size: 22px
}

/* RWD */
@media(max-width:920px) {
  #hamburger {
    display: block
  }

  #sidebar {
    position: fixed;
    left: 0;
    top: 54px;
    bottom: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .2s;
    background-image: url("/image/leaf.jpg");
  }

  body.nav-open #sidebar {
    transform: none
  }

  #right {
    position: fixed;
    right: 0;
    top: 54px;
    bottom: 0;
    z-index: 35;
    transform: translateX(100%);
    transition: transform .2s
  }

  body.right-open #right {
    transform: none;
    display: block
  }

  #right.hidden {
    display: block
  }

  #rightClose {
    display: block
  }

  #roomcard {
    left: auto;
    right: 8px;
    bottom: 8px;
    top: auto;
    width: min(60vw, 240px);    /* 右下角浮動卡:窄機身不需太寬,再縮 1/4 + 讓出左下角縮放鈕 */
    max-height: 62vh;
    overflow: auto
  }

  #logo small {
    display: none
  }

  .hbtn.lbl {
    display: none
  }

}

/* ── 微互動 ── */
@keyframes mapIn {

  /* 跳轉房/區 materialize 淡入 */
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }

}

@keyframes rcIn {

  /* 房間卡進場:右側滑入+淡入 */
  from {
    opacity: 0;
    transform: translateX(10px)
  }

  to {
    opacity: 1;
    transform: none
  }

}

@keyframes bannerFade {

  /* 換區 banner 底圖淡入 */
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }

}

/* 左側目錄 hover:左側長出 accent 細條 + 文字微右移 */
.areaitem, .grpitem {
  transition: background .14s ease, color .14s ease, box-shadow .14s ease, padding-left .14s ease
}

.areaitem:hover {
  box-shadow: inset 3px 0 var(--accent);
  padding-left: 14px
}

.grpitem:hover {
  box-shadow: inset 3px 0 var(--accent);
  padding-left: 26px
}

/* 世界總覽節點 hover/selected:本色光暈 */
#worldSvg .wn {
  transition: filter .15s ease
}

#worldSvg .wn:hover {

  /*filter: drop-shadow(0 0 4px var(--bc))*/
  text-shadow: 0 0 5px var(--bc);
}

#worldSvg .wn.cur {

  /*filter: drop-shadow(0 0 5px var(--accent))*/
}

/* 尊重系統「減少動態」:關閉循環/進場動畫 */
@media (prefers-reduced-motion:reduce) {
  #mapgrid .focus, #mapgrid .tp, #mapgrid .portal, #mapgrid .HIC {
    animation: none !important
  }

  #mapgrid {
    animation: none !important
  }

  #roomcard {
    animation: none !important
  }

  #bannerImg {
    animation: none !important
  }

}

/* 航運動畫 */
#worldSvg .wboat { font-size:14px; text-anchor:middle; dominant-baseline:middle; pointer-events:none; }
#worldSvg .wboat-g { cursor:default; }

#wboatprev { position:fixed; display:none; width:220px; z-index:200; pointer-events:none;
  border:1px solid #556; background:#111; border-radius:3px; overflow:hidden; box-shadow:0 2px 8px rgba(0,0,0,.6); }
#wboatprev.show { display:block; }
#wboatprev .wbp-img { width:100%; height:135px; background-size:cover; background-position:center; background-color:#1a1f2b; }
#wboatprev .wbp-body { display:flex; flex-direction:column; justify-content:center; padding:7px 10px 8px; gap:3px; background:#111; }
#wboatprev .wbp-name { font-size:15px; font-weight:700; color:#dde; line-height:1.2; }
#wboatprev .wbp-dest { font-size:11px; color:#778; line-height:1.2; }
