/* P 九回裏ホームラン魂 — 全畫面 3D，只保留載入條與 DEV 面板樣式 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #07040c; overflow: hidden; color: #eee; font-family: "M PLUS 1p", "Hiragino Sans", sans-serif; }
body { user-select: none; -webkit-user-select: none; touch-action: none; }
#app { position: fixed; inset: 0; }
#app canvas { display: block; width: 100%; height: 100%; touch-action: none; }
button { font-family: inherit; color: inherit; cursor: pointer; }

#loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #07040c; z-index: 20; }
.load-track { width: 240px; height: 6px; background: #222; border-radius: 3px; overflow: hidden; }
#loadBar { height: 100%; width: 0; background: linear-gradient(90deg, #ff2a4d, #ffd23f); transition: width .2s; }

/* DEV */
#devToggle { position: fixed; right: 10px; bottom: 10px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid #666; background: rgba(20,20,30,.75); font-size: 20px; z-index: 70; opacity: .7; }
#devToggle:hover { opacity: 1; }
html:not(.pk-dev) #devToggle, html:not(.pk-dev) #devPanel { display: none !important; }   /* 上線版：載入中也不露出齒輪 */
#devPanel { position: fixed; top: 0; right: 0; bottom: 0; width: 360px; max-width: 100vw; background: rgba(12,10,20,.94); border-left: 1px solid #444; z-index: 80;
  transform: translateX(100%); transition: transform .25s; display: flex; flex-direction: column; font-size: 12px; }
#devPanel.open { transform: none; }
.dev-head { padding: 10px 12px; font-weight: 900; display: flex; justify-content: space-between; border-bottom: 1px solid #333; color: #3bff6e; }
.dev-head button { background: none; border: 0; font-size: 18px; }
#devTabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid #333; }
#devTabs button { border: 1px solid #444; background: #1a1a26; border-radius: 6px; padding: 4px 8px; font-size: 12px; font-weight: 800; }
#devTabs button.on { background: #3bff6e; color: #000; }
#devBody { overflow: auto; padding: 8px 12px 40px; flex: 1; }
.dev-row { display: grid; grid-template-columns: 112px 1fr 64px; gap: 6px; align-items: center; margin: 3px 0; }
.dev-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ccc; }
.dev-row input[type=number] { width: 64px; background: #000; color: #fff; border: 1px solid #444; border-radius: 4px; padding: 2px 4px; }
.dev-row input[type=color] { grid-column: 2 / 4; height: 24px; background: none; border: 0; }
.dev-group { margin: 12px 0 4px; font-weight: 900; color: #ffd23f; border-bottom: 1px solid #333; padding-bottom: 2px; }
.dev-note { color: #9fe6ff; line-height: 1.5; margin: 4px 0 8px; }
.dev-btns { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.dev-btns button { border: 1px solid #555; background: #22222e; border-radius: 6px; padding: 5px 8px; font-size: 12px; font-weight: 800; }
.dev-btns button:active { background: #555; }
.dev-big { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dev-big button { padding: 12px 6px; font-size: 14px; }
.dev-big button.wide { grid-column: 1 / 3; }
.dev-status { margin: 6px 0 2px; padding: 8px 10px; border-radius: 6px; background: #1d2a1d; color: #3bff6e; font-weight: 900; font-size: 13px; }
.dev-btns button.primary { background: #3bff6e; color: #000; border-color: #3bff6e; }
.dev-export { width: 100%; height: 300px; background: #000; color: #9f9; font-family: ui-monospace, monospace; font-size: 11px; border: 1px solid #333; border-radius: 6px; }
@media (max-width: 760px) {
  #devPanel { top: auto; height: 55vh; width: 100%; border-left: 0; border-top: 1px solid #444; transform: translateY(100%); }
  #devPanel.open { transform: none; }
}
