/* T-100 灰模 greybox — 中性灰配色，無品牌色定案（D-013：美術風格主觀，未授權前不定案） */

:root {
  --grey-bg: #1c1c1e;
  --grey-panel: #2a2a2d;
  --grey-border: #4a4a4d;
  --grey-text: #e8e8ea;
  --grey-text-dim: #9a9a9e;
  --grey-accent: #6b6b70;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--grey-bg);
  color: var(--grey-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden; /* 全螢幕 canvas，不需捲動 */
}

#scene-canvas {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none; /* 避免行動瀏覽器手勢干擾固定鏡頭場景 */
}

/* 灰模標示徽章 */
#greybox-badge {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--grey-text);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--grey-border);
  border-radius: 4px;
  pointer-events: none;
  user-select: none;
}

/* dev FPS 計數器 */
#fps-counter {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 20;
  padding: 4px 8px;
  font-size: 11px;
  font-family: "SF Mono", "Consolas", monospace;
  color: #b8e6a0;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--grey-border);
  border-radius: 4px;
  pointer-events: none;
  user-select: none;
}

/* 登入 / 大廳 overlay 共用版面 */
.ui-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 24px 16px calc(env(safe-area-inset-bottom, 0px) + 32px);
  pointer-events: none; /* 只讓內部面板接收互動，外圍不擋場景點擊 */
}

.ui-overlay[hidden] {
  display: none;
}

.ui-panel {
  pointer-events: auto;
  width: 100%;
  max-width: 360px;
  padding: 20px 20px 24px;
  background: rgba(42, 42, 45, 0.88);
  border: 1px solid var(--grey-border);
  border-radius: 12px;
  text-align: center;
  backdrop-filter: blur(6px);
}

.ui-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  color: var(--grey-text);
}

.ui-subtitle {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--grey-text-dim);
}

.ui-btn {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--grey-text);
  background: var(--grey-accent);
  border: 1px solid var(--grey-border);
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
}

.ui-btn:active {
  background: var(--grey-border);
}

.ui-btn-secondary {
  background: transparent;
  margin-top: 12px;
}

.ui-hint {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--grey-text-dim);
}

/* 小螢幕（直立手機）微調 */
@media (max-width: 380px) {
  .ui-title {
    font-size: 19px;
  }
  .ui-btn {
    font-size: 15px;
    padding: 11px 14px;
  }
}
