/* 魔物收購所：網頁介面層（跟遊戲同樣 720×1280 座標，整層等比縮放，字才會清楚） */
#ui { position: fixed; left: 0; top: 0; width: 720px; height: 1280px; transform-origin: 0 0; pointer-events: none; z-index: 5; font-family: Cubic, "Microsoft JhengHei", sans-serif; color: #3a2208; -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; overflow: hidden; }
#ui * { box-sizing: border-box; }
#ui .hit { pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; }
#ui img { -webkit-user-drag: none; image-rendering: auto; }

/* ---- 共用框（用遊戲生成的木框、羊皮紙、金框圖片做九宮格） ---- */
.u-wood { border: 16px solid transparent; border-image: url(img/art/ui_btn.png) 32 33 fill / 16px stretch; color: #fff2d0; text-shadow: 0 2px 0 #2a1608, 2px 0 0 #2a1608, -2px 0 0 #2a1608, 0 -2px 0 #2a1608; }
.u-gold { border: 16px solid transparent; border-image: url(img/art/ui_btn_gold.png) 33 33 fill / 16px stretch; color: #fff8e0; text-shadow: 0 2px 0 #6a3a00, 2px 0 0 #6a3a00, -2px 0 0 #6a3a00, 0 -2px 0 #6a3a00; }
.u-dark { border: 14px solid transparent; border-image: url(img/art/ui_dark.png) 25 25 fill / 14px stretch; color: #ffe9b0; text-shadow: 0 2px 0 #1a0e04; }
.u-paper { border: 26px solid transparent; border-image: url(img/art/ui_panel.png) 29 30 fill / 26px stretch; }
.u-scroll { border: 0 40px; border-style: solid; border-color: transparent; border-image: url(img/art/ui_scroll.png) 32 44 fill / 0 40px stretch; }
.u-card { border: 22px solid transparent; border-image: url(img/art/ui_card_glass.png) 37 33 fill / 22px stretch; }

/* ---- 按鈕 ---- */
.u-btn { display: flex; align-items: center; justify-content: center; font-size: 26px; padding: 0 6px; transition: transform .08s; white-space: nowrap; }
.u-btn:active, .u-btn.press { transform: scale(.92); }
.u-btn.small { font-size: 21px; height: 56px; }
.u-btn.off { filter: grayscale(.8) brightness(.8); }
.u-btn.ad { border-image-source: url(img/art/ui_btn.png); }
.shake { animation: shake .25s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.pop { animation: pop .3s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ---- HUD ---- */
#hud-l { position: absolute; left: 10px; top: 10px; width: 312px; height: 100px; }
#hud-hp { position: absolute; left: 14px; top: 6px; width: 280px; height: 34px; background: url(img/art/ui_bar.png) center / 100% 100% no-repeat; }
#hud-hp i { position: absolute; left: 50px; top: 12px; height: 11px; width: 180px; background: #2a0a0a; }
#hud-hp b { position: absolute; left: 0; top: 0; height: 100%; background: linear-gradient(#ff6a5a, #c0262a); box-shadow: inset 0 2px 0 rgba(255,255,255,.35); transition: width .15s; }
#hud-coin { position: absolute; left: 10px; top: 44px; display: flex; align-items: center; gap: 8px; font-size: 32px; color: #ffe27a; text-shadow: 0 3px 0 #3a2208; }
#hud-coin img { width: 38px; height: 38px; }
#hud-bag { position: absolute; right: 14px; top: 54px; font-size: 22px; color: #e8dcc0; }
#hud-zone { position: absolute; right: 12px; top: 10px; width: 216px; height: 62px; font-size: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
#hud-zone small { font-size: 15px; color: #c9d3ff; }
.hud-btn { position: absolute; width: 150px; height: 58px; }
.dot { position: absolute; right: -6px; top: -8px; width: 22px; height: 22px; border-radius: 50%; background: #e8433a; border: 3px solid #fff2d0; display: none; }

/* ---- 右下動作鍵 ---- */
.act { position: absolute; border-radius: 50%; background: url(img/art/ui_round.png) center / 100% 100% no-repeat; display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 6px 4px rgba(0,0,0,.45)); }
.act img.ic { width: 56%; height: 56%; object-fit: contain; }
.act .lb { position: absolute; bottom: 10%; font-size: 24px; color: #fff2d0; text-shadow: 0 2px 0 #2a1608, 2px 0 0 #2a1608, -2px 0 0 #2a1608, 0 -2px 0 #2a1608; }
.act .n { position: absolute; right: 2px; bottom: -2px; font-size: 20px; color: #fff; text-shadow: 0 2px 0 #000, 1px 0 0 #000, -1px 0 0 #000; }
.act.empty img.ic { opacity: .35; }
.keycap { position: absolute; padding: 2px 9px; background: #f3e2b3; border-radius: 6px; box-shadow: 0 3px 0 #2a1608; font-size: 18px; color: #2a1608; white-space: nowrap; }
#rope-pct { position: absolute; font-size: 26px; color: #ffe27a; text-shadow: 0 3px 0 #0d1018, 2px 0 0 #0d1018, -2px 0 0 #0d1018; transform: translateX(-50%); white-space: nowrap; }
#gold-tag { position: absolute; font-size: 22px; color: #ffd23f; text-shadow: 0 2px 0 #3a1a00; transform: translateX(-50%); }

/* ---- 場景上的按鈕（跟著鏡頭） ---- */
.wbtn { position: absolute; height: 64px; transform: translate(-50%, -50%); animation: bob 1.2s ease-in-out infinite alternate; }
@keyframes bob { to { margin-top: -8px; } }

/* ---- 橫幅、浮字 ---- */
#banner { position: absolute; left: 50%; top: 900px; transform: translateX(-50%); height: 92px; min-width: 300px; max-width: 700px; display: flex; align-items: center; justify-content: center; padding: 0 30px; font-size: 26px; white-space: nowrap; opacity: 0; transition: opacity .25s, top .25s; }
#banner.show { opacity: 1; animation: pop .3s cubic-bezier(.3, 1.6, .5, 1); }
.ftxt { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; pointer-events: none; animation: fup 1.1s ease-in forwards; text-shadow: 0 3px 0 #0d1018, 2px 0 0 #0d1018, -2px 0 0 #0d1018, 0 -2px 0 #0d1018; }
@keyframes fup { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 1; } 15% { transform: translate(-50%, -50%) scale(1.15); } 25% { transform: translate(-50%, -50%) scale(1); } 70% { opacity: 1; } 100% { transform: translate(-50%, -110%); opacity: 0; } }
.big { font-size: 40px; color: #ffe27a; text-shadow: 0 4px 0 #2a1608, 3px 0 0 #2a1608, -3px 0 0 #2a1608, 0 -3px 0 #2a1608; }

/* ---- 面板 ---- */
.ov { position: absolute; inset: 0; background: rgba(0,0,0,.55); pointer-events: auto; animation: fadein .15s; }
@keyframes fadein { from { opacity: 0; } }
.pn { position: absolute; left: 20px; width: 680px; display: flex; flex-direction: column; animation: pnin .2s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes pnin { from { transform: scale(.9); opacity: 0; } }
.pn-title { position: absolute; left: 50%; top: -38px; transform: translateX(-50%); min-width: 290px; height: 82px; font-size: 38px; display: flex; align-items: center; justify-content: center; padding: 0 20px; white-space: nowrap; color: #ffe27a; }
.pn-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 44px 6px 6px; -webkit-overflow-scrolling: touch; }
.pn-body::-webkit-scrollbar { width: 6px; } .pn-body::-webkit-scrollbar-thumb { background: #b89a6a; border-radius: 3px; }
.pn-foot { display: flex; justify-content: center; gap: 16px; padding-top: 8px; }
.pn-foot .u-btn { width: 200px; height: 70px; font-size: 30px; }
.sub { text-align: center; font-size: 21px; color: #7a5a3a; margin-bottom: 10px; }
.sec { font-size: 22px; color: #7a5a3a; margin: 12px 4px 8px; }
.row { display: flex; align-items: center; gap: 14px; background: rgba(107,68,35,.13); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.row .ic { width: 72px; height: 72px; object-fit: contain; flex: none; }
.row .tx { flex: 1; min-width: 0; }
.row .nm { font-size: 26px; }
.row .ds { font-size: 18px; color: #7a5a3a; margin-top: 4px; line-height: 1.35; }
.row .bt { display: flex; flex-direction: column; gap: 6px; flex: none; }
.row .bt .u-btn { width: 130px; }
.row.hl { background: rgba(255,210,63,.32); }
.row.dim { opacity: .55; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cell { background: rgba(107,68,35,.13); border-radius: 8px; padding: 8px; display: flex; align-items: center; gap: 8px; }
.cell img { width: 60px; height: 60px; object-fit: contain; }
.sil { filter: brightness(0) opacity(.55); }
.res { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.res > div { background: rgba(107,68,35,.13); border-radius: 8px; text-align: center; padding: 8px 4px; font-size: 21px; }
.res img { width: 58px; height: 58px; object-fit: contain; display: block; margin: 0 auto 4px; }
.bar { height: 14px; background: rgba(58,34,8,.25); border-radius: 7px; overflow: hidden; margin-top: 6px; }
.bar b { display: block; height: 100%; background: #5bd16a; }
.bar.gold b { background: #ffb400; }
.rw { display: flex; gap: 14px; margin-top: 6px; font-size: 19px; align-items: center; }
.rw img { width: 34px; height: 34px; object-fit: contain; vertical-align: middle; }
.hearts { color: #e8436a; }
.link { font-size: 16px; color: #9a8a7a; text-decoration: underline; }
.link.warn { color: #c0392b; }
.timer { font-size: 17px; color: #2a6a3a; text-align: center; }
.letter { font-size: 24px; text-align: center; line-height: 1.6; padding: 0 20px; }
.loot { display: flex; justify-content: center; gap: 36px; margin-top: 24px; }
.loot div { text-align: center; font-size: 22px; animation: pop .4s cubic-bezier(.3, 1.6, .5, 1) backwards; }
.loot img { width: 64px; height: 64px; object-fit: contain; display: block; margin: 0 auto 4px; }

/* ---- 鐵匠升級演出 ---- */
.hammer { position: absolute; width: 84px; height: 84px; transform-origin: 80% 80%; pointer-events: none; animation: hammer .62s ease-in forwards; z-index: 3; }
@keyframes hammer { 0% { transform: rotate(40deg) translate(30px, -40px); opacity: 0; } 15% { opacity: 1; } 35% { transform: rotate(-25deg); } 55% { transform: rotate(40deg) translate(30px, -40px); } 75% { transform: rotate(-30deg); } 90% { opacity: 1; } 100% { transform: rotate(-30deg); opacity: 0; } }
.spark { position: absolute; width: 8px; height: 8px; background: #ffb347; pointer-events: none; animation: spark .5s ease-out forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
.flashW { animation: flashW .3s; } @keyframes flashW { 0% { filter: brightness(3); } 100% { filter: none; } }

/* ---- 選角 ---- */
.sel-ov { background: rgba(13,16,24,.35); }
.sel-title { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); width: 380px; height: 92px; font-size: 44px; display: flex; align-items: center; justify-content: center; }
.sel-g { position: absolute; top: 190px; width: 160px; height: 72px; font-size: 30px; }
.sel-name-lb { position: absolute; left: 0; right: 0; top: 296px; text-align: center; font-size: 28px; color: #fff2d0; text-shadow: 0 2px 0 #2a1608, 2px 0 0 #2a1608, -2px 0 0 #2a1608; }
.sel-name { position: absolute; left: 180px; top: 340px; width: 360px; height: 60px; text-align: center; font-family: Cubic, sans-serif; font-size: 28px; color: #3a2208; background: #f3e2b3; border: 4px solid #6b4423; border-radius: 6px; outline: none; pointer-events: auto; }
.card { position: absolute; top: 440px; width: 214px; height: 444px; display: flex; flex-direction: column; align-items: center; transition: transform .2s, filter .2s; overflow: visible; }
.card.off { transform: scale(.96); filter: brightness(.6) saturate(.7); }
.card.on { transform: scale(1.04); }
.card .tag { font-size: 17px; color: #ffd23f; text-shadow: 0 2px 0 #2a1608; margin-top: -8px; }
.card .stage { position: relative; width: 200px; height: 250px; display: flex; align-items: flex-end; justify-content: center; }
.card .stage .hero { height: 230px; position: relative; z-index: 2; transform-origin: 50% 100%; animation: float 1.6s ease-in-out infinite alternate; }
@keyframes float { to { translate: 0 -8px; } }
.card .rays { position: absolute; left: 50%; top: 45%; width: 300px; height: 300px; margin: -150px 0 0 -150px; border-radius: 50%; background: repeating-conic-gradient(rgba(255,210,63,.55) 0 8deg, transparent 8deg 30deg); mask: radial-gradient(circle, #000 20%, transparent 70%); -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); animation: spin 7s linear infinite; z-index: 1; display: none; }
.card.on .rays { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.card .ttl { font-size: 30px; color: #ffe27a; text-shadow: 0 3px 0 #3a1a00, 2px 0 0 #3a1a00, -2px 0 0 #3a1a00; margin-top: 4px; white-space: nowrap; }
.card .job { font-size: 20px; color: #c9d3ff; text-shadow: 0 2px 0 #0d1030; }
.card .ds { font-size: 21px; color: #fff2d0; text-align: center; line-height: 1.35; margin-top: 6px; text-shadow: 0 2px 0 #0d1030, 1px 0 0 #0d1030, -1px 0 0 #0d1030; white-space: pre-line; }
.mote { position: absolute; width: 6px; height: 6px; background: #ffe27a; box-shadow: 0 0 6px #ffd23f; animation: mote 1.4s linear forwards; z-index: 3; }
@keyframes mote { to { transform: translateY(-160px); opacity: 0; } }
.fx-img { position: absolute; pointer-events: none; mix-blend-mode: screen; z-index: 3; }
/* 選角招式示範：角色本身的動作 */
.a-sw { animation: aSw .7s ease-out !important; }
@keyframes aSw { 0% { transform: none; } 30% { transform: translateX(-10px) rotate(-18deg) scale(.95, 1.05); } 45% { transform: translateX(26px) rotate(22deg) scale(1.1, .93); } 100% { transform: none; } }
.a-ar { animation: aAr .9s ease-out !important; }
@keyframes aAr { 0% { transform: none; } 30% { transform: translateX(-12px) rotate(-6deg) scaleX(.93); } 40%, 55%, 70% { transform: translateX(-20px) rotate(-4deg); } 47%, 62% { transform: translateX(-10px); } 100% { transform: none; } }
.a-mg { animation: aMg .9s ease-out !important; }
@keyframes aMg { 0% { transform: none; filter: none; } 45% { transform: scale(.95, 1.1) rotate(-4deg); filter: brightness(1.4) hue-rotate(20deg); } 60% { transform: translateX(12px) scale(1.06, .95) rotate(8deg); filter: none; } 100% { transform: none; } }
.go-btn { position: absolute; left: 190px; top: 1020px; width: 340px; height: 100px; font-size: 40px; }

/* ---- 廣告畫面（上架後換真廣告） ---- */
.adbox { position: absolute; inset: 0; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; text-align: center; font-size: 30px; color: #fff; pointer-events: auto; white-space: pre-line; }
