:root{color-scheme:dark;font-family:system-ui,sans-serif;color:#fff5df;background:#c58b50}*{box-sizing:border-box}body{margin:0;overflow:hidden}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer}a{color:inherit;text-decoration:none}button:focus-visible,a:focus-visible{outline:3px solid #a3ffda;outline-offset:4px}#world{display:block;width:100vw;height:100dvh;touch-action:none}.hud{position:fixed;top:0;left:0;right:0;display:flex;justify-content:space-between;align-items:center;padding:20px;padding-top:max(20px,env(safe-area-inset-top));pointer-events:none}.hud>*{pointer-events:auto;background:#201b18c9;border:1px solid #ffffff30;border-radius:10px;padding:10px 16px;color:inherit;font-weight:700}.crosshair{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);opacity:.6;pointer-events:none}.hint{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);padding:10px 18px;border-radius:30px;background:#201b18bc;text-align:center;pointer-events:none;max-width:90%;width:max-content}.overlay{position:fixed;inset:0;display:grid;place-items:center;padding:24px;background:#15171388;backdrop-filter:blur(9px);overflow:auto}.overlay[hidden]{display:none}.panel{width:min(100%,520px);padding:clamp(24px,5vw,46px);background:linear-gradient(145deg,#302a24,#161b17);border:1px solid #b7d8bf40;border-radius:22px;box-shadow:0 24px 90px #0007}.eyebrow{color:#80eeb7;font-size:11px;letter-spacing:.16em}h1{font-size:clamp(36px,8vw,60px);line-height:1.05;margin:20px 0}p{line-height:1.65}.instructions{font-size:13px;color:#c4b9a8}.panel button{display:block;width:100%;padding:14px;margin:24px 0 16px;border:1px solid #b0ffd3;border-radius:10px;background:linear-gradient(#9cf6c3,#48c888);color:#12271a;font-weight:800;box-shadow:0 4px 0 #236540}.panel>a{display:block;text-align:center;font-size:14px;color:#c4b9a8}.touch-controls{position:fixed;left:20px;bottom:85px;display:none;text-align:center;touch-action:none;user-select:none}.touch-controls button{width:48px;height:48px;margin:3px;border:1px solid #ffffff50;border-radius:12px;background:#28241b99;color:white;font-size:24px;touch-action:none}@media(pointer:coarse){.touch-controls{display:block}.hint{bottom:10px;font-size:12px}.hud{padding:12px}}@media(max-height:500px){.panel{padding:18px}h1{margin:8px 0}.panel p{margin:8px 0}.panel button{margin:12px 0}}

/* Empty item slots stay clear of the objective and touch movement controls. */
.inventory-bar {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  width: min(420px, calc(100% - 24px));
  margin: 0;
  padding: 8px;
  list-style: none;
  border: 1px solid #e8d8b636;
  border-radius: 14px;
  background: #211d18df;
  box-shadow: inset 0 1px 0 #ffffff12, 0 5px 0 #15120fcc, 0 12px 26px #0004;
  pointer-events: none;
  user-select: none;
}
.inventory-slot {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  border: 1px solid #bba37c66;
  border-radius: 7px;
  background: linear-gradient(145deg, #171612, #373025);
  box-shadow: inset 0 2px 5px #0007, 0 1px 0 #ffffff0d;
}
.inventory-slot span {
  position: absolute;
  top: 3px;
  left: 6px;
  color: #c4b69e;
  font-size: 11px;
  line-height: 1.2;
}
.hint { bottom: calc(90px + env(safe-area-inset-bottom)); }
@media (pointer: coarse) {
  .touch-controls { bottom: calc(145px + env(safe-area-inset-bottom)); }
}

.hud .hud-actions { display:flex; gap:8px; padding:0; border:0; background:none; }
.hud-actions button { padding:10px 14px; border:1px solid #ffffff30; border-radius:10px; color:inherit; background:#201b18e6; font-weight:700; }
.hud-actions kbd { color:#c4b69e; font:inherit; font-size:11px; margin-left:6px; }
.backpack { width:min(620px,calc(100% - 24px)); max-height:calc(100dvh - 24px); overflow:auto; padding:clamp(16px,3vw,28px); border:1px solid #cbb08070; border-radius:18px; color:#fff5df; background:linear-gradient(145deg,#302b23,#171b17); box-shadow:0 30px 100px #0009; }
.backpack::backdrop { background:#11170f99; backdrop-filter:blur(5px); }
.backpack-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.backpack-heading h2 { margin:0; font-size:clamp(24px,4vw,32px); }
.backpack-heading .eyebrow { margin:0 0 8px; }
.backpack-heading button { width:40px; height:40px; border:1px solid #bba37c66; border-radius:8px; background:#ffffff08; color:inherit; font-size:26px; }
.backpack-capacity { display:flex; justify-content:space-between; margin:22px 0 12px; color:#c4b69e; font-size:13px; }
.backpack-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px; list-style:none; margin:0; padding:0; }
.backpack-cell { position:relative; aspect-ratio:1; min-width:0; border:1px solid #9a84603d; border-radius:7px; background:linear-gradient(145deg,#131410,#25251e); box-shadow:inset 0 2px 6px #0005; }
.backpack-cell.has-item { border-color:#c9ab716b; background:radial-gradient(ellipse at center,#5d513a55,#24251b); }
.cell-number { position:absolute; top:4px; left:6px; color:#9e957f; font-size:10px; }
.backpack-cell svg { position:absolute; inset:8% 15% 20%; width:70%; height:70%; filter:drop-shadow(1px 3px 2px #0007); }
.item-name { position:absolute; bottom:4px; left:0; right:0; text-align:center; font-size:11px; color:#e0d4b9; }
.backpack-help { margin:18px 0 0; color:#bdb19a; font-size:12px; text-align:center; }
@media(max-width:480px) {
  .hud { gap:6px; }
  .hud>a,.hud>span,.hud-actions button { padding:9px 8px; font-size:12px; }
  .hud-actions kbd { display:none; }
  .backpack-grid { gap:5px; }
  .backpack-cell { aspect-ratio: .85; }
  .item-name { font-size:10px; }
  .cell-number { font-size:8px; top:2px; left:4px; }
}

.backpack-grid > li { min-width:0; }
.backpack-grid button.backpack-cell { display:block; width:100%; padding:0; color:inherit; touch-action:none; user-select:none; -webkit-user-select:none; }
.backpack-cell.has-item { cursor:grab; }
.backpack-cell.has-item:active { cursor:grabbing; }
.backpack-cell.is-picked,.backpack-cell.drop-target { border-color:#91e8b5; outline:2px solid #91e8b5; outline-offset:-2px; background:#354e35; }
.backpack-quick { position:sticky; bottom:0; padding:1px 0 8px; margin-top:10px; background:#20231b; border-top:1px solid #bba37c55; }
.backpack-quick .backpack-capacity { margin:10px 0; }
.backpack-quick .backpack-cell { border-color:#bba37c88; }
.inventory-slot svg { position:absolute; inset:8% 15% 20%; width:70%; height:70%; filter:drop-shadow(1px 3px 2px #0007); }
.inventory-slot .item-name { position:absolute; top:auto; left:0; bottom:3px; right:0; font-size:10px; text-align:center; }
.item-drag-ghost { position:fixed; width:64px; height:64px; transform:translate(-50%,-50%); pointer-events:none; z-index:5; filter:drop-shadow(0 5px 8px #0009); }
.item-drag-ghost svg { width:100%; height:100%; }
.inventory-status { margin:8px 0 0; min-height:18px; color:#a3e7b9; font-size:12px; text-align:center; }
.backpack-help { margin-top:10px; }

.inventory-bar { grid-template-columns:repeat(9,minmax(0,1fr)); width:min(610px,calc(100% - 24px)); pointer-events:auto; }
.inventory-bar > li { min-width:0; }
.inventory-bar button { display:block; width:100%; padding:0; color:inherit; }
.inventory-slot.is-active { border-color:#a8efb6; outline:2px solid #a8efb6; outline-offset:1px; background:linear-gradient(145deg,#354831,#202b20); }
.held-item-name { position:fixed; bottom:calc(91px + env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); margin:0; padding:3px 10px; color:#f5e7cb; border-radius:6px; background:#201b18ba; font-size:12px; pointer-events:none; }
.hint { bottom:calc(119px + env(safe-area-inset-bottom)); }
@media(max-width:600px) { .inventory-bar { gap:4px; padding:6px; } .inventory-bar .item-name { display:none; } .inventory-bar .cell-number { font-size:9px; left:4px; top:2px; } }
