/* ============================================================
 * 地铁逃生 · 复刻版 — 样式(暗色军事风,橙色强调)
 * ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #08090c; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #d8dbe0;
}

#game-canvas { position: fixed; inset: 0; display: block; }
body.playing #game-canvas { cursor: none; }

/* ---------------- 全屏界面 ---------------- */
.screen {
  position: fixed; inset: 0; display: none;
  align-items: center; justify-content: center;
  background: rgba(6, 7, 10, 0.92);
  z-index: 50;
}
.screen.solid { background: #0b0d11; }
.panel {
  background: #12151a;
  border: 1px solid #2a2f38;
  border-radius: 10px;
  padding: 28px 34px;
  max-width: 960px; width: min(94vw, 960px);
  max-height: 92vh; overflow-y: auto;
  box-shadow: 0 12px 50px rgba(0,0,0,0.7);
}
h1.game-title {
  font-size: 52px; letter-spacing: 6px; text-align: center;
  color: #f0a028;
  text-shadow: 0 0 24px rgba(240,160,40,0.35), 0 2px 0 #6b4a12;
}
.subtitle { text-align: center; color: #6b7280; margin: 8px 0 30px; font-size: 13px; letter-spacing: 2px; }

.menu-btns { display: flex; flex-direction: column; gap: 12px; width: 320px; margin: 0 auto; }
button {
  font-family: inherit; cursor: pointer;
  background: #1c2027; color: #d8dbe0;
  border: 1px solid #3a414c; border-radius: 6px;
  padding: 10px 18px; font-size: 15px;
  transition: all .12s;
}
button:hover { background: #262c35; border-color: #f0a028; color: #fff; }
button.primary {
  background: linear-gradient(180deg, #f7b733, #e08a12);
  color: #1a1206; font-weight: bold; font-size: 17px;
  border: none; border-radius: 8px; padding: 14px 18px;
}
button.primary:hover { filter: brightness(1.12); }
button.danger:hover { border-color: #ff5b45; color: #ff8a75; }
button.disabled { opacity: 0.4; cursor: not-allowed; }
button.mini-btn { padding: 3px 10px; font-size: 12px; border-radius: 4px; }
button.mini-btn.sell:hover { border-color: #58e07d; color: #9af0b0; }

/* ---------------- 大厅 ---------------- */
#screen-lobby { align-items: stretch; justify-content: stretch; }
.lobby-wrap { display: flex; width: 100vw; height: 100vh; background: radial-gradient(1200px 600px at 50% -10%, #1a1e26, #0b0d11); }
.lobby-left {
  width: 400px; min-width: 360px; padding: 18px; overflow-y: auto;
  background: rgba(10,12,16,0.85); border-right: 1px solid #232830;
  display: flex; flex-direction: column; gap: 14px;
}
.lobby-right { flex: 1; padding: 18px 22px; display: flex; flex-direction: column; overflow: hidden; }
.lobby-top { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; border-bottom: 1px solid #232830; margin-bottom: 12px; }
.lobby-top .title { font-size: 22px; font-weight: bold; color: #f0a028; letter-spacing: 3px; }
.cash-chip { font-size: 18px; color: #ffd54a; font-weight: bold; }
#lobby-stats { color: #7a828c; font-size: 12px; }

.sec-title { color: #f0a028; font-size: 13px; font-weight: bold; letter-spacing: 2px; margin: 8px 0 6px; }
#loadout-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slot {
  background: #161a20; border: 1px solid #3a3f46; border-radius: 8px;
  padding: 8px 10px; cursor: pointer; min-height: 64px;
  transition: border-color .12s, background .12s;
}
.slot:hover { background: #1d222a; border-color: #f0a028; }
.slot.locked { cursor: default; opacity: 0.8; }
.slot-label { font-size: 11px; color: #6b7280; }
.slot-name { font-size: 14px; font-weight: bold; margin-top: 4px; }
.slot.empty .slot-name { color: #4a5058 !important; font-weight: normal; }

.step-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.step-name { flex: 1; }
.step-own { color: #6b7280; font-size: 12px; width: 64px; text-align: right; }
.step-btn { width: 28px; height: 26px; padding: 0; font-size: 15px; line-height: 1; }
.step-val { width: 44px; text-align: center; color: #6b7280; font-weight: bold; }
.step-val.on { color: #ffd54a; }
.bag-note { color: #5a616b; font-size: 11px; margin-top: 8px; }

.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab-btn { padding: 8px 22px; }
.tab-btn.active { background: #2a2f38; color: #f0a028; border-color: #f0a028; }
.tab-body { flex: 1; overflow-y: auto; }

#warehouse-grid, #store-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px; align-content: start;
}
.wh-item, .store-item {
  background: #14181e; border: 1px solid #2a2f38; border-left-width: 3px;
  border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px;
}
.wh-name { font-size: 14px; font-weight: bold; }
.wh-qty { font-size: 12px; color: #8a929c; }
.wh-price { font-size: 12px; color: #ffd54a; }
.wh-btns { display: flex; gap: 6px; margin-top: 4px; }
.empty-tip { color: #5a616b; padding: 40px; text-align: center; }

.tier-cards { display: flex; gap: 12px; margin-top: auto; padding-top: 14px; }
.tier-card {
  flex: 1; background: #14181e; border: 1px solid #2a2f38; border-radius: 8px;
  padding: 12px 14px; cursor: pointer; transition: all .12s;
}
.tier-card:hover { border-color: #6a7280; }
.tier-card.sel { border-color: #f0a028; background: #1d2027; box-shadow: 0 0 14px rgba(240,160,40,0.15); }
.tier-card .t-name { font-weight: bold; font-size: 15px; }
.tier-card .t-risk { font-size: 12px; margin: 2px 0 6px; }
.tier-card .t-desc { font-size: 11px; color: #6b7280; }

.lobby-actions { display: flex; gap: 10px; margin-top: 14px; }
.lobby-actions .primary { flex: 1; }

/* ---------------- 简报 / 结算 ---------------- */
#screen-briefing .panel, #screen-settle .panel { width: min(92vw, 640px); }
.brief-tier { font-size: 26px; font-weight: bold; letter-spacing: 2px; margin-bottom: 10px; }
#briefing-body p, #settle-body p { margin: 8px 0; line-height: 1.7; font-size: 14px; color: #aab0b8; }
.brief-keys {
  background: #0e1116; border: 1px solid #232830; border-radius: 6px;
  padding: 10px 14px; font-size: 12px; color: #7a828c; margin: 12px 0;
  letter-spacing: 1px;
}
.brief-warn { color: #d0905a !important; font-size: 12px !important; }
.settle-stats { display: flex; gap: 22px; color: #8a929c; font-size: 13px; margin: 12px 0; flex-wrap: wrap; }
.settle-sec { font-weight: bold; margin: 14px 0 6px; letter-spacing: 1px; }
.settle-list { line-height: 2; font-size: 14px; }
.settle-cash { margin-top: 12px; font-size: 16px; color: #ffd54a; }
.settle-actions { margin-top: 20px; display: flex; gap: 10px; justify-content: center; }

/* ---------------- 帮助 ---------------- */
#help-body h3 { color: #f0a028; margin: 14px 0 6px; font-size: 15px; }
#help-body p { color: #aab0b8; line-height: 1.8; font-size: 13px; }
table.keys { border-collapse: collapse; width: 100%; font-size: 13px; }
table.keys td { padding: 4px 10px; border-bottom: 1px solid #1d222a; }
table.keys td:first-child { color: #f0a028; font-weight: bold; width: 130px; }

/* ---------------- 槽位选择器 ---------------- */
#slot-picker { z-index: 60; }
.picker-head { font-size: 16px; font-weight: bold; color: #f0a028; margin-bottom: 12px; }
.picker-row {
  background: #161a20; border: 1px solid #2a2f38; border-left-width: 3px;
  border-radius: 6px; padding: 10px 14px; margin-bottom: 8px;
  display: flex; justify-content: space-between; cursor: pointer;
}
.picker-row:hover { background: #1d222a; }
.picker-row.unequip { color: #ff8a75; }
.picker-price { color: #6b7280; font-size: 12px; }
.picker-empty { color: #5a616b; padding: 20px; text-align: center; }

/* ---------------- HUD ---------------- */
#hud { position: fixed; inset: 0; display: none; pointer-events: none; z-index: 20; }
#hud > * { position: absolute; }

#minimap { top: 14px; left: 14px; border: 1px solid #3a414c; border-radius: 6px; background: rgba(8,10,13,0.85); }
#tier-label { top: 142px; left: 14px; font-size: 12px; font-weight: bold; letter-spacing: 1px; text-shadow: 0 1px 3px #000; }

#top-center { top: 14px; left: 50%; transform: translateX(-50%); text-align: center; }
#timer { font-size: 26px; font-weight: bold; color: #fff; text-shadow: 0 1px 4px #000; font-variant-numeric: tabular-nums; }
#cash-run { font-size: 13px; color: #ffd54a; text-shadow: 0 1px 3px #000; }

#killfeed { top: 14px; right: 14px; text-align: right; width: 300px; }
.feed-item {
  background: rgba(10,12,16,0.75); border-right: 2px solid #f0a028;
  padding: 4px 10px; margin-bottom: 4px; font-size: 12px; border-radius: 3px;
  transition: opacity .5s;
}
.feed-item.out { opacity: 0; }

#toasts { left: 50%; bottom: 190px; transform: translateX(-50%); text-align: center; width: 420px; }
.toast {
  font-size: 14px; font-weight: bold; text-shadow: 0 1px 4px #000;
  margin-top: 3px; transition: opacity .4s;
}
.toast.out { opacity: 0; }

/* 左下:生命/护甲 */
#vitals { left: 14px; bottom: 14px; width: 260px; }
.bar-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.bar-label { font-size: 11px; color: #8a929c; width: 30px; }
.bar { flex: 1; height: 14px; background: rgba(0,0,0,0.55); border: 1px solid #3a414c; border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; transition: width .15s; }
#hp-fill { background: #58c858; }
#armor-row { display: none; }
#armor-fill { background: #5a9dd8; }
.bar-text { position: absolute; left: 52px; font-size: 10px; line-height: 14px; color: #fff; text-shadow: 0 1px 2px #000; width: 200px; }
#hp-text { position: static; width: auto; font-size: 12px; font-weight: bold; text-shadow: 0 1px 2px #000; }
#armor-text { position: static; width: auto; font-size: 10px; font-weight: bold; text-shadow: 0 1px 2px #000; }

/* 右下:武器 */
#weapon-panel { right: 14px; bottom: 14px; text-align: right; }
#wpn-name { font-size: 15px; font-weight: bold; color: #e8ebef; text-shadow: 0 1px 3px #000; }
#wpn-ammo { font-size: 26px; font-weight: bold; font-variant-numeric: tabular-nums; text-shadow: 0 1px 4px #000; }
#wpn-slots { display: flex; gap: 5px; justify-content: flex-end; margin-top: 5px; }
#wpn-slots .wslot {
  background: rgba(10,12,16,0.7); border: 1px solid #3a414c; border-radius: 4px;
  padding: 2px 9px; font-size: 11px; color: #8a929c;
}
#wpn-slots .wslot.active { border-color: #f0a028; color: #ffd54a; }
#bag-count { font-size: 11px; color: #8a929c; margin-top: 5px; text-shadow: 0 1px 2px #000; }

/* 交互提示 */
#prompt {
  left: 50%; top: 58%; transform: translateX(-50%);
  background: rgba(10,12,16,0.8); border: 1px solid #3a414c;
  padding: 6px 16px; border-radius: 5px; font-size: 14px; display: none;
}
#channel-box {
  left: 50%; top: 63%; transform: translateX(-50%);
  width: 220px; display: none; text-align: center;
}
#channel-bar { height: 8px; background: rgba(0,0,0,0.6); border: 1px solid #3a414c; border-radius: 4px; overflow: hidden; }
#channel-fill { height: 100%; background: #f0a028; }
#channel-label { font-size: 12px; color: #d8dbe0; margin-top: 3px; text-shadow: 0 1px 2px #000; }

#extract-box {
  left: 50%; top: 40%; transform: translateX(-50%);
  width: 320px; display: none; text-align: center;
}
#extract-bar { height: 16px; background: rgba(0,0,0,0.6); border: 1px solid #58e07d; border-radius: 4px; overflow: hidden; }
#extract-fill { height: 100%; background: linear-gradient(90deg, #2f9e57, #58e07d); }
#extract-text { font-size: 15px; font-weight: bold; color: #58e07d; margin-top: 4px; text-shadow: 0 1px 3px #000; }

/* 背包面板 */
#bag-panel {
  right: 14px; top: 50%; transform: translateY(-50%);
  width: 250px; max-height: 60vh; overflow-y: auto;
  background: rgba(12,14,18,0.92); border: 1px solid #3a414c; border-radius: 8px;
  padding: 12px; display: none; pointer-events: auto;
}
#bag-panel h4 { color: #f0a028; font-size: 13px; margin-bottom: 8px; letter-spacing: 1px; }
.bag-row {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid #2a2f38; border-left-width: 3px;
  border-radius: 4px; padding: 5px 8px; margin-bottom: 5px; font-size: 12px;
  background: #14181e;
}
.bag-name { flex: 1; }
.bag-qty { color: #8a929c; }
.bag-drop { padding: 2px 8px; font-size: 11px; }
.bag-empty { color: #5a616b; text-align: center; padding: 20px 0; }

/* 受击 / 暗角 */
#hitflash { inset: 0; background: radial-gradient(ellipse at center, transparent 40%, rgba(200,30,20,0.5)); opacity: 0; transition: opacity .1s; }
#vignette { inset: 0; box-shadow: inset 0 0 120px 30px rgba(0,0,0,0.6); }

/* ---------------- 暂停 ---------------- */
#pause-overlay { z-index: 70; }
#pause-overlay .panel { width: 340px; text-align: center; }
#pause-overlay h2 { color: #f0a028; letter-spacing: 4px; margin-bottom: 18px; }
#pause-overlay button { display: block; width: 100%; margin-bottom: 10px; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: #2a2f38; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
