/* 經典天堂倖存者：打局中的介面（11-17，js/runbar.js；示意 docs/示意/打局介面示意.html）
   電腦版：下方狀態列照樣在，右邊 8 格換成消耗品快捷鍵；手機：右下角 2 排 × 4 格＋聊天／自動／換格三顆鈕
   右上角：有時間限制的效果（吃的加速、經驗藥水、撿到的藥水、變身）圖示＋剩下的時間 */

/* ---------- 共用：打局中村莊的東西藏起來，舊的喝水、瞬移鈕換成快捷鍵 ---------- */
#vhud.inrun #vNotice, #vhud.inrun #vOnline, #vhud.inrun .iw { display: none !important; }
body.inrun #btnTele, body.inrun .hbtn.pot { display: none !important; }
body:not(.inrun) #rq, body:not(.inrun) #rqTools, body:not(.inrun) #buffs { display: none !important; }

/* ---------- 電腦版：狀態列右邊 8 格（位置照原版快捷列的格子） ---------- */
#lhRk { display: none; position: absolute; left: 0; top: 0; width: 157px; height: 124px; pointer-events: none; }   /* 透明的外框不能擋住下面那排原版鈕（11-17 使用者：點不到）；只有 8 格本身收點擊 */
#lhRk .rk { pointer-events: auto; }
#vhud.inrun #lhRk { display: block; }
#vhud.inrun #lhR > .lh-key { display: none; }   /* 只藏村莊的 F5～F12 格子；下面那排原版鈕、頁籤照樣在（11-17 使用者） */
.lh-key.rk .n { left: 2px; top: 0; font-size: 9px; color: #ffe28a; text-shadow: 0 0 2px #000, 0 0 2px #000; pointer-events: none; z-index: 1; }
.lh-key.rk b { left: auto; right: 2px; bottom: -1px; text-align: right; font-weight: 700; z-index: 1; }
.lh-key.rk .tm { position: absolute; left: 1px; top: 0; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .55); color: #8fff8f; font-size: 10px; font-weight: 700; text-shadow: 0 0 2px #000; pointer-events: none; }
.lh-key.rk.zero img { opacity: .35; filter: grayscale(.6); }
.lh-key.rk.zero b { color: #ff8a6a; }
.lh-key.rk.empty { cursor: default; }

/* ---------- 手機：右下角 2 排 × 4 格，上面三顆鈕 ---------- */
#rq, #rqTools { display: none; }
@media (max-width: 760px), (pointer: coarse) {
  #vhud.inrun .vh-top, #vhud.inrun .vh-btns, #vhud.inrun .lh { display: none !important; }
  #vhud.inrun #chatBox:not(.rshow) { display: none !important; }
  body.inrun #chatBox.rshow:not(.open) { bottom: 172px; }
  body.inrun #rq { display: grid; }
  body.inrun #rqTools { display: flex; }
}
#rq { position: absolute; right: 8px; bottom: 16px; grid-template-columns: repeat(4, 48px); gap: 5px; pointer-events: auto; }
.rqk { position: relative; width: 48px; height: 48px; padding: 0; border: 0; cursor: pointer; touch-action: manipulation;
  background: rgba(0, 0, 0, .6) url(../assets/ui/orig/s5479.png?v=2) center / 100% 100% no-repeat; }
.rqk img { position: absolute; left: 7px; top: 7px; width: 34px; height: 34px; image-rendering: pixelated; pointer-events: none; }
.rqk .n { position: absolute; left: 3px; top: 1px; font-style: normal; font-size: 10px; color: #ffe28a; text-shadow: 0 0 2px #000, 0 0 2px #000; z-index: 1; pointer-events: none; }
.rqk b { position: absolute; right: 3px; bottom: 1px; font-size: 12px; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; z-index: 1; pointer-events: none; }
.rqk .tm { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .55); color: #8fff8f;
  font-size: 12px; font-weight: 700; text-shadow: 0 0 2px #000; pointer-events: none; }
.rqk.zero img { opacity: .35; filter: grayscale(.6); }
.rqk.zero b { color: #ff8a6a; }
.rqk:active:not(.empty) img { filter: brightness(1.4); }
#rqTools { position: absolute; right: 8px; bottom: 123px; gap: 6px; pointer-events: auto; }
.rqb { width: 54px; height: 34px; border-radius: 17px; padding: 0 4px; background: rgba(0, 0, 0, .65); border: 2px solid #8c6d32; color: #f4d27a;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; overflow: hidden; touch-action: manipulation; }
.rqb:active { background: rgba(140, 109, 50, .5); }

/* ---------- 右上角狀態圖示（像天堂）：圖示下面寫剩下的時間，最後 30 秒閃 ---------- */
#buffs { position: absolute; right: 58px; top: 10px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 18px 4px; max-width: 26vw; pointer-events: auto; }
#buffs > div { position: relative; width: 34px; height: 34px; box-sizing: border-box; background: rgba(0, 0, 0, .55); border: 1px solid #7ad0e0; }
#buffs img { position: absolute; left: 0; top: 0; width: 32px; height: 32px; image-rendering: pixelated; }
#buffs b { position: absolute; left: -8px; right: -8px; top: 34px; text-align: center; font-size: 11px; font-weight: 700; color: #fff; white-space: nowrap;
  text-shadow: 0 0 2px #000, 0 0 2px #000, 0 1px 1px #000; }
#buffs > div.end { animation: bfblink 1s steps(2, jump-none) infinite; }
@keyframes bfblink { 50% { opacity: .3; } }
@media (max-width: 640px), (max-aspect-ratio: 4 / 5) {
  #buffs { right: 6px; top: 56px; flex-direction: column; flex-wrap: nowrap; max-width: none; gap: 17px; }
}

/* 暫停、升級三選一的畫面（.scr，z 5）不能蓋住狀態列：打局中狀態列浮上來照樣可以點（11-17 使用者）；
   打開的視窗（角色、每日任務…）在狀態列上面，小視窗再上面 */
body.inrun #vhud { z-index: 6; }
body.inrun #scrPanel { z-index: 7; }

/* ---------- 小視窗：自動設定、換快捷鍵（電腦：狀態列右上方；手機：畫面中間） ---------- */
.rbpop { position: fixed; z-index: 8; right: 14px; bottom: calc(125px * var(--hk, 1) + 10px); width: 340px; max-width: calc(100vw - 20px);
  max-height: calc(100vh - 125px * var(--hk, 1) - 24px); overflow-y: auto; box-sizing: border-box; padding: 8px 10px;
  background: rgba(12, 10, 8, .97); border: 1px solid #8c6d32; box-shadow: 0 4px 16px rgba(0, 0, 0, .8); color: #e2d6b4; font-size: 13px; pointer-events: auto; }
.rb-t { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; color: #f4d27a; font-weight: 700; }
.rb-t span { min-width: 0; overflow: hidden; white-space: nowrap; }
.rb-x { flex: none; width: 26px; height: 26px; padding: 0; border: 1px solid #6a5428; background: #1a140c; color: #e2d6b4; cursor: pointer; font-size: 13px; }
.rb-x:hover { border-color: #e8c060; }
.rb-r { display: flex; align-items: center; gap: 6px; margin: 6px 0; white-space: nowrap; }
.rb-r img, .rb-eat img { width: 24px; height: 24px; image-rendering: pixelated; flex: none; }
.rbpop select { background: #120d07; color: #e2d6b4; border: 1px solid #5a4a2a; font: inherit; font-size: 13px; padding: 1px 2px; }
.rb-s { margin: 9px 0 4px; color: #a89a78; font-size: 12px; white-space: nowrap; overflow: hidden; }
.rb-eat { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.rb-eat label { display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; cursor: pointer; }
.rb-eat label span { min-width: 0; overflow: hidden; white-space: nowrap; }
.rb-slots { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; margin-bottom: 8px; }
.rb-slot { position: relative; aspect-ratio: 1; padding: 0; border: 1px solid #5a4a2a; cursor: pointer; background: #000 url(../assets/ui/orig/s5479.png?v=2) center / 100% 100% no-repeat; }
.rb-slot.on { outline: 2px solid #ffd34a; outline-offset: -1px; }
.rb-slot img { position: absolute; left: 12%; top: 12%; width: 76%; height: 76%; image-rendering: pixelated; }
.rb-slot i { position: absolute; left: 2px; top: 0; z-index: 1; font-style: normal; font-size: 10px; color: #ffe28a; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.rb-list { display: flex; flex-direction: column; gap: 3px; }
.rb-it { display: grid; grid-template-columns: 26px minmax(0, 1fr) 40px 52px; align-items: center; gap: 6px; padding: 2px 6px; border: 1px solid #3a2e18;
  background: rgba(255, 255, 255, .03); color: #e2d6b4; font: inherit; font-size: 13px; text-align: left; white-space: nowrap; cursor: pointer; }
.rb-it:hover { border-color: #8c6d32; background: rgba(160, 120, 50, .18); }
.rb-it img { width: 24px; height: 24px; image-rendering: pixelated; }
.rb-it span { min-width: 0; overflow: hidden; white-space: nowrap; }
.rb-it b { text-align: right; color: #fff; }
.rb-it em { font-style: normal; font-size: 11px; color: #8fe08a; text-align: right; white-space: nowrap; }
.rb-it.none { opacity: .55; }
.rb-it.clr { display: block; text-align: center; color: #a89a78; }
/* 變身（11-17）：變形卷軸「選變身」、高等變身卷軸「馬上變身」；變身清單一行一種 */
.rb-gos { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.rb-go { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 3px 6px; border: 1px solid #6b5426; background: rgba(60, 44, 16, .55);
  color: #e9dcb8; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.rb-go img { width: 24px; height: 24px; image-rendering: pixelated; }
.rb-go span { min-width: 0; overflow: hidden; white-space: nowrap; }
.rb-go b { padding: 1px 8px; border: 1px solid #8c6d32; background: #2a2010; color: #f4d27a; font-size: 12px; white-space: nowrap; }
.rb-go.hi b { border-color: #c9a040; background: #5a4010; color: #ffe08a; }
.rb-go:hover:not(:disabled) { border-color: #c9a040; background: rgba(120, 90, 30, .4); }
.rb-go:disabled { cursor: default; opacity: .7; }
.rb-it.rb-pk { grid-template-columns: minmax(0, 1fr) auto; }
.rb-it.rb-pk em { color: #c9bb94; }
.rb-f { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: #a89a78; font-size: 12px; white-space: nowrap; }
.rb-f span { min-width: 0; overflow: hidden; white-space: nowrap; }
@media (max-height: 420px) {   /* 橫式手機：小視窗矮一點 */
  .rb-it { padding: 0 6px; }
  .rb-it img { width: 20px; height: 20px; }
  .rb-slots { grid-template-columns: repeat(8, 30px); justify-content: start; margin-bottom: 5px; }
  .rb-list { gap: 2px; }
  .rb-t { margin-bottom: 4px; }
  .rb-f { margin-top: 5px; }
}
/* 手機：小視窗放畫面中間；選單字 16px（iPhone 輸入框、選單小於 16px 會自動放大）——要放在最後，才蓋得過上面的 13px */
@media (max-width: 760px), (pointer: coarse) {
  .rbpop { left: 50%; right: auto; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: min(94vw, 360px); max-height: 92vh; }
  .rbpop select { font-size: 16px; }
}
