/* Shadow Heist — 16-Bit Noir Museum Stealth UI */
:root {
  --bg: #080a12;
  --panel: #101524;
  --panel-2: #161d30;
  --border: #2a3554;
  --gold: #f5b938;
  --gold-bright: #fde047;
  --crimson: #e11d48;
  --cyan: #22d3ee;
  --emerald: #10b981;
  --text: #eef2ff;
  --muted: #94a3b8;
  --bar-safe: 52px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 15%, #161c30 0%, #080a12 75%);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  user-select: none;
  touch-action: none;
}

.hidden { display: none !important; }
.gold { color: var(--gold-bright) !important; }
body.showcase-mode #studio-bar-trigger { display: none !important; }

/* App Layout */
.app-shell {
  width: 100%;
  height: 100dvh;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--bar-safe);
  overflow: hidden;
}

/* Top HUD */
.hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  background: linear-gradient(180deg, rgba(16, 21, 36, 0.96), rgba(10, 13, 24, 0.94));
  border-bottom: 1px solid rgba(245, 185, 56, 0.24);
  flex-shrink: 0;
  z-index: 20;
}

.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hud-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: rgba(245, 185, 56, 0.1);
  border: 1px solid rgba(245, 185, 56, 0.4);
  border-radius: 8px;
  padding: 4px 10px;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s;
}
.hud-chip:hover { border-color: var(--gold-bright); transform: translateY(-1px); }
.chip-kicker { font-size: 9px; font-weight: 800; letter-spacing: 0.1em; color: var(--gold); text-transform: uppercase; }
.chip-main { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }

.hud-stat {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px 9px;
}
.stat-lbl { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); }
.stat-val { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-val small { font-weight: 500; color: var(--muted); font-size: 11px; }

.hud-obj {
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: #a5f3fc;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
}
.hud-obj.extract {
  background: rgba(16, 185, 129, 0.18);
  border-color: var(--emerald);
  color: #6ee7b7;
  animation: pulseGlow 1.1s ease-in-out infinite alternate;
}
@keyframes pulseGlow {
  from { box-shadow: 0 0 0 rgba(16, 185, 129, 0); }
  to { box-shadow: 0 0 12px rgba(16, 185, 129, 0.45); }
}

.hud-keycard {
  background: rgba(250, 204, 21, 0.18);
  border: 1px solid var(--gold-bright);
  color: var(--gold-bright);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 7px;
  white-space: nowrap;
}

.hud-alert-pill {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 7px;
  white-space: nowrap;
}
.hud-alert-pill.spotted {
  background: rgba(225, 29, 72, 0.2);
  border-color: var(--crimson);
  color: #fda4af;
}

.hud-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s, background 0.15s;
}
.hud-icon-btn:hover { border-color: #64748b; background: #1e2942; transform: translateY(-1px); }
.hud-icon-btn.accent-gold { border-color: rgba(245, 185, 56, 0.45); color: #fde68a; }
.hud-icon-btn.accent-cyan { border-color: rgba(34, 211, 238, 0.45); color: #a5f3fc; }

/* Challenge Banner */
.challenge-banner {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.18), rgba(245, 185, 56, 0.18));
  border-bottom: 1px solid rgba(34, 211, 238, 0.4);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #e0f2fe;
  padding: 5px 10px;
  flex-shrink: 0;
}

/* Stage & Canvas */
.stage-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px 6px;
  position: relative;
}

.canvas-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}

#game-canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100dvh - 156px);
  aspect-ratio: 3 / 2;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-radius: 10px;
  border: 2px solid rgba(245, 185, 56, 0.35);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65), 0 0 24px rgba(14, 165, 233, 0.12);
  background: #0c101c;
}

.vault-hint {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 12, 22, 0.82);
  border: 1px solid rgba(245, 185, 56, 0.35);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(4px);
}

/* Desktop Gadget Dock */
.gadget-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.gadget-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 21, 36, 0.95);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s, box-shadow 0.15s;
}
.gadget-pill:hover:not(.static-pill) { border-color: var(--cyan); transform: translateY(-1px); }
.gadget-pill.ready { border-color: var(--emerald); box-shadow: 0 0 12px rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.16); }
.gadget-pill.static-pill { cursor: default; opacity: 0.72; }
.gp-key {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 800;
  color: var(--gold-bright);
}
.gp-count {
  background: rgba(34, 211, 238, 0.18);
  color: var(--cyan);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 800;
}

/* Mobile Controls */
.mobile-controls {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 10px;
  gap: 12px;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(8, 10, 18, 0.3), rgba(10, 14, 26, 0.92));
  border-top: 1px solid rgba(245, 185, 56, 0.18);
}

.touch-joystick {
  position: relative;
  width: 112px;
  height: 112px;
  flex-shrink: 0;
  touch-action: none;
}
.joy-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.08), rgba(15, 23, 42, 0.75));
  border: 2px solid rgba(34, 211, 238, 0.45);
}
.joy-knob {
  position: absolute;
  width: 44px;
  height: 44px;
  left: 34px;
  top: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #67e8f9, #0284c7);
  border: 2px solid #e0f2fe;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.5);
  pointer-events: none;
}

.mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  max-width: 210px;
}
.mob-sub-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mob-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 10px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}
.mob-btn:active { transform: scale(0.96); }
.mob-use { background: linear-gradient(135deg, #065f46, #047857); border-color: #34d399; padding: 13px 12px; font-size: 13px; }
.mob-coin { background: rgba(245, 185, 56, 0.16); border-color: rgba(245, 185, 56, 0.55); color: #fef08a; }
.mob-smoke { background: rgba(148, 163, 184, 0.18); border-color: rgba(148, 163, 184, 0.5); color: #e2e8f0; }

/* ===================== MODALS (Strict position: fixed) ===================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(4, 6, 13, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 14px calc(var(--bar-safe) + 14px);
}

.modal-card {
  width: 100%;
  max-width: 500px;
  max-height: calc(100dvh - var(--bar-safe) - 28px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #131a2e 0%, #0b0f1d 100%);
  border: 1.5px solid rgba(245, 185, 56, 0.45);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.78);
  overflow-y: auto;
}
.modal-card.wide-card { max-width: 720px; }

.modal-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.modal-close:hover { background: rgba(225, 29, 72, 0.25); border-color: var(--crimson); }

.modal-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 3px;
}
.modal-title { font-size: 22px; font-weight: 900; letter-spacing: 0.02em; }

/* Title Card */
.title-card { text-align: center; max-width: 520px; }
.title-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
  background: rgba(245, 185, 56, 0.12);
  border: 1px solid rgba(245, 185, 56, 0.35);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.game-title {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.05;
  margin-bottom: 8px;
  text-shadow: 0 4px 20px rgba(34, 211, 238, 0.25);
}
.game-title span { color: var(--gold-bright); }
.title-sub { font-size: 13px; color: #cbd5e1; line-height: 1.45; margin-bottom: 14px; }

.title-challenge-box {
  background: rgba(34, 211, 238, 0.14);
  border: 1px solid var(--cyan);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #a5f3fc;
  margin-bottom: 12px;
}

.title-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.tstat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tstat b { font-size: 16px; font-weight: 900; color: var(--gold-bright); }
.tstat span { font-size: 10px; color: var(--muted); font-weight: 600; }

.title-cta-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.title-secondary-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.controls-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 12px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}
.controls-legend b { color: var(--text); }

/* Buttons */
.btn-primary, .btn-cyan, .btn-gold, .btn-danger, .btn-ghost {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.1s, filter 0.15s;
}
.btn-lg { padding: 13px 18px; font-size: 15px; }
.btn-primary { background: linear-gradient(135deg, #f59e0b, #d97706); color: #090d16; box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35); }
.btn-cyan { background: linear-gradient(135deg, #06b6d4, #0284c7); color: #fff; }
.btn-gold { background: rgba(245, 185, 56, 0.16); border: 1px solid rgba(245, 185, 56, 0.55); color: var(--gold-bright); }
.btn-danger { background: linear-gradient(135deg, #e11d48, #be123c); color: #fff; box-shadow: 0 6px 18px rgba(225, 29, 72, 0.35); }
.btn-ghost { background: rgba(255, 255, 255, 0.07); border: 1px solid var(--border); color: var(--text); }
.btn-primary:hover, .btn-cyan:hover, .btn-gold:hover, .btn-danger:hover, .btn-ghost:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* Clear / Busted Cards */
.clear-card, .busted-card { text-align: center; }
.stars-display { font-size: 38px; letter-spacing: 6px; margin: 6px 0; color: var(--gold-bright); text-shadow: 0 0 18px rgba(250, 204, 21, 0.5); }
.star-breakdown { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; text-align: left; }
.sb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}
.sb-row.earned { border-color: rgba(16, 185, 129, 0.5); background: rgba(16, 185, 129, 0.1); color: #a7f3d0; }

.clear-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.cm-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cm-item span { font-size: 9px; font-weight: 700; color: var(--muted); }
.cm-item b { font-size: 14px; font-weight: 900; }

.cliffhanger-box {
  background: rgba(245, 185, 56, 0.1);
  border: 1px dashed rgba(245, 185, 56, 0.5);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fde68a;
  margin-bottom: 12px;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.share-toast {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #6ee7b7;
}

.busted-siren {
  display: inline-block;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #fda4af;
  background: rgba(225, 29, 72, 0.22);
  border: 1px solid var(--crimson);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.busted-tip { font-size: 13px; color: #cbd5e1; margin: 10px 0 16px; line-height: 1.45; }
.busted-card .modal-actions { grid-template-columns: 1fr 1fr; }
.busted-card .btn-lg { grid-column: 1 / -1; }

/* Scrollable Modal Content */
.modal-scroll-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-right: 4px;
}

/* Vault Select */
.wing-section { margin-bottom: 14px; }
.wing-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  padding-bottom: 5px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.wing-title small { font-size: 11px; color: var(--muted); font-weight: 500; }
.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 8px;
}
.vault-tile {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.1s, border-color 0.15s;
}
.vault-tile:hover { border-color: var(--gold); transform: translateY(-2px); background: rgba(245, 185, 56, 0.08); }
.vault-tile.current { border-color: var(--cyan); box-shadow: 0 0 12px rgba(34, 211, 238, 0.25); }
.vt-num { font-size: 10px; font-weight: 800; color: var(--gold); }
.vt-name { font-size: 12px; font-weight: 800; line-height: 1.2; }
.vt-stars { font-size: 13px; color: var(--gold-bright); letter-spacing: 2px; }
.vt-meta { font-size: 10px; color: var(--muted); }

/* Hideout Tabs & Cards */
.hideout-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.htab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 9px;
  padding: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.htab.active {
  background: rgba(245, 185, 56, 0.16);
  border-color: var(--gold);
  color: var(--gold-bright);
}

.hideout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.hcard {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hcard.equipped { border-color: var(--cyan); background: rgba(34, 211, 238, 0.08); }
.hcard-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.hcard-name { font-size: 14px; font-weight: 800; }
.hcard-lv { font-size: 11px; font-weight: 800; color: var(--cyan); }
.hcard-desc { font-size: 11px; color: #cbd5e1; line-height: 1.35; flex: 1; }
.hcard-btn {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(245, 185, 56, 0.5);
  background: rgba(245, 185, 56, 0.15);
  color: var(--gold-bright);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.hcard-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.hcard-btn.equip { border-color: var(--cyan); background: rgba(34, 211, 238, 0.18); color: #a5f3fc; }

.trophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 8px;
}
.trophy-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.trophy-card.stolen { border-color: rgba(245, 185, 56, 0.45); background: rgba(245, 185, 56, 0.07); }
.trophy-icon { width: 42px; height: 42px; image-rendering: pixelated; }
.trophy-card.locked .trophy-icon { filter: brightness(0.15) contrast(1.2); opacity: 0.5; }
.trophy-name { font-size: 11px; font-weight: 800; line-height: 1.2; }
.trophy-sub { font-size: 10px; color: var(--muted); }

/* Daily & Leaderboard */
.daily-meta-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.dmeta {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dmeta span { font-size: 9px; color: var(--muted); font-weight: 700; }
.dmeta b { font-size: 14px; font-weight: 900; color: var(--cyan); }

.daily-submit-box {
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
  text-align: left;
}
.ds-head { font-size: 11px; font-weight: 800; color: #a5f3fc; margin-bottom: 6px; }
.ds-row { display: flex; gap: 6px; }
.ds-row input {
  flex: 1;
  background: rgba(8, 10, 18, 0.9);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.ds-status { font-size: 11px; color: #6ee7b7; margin-top: 5px; }

.lb-section-title { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; color: var(--gold); margin-bottom: 6px; }
.lb-list { display: flex; flex-direction: column; gap: 4px; max-height: 210px; overflow-y: auto; }
.lb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
}
.lb-rank { font-weight: 900; color: var(--gold); width: 28px; }
.lb-name { font-weight: 700; flex: 1; }
.lb-score { font-weight: 900; color: var(--cyan); font-variant-numeric: tabular-nums; }

/* ===================== RESPONSIVE MOBILE (390x844 & narrow) ===================== */
@media (max-width: 780px), (pointer: coarse) and (max-width: 960px) {
  .hud-bar { padding: 5px 8px; gap: 5px; flex-wrap: nowrap; }
  .hud-left { gap: 5px; }
  .hud-right { gap: 4px; }
  .hud-chip { padding: 3px 7px; }
  .chip-main { font-size: 11px; max-width: 108px; }
  .hud-stat { padding: 2px 6px; }
  .stat-val { font-size: 11px; }
  .stat-val small { display: none; }
  .hud-obj { display: none; }
  .hud-alert-pill { display: none; }
  .hud-icon-btn { padding: 5px 7px; font-size: 13px; }
  .hud-icon-btn .btn-txt { display: none; }

  .stage-wrap { padding: 4px 6px; }
  #game-canvas {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 245px);
  }
  .vault-hint { font-size: 10px; padding: 3px 8px; top: 6px; }
  .gadget-dock { display: none; }
  .mobile-controls { display: flex; }

  .modal-card { padding: 15px; }
  .game-title { font-size: 30px; }
  .title-secondary-row { grid-template-columns: 1fr; }
}
