/* ============ 基础 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0b0e14; }
body { font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; color: #e8ecf1; }
.hidden { display: none !important; }

#app, #app canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ============ HUD ============ */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
#hud #btn-exit { pointer-events: auto; }

#crosshair {
  position: absolute; left: 50%; top: 50%;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border: 2px solid rgba(255,255,255,.85); border-radius: 50%;
  box-shadow: 0 0 4px rgba(0,0,0,.6);
}
#crosshair::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 2px; height: 2px; margin: -1px 0 0 -1px; background: #fff; border-radius: 50%;
}

#interact-prompt {
  position: absolute; left: 50%; top: 58%; transform: translateX(-50%);
  background: rgba(10,14,22,.78); border: 1px solid rgba(255,255,255,.25);
  padding: 8px 16px; border-radius: 8px; font-size: 15px; white-space: nowrap;
}
#interact-prompt b { color: #ffd166; }

#timer {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  font-size: 30px; font-weight: 700; letter-spacing: 2px;
  background: rgba(10,14,22,.6); padding: 4px 22px; border-radius: 10px;
  font-variant-numeric: tabular-nums;
}
#timer.urgent { color: #ff5d5d; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

#hint-chip {
  position: absolute; top: 70px; left: 50%; transform: translateX(-50%);
  font-size: 17px; font-weight: 600; padding: 5px 18px; border-radius: 999px;
  background: rgba(10,14,22,.65); border: 1px solid rgba(255,255,255,.2);
}
#hint-chip.cold  { color: #7cc4ff; }
#hint-chip.cool  { color: #9be3c0; }
#hint-chip.warm  { color: #ffd166; }
#hint-chip.hot   { color: #ff8b5d; }
#hint-chip.blazing { color: #ff4d4d; }

#role-banner {
  position: absolute; top: 18px; left: 22px;
  font-size: 16px; font-weight: 600;
  background: rgba(10,14,22,.6); padding: 6px 14px; border-radius: 8px;
}
#toast {
  position: absolute; bottom: 14%; left: 50%; transform: translateX(-50%);
  background: rgba(10,14,22,.85); border: 1px solid rgba(255,255,255,.3);
  padding: 10px 22px; border-radius: 10px; font-size: 16px;
  transition: opacity .3s; white-space: nowrap;
}

#btn-exit {
  position: absolute; top: 16px; right: 16px;
  pointer-events: auto; cursor: pointer;
  background: rgba(200,60,60,.85); color: #fff;
  border: 1px solid rgba(255,255,255,.35); border-radius: 8px;
  padding: 7px 14px; font-size: 14px; font-weight: 600; font-family: inherit;
}
#btn-exit:hover { background: rgba(220,70,70,.95); }

#found-counter {
  position: absolute; top: 18px; right: 130px;
  font-size: 16px; font-weight: 600;
  background: rgba(10,14,22,.6); padding: 6px 14px; border-radius: 8px;
  color: #ffd166;
}

/* ============ 藏家面板 ============ */
#slot-panel {
  position: absolute; right: 24px; top: 50%; transform: translateY(-50%);
  width: 300px; max-height: 70vh; overflow-y: auto;
  background: rgba(12,17,26,.92); border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px; padding: 14px; z-index: 20;
}
#slot-panel h3 { font-size: 16px; margin-bottom: 8px; color: #ffd166; }
#slot-panel .slot-btn {
  display: block; width: 100%; text-align: left; margin: 6px 0;
  padding: 9px 12px; border-radius: 8px; font-size: 14px; cursor: pointer;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #e8ecf1;
}
#slot-panel .slot-btn:hover:not(:disabled) { background: rgba(255,255,255,.18); }
#slot-panel .slot-btn.ok { border-color: #58d68d; }
#slot-panel .slot-btn.no { opacity: .45; cursor: not-allowed; text-decoration: line-through; }
#slot-panel .slot-note { font-size: 12px; color: #9fb0c3; margin-top: 4px; }
#slot-panel .btn-primary { margin-top: 10px; width: 100%; }

#help-bar {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  max-width: 86vw; padding: 10px 22px; z-index: 15; text-align: center;
  background: rgba(12,17,26,.82); border: 1px solid rgba(255,255,255,.16); border-radius: 12px;
  font-size: 13.5px; color: #c8d4e0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#help-bar b { color: #ffd166; font-weight: 700; }
#help-bar .hb-sep { color: #5a6b80; margin: 0 8px; }
#help-bar .hb-count { color: #8fd6a8; }

/* ============ 全屏遮罩 ============ */
.screen {
  position: absolute; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(22,35,58,.78) 0%, rgba(11,14,20,.9) 75%);
}
.screen-card {
  text-align: center; padding: 44px 56px; max-width: 560px;
  background: rgba(16,22,33,.9); border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.screen-card h1 { font-size: 34px; margin-bottom: 10px; }
.screen-card .subtitle { color: #9fb0c3; font-size: 16px; margin-bottom: 24px; line-height: 1.7; }
.screen-card .score { font-size: 20px; font-weight: 700; color: #ffd166; margin-bottom: 24px; }
.screen-card .help-text { color: #74879c; font-size: 13px; margin-top: 22px; line-height: 1.9; }

.menu-options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; text-align: left; }
.menu-options label { display: flex; justify-content: space-between; align-items: center; font-size: 15px; color: #c8d4e0; }
.menu-options .opt-row { display: flex; gap: 8px; align-items: center; }
.menu-options select {
  background: #1c2836; color: #e8ecf1; border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px; padding: 6px 10px; font-size: 14px; min-width: 170px;
  transition: min-width .15s ease;
}
.menu-options select.narrow { min-width: 96px; }
.menu-options input.custom-input {
  background: #1c2836; color: #e8ecf1; border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px; padding: 6px 10px; font-size: 14px; width: 66px;
  font-family: inherit; text-align: center;
}
.menu-options input.custom-input:focus { outline: none; border-color: #ffd166; }
.menu-options input.custom-input::-webkit-inner-spin-button { opacity: 1; }

.btn-primary {
  background: linear-gradient(135deg, #ffd166, #ffb347); color: #21252b;
  border: none; border-radius: 10px; padding: 13px 42px;
  font-size: 17px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: scale(.98); }

/* ---- 联机模式（2026-09-18 方案①：房间号 + 状态中转） ---- */
.online-box {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px dashed rgba(255,255,255,.25);
  display: flex; flex-direction: column; gap: 10px; align-items: stretch;
}
.online-title { font-size: 14px; color: rgba(255,255,255,.75); margin: 0 0 2px; }
.online-join { display: flex; gap: 8px; }
.online-code-input {
  flex: 1; min-width: 0; text-align: center; letter-spacing: 4px;
  font-size: 18px; font-weight: 700; text-transform: uppercase;
  padding: 10px 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.12); color: #fff; font-family: inherit;
}
.online-join button {
  padding: 10px 18px; border-radius: 10px; border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.14); color: #fff; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.online-join button:hover { background: rgba(255,255,255,.24); }
.online-note { font-size: 12px; color: rgba(255,255,255,.55); margin: 0; line-height: 1.5; }
.online-error { font-size: 13px; color: #ff8f8f; margin: 0; }
.online-code-line { letter-spacing: 8px; font-size: 30px !important; user-select: all; cursor: pointer; }
.btn-ghost {
  margin-top: 10px; padding: 9px 26px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.3); background: transparent;
  color: rgba(255,255,255,.8); font-size: 14px; cursor: pointer; font-family: inherit;
}
.btn-ghost:hover { background: rgba(255,255,255,.1); }

/* 等待屏：分享链接框 */
.online-link-box { display: flex; gap: 8px; margin: 4px 0 10px; align-items: center; }
.online-link-input {
  flex: 1; min-width: 0; font-size: 13px; padding: 9px 10px;
  border-radius: 8px; border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.9); font-family: inherit;
}
.online-link-box button {
  padding: 9px 16px; border-radius: 8px; border: none;
  background: #ffd166; color: #1c2333; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.online-link-box button:hover { filter: brightness(1.08); }
