@font-face {
  font-family: "Barlow Condensed"; font-weight: 700; font-display: swap;
  src: url("../fonts/barlow-condensed-700.woff2") format("woff2");
}
#backpack[data-view="bag"] {
  --acid: #d6ee79; --paper: #e7e3ce; --muted: #acb7b0; --line: #515956;
  --type: "Barlow Condensed", Impact, "Arial Narrow", sans-serif;
  --mono: Consolas, "Courier New", monospace;
  width: min(58rem, 95vw); max-height: 96dvh; color: var(--paper); background: #1c2223;
  border: 1px solid #838a7c; box-shadow: 4px 5px 0 #11151b, 0 18px 64px #020609cc;
}
#backpack[data-view="bag"] .pack-spread { aspect-ratio: auto; }
#open-backpack, #bag-pocket button { -webkit-tap-highlight-color: transparent; }
#bag-pocket {
  position: relative; isolation: isolate; font-family: var(--mono);
  background: linear-gradient(115deg, #2b3434, #21252b 53%, #2f2b36);
}
#bag-pocket::after {
  content: ""; position: absolute; z-index: 2; inset: 0; pointer-events: none;
  background: url("art/scuff.png") repeat; opacity: .52;
}
.pack-mast {
  position: relative; display: flex; align-items: center; gap: 22px; height: 108px;
  overflow: hidden; border-bottom: 1px solid #777b77; background-color: #303436;
  background-image: repeating-linear-gradient(-48deg, transparent 0 10px, #141c2026 11px 14px), linear-gradient(102deg,#28383b 18%,#383441 90%);
}
.pack-mast::after {
  content: ""; position: absolute; right: 93px; width: 59px; height: 21px;
  background: repeating-linear-gradient(111deg, #90917f88 0 4px, transparent 4px 9px);
}
.pack-stamp {
  position: relative; height: 100%; width: 123px; flex: none;
  background-color: #ac9cbe;
  background-image: radial-gradient(#463d54 27%,transparent 33%);
  background-size: 4px 4px; clip-path: polygon(0 0,100% 0,84% 100%,0 100%);
}
.pack-stamp img { position: absolute; inset: 5% 12% 5% 7%; width: 81%; height: 90%; object-fit: contain; transform: rotate(-9deg); image-rendering: pixelated; }
.pack-heading span, .slot-heading, .pocket-tabs button, #open-notebook { text-transform: uppercase; }
.pack-heading span { color: var(--acid); font: bold 12px/1.1 var(--mono); letter-spacing: .18em; }
#backpack-title {
  margin: 3px 0 0 -3px; font: 700 clamp(48px, 6vw, 72px)/.81 var(--type);
  text-transform: uppercase; letter-spacing: -.035em; transform: skewX(-7deg);
  color: #ece8d5; text-shadow: -1px 1px #6caaa8, 2px 2px #71576e, 3px 3px #151a20;
}
#backpack[data-view="bag"] #close-pack {
  top: 27px; right: 23px; width: 44px; height: 44px; border-radius: 0;
  border: 1px solid #7c8479; box-shadow: inset 1px 1px #656a60, 2px 2px #111a1b;
  background: #303737; color: var(--paper);
}
.pocket-tabs { display: flex; gap: 3px; padding: 9px 21px 0; background: #151b1e; border-bottom: 2px solid var(--acid); }
.pocket-tabs button {
  display: flex; justify-content: center; align-items: center; gap: .6em; width: auto; height: 42px;
  padding: 0 clamp(12px, 2.4vw, 31px); border-radius: 0; border: 0;
  font: 700 17px/1 var(--type); letter-spacing: .055em; color: #c5cabc; background: #323a3b;
  clip-path: polygon(0 0, calc(100% - 9px) 0,100% 9px,100% 100%,0 100%);
}
.pocket-tabs button:hover { background: #46504c; }
.pocket-tabs button[aria-selected="true"] { color: #1a2621; background: var(--acid); }
.pocket-tabs button:focus-visible { outline: 2px dashed currentColor; outline-offset: -5px; }
.pocket-icon { display: inline-block; position: relative; flex: none; width: 15px; height: 14px; }
.file-disk { transform: scale(3); color: #d7e4bc; }
.file-disk[hidden] { display: none; }
.main-icon { border: 2px solid; border-radius: 4px 4px 2px 2px; }
.main-icon::after { content: ""; position: absolute; inset: 5px 1px 1px; border-top: 2px solid; }
.disk-icon { border: 2px solid; box-shadow: inset 0 -3px; }
.disk-icon::after { content: ""; position: absolute; top: 0; left: 2px; width: 6px; height: 4px; border: 1px solid; }
.tool-icon {
  background: currentColor; clip-path: polygon(0 65%,39% 35%,41% 14%,61% 0,74% 0,59% 21%,71% 33%,96% 13%,100% 31%,83% 53%,60% 55%,23% 98%,6% 98%);
}
.bag-body { display: grid; grid-template-columns: 1.26fr 1fr; gap: 25px; padding: 23px 24px; }
.slot-heading { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; }
.slot-heading h3 { margin: 0; color: #cbdbbc; font: bold 14px/1.25 var(--mono); letter-spacing: .02em; }
.slot-heading h3::after { content: ""; display: inline-block; width: .53em; height: .85em; margin-left: .28em; background: var(--acid); vertical-align: -.08em; }
.slot-heading::after { content: ""; order: 1; flex: 1; border-top: 1px solid var(--line); }
#slot-count { order: 2; color: #b5c4aa; font: 12px/1 var(--mono); white-space: nowrap; }
#bag-slots { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.bag-slot {
  position: relative; display: grid; place-items: center; width: 100%; height: auto; aspect-ratio: 1.18;
  padding: 6px; border-radius: 0; border: 1px solid #4f5852; background: #1b2224;
  box-shadow: inset 1px 2px 0 #10171b, inset -1px -1px #343c3a;
}
.bag-slot:empty::before {
  content: ""; width: 8px; height: 8px; background:
    linear-gradient(#4d5752,#4d5752) center/1px 100% no-repeat,
    linear-gradient(#4d5752,#4d5752) center/100% 1px no-repeat;
}
.bag-slot:hover { border-color: #a1b290; }
.bag-slot[aria-pressed="true"] {
  border: 2px solid var(--acid); background: repeating-linear-gradient(-45deg,#3e4b3c 0 2px,#394539 2px 6px);
  box-shadow: inset 0 0 0 2px #17201d;
}
.bag-slot[aria-pressed="true"]::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 9px; height: 9px;
  background: var(--acid); clip-path: polygon(0 0,100% 0,0 100%);
}
.bag-slot:focus-visible { outline: 1px dashed #f4ffd5; outline-offset: -6px; }
.bag-slot img { position: absolute; width: 69%; height: 77%; object-fit: contain; image-rendering: pixelated; transform: rotate(5deg); }
.item-inspector { display: grid; grid-template-rows: minmax(140px,1fr) auto; border: 1px solid #647065; background: #171f21; }
.item-stage { position: relative; isolation: isolate; display: grid; place-items: center; overflow: hidden; min-height: 155px; }
.item-stage::before {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background: repeating-linear-gradient(0deg,#202f3426 0 1px,transparent 1px 3px),
    linear-gradient(90deg,#97b4a516 1px,transparent 1px) 50% 50%/19px 19px,
    linear-gradient(#97b4a516 1px,transparent 1px) 50% 50%/19px 19px,
    radial-gradient(ellipse at 50% 60%,#465e50,#263d3d 70%,#213235);
}
.scan-target { position: absolute; height: 82%; aspect-ratio: 1; border: 1px dashed #acbc9166; border-radius: 50%; }
.scan-target::before,.scan-target::after { content: ""; position: absolute; background: #a1b29955; }
.scan-target::before { top: 50%; width: 148%; left: -24%; height: 1px; }
.scan-target::after { left: 50%; height: 132%; top: -16%; width: 1px; }
#inspect-sprite { position: absolute; height: 82%; max-width: 75%; object-fit: contain; transform: rotate(7deg); image-rendering: pixelated; filter: drop-shadow(5px 6px 0 #0d1a1c75); }
.item-info { padding: 13px 17px 15px; border-top: 1px solid #5c6d61; }
.item-info h3 { margin: 0; font: 700 34px/.96 var(--type); color: var(--paper); }
.item-info p { margin: 7px 0 12px; color: #c1cbc1; font: 13px/1.4 var(--mono); }
#open-notebook {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 20px;
  width: auto; height: auto; min-height: 38px; padding: 6px 12px; border: 1px solid #d1e989; border-radius: 0;
  background: var(--acid); color: #16231d; font: 700 16px/1 var(--type); letter-spacing: .045em;
}
#open-notebook:hover, #open-notebook:focus-visible { color: #101812; background: #ecffac; outline: 2px solid #e1f79f; outline-offset: 2px; }
.bag-controls { display: flex; align-items: center; gap: 23px; padding: 9px 24px; border-top: 1px solid #58615a; background: #1a1e20; color: #b7c1b8; font: 12px/1.2 var(--mono); }
.bag-controls::after { content: ""; margin-left: auto; width: 62px; height: 7px; background: repeating-linear-gradient(115deg,#a5b473 0 4px,transparent 4px 8px); }
.bag-controls span { display: flex; align-items: center; gap: 4px; }
.bag-controls kbd { padding: 1px 4px; border: 1px solid #69726a; color: var(--paper); font: 11px/1.2 var(--mono); }
@media (max-width: 650px) {
  .pack-mast { height: 77px; gap: 13px; }
  .pack-stamp { width: 84px; }
  .pack-heading span { font-size: 10px; }
  #backpack-title { font-size: 47px; }
  .pack-mast::after { display: none; }
  #backpack[data-view="bag"] #close-pack { top: 15px; right: 12px; }
  .pocket-tabs { padding: 5px 8px 0; }
  .pocket-tabs button { flex: 1; padding: 0 4px; height: 42px; font-size: 14px; gap: 6px; }
  .pocket-icon { width: 13px; height: 12px; }
  .bag-body { grid-template-columns: 1fr; gap: 12px; padding: 13px; }
  .slot-heading { margin-bottom: 8px; }
  #bag-slots { gap: 4px; }
  .bag-slot { height: clamp(44px, 7.3dvh, 62px); aspect-ratio: auto; }
  .item-inspector { grid-template-columns: 32% 1fr; grid-template-rows: auto; min-height: 128px; }
  .item-stage { min-height: 105px; }
  .item-info { border: 0; border-left: 1px solid #5c6d61; padding: 10px; }
  .item-info h3 { font-size: 27px; }
  .item-info p { font-size: 12px; margin: 5px 0 7px; }
  #open-notebook { min-height: 44px; }
  .bag-controls { gap: 12px; padding: 8px 13px; }
  .bag-controls::after { width: 26px; }
}
@media (pointer: coarse) { .bag-controls { display: none; } }
@media (max-height: 530px) and (min-width: 651px) {
  .pack-mast { height: 54px; gap: 11px; }
  .pack-stamp { width: 73px; }
  .pack-heading span { font-size: 9px; }
  #backpack-title { font-size: 35px; }
  #backpack[data-view="bag"] #close-pack { top: 5px; right: 12px; }
  .pocket-tabs { padding-top: 2px; }
  .pocket-tabs button { height: 33px; }
  .bag-body { padding: 10px 15px; gap: 14px; }
  .slot-heading { margin-bottom: 6px; }
  .bag-slot { height: clamp(38px,13dvh,62px); aspect-ratio: auto; }
  .item-inspector { grid-template-rows: 1fr auto; }
  .item-stage { min-height: 60px; }
  .item-info { padding: 5px 10px 8px; }
  .item-info h3 { font-size: 23px; }
  .item-info p { margin: 3px 0 5px; font-size: 11px; }
  #open-notebook { min-height: 30px; }
  .bag-controls { padding-block: 4px; }
}
