/* 逆命仙途：奪鼎 — 灰墨地形 + 青紫靈氣 + 金鼎光 */
:root {
  /* 色票同《問道長生》src/ui/styles.css：墨、金箔、朱砂、玉、天青、宣紙 */
  --bg: #11100e; --card: #1c1a16; --card2: #161411; --line: #3a342b; --line2: #5a5042;
  --gold: #d8b86c; --gold-hi: #f2dca0; --cinnabar: #b3372a; --cyan: #6fc2a0; --vio: #ab8ede;
  --txt: #ede5d3; --mut: #9a8f79; --red: #ec7862; --grn: #82c98a; --blu: #6aa6d8; --paper: #ece2ca;
  --hair: rgba(214, 180, 106, .26);
  --serif: "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", serif;
  --brush: "LXGW WenKai TC", "DFKai-SB", "BiauKai", "Kaiti TC", "STKaiti", "KaiTi", var(--serif);
  --sans: var(--serif);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--txt); font-family: var(--sans); overflow: hidden; }
button { font-family: inherit; color: inherit; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; }

/* ───── 標題 ───── */
#title { display: grid; place-items: center; overflow: hidden; }
.title-bg { position: absolute; inset: -20px; background: url(assets/bg/title.jpg) center/cover no-repeat; filter: saturate(.9) brightness(.55); animation: drift 40s ease-in-out infinite alternate; }
.title-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, transparent 0%, rgba(13,15,20,.55) 55%, var(--bg) 100%); }
@keyframes drift { from { transform: scale(1.04) translateY(0); } to { transform: scale(1.1) translateY(-14px); } }
.title-inner { position: relative; text-align: center; padding: 24px 16px; max-width: 720px; }
.eyebrow { color: var(--cyan); letter-spacing: .5em; font-size: 13px; }
.logo { font-family: var(--serif); font-weight: 900; font-size: clamp(44px, 9vw, 92px); margin: .15em 0 .1em; line-height: 1.1;
  background: linear-gradient(180deg, #fff3cf 0%, var(--gold) 55%, #9a6b16 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(232,182,76,.25); }
.logo span { font-size: .55em; }
.lede { color: #cbd5e1; font-size: 16px; line-height: 1.9; margin: 0 0 26px; text-shadow: 0 2px 8px #000; }
.menu { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.btn { appearance: none; border: 1px solid var(--line2); background: rgba(22,25,34,.85); padding: 11px 26px; border-radius: 10px; font-size: 16px; cursor: pointer; min-width: 220px; transition: border-color .15s, background .15s, transform .1s; }
.btn:hover { border-color: var(--gold); background: rgba(40,34,20,.9); }
.btn:active { transform: translateY(1px); }
.btn.primary { border-color: var(--gold); background: linear-gradient(180deg, rgba(232,182,76,.25), rgba(232,182,76,.08)); color: #fff3cf; font-weight: 700; }
.btn.ghost { background: transparent; }
.btn.small { min-width: 0; padding: 7px 14px; font-size: 14px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.title-foot { margin-top: 22px; color: var(--mut); font-size: 13px; }
.title-foot b { color: var(--gold); }

/* ───── 開局 ───── */
#create { overflow-y: auto; background: radial-gradient(ellipse at top, #1a1d28, var(--bg) 60%); }
.cwrap { max-width: 1120px; margin: 0 auto; padding: 22px 16px 120px; }
.chead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; justify-content: space-between; }
.chead h2 { font-family: var(--serif); color: var(--gold); margin: 0; font-size: 28px; }
.bank { color: var(--vio); font-size: 15px; }
.bank b { font-size: 22px; color: #ddd6fe; }
.sec-t { color: var(--cyan); letter-spacing: .2em; font-size: 13px; margin: 22px 0 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.pcard { position: relative; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px 12px 10px; cursor: pointer; transition: border-color .15s, transform .15s; text-align: left; }
.pcard:hover { border-color: var(--line2); transform: translateY(-2px); }
.pcard.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 8px 30px rgba(232,182,76,.12); }
.pcard.locked { opacity: .55; }
.pcard .glyph { float: right; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 22px; font-weight: 900; background: #0b0d12; border: 2px solid currentColor; }
.pcard h3 { margin: 0 0 2px; font-size: 18px; }
.pcard .stars { color: var(--gold); font-size: 12px; letter-spacing: 1px; }
.pcard p { margin: 6px 0 0; font-size: 13px; color: #cbd5e1; line-height: 1.6; }
.pcard .weak { color: #fca5a5; }
.pcard .stat { color: var(--mut); font-size: 12px; margin-top: 6px; }
.pcard .sks { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.pcard .sks span { font-size: 11px; border: 1px solid var(--line2); border-radius: 6px; padding: 1px 6px; color: #cbd5e1; }
.badge { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--cyan); color: var(--cyan); margin-left: 6px; vertical-align: middle; }
.badge.s { border-color: var(--gold); color: var(--gold); }
.badge.rec { border-color: var(--grn); color: var(--grn); }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.shop label { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card2); cursor: pointer; font-size: 14px; }
.shop label.off { opacity: .5; cursor: not-allowed; }
.shop small { color: var(--mut); display: block; }
.shop select { margin-top: 6px; background: #0b0d12; color: var(--txt); border: 1px solid var(--line2); border-radius: 6px; padding: 3px; }
.cfoot { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(13,15,20,.94); border-top: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; backdrop-filter: blur(6px); }
.cfoot .sum { color: #cbd5e1; font-size: 14px; }
.cfoot input { background: #0b0d12; border: 1px solid var(--line2); color: var(--txt); padding: 9px 10px; border-radius: 8px; width: 140px; font-size: 15px; }

/* ───── 遊戲版面 ───── */
#game { display: grid; grid-template-columns: 272px 1fr; }
#side { background: linear-gradient(180deg, #151821, #0f1117); border-right: 1px solid var(--line); padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
#stage { position: relative; overflow: hidden; background: #050608; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }

.who { display: flex; gap: 10px; align-items: center; }
.portrait { width: 64px; height: 64px; flex: none; border-radius: 12px; display: grid; place-items: center; font-family: var(--serif); font-size: 34px; font-weight: 900; background: radial-gradient(circle at 50% 35%, #2a2f3d, #0b0d12); border: 2px solid var(--cyan); box-shadow: 0 0 18px rgba(94,234,212,.2) inset; }
.who h3 { margin: 0; font-size: 17px; }
.who .sub { color: var(--mut); font-size: 12px; }
.realm { display: inline-block; margin-top: 4px; font-size: 12px; padding: 1px 8px; border-radius: 8px; background: rgba(232,182,76,.12); color: var(--gold); border: 1px solid rgba(232,182,76,.4); }
.bars { display: flex; flex-direction: column; gap: 6px; }
.barrow { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 6px; font-size: 12px; }
.barrow > span { color: var(--mut); }
.bar { position: relative; height: 16px; border-radius: 4px; background: #0b0d12; border: 1px solid #262b37; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; transition: width .25s ease; }
.bar b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.bar .tick { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.35); }
.hp i { background: linear-gradient(90deg, #b91c1c, #f87171); }
.mp i { background: linear-gradient(90deg, #1d4ed8, #60a5fa); }
.sp i { background: linear-gradient(90deg, #15803d, #4ade80); }
.sp.full i { box-shadow: 0 0 10px #4ade80; }
.mind i { background: linear-gradient(90deg, #6d28d9, #c4b5fd); }
.life i { background: linear-gradient(90deg, #a16207, #fbbf24); }
.tox i { background: linear-gradient(90deg, #65a30d, #d9f99d); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; text-align: center; }
.stats div { background: #0b0d12; border: 1px solid #222734; border-radius: 6px; padding: 3px 0; font-size: 11px; color: var(--mut); }
.stats b { display: block; color: var(--txt); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; min-height: 0; }
.chip { font-size: 11px; padding: 1px 7px; border-radius: 8px; border: 1px solid var(--line2); color: #cbd5e1; }
.chip.bad { border-color: #7f1d1d; color: #fca5a5; }
.chip.good { border-color: #14532d; color: #86efac; }
.panel-t { color: var(--cyan); font-size: 12px; letter-spacing: .2em; margin: 2px 0 4px; display: flex; justify-content: space-between; }
.panel-t em { color: var(--mut); letter-spacing: 0; font-style: normal; }
.inv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.inv button { display: flex; align-items: center; gap: 6px; background: #0b0d12; border: 1px solid #222734; border-radius: 8px; padding: 5px 6px; cursor: pointer; font-size: 12px; text-align: left; }
.inv button:hover { border-color: var(--gold); }
.inv i { font-style: normal; width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 5px; background: #1a1e28; font-family: var(--serif); font-weight: 900; font-size: 13px; }
.inv .n { margin-left: auto; color: var(--mut); }
.tre { display: flex; flex-wrap: wrap; gap: 4px; }
.tre span { font-size: 11px; padding: 2px 7px; border-radius: 6px; border: 1px solid rgba(232,182,76,.4); color: var(--gold); }
.side-foot { margin-top: auto; display: flex; gap: 6px; }
.side-foot .btn { flex: 1; min-width: 0; }
.empty { color: #4b5563; font-size: 12px; }

#topbar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: rgba(13,15,20,.78); border: 1px solid var(--line); border-radius: 20px; padding: 4px 16px; font-size: 13px; white-space: nowrap; pointer-events: none; backdrop-filter: blur(4px); }
#topbar b { color: var(--gold); font-family: var(--serif); }
#topbar .t { color: var(--mut); margin-left: 10px; }
#log { position: absolute; left: 10px; top: 10px; width: min(400px, 44%); max-height: 46%; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; pointer-events: none; font-size: 13px; line-height: 1.45; mask-image: linear-gradient(180deg, transparent 0%, #000 30%); }
#log div { background: rgba(5,6,8,.62); padding: 1px 8px; border-radius: 4px; width: fit-content; max-width: 100%; }
#log .warn { color: #fde047; } #log .bad { color: #fca5a5; } #log .good { color: #86efac; } #log .skill { color: #99f6e4; }
#log .ghost { color: #c4b5fd; } #log .diary { color: #e2e8f0; font-style: italic; } #log .floor { color: var(--gold); font-weight: 700; }
#log .boss { color: #fb923c; font-weight: 700; } #log .hint { color: #93c5fd; } #log .ach { color: var(--gold); }

#ghost { position: absolute; left: 50%; bottom: 128px; transform: translateX(-50%); width: min(640px, 92%); background: rgba(20,16,36,.9); border: 1px solid rgba(167,139,250,.55); color: #ede9fe; border-radius: 12px; padding: 10px 14px 10px 46px; font-size: 14px; line-height: 1.7; box-shadow: 0 10px 40px rgba(0,0,0,.5); animation: rise .35s ease; pointer-events: auto; cursor: pointer; }
#ghost::before { content: "魂"; position: absolute; left: 10px; top: 10px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #2e1065; color: #ddd6fe; font-family: var(--serif); font-weight: 900; font-size: 14px; }
#ghost.diary { background: rgba(28,28,30,.94); border-color: #64748b; color: #e2e8f0; font-style: italic; }
#ghost.diary::before { content: "骸"; background: #334155; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

#banner { position: absolute; left: 0; right: 0; top: 30%; text-align: center; pointer-events: none; animation: bannerIn 2.6s ease forwards; }
#banner h2 { font-family: var(--serif); font-weight: 900; font-size: clamp(30px, 5vw, 54px); margin: 0; color: #fff3cf; text-shadow: 0 0 30px rgba(232,182,76,.6), 0 2px 0 #000; letter-spacing: .1em; }
#banner p { margin: 6px auto 0; max-width: 640px; color: #e2e8f0; font-size: 15px; text-shadow: 0 2px 6px #000; padding: 0 16px; }
#banner.boss h2 { color: #fecaca; text-shadow: 0 0 30px rgba(248,113,113,.7), 0 2px 0 #000; }
@keyframes bannerIn { 0% { opacity: 0; transform: scale(1.08); } 12% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }

#tip { position: absolute; pointer-events: none; background: rgba(11,13,18,.95); border: 1px solid var(--line2); border-radius: 8px; padding: 6px 10px; font-size: 12px; max-width: 260px; line-height: 1.6; z-index: 5; }
#tip b { color: var(--gold); }

#bar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 6px; align-items: flex-end; background: rgba(13,15,20,.86); border: 1px solid rgba(94,234,212,.35); border-radius: 14px; padding: 8px 10px; backdrop-filter: blur(6px); box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 10px 30px rgba(0,0,0,.5); max-width: calc(100% - 20px); overflow-x: auto; }
.sk { position: relative; width: 66px; flex: none; border: 1px solid var(--line2); background: #0b0d12; border-radius: 10px; padding: 4px 2px 3px; cursor: pointer; text-align: center; transition: border-color .12s, transform .1s; }
.sk:hover { border-color: var(--cyan); }
.sk:active { transform: translateY(1px); }
.sk .k { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); background: #0d0f14; border: 1px solid var(--cyan); color: var(--cyan); font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 5px; line-height: 14px; }
.sk .ic { font-family: var(--serif); font-weight: 900; font-size: 22px; line-height: 30px; color: #e0f2fe; }
.sk .nm { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sk .cost { font-size: 10px; color: var(--mut); height: 13px; }
.sk .cost .m { color: var(--blu); } .sk .cost .s { color: var(--grn); }
.sk.off { opacity: .45; }
.sk.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 16px rgba(232,182,76,.35); }
.sk .cd { position: absolute; inset: 0; border-radius: 10px; background: rgba(0,0,0,.6); display: grid; place-items: center; font-size: 20px; font-weight: 700; color: #fff; }
.sk.gen .k { border-color: var(--vio); color: var(--vio); }
.sk.util .ic { color: #a7f3d0; }
.sk.dash.on { border-color: var(--grn); box-shadow: 0 0 14px rgba(74,222,128,.4); }
.sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 2px; }

/* ───── 彈窗 ───── */
#modal { position: fixed; inset: 0; background: rgba(5,6,8,.72); display: grid; place-items: center; z-index: 20; padding: 16px; backdrop-filter: blur(3px); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
#modal .box { width: min(720px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: linear-gradient(180deg, #181b25, #11131a); border: 1px solid var(--line2); border-radius: 16px; padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
#modal h2 { font-family: var(--serif); color: var(--gold); margin: 0 0 4px; font-size: 26px; }
#modal .mut { color: var(--mut); font-size: 14px; margin: 0 0 14px; line-height: 1.7; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 14px 0 6px; }
.opt { text-align: left; border: 1px solid var(--line2); background: #0e1016; border-radius: 12px; padding: 12px; cursor: pointer; transition: border-color .15s, transform .15s; }
.opt:hover { border-color: var(--gold); transform: translateY(-2px); }
.opt:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.opt h4 { margin: 0 0 4px; color: #fff3cf; font-size: 17px; }
.opt p { margin: 0; color: #cbd5e1; font-size: 13px; line-height: 1.6; }
.opt small { display: block; margin-top: 6px; color: var(--mut); font-size: 12px; }
.opt .num { float: right; color: var(--mut); font-size: 12px; }
.rows { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; font-size: 14px; margin: 10px 0; }
.rows span { color: var(--mut); }
.rows b { text-align: right; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.warnline { color: #fca5a5; font-size: 14px; margin: 8px 0 0; }
.okline { color: #86efac; font-size: 14px; margin: 8px 0 0; }
.endart { width: 100%; border-radius: 12px; border: 1px solid var(--line); margin: 6px 0 12px; max-height: 260px; object-fit: cover; }
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.help-grid kbd { background: #0b0d12; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; font-family: inherit; font-size: 12px; white-space: nowrap; }
.hist { font-size: 13px; color: #cbd5e1; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
.hist div { padding: 2px 0; }
.achs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.achs span { font-size: 12px; padding: 3px 9px; border-radius: 8px; border: 1px solid var(--line2); color: #4b5563; }
.achs span.got { border-color: var(--gold); color: var(--gold); }

#toast { position: fixed; right: 16px; top: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 30; pointer-events: none; }
#toast div { background: rgba(28,22,8,.95); border: 1px solid var(--gold); color: #fff3cf; padding: 8px 14px; border-radius: 10px; font-size: 14px; animation: rise2 .3s ease; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
@keyframes rise2 { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ───── 窄螢幕 ───── */
@media (max-width: 820px) {
  #game { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  #side { flex-direction: row; flex-wrap: wrap; max-height: 30vh; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; gap: 8px; }
  #side > * { flex: 1 1 260px; }
  .portrait { width: 44px; height: 44px; font-size: 24px; }
  #log { width: 70%; max-height: 32%; font-size: 12px; }
  #topbar { top: auto; bottom: 96px; font-size: 12px; }
  #ghost { bottom: 92px; font-size: 13px; }
  .sk { width: 54px; }
  .sk .nm { font-size: 10px; }
  .sk.util { order: -1; }
}

/* ───── 資源圖（佔位符／正式圖）───── */
img[data-k] { display: block; object-fit: cover; }
.pimg { width: 100%; height: 100%; border-radius: 10px; }
.portrait { overflow: hidden; padding: 0; }
.bi { display: inline-block !important; width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; border-radius: 3px; object-fit: contain !important; }
.barrow { grid-template-columns: 52px 1fr; }
.ii { width: 22px; height: 22px; border-radius: 5px; object-fit: contain !important; }
.inv i { background: transparent; }
.ti { display: inline-block !important; width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; object-fit: contain !important; }
.sk .ic { height: 32px; display: grid; place-items: center; }
.si { width: 30px; height: 30px; border-radius: 6px; object-fit: contain !important; }
.pcard .glyph { overflow: hidden; border-width: 2px; }
.pcard .glyph + .glyph { display: none; }
.gimg { width: 100%; height: 100%; object-fit: contain !important; }
.oi { float: left; width: 40px; height: 40px; margin: 0 10px 4px 0; border-radius: 8px; object-fit: contain !important; }
.ai { display: inline-block !important; width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; object-fit: contain !important; }
.achs span:not(.got) .ai { filter: grayscale(1) opacity(.5); }
img.endart { width: 100%; height: 220px; }
img.endart.short { height: 120px; }
.gav { position: absolute; left: 8px; top: 8px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(171,142,222,.6); }
#ghost::before { display: none; }
#banner .bimg { position: absolute; left: 50%; top: -40px; transform: translateX(-50%); width: min(760px, 92%); height: 190px; background-size: cover; background-position: center; opacity: .55; z-index: -1;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 72%); mask-image: radial-gradient(ellipse at center, #000 30%, transparent 72%); }
#banner .bboss { width: 150px; height: 150px; margin: 0 auto 6px; object-fit: contain !important; filter: drop-shadow(0 0 18px rgba(236,120,98,.55)); }
.tico { display: inline-block !important; width: 20px; height: 20px; vertical-align: -5px; margin-right: 6px; object-fit: contain !important; }
.audio-row { display: flex; gap: 6px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.audio-row .btn { min-width: 0; padding: 4px 10px; font-size: 12px; }
#side .audio-row { justify-content: stretch; margin-top: 0; }
#side .audio-row .btn { flex: 1; }
.logoimg { max-width: min(720px, 90vw); margin: 0 auto; }
#create { background: linear-gradient(180deg, rgba(17,16,14,.55), var(--bg) 340px), var(--create-bg, none) center top / 100% auto no-repeat, var(--bg); }
.chead h2, .logo, #modal h2, #banner h2 { font-family: var(--brush); }
.title-inner .lede { font-family: var(--serif); }

/* ───── 完整版 ───── */
.stats2 { display: flex; gap: 12px; font-size: 12px; color: var(--mut); flex-wrap: wrap; }
.stats2 b { color: var(--txt); }
#topbar .mod { display: inline-block; margin-left: 8px; padding: 0 7px; border-radius: 8px; border: 1px solid rgba(171,142,222,.6); color: #d8c8f5; font-size: 11px; }
.diffs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.dcard h3 { margin-bottom: 4px; }
.shophead { display: flex; gap: 14px; align-items: center; }
.shopimg { width: 84px; height: 84px; border-radius: 12px; border: 2px solid var(--gold); flex: none; }
.sk.locked { opacity: .55; }
.sk .cd.lock { font-size: 14px; color: var(--gold); background: rgba(0,0,0,.55); }

/* ───── 玩法擴充 ───── */
#topbar .mod.risky { border-color: var(--red); color: var(--red); }
#topbar .mod.trial { border-color: var(--gold); color: var(--gold-hi); }
#topbar .mod.trial.done { border-color: var(--grn); color: var(--grn); }
#topbar .mod.trial.fail { border-color: var(--line2); color: var(--mut); text-decoration: line-through; }
#topbar .mod .bi { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
.bonds { display: grid; gap: 5px; }
.bonds > div { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 4px 6px; font-size: 12px; }
.bonds em { color: var(--gold); font-style: normal; letter-spacing: 1px; font-size: 11px; }
.bonds i { grid-column: 1 / -1; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bonds i b { display: block; height: 100%; background: var(--cyan); }
.cave { display: grid; gap: 8px; }
.cave .cv { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; background: var(--card2); }
.cave .cv .oi { width: 40px; height: 40px; }
.cave .cv p { margin: 2px 0 0; font-size: 12px; color: var(--mut); }
.cave .cv .lv { color: var(--gold); font-size: 12px; letter-spacing: 1px; }
.cave .btn.small, .hist .btn.small { min-width: 0; padding: 4px 10px; font-size: 12px; }
@media (max-width: 640px) { .cave .cv { grid-template-columns: 36px 1fr; } .cave .cv > :last-child { grid-column: 1 / -1; } }
#modal input[data-bondname] { background: var(--card2); border: 1px solid var(--line2); color: var(--txt); border-radius: 6px; padding: 3px 8px; font: inherit; }
#modal input[data-bondname]:focus { outline: none; border-color: var(--gold); }
#modal video.pv { display: block; width: min(960px, 86vw); aspect-ratio: 16 / 9; background: #000; border-radius: 8px; margin: 8px 0 4px; }
/* 部署版：回首頁連結（只在標題／開局畫面顯示） */
.home-link { position: fixed; right: 14px; bottom: 12px; z-index: 30; color: var(--mut); text-decoration: none; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 3px 10px; background: rgba(17,16,14,.7); }
.home-link:hover { color: var(--gold); border-color: var(--gold); }
body:has(#game:not(.hidden)) .home-link { display: none; }
