:root {
  --ink: #0b0714;
  --bg: #140d2b;
  --y: #ffd23f;
  --p: #ff4fa3;
  --c: #2fe0d0;
  --v: #a66bff;
  --muted: #6a5a9a;
  --font: 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', system-ui, sans-serif;
  --title: 'Huninn', 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;   /* 標題：粉圓體（圓潤Q版，好讀） */
  --display: 'Bungee', 'Noto Sans TC', sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #07050f; color: #fff; font-family: var(--font); overflow: hidden; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
button { font-family: inherit; border: 0; cursor: pointer; touch-action: manipulation; }
.hidden { display: none !important; }
img.emoji { height: 1em; width: 1em; margin: 0 .05em 0 .1em; vertical-align: -0.12em; pointer-events: none; filter: drop-shadow(1px 1px 0 #0b0714aa); }

#app { position: relative; width: 100%; max-width: 520px; height: 100dvh; margin: 0 auto; overflow: hidden; background: var(--bg); transform-origin: top center; }
#world { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }

/* 按鈕：貼紙風 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 14px; font-weight: 900; font-size: 15px; background: #fff; color: var(--ink); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); transform: rotate(-1deg); }
.btn:active { transform: translate(2px, 2px) rotate(-1deg); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--y); }
.btn.teal { background: var(--c); }
.btn.pink { background: var(--p); color: #fff; text-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { filter: grayscale(1) brightness(.8); pointer-events: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; background: #fff; color: var(--ink); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); font-size: 20px; font-weight: 900; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; background: #fff; color: var(--ink); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); font-size: 13px; font-weight: 900; white-space: nowrap; }
.chip b { font-family: var(--display); font-size: 12px; }

/* HUD */
.hud { position: absolute; left: 0; right: 0; top: 0; padding: 8px 8px 0; padding-top: max(8px, env(safe-area-inset-top)); pointer-events: none; z-index: 5; }
.hud > * { pointer-events: auto; }
.res-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.res { background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 2px 2px 0 var(--ink); padding: 3px 6px; font-weight: 900; line-height: 1.1; min-width: 0; }
.res .top { display: flex; align-items: center; gap: 3px; font-size: 14px; }
.res .top b { font-family: var(--display); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.res .bar { height: 5px; border-radius: 9px; background: #e6e0f5; margin-top: 3px; overflow: hidden; }
.res .bar i { display: block; height: 100%; background: var(--c); }
.res.full .bar i { background: var(--p); }
.res .rate { font-size: 10px; color: var(--muted); }
.res .rate.neg { color: #d8203f; }
.hud-row2 { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.title-tag { margin-left: auto; font-weight: 900; font-size: 15px; color: var(--y); -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; text-shadow: 2px 2px 0 var(--p), 3px 3px 0 var(--ink); transform: rotate(-3deg); pointer-events: none; }

.zoom-btns { position: absolute; right: 8px; top: 50%; display: flex; flex-direction: column; gap: 8px; z-index: 5; transform: translateY(-50%); }

.bottom-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; padding: 8px; padding-bottom: max(10px, env(safe-area-inset-bottom)); z-index: 5; }
.btn.nav { flex: 1; flex-direction: column; gap: 0; padding: 6px 4px; font-size: 22px; }
.btn.nav small { font-size: 12px; }
.btn.nav:nth-child(even) { transform: rotate(1deg); }

/* 底部面板（建築資訊、建造選單等） */
.sheet { position: absolute; left: 6px; right: 6px; bottom: 76px; max-height: 58%; overflow-y: auto; overflow-x: hidden; z-index: 8; background: #1d1438 url('../assets/ui/panel_bg.webp'); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 5px 5px 0 var(--ink); padding: 12px; animation: up .25s cubic-bezier(.2, 1.3, .5, 1); }
@keyframes up { from { transform: translateY(30%); opacity: 0; } }
.sh-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sh-head .ic { font-size: 34px; }
.sh-head .nm { font-size: 20px; font-weight: 900; }
.sh-head .lv { font-family: var(--display); font-size: 13px; color: var(--y); }
.sh-head .x { margin-left: auto; }
.card { background: #ffffffeb; color: var(--ink); border: 2px solid var(--ink); border-radius: 12px; padding: 8px 10px; box-shadow: 2px 2px 0 var(--ink); margin-bottom: 8px; font-size: 13px; line-height: 1.5; }
.card b.t { display: block; font-size: 12px; color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cost { display: inline-flex; gap: 6px; flex-wrap: wrap; font-weight: 900; }
.cost span.no { color: #d8203f; }
.avatars { display: flex; gap: 6px; flex-wrap: wrap; }
.av { position: relative; width: 54px; height: 62px; border-radius: 12px; background: #fff; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; overflow: hidden; }
.av img { height: 48px; }
.av small { font-size: 10px; font-weight: 900; color: var(--ink); }
.av.empty { background: #ffffff55; border-style: dashed; color: var(--ink); font-size: 22px; justify-content: center; }
.av.skill::after { content: '★'; position: absolute; top: 1px; right: 3px; color: #e0a100; font-size: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt { text-align: left; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 2px 2px 0 var(--ink); padding: 8px; font-size: 12px; }
.opt .o-nm { font-size: 15px; font-weight: 900; }
.opt:disabled { opacity: .45; }
.vl { display: flex; gap: 8px; align-items: center; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 2px 2px 0 var(--ink); padding: 6px 8px; margin-bottom: 6px; }
.vl img { height: 52px; }
.vl .vb { flex: 1; min-width: 0; font-size: 12px; }
.vl .vn { font-size: 15px; font-weight: 900; }
.vl.locked img { filter: brightness(0) opacity(.35); }

/* 覆蓋彈窗 */
.overlay { position: absolute; inset: 0; z-index: 20; background: #07041ad9 url('../assets/ui/splat.webp'); display: flex; flex-direction: column; align-items: center; justify-content: safe center; padding: 20px 14px; overflow-y: auto; overflow-x: hidden; }
.ov-title { font-size: 26px; font-weight: 900; color: var(--y); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--p), 5px 5px 0 var(--ink); transform: rotate(-2deg); margin-bottom: 10px; text-align: center; }
.ov-card { width: 100%; max-width: 360px; background: #1d1438 url('../assets/ui/panel_bg.webp'); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 5px 5px 0 var(--ink); padding: 14px; }
.ov-actions { display: flex; gap: 10px; margin-top: 14px; justify-content: center; }
.gain { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 6px 0; }
.toast { position: absolute; left: 50%; top: 110px; z-index: 30; transform: translate(-50%, -10px); background: #fff; color: var(--ink); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); padding: 8px 14px; border-radius: 99px; font-weight: 900; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.pw-input { width: 100%; padding: 10px; border-radius: 10px; border: 3px solid var(--ink); font-size: 16px; font-weight: 700; }
.ver { text-align: center; font-size: 11px; color: #c9bff0; margin-top: 10px; }

/* ===== 宇宙方舟版 ===== */
.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: block; }
.screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.btn.nav.on { background: var(--y); }
.side-btns { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 5; }
.fab { width: 54px; height: 54px; border-radius: 16px; background: #fff; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 20px; font-weight: 900; color: var(--ink); padding: 0; }
.fab small { font-size: 10px; }
.fab:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.feed { position: absolute; left: 10px; right: 76px; bottom: 84px; display: flex; flex-direction: column; gap: 5px; -webkit-mask-image: linear-gradient(transparent, #000 40%); mask-image: linear-gradient(transparent, #000 40%); pointer-events: none; z-index: 4; }
.feed div { background: #0b0714cc; color: #fff; border-left: 4px solid var(--c); border-radius: 8px; padding: 5px 9px; font-size: 12.5px; font-weight: 700; animation: feedIn .4s ease-out; }
@keyframes feedIn { from { opacity: 0; transform: translateY(10px); } }
.orbit-bar { position: absolute; left: 10px; right: 76px; top: 110px; z-index: 6; display: flex; gap: 8px; }
.orbit-bar .btn { flex: 1; }
#capChip { cursor: pointer; }
#capChip img, .chip img.av-s { height: 20px; }
.tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.tabs button { flex: 1; padding: 7px; border-radius: 10px; background: #fff; color: var(--ink); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); font-size: 13px; font-weight: 900; }
.tabs button.on { background: var(--y); }
.pl { display: flex; gap: 8px; align-items: center; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 2px 2px 0 var(--ink); padding: 6px; margin-bottom: 6px; font-size: 12px; width: 100%; text-align: left; }
.pl .ball { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--ink); background-size: cover; background-position: center; flex: none; box-shadow: inset -8px -6px 0 #0005; }
.pl .nm { font-weight: 900; font-size: 14px; }
.pl .st { margin-left: auto; text-align: right; font-weight: 900; flex: none; }
.ok { color: #1a9a4a; } .no { color: #d8203f; }
.pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pick button { background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 2px 2px 0 var(--ink); padding: 4px; font-size: 11px; font-weight: 900; }
.pick button img { height: 56px; display: block; margin: 0 auto; }
.pick button.on { background: var(--y); outline: 3px solid var(--p); }
.pick button small { display: block; font-size: 10px; color: var(--muted); }

/* 星球登陸畫面 */
.land { position: absolute; inset: 0; z-index: 12; display: flex; flex-direction: column; background: #140d2b url('../assets/ui/concrete.webp'); }
.lhud { padding: 10px 12px 8px; padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 3px solid var(--ink); }
.lhud .ttl { font-weight: 900; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lhud .trk { position: relative; height: 12px; border: 2px solid var(--ink); border-radius: 99px; background: #0008; margin-top: 4px; overflow: hidden; }
.lhud .trk i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--c), var(--y)); transition: width .3s; }
.lstat { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.lstat .bar2 { flex: 1; height: 18px; border: 2px solid var(--ink); border-radius: 99px; background: #0009; position: relative; overflow: hidden; box-shadow: 2px 2px 0 var(--ink); }
.lstat .bar2 i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#7ff5a8, #1fae5c); transition: width .3s; }
.lstat .bar2 span { position: absolute; inset: 0; text-align: center; font-size: 11px; font-weight: 900; line-height: 15px; text-shadow: 0 1px 2px #000; }
.lscene { position: relative; height: 36%; min-height: 200px; background-size: auto 100%; background-position: center; border-bottom: 3px solid var(--ink); overflow: hidden; }
.lparty { position: absolute; left: 4%; bottom: 6%; display: flex; align-items: flex-end; gap: 0; }
.lparty img { height: 110px; margin-right: -18px; filter: drop-shadow(2px 2px 0 #0008); animation: bob 1.8s ease-in-out infinite; }
.lparty img:nth-child(2) { height: 92px; animation-delay: .3s; }
.lparty img:nth-child(3) { height: 86px; animation-delay: .6s; }
.lalien { position: absolute; right: 5%; bottom: 6%; height: 118px; filter: drop-shadow(2px 2px 0 #0008); animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.lpanel { flex: 1; min-height: 0; position: relative; padding: 8px 10px; overflow: hidden; }
.loglines { display: flex; flex-direction: column; gap: 5px; max-height: 100%; overflow-y: auto; }
.loglines div { background: #ffffffeb; color: var(--ink); border: 2px solid var(--ink); border-left-width: 6px; border-left-color: var(--c); border-radius: 8px; box-shadow: 2px 2px 0 var(--ink); font-weight: 700; font-size: 13px; padding: 5px 9px; }
.loglines div.bad { border-left-color: var(--p); }
.loglines div.gold { border-left-color: var(--y); }
.ev { position: absolute; left: 8px; right: 8px; bottom: 8px; max-height: calc(100% - 16px); overflow-y: auto; background: #1d1438 url('../assets/ui/panel_bg.webp'); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 5px 5px 0 var(--ink); padding: 10px; animation: up .25s cubic-bezier(.2, 1.3, .5, 1); }
.ev .h { display: flex; gap: 8px; align-items: center; font-weight: 900; font-size: 17px; margin-bottom: 4px; }
.ev .d { font-size: 13px; color: #e8e0ff; line-height: 1.55; margin-bottom: 4px; }
.ev .btn { width: 100%; justify-content: space-between; margin-top: 7px; font-size: 14px; padding: 8px 12px; text-align: left; }
.ev .btn small { font-size: 11px; opacity: .85; flex: none; }
.gobar { display: flex; gap: 10px; align-items: center; padding: 10px 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); border-top: 3px solid var(--ink); }
.gobar .go { flex: 1; flex-direction: column; gap: 0; font-size: 22px; letter-spacing: 4px; background: var(--y); }
.gobar .go small { font-size: 11px; letter-spacing: 1px; }
.jr { background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 2px 2px 0 var(--ink); padding: 8px; margin-bottom: 8px; font-size: 12px; }
.jr .jh { display: flex; gap: 8px; align-items: center; font-weight: 900; font-size: 14px; }
.jr .jh .ball { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink); background-size: cover; background-position: center; flex: none; }
.jr ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.5; }
.btn .cost { display: inline-flex; gap: 4px; font-size: 12px; }
.btn .cost img.emoji, .vl .cost img.emoji { height: 14px; width: 14px; }
.orbit-bar { top: 118px; }
.vl .btn img.emoji, .row .btn img.emoji { height: 18px; width: auto; }
/* 星系資訊卡與躍遷鈕 */
.gal-info { position: absolute; left: 10px; right: 76px; top: 104px; z-index: 5; display: flex; align-items: center; gap: 8px; background: #0b0714cc; border: 2px solid var(--ink); border-radius: 12px; padding: 5px 9px; box-shadow: 2px 2px 0 var(--ink); }
.gal-info .gn { font-weight: 900; font-size: 14px; white-space: nowrap; }
.gal-info .bar2 { flex: 1; min-width: 60px; height: 16px; border: 2px solid var(--ink); border-radius: 99px; background: #fff2; position: relative; overflow: hidden; }
.gal-info .bar2 i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--c), var(--y)); transition: width .4s; }
.gal-info .bar2 span { position: absolute; inset: 0; text-align: center; font-size: 10px; font-weight: 900; line-height: 13px; text-shadow: 0 1px 2px #000; }
.gal-info .gs { font-size: 11px; font-weight: 900; color: var(--c); white-space: nowrap; }
.orbit-bar { top: 150px; }
.warp-btn { position: absolute; right: 8px; bottom: 84px; z-index: 6; width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); background: #8a86a0; color: var(--ink); font-size: 24px; font-weight: 900; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; }
.warp-btn small { font-size: 11px; }
.warp-btn.ready { background: var(--p); color: #fff; animation: warpPulse 1.2s ease-in-out infinite; }
@keyframes warpPulse { 50% { transform: scale(1.08); box-shadow: 0 0 0 6px #ff4fa355, 3px 3px 0 var(--ink); } }
.feed { right: 80px; }
#mapScreen .side-btns { top: 150px; transform: none; }

/* ======================================================================
   Q版街頭塗鴉 UI（2026-09-28，比照嘻哈柴犬GO）：水泥條、膠帶、噴漆字、歪貼紙
   ====================================================================== */
:root { --tape: #f3e6c4cc; }
#app { background: #140d2b url('../assets/ui/concrete.webp'); }

/* 頂部 HUD：水泥條＋黑邊，資源是歪貼的白貼紙 */
.hud { background: #140d2bd9 url('../assets/ui/concrete.webp'); border-bottom: 3px solid var(--ink); padding-bottom: 7px; box-shadow: 0 4px 0 #0b071466; }
.hud::after { content: ''; position: absolute; inset: 0; background: url('../assets/ui/splat.webp') center / 140% auto; opacity: .22; pointer-events: none; }
.hud > * { position: relative; z-index: 1; }
.res { box-shadow: 3px 3px 0 var(--ink); }
.res:nth-child(odd) { transform: rotate(-1.5deg); }
.res:nth-child(even) { transform: rotate(1.2deg); }
.res .bar { border: 1.5px solid var(--ink); height: 7px; }
.hud-row2 .chip { transform: rotate(-1deg); }
.hud-row2 .chip:nth-child(2) { transform: rotate(1deg); background: var(--c); }
.hud-row2 .chip:nth-child(3) { background: var(--y); }
#btnSettings { transform: rotate(4deg); }

/* 底部分頁：水泥條，選中的那格是黃色噴漆貼紙＋粉紅噴霧光 */
.bottom-bar { background: #0c0820 url('../assets/ui/concrete.webp'); border-top: 3px solid var(--ink); padding-top: 8px; box-shadow: 0 -4px 0 #0b071466; }
.btn.nav { background: #ffffffe6; box-shadow: 3px 3px 0 var(--ink); }
.btn.nav.on { background: var(--y); transform: rotate(-3deg) translateY(-3px); box-shadow: 4px 4px 0 var(--ink), 0 0 16px #ff4fa388; }
.btn.nav.on small { color: var(--ink); }

/* 面板與彈窗：磚牆＋膠帶 */
.ov-card { position: relative; }
.ov-card::before, .sheet::before, .gal-info::before {
  content: ''; position: absolute; top: -9px; left: 50%; width: 64px; height: 18px; margin-left: -32px;
  background: var(--tape); transform: rotate(-4deg); box-shadow: 0 1px 2px #0006; pointer-events: none; z-index: 2;
}
.ov-card { transform: rotate(-.4deg); }
.card { border-width: 2px; box-shadow: 3px 3px 0 var(--ink); }
.card:nth-child(even) { transform: rotate(.35deg); }
.ov-title { font-size: 28px; letter-spacing: 2px; text-shadow: 3px 3px 0 var(--p), 6px 6px 0 var(--ink), 0 0 18px #ff4fa366; }
.toast { transform: translate(-50%, -10px) rotate(-1.5deg); }
.toast.show { transform: translate(-50%, 0) rotate(-1.5deg); }
.tabs button:nth-child(odd) { transform: rotate(-1deg); }
.tabs button.on { transform: rotate(-2deg); box-shadow: 3px 3px 0 var(--ink); }
.pl { box-shadow: 3px 3px 0 var(--ink); }
.pl:nth-child(odd) { transform: rotate(-.5deg); }

/* 側邊按鈕：顏色不同的歪貼紙 */
.fab { box-shadow: 3px 3px 0 var(--ink); }
.side-btns .fab:nth-child(odd) { transform: rotate(-3deg); }
.side-btns .fab:nth-child(even) { transform: rotate(2.5deg); }
#btnBook, #btnFloor { background: var(--y); }
#btnLocate, #btnWiden { background: var(--c); }
#btnFit { background: #d9c4ff; }
.fab:active { transform: translate(2px, 2px) !important; }

/* 星系資訊卡：水泥貼紙、噴漆星系名 */
.gal-info { top: 112px; background: #1d1438 url('../assets/ui/panel_bg.webp'); border-width: 3px; box-shadow: 4px 4px 0 var(--ink); transform: rotate(-1deg); padding: 7px 10px 6px; }
.gal-info .gn { font-size: 16px; color: var(--y); -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 2px 2px 0 var(--p), 3px 3px 0 var(--ink); letter-spacing: 1px; }
.gal-info .bar2 { border-width: 2px; box-shadow: 2px 2px 0 var(--ink); background: #0008; }
.gal-info .gs { color: var(--c); -webkit-text-stroke: .5px var(--ink); }
.orbit-bar { top: 164px; }
.orbit-bar .btn:first-child { transform: rotate(-2deg); }
.orbit-bar .btn:last-child { transform: rotate(1.5deg); }

/* 訊息流：沿用原本的深色半透明條（老爺指定），最少完整顯示最後 4 條，第 5 條淡出 */
.feed { -webkit-mask-image: linear-gradient(transparent, #000 22%); mask-image: linear-gradient(transparent, #000 22%); }

/* 躍遷鈕：大顆粉紅噴漆貼紙 */
.warp-btn { border-width: 4px; box-shadow: 4px 4px 0 var(--ink); transform: rotate(-4deg); }
.warp-btn small { font-weight: 900; letter-spacing: 1px; }
.warp-btn.ready { text-shadow: 1px 1px 0 var(--ink); }
@keyframes warpPulse { 50% { transform: rotate(-4deg) scale(1.08); box-shadow: 0 0 0 6px #ff4fa355, 4px 4px 0 var(--ink); } }

/* 登陸畫面：比照嘻哈柴犬GO 冒險畫面 */
.lhud { background: #140d2b url('../assets/ui/concrete.webp'); }
.lpanel { background: #1a1233 url('../assets/ui/concrete.webp'); }
.lpanel::after { content: ''; position: absolute; inset: 0; background: url('../assets/ui/splat.webp'); opacity: .35; pointer-events: none; }
.loglines, .ev { position: relative; z-index: 1; }
.ev { position: absolute; z-index: 2; }
.gobar { background: #0c0820 url('../assets/ui/concrete.webp'); }
.gobar .go { border-width: 4px; border-radius: 20px; box-shadow: 6px 6px 0 var(--ink); transform: rotate(-1deg); }
.gobar .go:not(:disabled) { animation: gopulse2 1.6s ease-in-out infinite; }
@keyframes gopulse2 { 50% { box-shadow: 6px 6px 0 var(--ink), 0 0 22px #ffd23faa; } }
/* 星系資訊卡：兩行（名稱＋雷達／探索條），避免擠壓 */
.gal-info { display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'n s' 'b b'; row-gap: 5px; column-gap: 8px; }
.gal-info .gn { grid-area: n; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gal-info .gs { grid-area: s; align-self: center; }
.gal-info .bar2 { grid-area: b; }
.orbit-bar { top: 178px; }
#mapScreen .side-btns { top: 178px; }
/* 星球正式圖：列表小圖不裁切、不加黑框 */
.ball.planet { border: 0; border-radius: 0; background-size: contain; background-repeat: no-repeat; background-color: transparent; box-shadow: none; filter: drop-shadow(2px 2px 0 #0b071488); }
/* 圖示放大（老爺：ICON 不要太小） */
img.emoji { height: 1.25em; width: 1.25em; vertical-align: -0.25em; }
.res .top img.emoji { height: 20px; width: 20px; }
.btn.nav img.emoji { height: 30px; width: 30px; }
.fab img.emoji { height: 28px; width: 28px; margin: 0; }
.warp-btn img.emoji { height: 30px; width: 30px; margin: 0; }
.chip img.emoji { height: 18px; width: 18px; }
.feed img.emoji, .loglines img.emoji { height: 18px; width: 18px; }
.ev .h img.emoji, .sh-head .ic img.emoji { height: 30px; width: 30px; }
.ov-title img.emoji { height: 32px; width: 32px; }
.btn .cost img.emoji, .vl .cost img.emoji, .card .cost img.emoji { height: 17px; width: 17px; }
.hud-row2 { flex-wrap: nowrap; min-width: 0; }
.hud-row2 .chip { flex: none; }
#voyChip { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 22px; }
#btnSettings { flex: none; }
/* 自動探險鈕、經驗條、能力徽章 */
.auto-btn { flex: none; flex-direction: column; gap: 0; width: 70px; padding: 8px 4px; font-size: 22px; background: #fff; transform: rotate(2deg); }
.auto-btn small { font-size: 11px; }
.auto-btn.on { background: var(--c); box-shadow: 4px 4px 0 var(--ink), 0 0 14px #2fe0d0aa; }
.expbar { position: relative; height: 14px; margin-top: 4px; border: 2px solid var(--ink); border-radius: 99px; background: #e6e0f5; overflow: hidden; }
.expbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #a66bff, #ff4fa3); }
.expbar span { position: absolute; inset: 0; font-size: 9.5px; font-weight: 900; line-height: 10px; text-align: center; color: var(--ink); text-shadow: 0 0 2px #fff; }
.abil { display: inline-flex; flex-direction: column; margin: 2px 4px 0 0; padding: 2px 6px; border: 2px solid var(--ink); border-radius: 8px; background: var(--y); font-size: 11px; font-weight: 900; }
.abil small { font-size: 9.5px; font-weight: 700; color: #4a3d78; }
.pick button:disabled { opacity: .45; }
/* 資源上限常駐顯示 */
.res .top { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
.res .top small.cap { font-family: var(--display); font-size: 9px; color: var(--muted); margin-left: 1px; align-self: flex-end; line-height: 14px; }
/* 資源上限放在第三行右側（避免數字被截斷） */
.res .rate { display: flex; justify-content: space-between; gap: 2px; white-space: nowrap; }
.res .rate .cap { color: #8a7fb8; font-size: 9px; }
/* 選隊員卡片裡的專長小圖示 */
.pick button small img.emoji { height: 15px; width: 15px; display: inline; margin: 0 1px; vertical-align: -3px; }
.pick button > img.emoji { height: 15px; width: 15px; display: inline; margin: 0; }

/* ===== 航海紀錄：日誌／圖鑑／成就 ===== */
.book { position: absolute; inset: 0; z-index: 15; display: flex; flex-direction: column; background: #140d2b url('../assets/ui/concrete.webp'); }
.book::after { content: ''; position: absolute; inset: 0; background: url('../assets/ui/splat.webp'); opacity: .25; pointer-events: none; }
.book > * { position: relative; z-index: 1; }
.bk-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px; padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 3px solid var(--ink); background: #0c0820cc; }
.bk-back { padding: 7px 12px; font-size: 14px; flex: none; }
.bk-title { flex: 1; min-width: 0; text-align: center; font-size: 20px; font-weight: 900; color: var(--y); -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 2px 2px 0 var(--p), 4px 4px 0 var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transform: rotate(-1deg); }
.bk-tabs { padding: 8px 10px 4px; margin: 0; }
.bk-tabs button { position: relative; }
.bk-dot { position: absolute; top: -5px; right: -5px; width: 12px; height: 12px; border-radius: 50%; background: #ff2d55; border: 2px solid #fff; box-shadow: 0 0 0 2px var(--ink); }
.bk-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 6px 10px 16px; -webkit-overflow-scrolling: touch; }
.card.sm { font-size: 12px; padding: 6px 9px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 2px 0 6px; }
.chips .chip { font-size: 12px; padding: 3px 9px; }
.chips .chip.on { background: var(--y); transform: rotate(-2deg); }
.day { color: var(--y); font-weight: 900; font-size: 13px; margin: 10px 0 4px; text-shadow: 1px 1px 0 var(--ink); }
.jl { background: #ffffffeb; color: var(--ink); border: 2px solid var(--ink); border-left: 6px solid var(--c); border-radius: 8px; box-shadow: 2px 2px 0 var(--ink); padding: 6px 9px; margin-bottom: 6px; font-size: 13px; font-weight: 700; line-height: 1.45; }
.jl small { color: #6a5a9a; font-weight: 700; white-space: nowrap; }
.jl.link { cursor: pointer; }
.jl.k-event { border-left-color: var(--p); } .jl.k-train { border-left-color: var(--v); } .jl.k-warp { border-left-color: var(--y); } .jl.k-crew { border-left-color: #1fae5c; } .jl.k-ark { border-left-color: var(--o, #ff8a1f); }
.acc { background: #1d1438 url('../assets/ui/panel_bg.webp'); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 4px 4px 0 var(--ink); margin-bottom: 12px; overflow: hidden; }
.acc.locked { opacity: .55; }
.acc-h { display: flex; align-items: center; gap: 9px; padding: 8px 10px; font-weight: 900; cursor: pointer; }
.acc-h .star { width: 40px; height: 40px; object-fit: contain; flex: none; filter: drop-shadow(2px 2px 0 #0008); }
.acc-h .star.dark { border-radius: 50%; background: #333; border: 2px solid var(--ink); width: 34px; height: 34px; }
.acc-h .nm { font-size: 16px; color: var(--y); -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; text-shadow: 2px 2px 0 var(--p); }
.acc-h .sub { font-size: 11px; color: #cfc3ff; }
.acc-h .arr { margin-left: auto; font-size: 18px; flex: none; }
.acc-b { padding: 0 10px 10px; }
.sec { font-size: 13px; font-weight: 900; color: #fff; margin: 8px 0 5px; display: flex; justify-content: space-between; text-shadow: 1px 1px 0 var(--ink); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.pc, .ec { background: #fff; border: 2px solid var(--ink); border-radius: 10px; box-shadow: 2px 2px 0 var(--ink); text-align: center; padding: 4px 2px; color: var(--ink); font-size: 10.5px; font-weight: 900; line-height: 1.25; }
.pc img { width: 46px; height: 46px; object-fit: contain; display: block; margin: 0 auto 2px; }
.pc.dim img, .ec.dim img { filter: brightness(.45); }
.pc.lock img, .ec.lock img { filter: brightness(0) opacity(.35); }
.pc .b, .ec .b { font-size: 9.5px; color: #6a5a9a; }
.egrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; }
.ec img { width: 40px; height: 40px; object-fit: contain; display: block; margin: 0 auto 2px; }
.abil-row { display: flex; flex-wrap: wrap; }
.abil.off { background: #ddd6ee; }
.det { background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 4px 4px 0 var(--ink); padding: 10px; font-size: 13px; line-height: 1.55; }
.det h4 { margin: 0 0 6px; font-size: 18px; display: flex; gap: 10px; align-items: center; }
.det h4 img { width: 64px; height: 64px; object-fit: contain; flex: none; }
.det h4 small { font-size: 11.5px; color: #6a5a9a; font-weight: 700; }
.det .hint { background: #f3effd; border-radius: 8px; padding: 6px 8px; margin-bottom: 4px; }
.sec2 { font-size: 13px; font-weight: 900; margin: 10px 0 4px; display: flex; justify-content: space-between; border-bottom: 2px dashed #d6ccf2; padding-bottom: 2px; }
.ch { border-left: 5px solid var(--c); background: #f3effd; border-radius: 6px; padding: 6px 8px; margin: 5px 0; font-size: 12.5px; }
.ch.bad { border-left-color: var(--p); }
.ch.lockch { border-left-color: #bbb; color: #9a8fc0; }
.ch b { display: block; font-size: 13.5px; }
.ch small { display: block; color: #4a3d78; margin-top: 3px; }
.ach { display: flex; gap: 8px; align-items: center; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 2px 2px 0 var(--ink); padding: 7px 8px; margin-bottom: 7px; font-size: 12px; }
.ach .ic { font-size: 26px; flex: none; }
.ach .ic img.emoji { height: 30px; width: 30px; }
.ach .t { font-weight: 900; font-size: 14px; }
.ach .bar { height: 8px; border: 1.5px solid var(--ink); border-radius: 9px; background: #e6e0f5; margin-top: 4px; overflow: hidden; }
.ach .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--c), var(--y)); }
.ach .btn { padding: 6px 8px; font-size: 12px; flex: none; }
.ach.done { background: #fff7d6; outline: 3px solid var(--y); }
.ach.claimed { opacity: .7; }
.btn.nav.has-dot::after { content: ''; position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%; background: #ff2d55; border: 2px solid #fff; box-shadow: 0 0 0 2px var(--ink); }
.btn.nav { position: relative; }
.pc img.emoji, .ec img.emoji, .pc .b img.emoji, .ec .b img.emoji { width: 13px; height: 13px; display: inline; margin: 0 1px 0 0; vertical-align: -2px; filter: none; }
.acc-h .nm img.emoji { width: 16px; height: 16px; }

/* ======================================================================
   2026-09-28 老爺回饋：字體好讀、拿掉逐筆劃黑框、捲動軸自訂、圖示再放大
   ====================================================================== */
/* 標題改用粉圓體，拿掉 -webkit-text-stroke（每個筆劃描黑框很難讀），改用錯位陰影保留塗鴉感 */
.ov-title, .bk-title, .gal-info .gn, .acc-h .nm, .title-tag {
  -webkit-text-stroke: 0; paint-order: normal; font-family: var(--title); font-weight: 400; letter-spacing: 1px;
}
.ov-title { font-size: 30px; text-shadow: 2px 2px 0 var(--p), 4px 4px 0 var(--ink); }
.bk-title { font-size: 22px; text-shadow: 2px 2px 0 var(--p), 3px 3px 0 var(--ink); }
.gal-info .gn { font-size: 17px; text-shadow: 2px 2px 0 var(--ink); }
.gal-info .gs { -webkit-text-stroke: 0; text-shadow: 1px 1px 0 var(--ink); }
.acc-h .nm { font-size: 17px; text-shadow: 2px 2px 0 var(--ink); }
.sh-head .nm, .ev .h, .det h4, .ach .t, .lhud .ttl, .vl .vn, .pl .nm, .opt .o-nm { font-family: var(--title); font-weight: 400; letter-spacing: .5px; }
.sh-head .nm { font-size: 22px; } .ev .h { font-size: 19px; } .det h4 { font-size: 20px; } .ach .t { font-size: 15px; } .vl .vn { font-size: 16px; } .pl .nm { font-size: 15px; }
body { -webkit-font-smoothing: antialiased; }

/* 捲動軸：不用瀏覽器預設，改成細的黃色貼紙條（手機上系統本來就會自動隱藏） */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: #0b071455; border-radius: 9px; }
::-webkit-scrollbar-thumb { background: var(--y); border: 2px solid var(--ink); border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: var(--p); }
::-webkit-scrollbar-corner { background: transparent; }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--y) #0b071455; } }

/* 圖示放大（不影響排版的地方盡量大） */
img.emoji { height: 1.35em; width: 1.35em; vertical-align: -0.3em; }
.res .top img.emoji { height: 23px; width: 23px; }
.btn.nav img.emoji { height: 34px; width: 34px; }
.fab img.emoji { height: 32px; width: 32px; }
.warp-btn img.emoji { height: 34px; width: 34px; }
.chip img.emoji { height: 20px; width: 20px; }
.feed img.emoji, .loglines img.emoji, .jl img.emoji { height: 21px; width: 21px; }
.ev .h img.emoji, .sh-head .ic img.emoji, .det h4 img.emoji { height: 34px; width: 34px; }
.ov-title img.emoji { height: 40px; width: 40px; }
.bk-tabs img.emoji, .tabs img.emoji { height: 22px; width: 22px; }
.sec img.emoji, .sec2 img.emoji { height: 20px; width: 20px; }
.btn .cost img.emoji, .vl .cost img.emoji, .card .cost img.emoji, .cost img.emoji { height: 20px; width: 20px; }
.ach .ic img.emoji { height: 38px; width: 38px; }
.pc .b img.emoji, .ec .b img.emoji { width: 15px; height: 15px; }
.gal-info img.emoji { height: 22px; width: 22px; }
.orbit-bar .btn img.emoji, .ev .btn img.emoji, .row .btn img.emoji { height: 22px; width: 22px; }
/* 船員卡的按鈕維持一行 */
.vl .row .btn { padding: 7px 10px; font-size: 13px; }
.vl .row .btn img.emoji, .vl .row .btn .cost img.emoji { height: 18px; width: 18px; }
/* 資源列：現有／上限 同一行，放不下時自動縮小 */
.res .top { display: flex; align-items: baseline; gap: 2px; white-space: nowrap; overflow: hidden; }
.res .top img.emoji { align-self: center; flex: none; }
.res .top b { font-family: var(--display); font-size: 13px; }
.res .top small.capv { font-size: 10px; font-weight: 900; color: #8a7fb8; letter-spacing: -.2px; }
.res.tight .top img.emoji { height: 19px; width: 19px; }
.res.tight .top b { font-size: 11px; }
.res.tight .top small.capv { font-size: 9px; }
.res.tighter .top img.emoji { height: 16px; width: 16px; margin: 0; }
.res.tighter .top b { font-size: 10px; letter-spacing: -.3px; }
.res.tighter .top small.capv { font-size: 8px; }
.res .rate { display: block; }
.res .top b, .res .top small.capv { flex: none; overflow: visible; text-overflow: clip; }
.res.tightest .top img.emoji { height: 14px; width: 14px; }
.res.tightest .top b { font-size: 9px; letter-spacing: -.4px; }
.res.tightest .top small.capv { font-size: 7.5px; letter-spacing: -.4px; }
.res.tightest, .res.tighter { padding-left: 4px; padding-right: 4px; }
.icon-btn img.ui-ic { height: 26px; width: 26px; margin: 0; vertical-align: middle; }
.bk-back img.ui-ic { height: 22px; width: 22px; margin: 0 2px 0 0; }
.av.skill::after { content: ''; width: 16px; height: 16px; top: 0; right: 1px; background: url('../assets/ui/fitstar.webp') center / contain no-repeat; }
/* 登陸畫面：角色站高一點、我方放大、雙方面對面 */
.lparty { bottom: 13%; }
.lparty img { height: 132px; margin-right: -22px; }
.lparty img:nth-child(2) { height: 114px; }
.lparty img:nth-child(3) { height: 106px; }
.lalien { bottom: 12%; height: 124px; }
.lparty img.flip, .lalien.flip { scale: -1 1; }
/* 拖曳捲動時游標 */
.dragging, .dragging * { cursor: grabbing !important; }
/* 戰力 */
#powChip { background: var(--p); color: #fff; text-shadow: 1px 1px 0 var(--ink); }
#powChip b { font-family: var(--display); font-size: 12px; margin-left: 2px; }
#powChip.damaged { background: #ff8a1f; animation: warpPulse 1.2s ease-in-out infinite; }
.threat { display: flex; align-items: center; justify-content: space-between; gap: 6px; background: #0b0714aa; border: 2px solid var(--ink); border-radius: 10px; padding: 6px 8px; margin: 6px 0; font-size: 13px; font-weight: 900; }
.threat .vs { font-family: var(--display); color: var(--y); font-size: 16px; }
.tip { font-size: 12px; font-weight: 900; color: var(--y); margin-bottom: 6px; }
.ev .btn.battle { background: var(--p); color: #fff; text-shadow: 1px 1px 0 var(--ink); }
.pw-row { display: flex; justify-content: space-between; background: #ffffffe6; color: var(--ink); border: 2px solid var(--ink); border-radius: 8px; padding: 4px 8px; margin-bottom: 4px; font-size: 12.5px; font-weight: 700; }
/* 存讀檔 */
.save-box { min-height: 70px; font-size: 12px; resize: vertical; }
label.btn { cursor: pointer; }
/* 特殊船員 */
.rar { display: inline-block; padding: 0 6px; border: 2px solid var(--ink); border-radius: 8px; font-size: 10.5px; font-weight: 900; color: var(--ink); vertical-align: 1px; }
.vl.sp img { height: 70px; }
.spl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.spl { display: flex; gap: 6px; align-items: center; background: #ffffffd9; color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; padding: 4px 6px; font-size: 11.5px; }
.spl img.sil { height: 46px; filter: brightness(0) opacity(.4); flex: none; }
.spl small { color: #4a3d78; font-size: 10.5px; line-height: 1.3; display: block; }
img.join { height: 170px; filter: drop-shadow(3px 3px 0 #0b071488); }
.merc { display: flex; gap: 8px; align-items: center; background: #ffffff18; border: 2px dashed var(--y); border-radius: 10px; padding: 6px; margin: 6px 0; font-size: 12.5px; }
.merc img { height: 60px; }
.vl.sp img { height: auto; }
.vl.sp > img { height: 70px; }
.vl .vb img.emoji, .merc div img.emoji { height: 18px; width: 18px; }
.merc img { height: auto; } .merc > img { height: 60px; }
/* 圖片不能被拖走（網頁版拖曳捲動時） */
img { -webkit-user-drag: none; user-drag: none; }
/* 測試工具 */
.dev-res { display: grid; grid-template-columns: 70px 56px 1fr auto auto; gap: 5px; align-items: center; margin-bottom: 5px; font-size: 12.5px; font-weight: 900; }
.dev-res b { font-family: var(--display); font-size: 12px; color: var(--y); text-align: right; }
.dev-res input { padding: 6px; font-size: 14px; min-width: 0; }
.dev-res .btn { padding: 6px 8px; font-size: 12px; }
.av.sp-av { width: 62px; height: 70px; background: #fff7d6; border-color: var(--ink); outline: 2px solid var(--y); }
.av.sp-av img { height: 54px; }
button.vl { text-align: left; }
/* 訊息列抬高，不被底部選單擋住（老爺回報） */
.feed { bottom: 100px; }
.warp-btn { bottom: 100px; }
/* 換位置提示條 */
.swap-bar { position: absolute; left: 10px; right: 76px; top: 108px; z-index: 6; display: flex; gap: 8px; align-items: center; background: var(--y); color: var(--ink); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); padding: 6px 8px; font-size: 13px; font-weight: 900; animation: warpPulse 1.4s ease-in-out infinite; }
.swap-bar span { flex: 1; }
.swap-bar .btn { padding: 5px 10px; font-size: 12px; }

/* 火箭突發事件警報條 */
.inc-bar { position: absolute; left: 10px; right: 76px; top: 150px; z-index: 7; display: flex; gap: 8px; align-items: center; text-align: left; background: #d8203f; color: #fff; border: 3px solid var(--ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); padding: 6px 10px; font-size: 13px; font-weight: 900; animation: incPulse .9s ease-in-out infinite; }
.inc-bar .ic { font-size: 22px; }
.inc-bar .tx { flex: 1; line-height: 1.25; }
.inc-bar small { display: block; font-size: 11px; font-weight: 700; opacity: .9; }
.inc-bar[data-scr=map] { top: 172px; }
@keyframes incPulse { 50% { background: #ff4f5e; transform: translateY(-1px); } }
.breaker { display: flex; gap: 8px; justify-content: center; margin: 12px 0; }
.breaker button { width: 48px; height: 78px; border-radius: 10px; border: 3px solid var(--ink); background: #3a3350; box-shadow: 3px 3px 0 var(--ink); font-size: 22px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 6px 0; color: #fff; }
.breaker button.on { background: #1a9a4a; }
.breaker button i { width: 16px; height: 16px; border-radius: 50%; background: #555; border: 2px solid var(--ink); }
.breaker button.on i { background: #ffd23f; box-shadow: 0 0 10px #ffd23f; }

/* 劇情對話與特效 */
.talk { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; opacity: 0; animation: talkIn .35s ease-out forwards; }
.talk.npc { flex-direction: row-reverse; text-align: right; }
.talk > img, .talk .sp-ic { width: 38px; height: 38px; flex: none; object-fit: contain; background: #ffffff22; border: 2px solid var(--ink); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.talk > div { background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 2px 2px 0 var(--ink); padding: 5px 9px; font-size: 13px; line-height: 1.45; max-width: 82%; }
.talk.npc > div { background: #fff7d6; }
.talk b { display: block; font-size: 11px; color: #7a3fd0; }
.after-talk { opacity: 0; animation: talkIn .35s ease-out forwards; }
@keyframes talkIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.link-note { background: #2fe0d022; border: 2px dashed #2fe0d0; border-radius: 10px; padding: 5px 8px; font-size: 12px; color: #bff8f2; margin: 6px 0; }
.crit-note { background: linear-gradient(90deg, #ffd23f, #ff4fa3); color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; padding: 6px 9px; font-weight: 900; font-size: 13px; margin: 6px 0; }
.land.fx-shake { animation: fxShake .45s; }
.land.fx-flash::before, .land.fx-gold::before { content: ''; position: absolute; inset: 0; z-index: 30; pointer-events: none; animation: fxFlash .6s forwards; background: #fff; }
.land.fx-gold::before { background: radial-gradient(circle, #ffd23fcc, #ff4fa300 70%); animation-duration: 1.1s; }
@keyframes fxShake { 0%, 100% { transform: none; } 20% { transform: translateX(-9px) rotate(-1deg); } 40% { transform: translateX(8px) rotate(1deg); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
@keyframes fxFlash { from { opacity: .7; } to { opacity: 0; } }
.confetti { position: absolute; inset: 0; z-index: 31; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 13px; border: 1px solid var(--ink); animation: confettiFall 1.8s ease-in forwards; }
@keyframes confettiFall { to { top: 105%; transform: rotate(720deg) translateX(30px); } }
/* 真實典故 */
.lore { background: #fff7d6; color: var(--ink); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); padding: 9px 11px; margin: 6px 0; }
.lore .lt { font-family: var(--title); font-size: 17px; margin-bottom: 4px; }
.lore .lm { font-size: 12px; color: #6a5a3a; margin-bottom: 6px; }
.lore .lx { font-size: 13px; line-height: 1.6; }
.lore .ln { font-size: 12px; color: #7a3fd0; margin-top: 6px; border-top: 2px dashed #0b071433; padding-top: 5px; }
.talk-skip .talk, .talk-skip .after-talk { animation-delay: 0s !important; }
/* 劇情有對話時面板比較長：允許往上蓋住場景（最多到標題列下方） */
.lpanel { overflow: visible; }
.lpanel .ev { max-height: calc(100% - 16px + min(36vh, 300px)); }
.talk.npc > div { text-align: left; }

/* 星際大戰 */
.hull { position: relative; height: 22px; background: #3a1020; border: 2px solid var(--ink); border-radius: 11px; overflow: hidden; margin: 4px 0 8px; }
.hull i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #ff4f5e, #ffd23f); transition: width .4s; }
.hull span { position: relative; display: block; text-align: center; font-size: 12px; font-weight: 900; line-height: 18px; color: #fff; text-shadow: 1px 1px 0 var(--ink); }
.wvs { display: flex; gap: 6px; align-items: stretch; margin: 6px 0; }
.wvs .vs { align-self: center; font-family: var(--title); font-size: 18px; color: #ff4f5e; }
.wside { flex: 1; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 2px 2px 0 var(--ink); padding: 6px; text-align: center; min-width: 0; }
.wside.on { background: var(--y); }
.wside b { display: block; font-size: 13px; }
.wside small { display: block; font-size: 11px; opacity: .8; }
.wodd { font-family: var(--title); font-size: 22px; }
.card.friend small { opacity: .8; }
.btn.wide { width: 100%; margin-top: 7px; justify-content: space-between; text-align: left; }
.wside small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 主選單：圖示／名稱 橫排，放大（老爺 2026-09-29） */
.btn.nav { flex-direction: row; gap: 5px; padding: 8px 4px; }
.btn.nav img.emoji { height: 38px; width: 38px; margin: 0; }
.btn.nav small { font-size: 16px; font-weight: 900; white-space: nowrap; display: inline-block; writing-mode: horizontal-tb; flex: none; }
.btn.nav img.emoji { flex: none; }
@media (max-width: 360px) { .btn.nav img.emoji { height: 32px; width: 32px; } .btn.nav small { font-size: 14px; } }

details.lore-d { margin: 8px 0; }
details.lore-d > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 6px; background: #fff7d6; color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; box-shadow: 2px 2px 0 var(--ink); padding: 7px 10px; font-weight: 900; font-size: 14px; }
details.lore-d > summary::-webkit-details-marker { display: none; }
details.lore-d > summary span:last-child { font-size: 12px; color: #7a3fd0; }
details.lore-d[open] > summary .arr { display: inline-block; transform: rotate(90deg); }

/* 選人卡：上＝選擇（2）、下＝詳情（1） */
.pick .pk { display: flex; flex-direction: column; border: 2px solid var(--ink); border-radius: 12px; box-shadow: 2px 2px 0 var(--ink); overflow: hidden; background: #fff; }
.pick .pk.on { outline: 3px solid var(--p); }
.pick .pk > .pk-main { flex: 2; border: 0; border-radius: 0; box-shadow: none; outline: none; min-height: 92px; }
.pick .pk.on > .pk-main { background: var(--y); }
.pick .pk > .pk-info { flex: 1; min-height: 40px; border: 0; border-top: 2px dashed #0b071455; border-radius: 0; box-shadow: none; background: #efe8ff; color: #4a2a8a; font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center; gap: 3px; padding: 3px; }
.pick .pk > .pk-info img.emoji { height: 16px; width: 16px; margin: 0; }
.pick .pk.off > .pk-info { opacity: 1; }
.pick .pk > .pk-info:active { background: #d9ccff; }
/* 船員詳情小窗（疊在選人彈窗上） */
.overlay.pop { z-index: 26; }
.info-card .ih { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.info-card .ih img { height: 72px; width: auto; }
.info-card .ih b { font-size: 17px; }
.info-card .ieff { background: #2fe0d0; color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; padding: 7px 9px; font-weight: 900; font-size: 13px; margin-bottom: 8px; line-height: 1.5; }
.info-card .ir { background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; padding: 6px 9px; margin-bottom: 6px; font-size: 13px; line-height: 1.5; }
.info-card .ir b { display: block; font-size: 12px; color: #7a3fd0; }
.info-card .ir small { display: block; font-size: 11px; opacity: .75; }
.info-card .ir.no { background: #ffe0e6; }
.fort-art { display: block; width: 150px; margin: -6px auto 6px; filter: drop-shadow(3px 3px 0 #0b071488); }
/* 特殊船員卡：按鈕同一列不換行（老爺 2026-09-29） */
.sp-btns { display: flex; flex-wrap: nowrap; gap: 5px; width: 100%; margin-top: 4px; }
.sp-btns .btn { flex: 1 1 0; min-width: 0; padding: 6px 4px; font-size: 13px; white-space: nowrap; justify-content: center; }
.sp-btns .btn img.emoji { height: 16px; width: 16px; margin: 0 2px 0 0; }

/* 右側圓角按鈕：圖示＋文字整組置中；圓形、瘦長的圖示（🎯🔍🔭）個別放大，視覺上跟書本、全覽一樣大（老爺 2026-09-29 截圖） */
.side-btns .fab { justify-content: center; gap: 1px; }
.side-btns .fab img.emoji { height: 32px; width: 32px; margin: 0; flex: none; object-fit: contain; }
.side-btns .fab small { line-height: 1; flex: none; }
#btnLocate img.emoji, #mZin img.emoji, #mZout img.emoji, #rZin img.emoji, #rZout img.emoji { height: 38px; width: 38px; margin: -3px 0 -2px; }
#btnFit img.emoji { height: 30px; width: 30px; margin-bottom: 2px; }

/* 精簡選人卡（2026-09-29 第二版） */
.pick .pk { position: relative; }
.pick .pk > .pk-main { min-height: 0; padding: 6px 3px 3px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.pick .pk > .pk-main > img:not(.emoji) { height: 46px; }
.pick .pk > .pk-main { font-size: 12px; white-space: nowrap; overflow: hidden; }
.pick .pk > .pk-info { min-height: 26px; flex: none; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 3px; }
.pk-bl { position: absolute; left: 3px; top: 3px; pointer-events: none; }
.pk-bl img.emoji { height: 18px !important; width: 18px !important; }
.pk-br { position: absolute; right: 3px; top: 3px; pointer-events: none; background: #2fe0d0; color: var(--ink); border: 2px solid var(--ink); border-radius: 8px; font-size: 9px; font-weight: 900; padding: 0 4px; line-height: 14px; max-width: 70%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-br.busy { background: #ffb3c2; }

/* 開合箭頭 */
img.chev { width: 24px; height: 24px; flex: none; margin-left: auto; transition: transform .2s; filter: drop-shadow(1px 1px 0 #0b071466); }
img.chev.open, details[open] > summary img.chev { transform: rotate(90deg); }
details.lore-d > summary img.chev { margin-left: 4px; vertical-align: middle; width: 22px; height: 22px; }

.pk-nm { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 1px; max-width: 100%; white-space: nowrap; overflow: hidden; line-height: 1.2; }
.pk-nm img.emoji { height: 14px !important; width: 14px !important; margin: 0 !important; flex: none; }
.pick .pk > .pk-main > img:not(.emoji) { height: 44px; }

/* 艙室指派清單：成員所在地（待命＝淡綠底排最前、外出＝灰底） */
.vl.st-idle, .vl.st-work, .vl.st-away { position: relative; padding-top: 18px; }
.vl.st-idle { background: #d8ffe9 !important; }
.vl.st-away { background: #e4e0ec !important; opacity: .85; }
.loc-tag { position: absolute; right: 6px; top: 4px; font-size: 11px; font-weight: 900; padding: 0 7px; line-height: 18px; border: 2px solid var(--ink); border-radius: 9px; background: #fff; color: var(--ink); white-space: nowrap; }
.loc-tag.idle { background: #2fe0d0; }
.loc-tag.work { background: #ffd23f; }
.loc-tag.away { background: #c9c1dc; }
.loc-tag img.emoji { height: 13px !important; width: 13px !important; margin: 0 2px 0 0 !important; vertical-align: -2px; }
