/* 回响法庭 ～残响的五分钟～ */
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body { height:100%; }
body {
  background:#0a0e14; color:#e8ecf2;
  font-family:"PingFang SC","Noto Sans CJK SC","Microsoft YaHei",sans-serif;
  overflow:hidden; user-select:none;
}
#app { position:fixed; inset:0; display:flex; flex-direction:column; }

/* ---- 背景层 ---- */
#bg { position:absolute; inset:0; z-index:0; background-size:cover; background-position:center; transition:opacity .4s; filter:brightness(.82) saturate(1.05); }
#bg.bg-dark { background:radial-gradient(120% 90% at 50% 20%, #14202e 0%, #0a0e14 70%); }
#vig { position:absolute; inset:0; z-index:1; pointer-events:none;
  background:radial-gradient(90% 80% at 50% 42%, transparent 55%, rgba(0,0,10,.55) 100%); }

/* 场景色彩底(图片缺失时兜底) */
.csg-court { background:linear-gradient(180deg,#16283a 0%,#101b28 55%,#0b1420 100%) !important; }
.csg-screenroom { background:linear-gradient(180deg,#101623 0%,#0a0f18 60%,#070a10 100%) !important; }
.csg-booth { background:linear-gradient(180deg,#1c1a28 0%,#121020 100%) !important; }
.csg-lobby { background:linear-gradient(180deg,#2a2030 0%,#1a1422 100%) !important; }
.csg-corridor { background:linear-gradient(180deg,#1a2430 0%,#101823 100%) !important; }

/* ---- HUD ---- */
#hud { position:relative; z-index:20; display:flex; align-items:center; justify-content:space-between;
  padding:8px 12px; background:linear-gradient(180deg,rgba(8,12,18,.92),rgba(8,12,18,.55) 80%,transparent); }
#coin-row { display:flex; gap:6px; width:120px; }
.coin { font-size:18px; color:#ffd75e; text-shadow:0 0 8px rgba(255,200,60,.6); transition:.3s; }
.coin.dead { color:#3a4250; text-shadow:none; filter:grayscale(1); }
#hud-title { font-weight:700; letter-spacing:4px; color:#cdd7e4; font-size:14px; text-shadow:0 1px 4px #000; }
.hud-btns { display:flex; gap:8px; }
.hud-btns button { background:rgba(20,32,48,.85); border:1px solid #3a5a7e; color:#bcd4ea;
  padding:6px 10px; border-radius:8px; font-size:13px; cursor:pointer; }
.hud-btns button:active { transform:scale(.95); }

/* ---- 屏幕 ---- */
.screen { position:absolute; inset:0; z-index:10; display:none; }
.screen.on { display:block; }

/* ---- 标题 ---- */
#scr-title { display:none; align-items:center; justify-content:center; }
#scr-title.on { display:flex; }
#scr-title { background:radial-gradient(120% 100% at 50% 30%, #17273a 0%, #0a0e14 75%); }
.title-box { text-align:center; padding:20px; }
.title-gavel { font-size:64px; filter:drop-shadow(0 0 18px rgba(255,215,94,.5)); animation:sway 3.5s ease-in-out infinite; }
@keyframes sway { 0%,100%{transform:rotate(-8deg)} 50%{transform:rotate(8deg)} }
.title-box h1 { font-size:clamp(44px,9vw,72px); letter-spacing:12px; margin:8px 0 4px;
  background:linear-gradient(180deg,#fff2c8,#ffd75e 45%,#b8860b); -webkit-background-clip:text; background-clip:text; color:transparent;
  text-shadow:0 4px 30px rgba(255,215,94,.25); }
.title-sub { color:#9fd8cc; letter-spacing:8px; font-size:clamp(14px,2.6vw,20px); }
.title-credit { margin-top:14px; color:#5c7186; font-size:12px; letter-spacing:2px; }
.title-btns { margin:34px 0 14px; display:flex; gap:14px; justify-content:center; flex-wrap:wrap; }
.title-btns button { font-size:17px; padding:12px 30px; border-radius:12px; cursor:pointer;
  background:linear-gradient(180deg,#1d3552,#12233a); border:1px solid #4a7aa8; color:#d8ecff; letter-spacing:2px; }
.title-btns button:hover { box-shadow:0 0 18px rgba(90,160,255,.35); }
.title-tip { color:#54687c; font-size:12px; }

/* ---- 立绘 ---- */
.sprite { position:absolute; bottom:22vh; max-width:44%; transition:opacity .25s, transform .25s; z-index:5; }
.sprite img { max-height:56vh; max-width:100%; object-fit:contain; display:block;
  border-radius:10px; box-shadow:0 8px 40px rgba(0,0,0,.6); }
.sprite.left { left:2%; }
.sprite.right { right:2%; }
.sprite.off { opacity:0; pointer-events:none; }
.sprite.shake { animation:shk .45s; }
@keyframes shk { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-10px) rotate(-1deg)} 40%{transform:translateX(8px)} 60%{transform:translateX(-6px)} 80%{transform:translateX(4px)} }
.sp-name { font-size:20px; color:#9ab; background:rgba(10,16,24,.7); padding:14px 18px; border-radius:10px; }

/* ---- 对话框 ---- */
#dlg { position:absolute; left:2.5%; right:2.5%; bottom:2.5%; min-height:24vh; z-index:8;
  background:linear-gradient(180deg,rgba(12,20,32,.96),rgba(8,14,24,.98));
  border:1px solid #2c4a6e; border-top:3px solid #4a7aa8; border-radius:14px;
  padding:20px 22px 26px; box-shadow:0 10px 50px rgba(0,0,0,.7); cursor:pointer; }
#dlg .name { position:absolute; top:-18px; left:18px; background:#12233a; border:1px solid #4a7aa8;
  color:var(--spc,#9ab); padding:5px 18px; border-radius:20px; font-weight:700; font-size:15px; letter-spacing:1px;
  box-shadow:0 0 14px rgba(60,120,200,.3); }
#dlg .name.narr { display:none; }
#dlg .name .ntitle { font-weight:400; font-size:11px; opacity:.7; margin-left:8px; }
#dlg-text { font-size:clamp(15px,2.2vw,18px); line-height:1.9; min-height:8vh; letter-spacing:.5px; }
#dlg-text b { color:#ffd75e; }
#dlg-text .hl { color:#5ee0c0; font-style:normal; }
#dlg-more { position:absolute; right:18px; bottom:8px; color:#ffd75e; animation:bob 1s infinite; font-size:14px; }
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(4px)} }
#skipbtn { position:absolute; top:8px; right:10px; background:none; border:1px solid #33506e; color:#7fa2c4;
  border-radius:8px; padding:3px 10px; cursor:pointer; font-size:14px; }

/* ---- 调查 ---- */
#place-name { position:absolute; top:64px; left:50%; transform:translateX(-50%); z-index:12;
  background:rgba(10,18,28,.88); border:1px solid #3a5a7e; padding:7px 24px; border-radius:22px;
  font-size:14px; letter-spacing:2px; color:#cfe4f8; white-space:nowrap; }
#inv-stage { position:absolute; inset:0; z-index:6; }
.hot { position:absolute; transform:translate(-50%,-50%); text-align:center; cursor:pointer; z-index:7; }
.hot.off { display:none; }
.hot-dot { width:52px; height:52px; margin:0 auto; border-radius:50%;
  background:radial-gradient(circle at 35% 30%, #2a5f8a, #0e2236); border:2px solid #58a8e0;
  display:flex; align-items:center; justify-content:center; font-size:22px;
  box-shadow:0 0 18px rgba(80,170,255,.5); animation:pulse 1.6s infinite; }
.hot.done .hot-dot { border-color:#4a5a4a; box-shadow:none; animation:none; opacity:.45; }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.12)} }
.hot-label { margin-top:6px; font-size:12px; color:#dcecff; background:rgba(8,14,24,.8); padding:3px 10px; border-radius:10px; white-space:nowrap; }
#inv-map { position:absolute; bottom:16px; left:50%; transform:translateX(-50%); z-index:12;
  display:flex; gap:10px; flex-wrap:wrap; justify-content:center; max-width:94%; }
.mapbtn { background:linear-gradient(180deg,#1d3552,#12233a); border:1px solid #4a7aa8; color:#d8ecff;
  padding:11px 18px; border-radius:12px; font-size:14px; cursor:pointer; }
.mapbtn.go { border-color:#ffd75e; color:#ffe9a8; box-shadow:0 0 14px rgba(255,215,94,.35); animation:pulse 1.6s infinite; }
.mapnote { color:#7d93a8; font-size:13px; background:rgba(10,18,28,.8); padding:9px 16px; border-radius:12px; }

/* ---- 法庭质证 ---- */
#testi-panel { position:absolute; left:2.5%; right:2.5%; top:12vh; bottom:3vh; z-index:8;
  background:linear-gradient(180deg,rgba(12,20,32,.96),rgba(8,14,24,.98));
  border:1px solid #2c4a6e; border-radius:14px; padding:16px; display:flex; flex-direction:column; gap:10px; }
#testi-panel.shake { animation:shk .45s; }
#testi-head { display:flex; justify-content:space-between; align-items:baseline; border-bottom:1px solid #24405e; padding-bottom:8px; }
#court-title { color:#8fb4d8; font-size:13px; letter-spacing:2px; }
#testi-witness { color:#ffd75e; font-weight:700; font-size:16px; letter-spacing:1px; }
#testi-lines { flex:1; overflow-y:auto; display:flex; flex-direction:column; gap:8px; overscroll-behavior:contain; }
.tline { background:linear-gradient(90deg,rgba(26,44,66,.9),rgba(16,28,44,.9)); border:1px solid #2c4a6e;
  border-left:4px solid #3a6a9e; border-radius:10px; padding:10px 12px; font-size:15px; line-height:1.7; cursor:pointer;
  display:flex; gap:10px; transition:.15s; }
.tline:hover { border-left-color:#ffd75e; transform:translateX(3px); }
.tline.sel { border-color:#ffd75e; border-left-color:#ffd75e; box-shadow:0 0 12px rgba(255,215,94,.25); background:linear-gradient(90deg,rgba(60,52,24,.9),rgba(30,26,14,.9)); }
.tline.spent { opacity:.35; text-decoration:line-through; cursor:default; }
.tnum { color:#5e7ea0; font-weight:700; flex:0 0 auto; }
#testi-msg { min-height:44px; color:#bcd4ea; font-size:14px; line-height:1.6; background:rgba(6,12,20,.7);
  border:1px dashed #2c4a6e; border-radius:10px; padding:8px 12px; }
#testi-btns { display:flex; gap:10px; }
.tb { flex:1; padding:13px; border-radius:12px; font-size:16px; font-weight:700; letter-spacing:2px; cursor:pointer; border:2px solid; }
.tb.ask { background:linear-gradient(180deg,#1d3552,#12233a); border-color:#4a7aa8; color:#d8ecff; }
.tb.present { background:linear-gradient(180deg,#52381d,#3a2512); border-color:#c8963e; color:#ffe9a8; box-shadow:0 0 12px rgba(255,200,80,.2); }
.tb:active { transform:scale(.97); }

/* ---- 回应浮层 ---- */
#replybox { position:absolute; left:4%; right:4%; top:14vh; z-index:40; display:none;
  background:linear-gradient(180deg,#132338,#0b1626); border:2px solid #5a8ac0; border-radius:14px;
  padding:18px 20px; box-shadow:0 16px 60px rgba(0,0,0,.8); cursor:pointer; }
#replybox.on { display:flex; gap:14px; align-items:flex-start; animation:pop .25s; }
@keyframes pop { from{transform:scale(.9);opacity:0} to{transform:scale(1);opacity:1} }
.tr-sp { flex:0 0 auto; font-weight:700; font-size:14px; padding-top:4px; min-width:56px; }
.tr-text { font-size:15px; line-height:1.8; }
.tr-text b { color:#ffd75e; } .tr-text .hl { color:#5ee0c0; font-style:normal; }

/* ---- 法之勾玉 ---- */
#scr-logic, #scr-replay { display:none; flex-direction:column; padding:70px 4% 20px; gap:12px; }
#scr-logic.on, #scr-replay.on { display:flex; }
.logic-head { text-align:center; }
#logic-title, #replay-title { color:#ffd75e; font-size:20px; letter-spacing:3px; font-weight:700; }
#logic-desc, #replay-desc { color:#8fb4d8; font-size:13px; margin-top:6px; }
#logic-cols { flex:1; display:flex; align-items:center; justify-content:center; gap:16px; min-height:0; }
.logic-col { flex:1; max-width:340px; display:flex; flex-direction:column; gap:10px; max-height:48vh; overflow-y:auto; overscroll-behavior:contain; }
.logic-mid { color:#ffd75e; font-size:26px; text-shadow:0 0 14px rgba(255,215,94,.5); }
.lchip { background:linear-gradient(90deg,rgba(26,44,66,.95),rgba(16,28,44,.95)); border:1px solid #3a5a7e;
  border-radius:12px; padding:12px; cursor:pointer; display:flex; gap:10px; align-items:center; transition:.15s; }
.lchip:hover { border-color:#8ac0ff; }
.lchip.sel { border-color:#ffd75e; box-shadow:0 0 14px rgba(255,215,94,.3); }
.lchip.solved { border-color:#4e9a6e; opacity:.55; cursor:default; }
.lchip-ico { font-size:18px; } .lchip-name { font-size:14px; line-height:1.5; }
#logic-msg, #replay-msg { text-align:center; color:#bcd4ea; font-size:14px; min-height:40px; line-height:1.6; }
#logic-msg .hl, #replay-msg .hl { color:#5ee0c0; font-style:normal; }

/* ---- 案发重现 ---- */
#replay-done { display:flex; flex-direction:column; gap:6px; }
#replay-pool { flex:1; display:flex; flex-direction:column; gap:8px; overflow-y:auto; overscroll-behavior:contain; }
.rchip { background:linear-gradient(90deg,rgba(40,30,60,.95),rgba(24,18,40,.95)); border:1px solid #6a5a9e;
  border-radius:12px; padding:11px 14px; font-size:14px; line-height:1.6; cursor:pointer; display:flex; gap:10px; }
.rchip:hover { border-color:#b8a0ff; }
.rchip.placed { border-color:#4e9a6e; cursor:default; }
.rchip.flash { animation:shk .45s; border-color:#e0596a; }
.rslot { flex:0 0 26px; height:26px; border-radius:50%; background:#4e9a6e; color:#fff; display:flex;
  align-items:center; justify-content:center; font-weight:700; }

/* ---- 覆盖层 ---- */
.overlay { position:absolute; inset:0; z-index:50; display:none; align-items:center; justify-content:center;
  background:rgba(4,8,14,.82); backdrop-filter:blur(3px); }
.overlay.on { display:flex; }
.ov-panel { width:min(560px,92%); max-height:80vh; overflow-y:auto; overscroll-behavior:contain;
  background:linear-gradient(180deg,#101c2c,#0a1420); border:1px solid #3a5a7e; border-radius:16px; padding:18px; }
.ov-head { display:flex; justify-content:space-between; align-items:center; color:#ffd75e; font-weight:700;
  letter-spacing:2px; border-bottom:1px solid #24405e; padding-bottom:10px; margin-bottom:12px; }
.ov-head button { background:none; border:1px solid #4a6a8e; color:#9ab; border-radius:8px; padding:4px 10px; cursor:pointer; }
.ev-item { border:1px solid #2c4a6e; border-radius:12px; padding:12px; margin-bottom:10px; background:rgba(16,28,44,.7); }
.ev-item.pickable { cursor:pointer; }
.ev-item.pickable:hover { border-color:#ffd75e; box-shadow:0 0 10px rgba(255,215,94,.2); }
.ev-item-name { color:#cfe4f8; font-weight:700; margin-bottom:4px; }
.ev-item-desc { color:#8fa8c0; font-size:13px; line-height:1.7; }
.ev-empty { color:#5e7ea0; text-align:center; padding:30px 0; }
.ev-toast { position:absolute; top:70px; right:14px; z-index:60; display:flex; gap:10px; align-items:center;
  background:linear-gradient(90deg,#132338,#0e1a2c); border:1px solid #ffd75e; border-radius:12px; padding:10px 16px;
  box-shadow:0 8px 30px rgba(0,0,0,.6); animation:slidein .35s; }
.ev-toast.out { opacity:0; transition:.5s; }
.ev-toast-icon { font-size:24px; }
.ev-toast-title { color:#ffd75e; font-size:11px; letter-spacing:2px; }
.ev-toast-name { color:#eef4fa; font-weight:700; }
@keyframes slidein { from{transform:translateX(120%)} to{transform:translateX(0)} }

/* ---- 判决 ---- */
.ov-panel.verdict { text-align:center; border-color:#ffd75e; }
.vd-gavel { font-size:48px; animation:sway 3s infinite; }
.vd.big { font-size:26px; font-weight:900; letter-spacing:3px; margin:12px 0;
  background:linear-gradient(180deg,#fff2c8,#ffd75e); -webkit-background-clip:text; background-clip:text; color:transparent; }
.vd.big.lose { background:linear-gradient(180deg,#ffb8b8,#e0596a); -webkit-background-clip:text; background-clip:text; }
.vd.small { color:#8fa8c0; font-size:13px; }
.vd-btns { margin-top:20px; display:flex; gap:12px; justify-content:center; }
.vd-btns button { padding:12px 26px; border-radius:12px; font-size:15px; cursor:pointer;
  background:linear-gradient(180deg,#52381d,#3a2512); border:1px solid #c8963e; color:#ffe9a8; letter-spacing:2px; }

/* ---- 手机 ---- */
@media (max-width:640px) {
  #dlg { min-height:28vh; }
  .sprite { max-width:52%; bottom:32vh; }
  .sprite img { max-height:42vh; }
  #testi-panel { top:11vh; }
  .hot-dot { width:44px; height:44px; font-size:18px; }
  .hot-label { font-size:11px; }
  #logic-cols { flex-direction:column; gap:8px; }
  .logic-col { max-height:26vh; flex-direction:row; flex-wrap:wrap; }
  .lchip { flex:1 1 44%; }
  .logic-mid { display:none; }
  #hud-title { display:none; }
}
