/* hud.css — 玩樂坊 v2 共用 HUD 樣式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #05060a; font-family: -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif; }
#c { position: fixed; inset: 0; display: block; touch-action: none; }

/* ---- 載入層 ---- */
#boot { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: #05060a; color: #cfd6e6; transition: opacity .5s; }
#boot.hide { opacity: 0; pointer-events: none; }
#boot .logo { font-size: 26px; letter-spacing: 4px; color: #ffb060; }
#boot .bar { width: 220px; height: 3px; background: #1b2130; border-radius: 2px; overflow: hidden; }
#boot .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff7a30, #ffb060); transition: width .3s; }
#boot .tip { font-size: 12px; opacity: .55; }

/* ---- 瞄準 ---- */
#crosshair { position: fixed; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%); z-index: 10; pointer-events: none; }
#crosshair::before, #crosshair::after { content: ''; position: absolute; background: rgba(255,255,255,.9); }
#crosshair::before { left: 50%; top: 0; width: 2px; height: 100%; transform: translateX(-50%); }
#crosshair::after { top: 50%; left: 0; height: 2px; width: 100%; transform: translateY(-50%); }
#crosshair .dot { position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; background: #ff7a30; border-radius: 50%; transform: translate(-50%, -50%); }

/* ---- HUD 頂欄 ---- */
#hud { position: fixed; inset: 0; z-index: 11; pointer-events: none; }
#hud .top { position: absolute; top: 14px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: flex-start; }
.chip { background: rgba(8,12,20,.62); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 8px 12px; color: #e8ecf5; font-size: 13px; letter-spacing: 1px; backdrop-filter: blur(6px); }
.chip b { color: #ffb060; font-size: 16px; }
.chip .lbl { opacity: .6; font-size: 11px; }

/* ---- 生命值 ---- */
#hpwrap { width: 160px; height: 8px; background: rgba(255,255,255,.12); border-radius: 4px; overflow: hidden; margin-top: 5px; }
#hp { height: 100%; width: 100%; background: linear-gradient(90deg, #ff4d4d, #ff7a30); transition: width .15s; }

/* ---- 底部提示 ---- */
#hint { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 12; color: rgba(255,255,255,.75); font-size: 13px; letter-spacing: 2px; text-shadow: 0 1px 4px #000; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .75; } 50% { opacity: .35; } }

/* ---- 結算卡 ---- */
#scorecard { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; background: rgba(3,5,10,.72); backdrop-filter: blur(8px); }
#scorecard.show { display: flex; }
#scorecard .card { background: linear-gradient(180deg, #10182a, #0a0f1a); border: 1px solid rgba(255,176,96,.28); border-radius: 18px; padding: 34px 42px; text-align: center; color: #e8ecf5; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
#scorecard h2 { font-size: 30px; letter-spacing: 3px; color: #ffb060; margin-bottom: 8px; }
#scorecard .stat { font-size: 15px; opacity: .85; margin: 6px 0; }
#scorecard .stat b { color: #ffd9a0; font-size: 22px; }
#scorecard button { margin-top: 20px; padding: 12px 34px; font-size: 16px; letter-spacing: 3px; border: none; border-radius: 30px; cursor: pointer; color: #14100a; background: linear-gradient(90deg, #ffb060, #ff7a30); font-weight: 700; }
#scorecard button:active { transform: scale(.97); }

/* ---- 手機雙搖桿 ---- */
#joystick { position: fixed; bottom: 26px; left: 26px; z-index: 20; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); display: none; touch-action: none; }
#joystick .knob { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.22); transform: translate(-50%, -50%); }
#joylook { position: fixed; bottom: 26px; right: 26px; z-index: 20; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); display: none; touch-action: none; }
#joylook .knob { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,122,48,.5); transform: translate(-50%, -50%); }
body.touch #joystick, body.touch #joylook { display: block; }

@media (max-width: 820px) {
  .chip { font-size: 11px; padding: 6px 9px; }
  .chip b { font-size: 13px; }
}
