/* NETRUNNER: BREACH — Minecraft-style UI */
:root{
  --mc-gray:#7d7d7d; --mc-light:#b5b5b5; --mc-dark:#565656;
  --mc-text:#e0e0e0; --mc-yellow:#ffff55; --mc-green:#55ff55;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;background:#000;overflow:hidden;
  font-family:"Courier New",ui-monospace,Menlo,Consolas,monospace;
  font-weight:bold;color:var(--mc-text);user-select:none}
#stage{position:fixed;inset:0;background:#000}
#view{position:absolute;inset:0;width:100%;height:100%;image-rendering:pixelated}

#fx-flash{pointer-events:none;position:absolute;inset:0;z-index:7;background:#c00;opacity:0;transition:opacity .08s}

/* ── HUD ─────────────────────────────────────────────────────────────── */
#hud{position:absolute;inset:0;z-index:10;pointer-events:none}
#hud-top{position:absolute;top:10px;left:0;right:0;display:flex;justify-content:space-between;align-items:flex-start;padding:0 12px}
#objtag{font-size:14px;color:#fff;text-shadow:2px 2px 0 #3f3f3f;background:rgba(0,0,0,.45);
  padding:5px 10px;border:2px solid rgba(0,0,0,.6)}
#minimap{background:rgba(0,0,0,.5);border:2px solid #000;outline:2px solid #555;image-rendering:pixelated}
#crosshair{position:absolute;top:50%;left:50%;width:18px;height:18px;transform:translate(-50%,-50%);
  mix-blend-mode:difference}
#crosshair::before,#crosshair::after{content:"";position:absolute;background:#ddd}
#crosshair::before{left:8px;top:0;width:2px;height:18px}
#crosshair::after{top:8px;left:0;width:18px;height:2px}

#narration{position:absolute;left:12px;bottom:110px;max-width:min(640px,80%);
  font-size:14px;line-height:1.5;color:#fff;white-space:pre-line;text-align:left;
  text-shadow:2px 2px 0 #3f3f3f;background:rgba(0,0,0,.45);padding:8px 12px;
  border-left:4px solid var(--mc-green);opacity:0;transition:opacity .2s}
#narration.show{opacity:1}

#hud-bottom{position:absolute;bottom:12px;left:0;right:0;display:flex;flex-direction:column;
  gap:6px;align-items:center}
#hearts{image-rendering:pixelated;filter:drop-shadow(2px 2px 0 rgba(0,0,0,.6))}

/* hotbar */
#hotbar{display:flex;gap:0}
.slot{width:48px;height:48px;background:rgba(30,30,30,.75);position:relative;
  border:2px solid #000;outline:3px solid #8b8b8b;outline-offset:-5px;
  box-shadow:inset 2px 2px 0 rgba(255,255,255,.18), inset -2px -2px 0 rgba(0,0,0,.5);
  display:flex;align-items:center;justify-content:center;margin-right:4px}
.slot.selected{outline-color:#fff}
.count{position:absolute;right:4px;bottom:2px;font-size:13px;color:#fff;text-shadow:2px 2px 0 #3f3f3f}
.icon{width:24px;height:24px;image-rendering:pixelated;display:block}
.icon.gun{background:linear-gradient(180deg,#576068 0 30%,#3a3f46 30% 70%,#22262c 70% 100%);
  clip-path:polygon(0 35%,70% 35%,70% 20%,100% 20%,100% 60%,55% 60%,55% 100%,30% 100%,30% 60%,0 60%)}
.icon.cell{background:
  repeating-linear-gradient(90deg,#8f2b1e 0 6px,#d8442e 6px 9px);border:2px solid #5e1c13}
.icon.emerald{background:#17915b;position:relative;border:2px solid #0c5f3a}
.icon.emerald::after{content:"";position:absolute;left:3px;top:3px;width:8px;height:8px;background:#8fffc9}
.icon.keyr{background:#3a3a3a;border:2px solid #222}
.icon.keyb{background:#3a3a3a;border:2px solid #222}
.icon.keyr.have{background:#e03030;border-color:#ff8080;box-shadow:0 0 6px #ff4040}
.icon.keyb.have{background:#3070e0;border-color:#80a8ff;box-shadow:0 0 6px #4080ff}

/* ── overlays: MC menu style ────────────────────────────────────────── */
.overlay{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;
  background:#3a2c1e;padding:20px}
.panel{width:min(600px,94%);text-align:center;padding:10px}
h1{font-size:40px;color:#fff;letter-spacing:1px;
  text-shadow:4px 4px 0 #3f3f3f;margin-bottom:4px}
h2{font-size:22px;color:var(--mc-yellow);text-shadow:2px 2px 0 #3f3f3f;margin-bottom:16px}
.splash{color:var(--mc-yellow);font-size:15px;text-shadow:2px 2px 0 #3f3f3f;
  transform:rotate(-4deg);margin-bottom:26px;animation:splashPulse 1s ease-in-out infinite}
@keyframes splashPulse{0%,100%{transform:rotate(-4deg) scale(1)}50%{transform:rotate(-4deg) scale(1.06)}}

button{display:block;width:min(400px,100%);margin:8px auto;padding:13px 20px;
  font-family:inherit;font-weight:bold;font-size:17px;color:#fff;text-shadow:2px 2px 0 #3f3f3f;
  background:var(--mc-gray);cursor:pointer;
  border:2px solid #000;
  box-shadow:inset 2px 2px 0 var(--mc-light), inset -2px -2px 0 var(--mc-dark)}
button:hover{background:#8f9bbc;box-shadow:inset 2px 2px 0 #c8d0e8, inset -2px -2px 0 #4a5470}
button:active{box-shadow:inset -2px -2px 0 var(--mc-light), inset 2px 2px 0 var(--mc-dark)}
button:disabled{opacity:.55;cursor:default}

.controls{margin-top:24px;font-size:14px;line-height:1.8;color:#d8d8d8;text-shadow:2px 2px 0 #2f2f2f}
.controls b{color:var(--mc-yellow);display:block;margin-bottom:2px}
.dim{color:#a8a8a8;font-size:12px}
#board{margin-top:20px;text-align:left;font-size:14px;display:inline-block}
#board b{color:var(--mc-yellow);text-shadow:2px 2px 0 #3f3f3f}
#board ol{margin:6px 0 0 24px;color:#d8d8d8;line-height:1.7}
#brief-text{text-align:left;font-size:15px;line-height:1.7;color:#e8e8e8;white-space:pre-line;
  margin:0 auto 20px;max-width:520px;text-shadow:2px 2px 0 #2f2f2f;
  background:rgba(0,0,0,.4);padding:14px 16px;border:2px solid #000}
#end-stats{font-size:17px;line-height:1.8;margin-bottom:12px}
#end-stats b{color:var(--mc-yellow)}
#end-log{font-size:13px;line-height:1.6;margin-bottom:16px;white-space:pre-line}
#submit-row{display:flex;gap:8px;justify-content:center;margin-bottom:8px;flex-wrap:wrap}
#submit-row button{width:auto;margin:0}
#handle{font-family:inherit;font-weight:bold;font-size:15px;padding:12px;width:170px;
  background:#000;color:#e0e0e0;border:2px solid var(--mc-gray)}
#handle:focus{outline:none;border-color:#fff}
.hidden{display:none!important}

/* touch */
#touch{position:absolute;inset:0;z-index:15}
.tpad{position:absolute;left:20px;bottom:20px;width:120px;height:120px;
  border:3px solid #000;outline:3px solid #8b8b8b;outline-offset:-6px;background:rgba(30,30,30,.4)}
.tbtn{position:absolute;bottom:40px;border:3px solid #000;outline:3px solid #8b8b8b;outline-offset:-6px;
  background:rgba(30,30,30,.5);color:#fff;text-shadow:2px 2px 0 #3f3f3f;
  width:84px;height:84px;display:flex;align-items:center;justify-content:center;font-size:14px}
#tfire{right:24px}
#tuse{right:120px;bottom:130px;width:64px;height:64px;font-size:12px}

@media (max-width:640px){
  h1{font-size:26px}
  #objtag{font-size:11px}
  #minimap{width:84px;height:84px}
  .slot{width:40px;height:40px}
}
