/* Inbox Defender — board and shop skin. Paper-and-desk look, deliberately drier
   than the site chrome. */

.id-title { margin-top: 8px; font-size: clamp(40px, 8vw, 64px); }
.id-subtitle { max-width: 60ch; margin: 12px 0 0; color: var(--muted); font-size: 17px; }

/* ---------- HUD ---------- */

.id-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 16px;
  align-items: stretch;
}

.id-hud-item {
  background: var(--card);
  border-radius: 16px;
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 92px;
}

.id-hud-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.id-hud-value { font-family: var(--font-display); font-size: 26px; line-height: 1; }

.id-hud-sanity { min-width: 150px; }

.id-sanity-bar {
  width: 100%;
  height: 10px;
  background: #ddd;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 6px;
}

.id-sanity-fill {
  height: 100%;
  width: 100%;
  background: #14a05a;
  transition: width 0.2s ease, background 0.2s ease;
}

.id-hud-controls { display: flex; gap: 8px; align-items: center; margin-left: auto; flex-wrap: wrap; }

.id-hud-controls .btn { padding: 10px 20px; font-size: 15px; }
.id-hud-controls .btn:disabled { opacity: 0.45; cursor: default; transform: none; }
#speedBtn { min-width: 56px; }

/* ---------- stage ---------- */

.id-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.id-board-wrap {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 1px 0 rgba(7, 6, 7, 0.08);
}

#board {
  display: block;
  width: 100%;
  aspect-ratio: 616 / 440;
  border-radius: 10px;
  touch-action: manipulation;
}

/* ---------- shop ---------- */

.id-side { display: flex; flex-direction: column; gap: 12px; }

.id-shop { display: flex; flex-direction: column; gap: 8px; }

.id-shop-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  background: var(--card);
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 12px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.id-shop-item:hover { border-color: rgba(7, 6, 7, 0.2); }
.id-shop-item.is-active { border-color: var(--ink); background: var(--glare); }
.id-shop-item.is-broke { opacity: 0.5; }

.id-shop-glyph {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 17px;
}

.id-shop-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.id-shop-body strong { font-weight: 700; }
.id-shop-body em { font-style: normal; color: var(--muted); font-weight: 500; }
.id-shop-cost { font-size: 13px; color: var(--orange); font-weight: 700; }
.id-shop-blurb { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

/* ---------- inspector ---------- */

.id-inspect {
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  font-size: 14px;
}

.id-inspect-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.id-inspect-head span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.id-inspect-stats {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 10px 0 12px;
  font-size: 13px;
  color: var(--muted);
}
.id-inspect-stats strong { color: var(--ink); }

.id-inspect-actions { display: flex; flex-direction: column; gap: 6px; }
.id-inspect-actions .btn { padding: 9px 16px; font-size: 14px; text-align: center; }
.id-inspect-actions .btn:disabled { opacity: 0.45; cursor: default; transform: none; }

/* ---------- log ---------- */

.id-log {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.id-log-line {
  background: var(--card);
  border-left: 3px solid var(--muted);
  border-radius: 0 8px 8px 0;
  padding: 5px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- overlay ---------- */

/* [hidden] alone would lose to the display rule below */
.id-overlay[hidden] { display: none; }

.id-overlay {
  position: absolute;
  inset: 0;
  background: rgba(226, 226, 223, 0.94);
  border-radius: 16px;
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
}

.id-overlay h2 { font-size: clamp(30px, 5vw, 44px); }
.id-overlay p { margin: 12px 0 20px; color: var(--muted); max-width: 34ch; }

.id-overlay .coffee-note { margin: 18px 0 0; font-size: 13px; line-height: 1.45; max-width: 34ch; opacity: 0.8; }
.id-overlay .coffee-note a { color: inherit; text-underline-offset: 2px; }

/* ---------- copy ---------- */

.id-howto, .id-about { margin-top: 24px; }
.id-howto h2, .id-about h2 { font-size: 28px; margin-bottom: 12px; }
.id-howto p, .id-about p { margin: 0 0 12px; max-width: 78ch; }
.id-howto p:last-child, .id-about p:last-child { margin-bottom: 0; }

.id-roster { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 8px; }
.id-roster h3 { font-size: 22px; margin-bottom: 6px; }
.id-roster p { font-size: 14px; color: var(--muted); }

@media (max-width: 980px) {
  .id-stage { grid-template-columns: minmax(0, 1fr); }
  .id-side { flex-direction: column; }
  .id-shop { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}

@media (max-width: 640px) {
  .id-hud-controls { margin-left: 0; width: 100%; }
  .id-hud-controls .btn { flex: 1; text-align: center; }
  .id-shop-blurb { display: none; }
  .id-roster { grid-template-columns: 1fr; }
}
