/* Print & Rip. The canvas fills the window; the menus float over it. */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --bg: #231f1b;
  --paper: #f7f5ee;
  --ink: #1a1a1a;
  --gold: #ffd21a;
  --lcd: #7dff9b;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  overflow: hidden;
  font-family: 'IBM Plex Sans Condensed', system-ui, sans-serif;
  color: #f2efe6;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#play {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  touch-action: none;
}

.pause-btn {
  position: fixed;
  top: calc(10px + var(--sat));
  right: max(10px, calc(50vw - 270px));
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font: 700 14px 'Rubik Mono One', monospace;
  z-index: 5;
  cursor: pointer;
}

.ui {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow-y: auto;
  padding: calc(16px + var(--sat)) 14px 24px;
  background: rgba(20, 16, 12, 0.82);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.ui[hidden] { display: none; }
/* Title and closet: only cover the desk, so the printer shows below. */
.ui.top {
  bottom: 40vh;
  bottom: 40dvh;
  background: linear-gradient(rgba(20, 16, 12, 0.88), rgba(20, 16, 12, 0.6));
}
.ui.closet { bottom: 62vh; bottom: 62dvh; }
.ui.dim { align-items: center; }

.panel {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.panel.small { max-width: 380px; }
.panel.title { align-items: stretch; text-align: center; }

.logo { margin: 4px 0 2px; transform: perspective(500px) rotateX(14deg); }
.logo-top {
  font: 400 clamp(28px, 9vw, 46px) 'Rubik Mono One', monospace;
  letter-spacing: 0.02em;
  color: var(--paper);
  text-shadow: 0 1px 0 #bbb, 0 2px 0 #999, 0 3px 0 #777, 0 4px 0 #555, 0 8px 12px rgba(0, 0, 0, 0.6);
}
.logo-sub {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 14px 6px;
  font: 400 clamp(16px, 5vw, 24px) 'Rubik Mono One', monospace;
  color: var(--ink);
  background: var(--paper);
  transform: rotate(-3deg);
  clip-path: polygon(0 8%, 6% 0, 12% 8%, 18% 0, 24% 8%, 30% 0, 36% 8%, 42% 0, 48% 8%, 54% 0, 60% 8%, 66% 0, 72% 8%, 78% 0, 84% 8%, 90% 0, 96% 8%, 100% 0, 100% 100%, 0 100%);
  box-shadow: 4px 6px 0 rgba(0, 0, 0, 0.4);
}
.logo-sub span { color: #d4232b; }
.tag { margin: 4px 0 6px; color: #d8d2c2; }

h2 { margin: 0; font: 400 20px 'Rubik Mono One', monospace; text-align: center; color: var(--gold); }
h3 { margin: 10px 0 0; font: 400 13px 'Rubik Mono One', monospace; color: #e8e2d0; }
h3 small, .muted { color: #a59e8c; font: 500 13px 'IBM Plex Sans Condensed', sans-serif; }
.center { text-align: center; }
.foot { margin-top: 4px; }
.foot a { color: #c9c2b0; }

.head { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 8px; }
.head h2 { text-align: left; }
.back {
  width: 40px; height: 40px; border-radius: 10px; border: 0; cursor: pointer;
  background: #3a332b; color: #fff; font-size: 20px;
}

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  min-height: 48px; padding: 10px 16px;
  border: 0; border-radius: 12px; cursor: pointer;
  background: #e9e4d6; color: #1a1a1a;
  font: 700 16px 'IBM Plex Sans Condensed', sans-serif;
  box-shadow: 0 5px 0 #9a937f, 0 8px 14px rgba(0, 0, 0, 0.4);
  transition: transform 0.06s, box-shadow 0.06s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #9a937f, 0 3px 6px rgba(0, 0, 0, 0.4); }
.btn small { font-weight: 500; opacity: 0.7; }
.btn.big { background: var(--gold); font-size: 19px; min-height: 56px; box-shadow: 0 5px 0 #a8850a, 0 8px 14px rgba(0, 0, 0, 0.4); }
.btn.ghost { background: transparent; color: #e9e4d6; box-shadow: inset 0 0 0 2px #6a6252; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.sticky { position: sticky; bottom: 0; margin-top: 8px; }
.dot { background: #d4232b; color: #fff; border-radius: 99px; padding: 0 8px; font-size: 13px; }

.row { display: flex; gap: 8px; justify-content: center; }
.chip {
  min-width: 44px; min-height: 36px; padding: 6px 12px;
  border-radius: 99px; border: 2px solid #6a6252; cursor: pointer;
  background: #2c2620; color: #e9e4d6; font: 700 14px 'IBM Plex Sans Condensed', sans-serif;
}
.chip.on { background: var(--gold); color: #1a1a1a; border-color: var(--gold); }
.chip:disabled { opacity: 0.4; cursor: default; }
.cash { color: #8bff9e; font-family: VT323, monospace; font-size: 20px; }

.floor-pick { display: flex; align-items: center; justify-content: center; gap: 18px; }
.floor-pick div { text-align: center; display: flex; flex-direction: column; }
.floor-pick b { font: 400 22px 'Rubik Mono One', monospace; }
.floor-pick small { color: #a59e8c; }

.boss-card {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px;
  background: repeating-linear-gradient(45deg, #3a1010 0 12px, #2a0c0c 12px 24px); border: 2px solid #d4232b;
}
.boss-card b { color: #ff8080; }

.grid { display: grid; gap: 8px; }
.grid.papers { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grid.inks { grid-template-columns: repeat(4, 1fr); }
.grid.looks { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }

.card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 10px; border-radius: 12px; border: 2px solid #4a4237; cursor: pointer;
  background: #2c2620; color: #f2efe6; font: 500 13px 'IBM Plex Sans Condensed', sans-serif;
  box-shadow: 0 4px 0 #15110d;
}
.card b { font-size: 15px; }
.card em { font-style: normal; color: var(--gold); font-size: 12px; }
.card .blurb { color: #b9b29f; font-size: 12px; line-height: 1.25; }
.card.on { border-color: var(--gold); background: #3a3122; }
.card:disabled { opacity: 0.45; cursor: default; }
.card:disabled em { color: #a59e8c; }
.slot-no {
  position: absolute; top: 6px; right: 8px; font: 400 12px 'Rubik Mono One', monospace; font-style: normal;
  background: var(--gold); color: #1a1a1a; border-radius: 99px; width: 22px; height: 22px; display: grid; place-items: center;
}

.swatch {
  width: 100%; height: 30px; border-radius: 3px; margin-bottom: 4px; background: var(--paper);
  transform: perspective(200px) rotateX(18deg); box-shadow: 0 4px 0 #8f8a7c, 0 6px 8px rgba(0, 0, 0, 0.4);
}
.sw-receipt { background: repeating-linear-gradient(#f7f5ee 0 5px, #777 5px 6px, #f7f5ee 6px 8px); }
.sw-barcode { background: repeating-linear-gradient(90deg, #111 0 2px, #f7f5ee 2px 4px, #111 4px 7px, #f7f5ee 7px 8px, #111 8px 9px, #f7f5ee 9px 12px); }
.sw-qr { background: conic-gradient(#111 25%, #f7f5ee 0 50%, #111 0 75%, #f7f5ee 0) 0 0 / 8px 8px; }
.sw-origami { background: repeating-linear-gradient(60deg, #f7f5ee 0 10px, #d8d3c4 10px 20px); }
.sw-glossy { background: linear-gradient(120deg, #7ab0e8, #e9f6ff 45%, #fff 50%, #9fd3ff 60%, #7ab0e8); }
.sw-thermal { background: repeating-linear-gradient(#eef3f6 0 5px, #b8c0c6 5px 6px); }
.sw-cardstock { background: #d9c49a; box-shadow: 0 6px 0 #a58a5a, 0 8px 8px rgba(0, 0, 0, 0.4); }

.card.ink { align-items: center; text-align: center; }
.drop {
  width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); margin: 2px 0 6px;
  background: var(--ink); box-shadow: inset -4px 4px 6px rgba(255, 255, 255, 0.35), 2px 3px 4px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.look { align-items: center; text-align: center; }
.look-sw { width: 100%; height: 46px; border-radius: 8px; margin-bottom: 4px; box-shadow: 0 5px 0 rgba(0, 0, 0, 0.45); }
.lk-chassis-office .look-sw { background: linear-gradient(#d6d8d9 40%, #b9bcbe 40%); }
.lk-chassis-beige .look-sw { background: linear-gradient(#e7dcc1 40%, #d2c4a2 40%); }
.lk-chassis-bondi .look-sw { background: linear-gradient(rgba(40, 170, 190, 0.85) 40%, rgba(22, 138, 160, 0.75) 40%); }
.lk-chassis-grape .look-sw { background: linear-gradient(rgba(130, 80, 190, 0.85) 40%, rgba(104, 58, 160, 0.75) 40%); }
.lk-chassis-toner .look-sw { background: linear-gradient(#3b3f46 40%, #2a2d33 40%); }
.lk-chassis-safety .look-sw { background: linear-gradient(#ff8a3d 40%, #e86d1f 40%); }
.lk-paper-plain .look-sw { background: #f7f5ee; }
.lk-paper-holo .look-sw { background: linear-gradient(120deg, #ff6bd6, #6bf0ff, #fffb6b, #9b6bff); }
.lk-paper-parchment .look-sw { background: radial-gradient(circle at 30% 40%, #f0e0b8, #d8c08a); }
.lk-paper-legal .look-sw { background: linear-gradient(90deg, transparent 12px, rgba(220, 40, 40, 0.6) 12px 14px, transparent 14px), repeating-linear-gradient(#fdf3a6 0 9px, #8fb0e8 9px 10px); }
.lk-paper-blueprint .look-sw { background: #1d4f9e; background-image: linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px); background-size: 10px 10px; }

.memo {
  background: var(--paper); color: var(--ink); padding: 14px 16px; border-radius: 2px;
  transform: rotate(-1deg); box-shadow: 4px 6px 0 rgba(0, 0, 0, 0.35);
  font: 22px/1.1 VT323, monospace;
}
.memo p { margin: 8px 0 0; }
.memo-head { border-bottom: 2px dashed #888; padding-bottom: 6px; }
.name { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.name input {
  min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 2px solid #6a6252;
  background: #15110d; color: #fff; font: 600 16px 'IBM Plex Sans Condensed', sans-serif; user-select: text;
}

.board { margin: 0; padding: 8px 12px 8px 36px; background: #0f2a12; border-radius: 8px; color: var(--lcd); font: 20px VT323, monospace; }
.board li { padding: 2px 0; }
.board li span { display: inline-block; min-width: 55%; }
.board li.me { color: var(--gold); }
.board li.muted { list-style: none; margin-left: -24px; color: #4f9a5d; font-family: VT323, monospace; }

.review {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center;
  padding: 10px 12px; background: #2c2620; border-radius: 10px; border-left: 5px solid var(--gold);
}
.review.paid { opacity: 0.55; border-left-color: #4f9a5d; }
.review small { color: #a59e8c; }
.bar { height: 6px; background: #15110d; border-radius: 3px; margin: 6px 0 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--gold); }
.stamp { font: 400 12px 'Rubik Mono One', monospace; color: #4f9a5d; border: 2px solid #4f9a5d; padding: 2px 6px; transform: rotate(-8deg); }

.howto p { margin: 0 0 10px; line-height: 1.4; color: #e0dacb; }
.howto b { color: var(--gold); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stats div { background: #0f2a12; border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; }
.stats small { color: #4f9a5d; font: 16px VT323, monospace; }
.stats b { color: var(--lcd); font: 28px VT323, monospace; }
.unlock { margin: 0; padding: 8px 10px; border-radius: 8px; background: #3a3122; color: var(--gold); text-align: center; }
.noscript { padding: 20px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
