/* 《待辦：執房》HUD 樣式 — 圓潤可愛風，同 QuestBoard 完全唔同 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: -apple-system, "PingFang HK", "Microsoft JhengHei", sans-serif;
  background: #f5e6c8; color: #5a4a3a;
  user-select: none; -webkit-user-select: none; touch-action: none;
}
#app { position: fixed; inset: 0; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* 頂部 HUD */
#hud-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px;
  pointer-events: none; z-index: 10;
}
#hud-top > * { pointer-events: auto; }
#player-chip {
  background: rgba(255,255,255,.92); border-radius: 20px;
  padding: 6px 12px; font-size: 13px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); white-space: nowrap;
}
#player-level {
  background: #ffb84d; color: #fff; border-radius: 10px;
  padding: 1px 7px; font-size: 11px; margin-left: 4px;
}
#xp-bar {
  flex: 1; height: 14px; background: rgba(255,255,255,.75);
  border-radius: 8px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,.15);
}
#xp-fill {
  height: 100%; width: 0%; border-radius: 8px;
  background: linear-gradient(90deg, #7ddf8e, #4caf6d);
  transition: width .4s ease;
}
#clean-chip, #coin-chip {
  background: rgba(255,255,255,.92); border-radius: 20px;
  padding: 6px 12px; font-size: 13px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); white-space: nowrap;
}

/* 側邊垃圾桶 */
#hud-bin {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: rgba(255,255,255,.9); border-radius: 16px; padding: 10px 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,.15); z-index: 10; cursor: pointer;
}
#bin-icon { font-size: 28px; }
#bin-bar { width: 12px; height: 90px; background: #eee; border-radius: 6px; overflow: hidden; display: flex; align-items: flex-end; }
#bin-fill { width: 100%; height: 0%; background: linear-gradient(0deg, #ff9a5a, #ff6b4a); transition: height .3s; }
#bin-text { font-size: 11px; font-weight: 700; }

/* 角落大掣 */
#hud-buttons {
  position: absolute; left: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  display: flex; flex-direction: column; gap: 10px; z-index: 10;
}
.hud-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  font-size: 20px; background: rgba(255,255,255,.94);
  box-shadow: 0 3px 10px rgba(0,0,0,.18); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s;
}
.hud-btn:active { transform: scale(.9); }

/* toast */
#toast {
  position: absolute; top: 76px; left: 50%; transform: translateX(-50%);
  background: rgba(60,50,40,.92); color: #fff; border-radius: 20px;
  padding: 10px 18px; font-size: 14px; font-weight: 600; z-index: 50;
  transition: opacity .3s; white-space: nowrap; max-width: 90vw;
}
#toast.hidden { opacity: 0; pointer-events: none; }

/* modal */
.modal {
  position: absolute; inset: 0; z-index: 100;
  background: rgba(0,0,0,.45); display: flex;
  align-items: center; justify-content: center; padding: 20px;
}
.modal.hidden { display: none; }
.modal-card {
  background: #fffdf7; border-radius: 24px; padding: 28px 24px;
  max-width: 340px; width: 100%; text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  animation: pop .25s ease;
}
.modal-card h2 { font-size: 20px; margin-bottom: 12px; }
.modal-card p { font-size: 15px; line-height: 1.6; margin-bottom: 18px; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.btn-primary {
  background: linear-gradient(135deg, #ffb84d, #ff9a3d); color: #fff;
  border: none; border-radius: 16px; padding: 12px 36px;
  font-size: 16px; font-weight: 700; cursor: pointer;
  box-shadow: 0 3px 10px rgba(255,154,61,.4);
}
.btn-primary:active { transform: scale(.95); }

/* 教學 */
#tutorial { position: absolute; inset: 0; z-index: 90; pointer-events: none; }
#tutorial.hidden { display: none; }
#tutorial-text {
  position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%);
  background: rgba(255,255,255,.96); border-radius: 18px; padding: 14px 20px;
  font-size: 15px; font-weight: 600; box-shadow: 0 4px 16px rgba(0,0,0,.2);
  max-width: 80vw; text-align: center; pointer-events: auto;
}
#tutorial-hand { position: absolute; font-size: 44px; animation: bounce 1s infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
#btn-tutorial-skip {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 70px); right: 12px;
  background: rgba(255,255,255,.9); border: none; border-radius: 14px;
  padding: 8px 14px; font-size: 13px; font-weight: 600; pointer-events: auto;
}

/* loading */
#loading {
  position: absolute; inset: 0; z-index: 200; background: #f5e6c8;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .5s;
}
#loading.hidden { opacity: 0; pointer-events: none; }
.loading-box { text-align: center; }
.loading-title { font-size: 28px; font-weight: 800; color: #8a6d4f; margin-bottom: 8px; }
.loading-sub { font-size: 14px; color: #b09a7e; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .4; } }
