/* Dime Store Detective — Mobile-fixed layout (no page scroll) */

*{ box-sizing:border-box; }
html, body{
  height:100%;
  margin:0;
  padding:0;
  overflow:hidden;
  background:#050814;
  color:#e5e7eb;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
}

/* App frame */
.game{
  position:fixed;
  inset:0;
  height:100svh;
  width:100%;
  display:flex;
  flex-direction:column;
  padding:12px;
  gap:10px;
}

/* Topbar */
#topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.topbar-left, .topbar-right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.small-btn{
  border:1px solid rgba(255,255,255,0.14);
  background:rgba(255,255,255,0.06);
  color:#e5e7eb;
  padding:10px 14px;
  border-radius:12px;
  font-size:16px;
  cursor:pointer;
}

.small-btn:active{ transform:translateY(1px); }

.more-btn{
  width:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
}

/* More menu */
#moreMenu{
  position:absolute;
  top:60px;
  right:12px;
  display:none;
  flex-direction:column;
  gap:8px;
  background:rgba(8,12,28,0.95);
  border:1px solid rgba(255,255,255,0.12);
  border-radius:14px;
  padding:10px;
  z-index:40;
  min-width:160px;
}

#moreMenu.open{ display:flex; }

.menu-btn{
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.06);
  color:#e5e7eb;
  padding:10px 12px;
  border-radius:12px;
  font-size:16px;
  text-align:left;
  cursor:pointer;
}

/* Stage */
#stage{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  position:relative;
  overflow:hidden;
  border-radius:18px;
  background:radial-gradient(120% 120% at 50% 20%, rgba(255,255,255,0.06), rgba(255,255,255,0.00));
}

/* Canvas scaling */
canvas{
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Suspect portrait canvas */
#suspect{
  width:min(92vw, 430px);
  height:auto;
  max-height:46svh;
}

/* Detective canvas — desktop only & slide-in */
#detective{
  position:absolute;
  left:-520px;
  bottom:0;
  width:380px;
  height:auto;
  opacity:0;
  pointer-events:none;
  transition: left 260ms ease, opacity 260ms ease;
}

#detective.visible{
  left:10px;
  opacity:1;
}

@media (max-width: 820px), (pointer: coarse){
  #detective{ display:none; }
}

/* Questions */
#questions{
  flex:0 0 auto;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.question-btn{
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.06);
  color:#e5e7eb;
  padding:12px 14px;
  border-radius:999px;
  font-size:18px;
  cursor:pointer;
}

.question-btn.used{ opacity:0.55; }
.question-btn:disabled{ opacity:0.45; cursor:not-allowed; }

/* Dialogue box */
.dialogue-box{
  flex:1 1 auto;
  min-height:0;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.04);
  border-radius:18px;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.dialogue-label{
  font-size:13px;
  letter-spacing:0.16em;
  opacity:0.75;
}

.dialogue-text{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding-right:6px;
  line-height:1.35;
  font-size:16px;
  white-space:pre-wrap;
}

/* Bottom bar */
#bottomBar{
  flex:0 0 auto;
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  padding-bottom: env(safe-area-inset-bottom);
}

#accuseBtn{
  flex:1;
  border:none;
  background:rgba(156,58,74,0.85);
  color:#fff;
  padding:14px 18px;
  border-radius:999px;
  font-size:20px;
  cursor:pointer;
}

#accuseBtn:disabled{ opacity:0.45; cursor:not-allowed; }

#nextCaseBtn{
  display:none;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.06);
  color:#e5e7eb;
  padding:14px 16px;
  border-radius:999px;
  font-size:16px;
  cursor:pointer;
}

/* Toast */
#toast{
  position:fixed;
  left:50%;
  bottom:80px;
  transform:translateX(-50%);
  background:rgba(0,0,0,0.7);
  color:#fff;
  padding:10px 12px;
  border-radius:14px;
  display:flex;
  align-items:center;
  gap:10px;
  opacity:0;
  pointer-events:none;
  transition:opacity 180ms ease;
  z-index:60;
}

#toast.show{ opacity:1; }

#toastRetry{
  border:1px solid rgba(255,255,255,0.2);
  background:rgba(255,255,255,0.08);
  color:#fff;
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
}

/* Overlays */
#accuseOverlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.6);
  display:none;
  z-index:80;
}

#accuseOverlay.active{ display:block; }

/* ✅ DIRECTORY OVERLAY — FULLY OPAQUE */
#directoryOverlay{
  position:fixed;
  inset:0;
  background:#050814;          /* ✅ solid */
  display:none;
  z-index:90;                  /* ✅ above everything */
}

#directoryOverlay.active{
  display:flex;                /* ✅ full-screen app panel */
  flex-direction:column;
}

/* Directory header */
.directory-header{
  background:#050814;          /* ✅ solid */
  border-bottom:1px solid rgba(255,255,255,0.12);
  padding:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.directory-title{
  font-weight:700;
  letter-spacing:0.08em;
}

.directory-close{
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.06);
  color:#e5e7eb;
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
}

/* Directory list area */
.directory-grid{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding:12px;
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}

.directory-card{
  display:flex;
  gap:12px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.10);
  border-radius:16px;
  padding:12px;
}

.directory-avatar{
  width:44px;
  height:44px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.10);
  font-weight:700;
}

.directory-main{ flex:1; display:flex; flex-direction:column; gap:4px; }
.directory-name{ font-weight:700; }
.directory-job, .directory-loc, .directory-tagline{ opacity:0.8; font-size:13px; }

.directory-status{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:6px;
}

.directory-status-pill{
  font-size:12px;
  padding:4px 8px;
  border-radius:999px;
  background:rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.10);
}

.directory-footer-row{ margin-top:8px; }

.directory-interview{
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.06);
  color:#e5e7eb;
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
}

/* Accuse panel */
.accuse-panel{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:min(92vw, 520px);
  background:rgba(8,12,28,0.98);
  border:1px solid rgba(255,255,255,0.14);
  border-radius:18px;
  padding:14px;
}

.accuse-title{
  font-weight:700;
  letter-spacing:0.08em;
  margin-bottom:12px;
}

.accuse-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.accuse-btn{
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.06);
  color:#e5e7eb;
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
}

.accuse-footer{
  margin-top:12px;
  display:flex;
  justify-content:flex-end;
}

.ghost-btn{
  border:1px solid rgba(255,255,255,0.12);
  background:transparent;
  color:#e5e7eb;
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
}
