:root {
  --cream: #fbf3e2;
  --cream-2: #fff9ec;
  --paper: #f6ecd8;
  --ink: #2a2622;
  --ink-soft: rgba(42, 38, 34, 0.62);
  --red: #e23b2e;
  --red-dark: #b3261c;
  --mustard: #f2b02b;
  --mustard-dark: #c98d13;
  --green: #3e8e4f;
  --green-dark: #2c6b3b;
  --blue: #1f6fb2;
  --blue-dark: #154f81;
  --brown: #c9762a;
  --grape: #7a4fbf;
  --display: "Alfa Slab One", Georgia, "Times New Roman", serif;
  --text: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --num: "Doto", "Courier New", monospace;
  --line: 3px;
  --shadow: 5px 5px 0 rgba(42, 38, 34, 0.16);
  --shadow-big: 8px 8px 0 rgba(42, 38, 34, 0.18);
  --u: 8px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.35;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
  overscroll-behavior: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(rgba(42, 38, 34, 0.34) 0.8px, transparent 0.9px);
  background-size: 7px 7px;
  opacity: 0.16;
  mix-blend-mode: multiply;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }

::selection { background: var(--mustard); color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

/* ---------- boot ---------- */
#boot {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  background: var(--cream);
  transition: opacity 0.4s ease, visibility 0.4s;
}
#boot.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-title {
  font-family: var(--display);
  font-size: clamp(34px, 9vw, 76px);
  line-height: 0.9;
  letter-spacing: 0.01em;
  color: var(--cream);
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 4px 4px 0 var(--red), 7px 7px 0 var(--ink);
  transform: rotate(-1.5deg);
}
.boot-sub {
  font-family: var(--display);
  font-size: clamp(12px, 2.4vw, 18px);
  letter-spacing: 0.22em;
  color: var(--red);
}
.boot-bar {
  width: min(260px, 60vw);
  height: 12px;
  margin: 10px auto 0;
  border: 3px solid var(--ink);
  background: var(--cream-2);
  overflow: hidden;
}
.boot-bar i {
  display: block;
  height: 100%;
  width: 35%;
  background: repeating-linear-gradient(90deg, var(--green) 0 8px, var(--green-dark) 8px 10px);
  animation: bootload 1.1s ease-in-out infinite;
}
@keyframes bootload {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}
#boot p { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }

/* ---------- app frame ---------- */
#app {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.screen {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  position: relative;
}
.screen.on { display: flex; }

/* ---------- top bar ---------- */
#topbar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: calc(6px + var(--safe-t)) 10px 6px;
  background: var(--cream-2);
  border-bottom: 3px solid var(--ink);
  flex: 0 0 auto;
  z-index: 12;
}
#topbar.on { display: flex; }
.tb-home {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.tb-home span { display: none; }
.tb-home .mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--red);
  border: 3px solid var(--ink);
  color: var(--cream);
  font-family: var(--display);
  font-size: 17px;
  box-shadow: 2px 2px 0 rgba(42, 38, 34, 0.2);
  transform: rotate(-2deg);
}
.tb-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-left: auto;
  text-align: right;
  line-height: 1.1;
}
.tb-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(42, 38, 34, 0.16);
  font-family: var(--num);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}
.icon-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(42, 38, 34, 0.16); }
.icon-btn svg { width: 18px; height: 18px; }
.tb-rank {
  display: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 8px;
  border: 2px solid var(--ink);
  background: var(--mustard);
  white-space: nowrap;
  box-shadow: 2px 2px 0 rgba(42, 38, 34, 0.18);
}

/* ---------- buttons ---------- */
.btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: var(--cream);
  background: var(--green);
  border: var(--line) solid var(--ink);
  box-shadow: var(--shadow);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.05;
  text-align: left;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); box-shadow: 6px 7px 0 rgba(42, 38, 34, 0.18); filter: saturate(1.05); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 rgba(42, 38, 34, 0.18); }
.btn[disabled], .btn.locked { filter: grayscale(0.5) brightness(0.96); opacity: 0.72; cursor: not-allowed; }
.btn[disabled]:hover, .btn.locked:hover { transform: none; box-shadow: var(--shadow); }
.btn-red { background: var(--red); }
.btn-mustard { background: var(--mustard); color: var(--ink); }
.btn-green { background: var(--green); }
.btn-blue { background: var(--blue); }
.btn-cream { background: var(--cream); color: var(--ink); }
.btn-ghost { background: var(--cream-2); color: var(--ink); box-shadow: 3px 3px 0 rgba(42, 38, 34, 0.14); }
.btn-lg { padding: 16px 18px; font-size: clamp(15px, 2.1vw, 19px); }
.btn-sm { padding: 9px 11px; font-size: 12px; letter-spacing: 0.06em; box-shadow: 3px 3px 0 rgba(42, 38, 34, 0.16); }
.btn .ico {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--cream);
  border: 2.5px solid var(--ink);
  color: var(--ink);
  overflow: hidden;
}
.btn .ico img { width: 100%; height: 100%; object-fit: contain; padding: 1px; }
.btn .ico svg { width: 20px; height: 20px; }
.btn .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.btn .txt small {
  font-family: var(--text);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: none;
  opacity: 0.82;
}
.btn .grow { flex: 1; }
.corner-tag {
  position: absolute;
  top: 4px;
  right: 5px;
  pointer-events: none;
  background: var(--mustard);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: rotate(3deg);
  box-shadow: 2px 2px 0 rgba(42, 38, 34, 0.2);
  white-space: nowrap;
}
.corner-tag.red { background: var(--red); color: var(--cream); }
.corner-tag.blue { background: var(--blue); color: var(--cream); }
.corner-tag.green { background: var(--green); color: var(--cream); }

/* ---------- printed plates ---------- */
.plate {
  background: var(--cream-2);
  border: var(--line) solid var(--ink);
  box-shadow: var(--shadow);
  position: relative;
}
.plate.soft { background: var(--paper); }
.stamp {
  display: inline-block;
  padding: 5px 10px;
  border: 3px solid currentColor;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: rotate(-6deg);
  opacity: 0.92;
  white-space: nowrap;
}
.stamp.red { color: var(--red); }
.stamp.green { color: var(--green); }
.stamp.mustard { color: var(--mustard-dark); }
.stamp.blue { color: var(--blue); }
.stamp.ink { color: var(--ink); }
.tape {
  background: repeating-linear-gradient(45deg, var(--mustard) 0 10px, var(--ink) 10px 20px);
  height: 16px;
  border: 2px solid var(--ink);
}
.shelf-rule {
  height: 3px;
  background: var(--ink);
  opacity: 0.85;
}
.num {
  font-family: var(--num);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.h-display { font-family: var(--display); letter-spacing: 0.01em; font-weight: 400; }

/* rating colors */
.r-good { color: var(--green); }
.r-mid { color: #94620a; }
.r-bad { color: var(--red); }
.bg-good { background: var(--green); }
.bg-mid { background: var(--mustard); }
.bg-bad { background: var(--red); }

/* ---------- menu ---------- */
#scr-menu { overflow: hidden; }
.menu-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(8px + var(--safe-t)) 12px 8px;
  isolation: isolate;
}
.menu-bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  background-image: url("../assets/store_map_backdrop.webp");
  background-size: cover;
  background-position: center 58%;
  filter: saturate(0.92) brightness(1.04);
}
.menu-veil {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 50% 34%, rgba(251, 243, 226, 0.94) 0%, rgba(251, 243, 226, 0.72) 44%, rgba(251, 243, 226, 0.18) 74%, rgba(42, 38, 34, 0.12) 100%),
    linear-gradient(180deg, rgba(251, 243, 226, 0.55) 0%, rgba(251, 243, 226, 0) 40%, rgba(251, 243, 226, 0.55) 100%);
}
.menu-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.2vh, 12px);
  width: min(520px, 94vw);
  margin-top: auto;
  margin-bottom: auto;
}
.titlelock {
  position: relative;
  width: min(470px, 80vw, 58vh);
  transform: rotate(-0.6deg);
  filter: drop-shadow(4px 7px 0 rgba(42, 38, 34, 0.2));
  margin-bottom: 2px;
}
.titlelock img { width: 100%; height: auto; }
.titlelock .ribbon {
  position: absolute;
  left: 50%;
  top: 68.5%;
  width: 106%;
  height: 25.5%;
  transform: translateX(-50%) rotate(-3.4deg);
  background: var(--red);
  border: 3.5px solid var(--ink);
  clip-path: polygon(3% 14%, 97% 0%, 100% 74%, 97% 100%, 3% 88%, 0 100%, 0 26%);
  display: grid;
  place-items: center;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.14);
}
.titlelock .ribbon span {
  font-family: var(--display);
  font-size: clamp(13px, 4.2vw, 25px);
  color: var(--cream);
  letter-spacing: 0.035em;
  text-shadow: 2px 2px 0 rgba(42, 38, 34, 0.5);
  white-space: nowrap;
  transform: rotate(0.4deg);
}
.menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}
.menu-mini {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  margin-top: 2px;
}
.menu-mini .btn {
  padding: 8px 8px;
  justify-content: center;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  min-height: 58px;
}
.menu-mini .btn .ico { width: 24px; height: 24px; border-width: 2px; }
.menu-mini .btn .ico svg { width: 15px; height: 15px; }
.menu-save {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 4px;
  background: rgba(255, 249, 236, 0.86);
  border: 2px dashed rgba(42, 38, 34, 0.4);
  padding: 5px 8px;
}
.menu-save b { font-family: var(--num); font-size: 14px; letter-spacing: 0; }
.menu-save .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); border: 2px solid var(--ink); }
.menu-save .dot.off { background: var(--red); }
.menu-deco {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(3px 5px 0 rgba(42, 38, 34, 0.16));
}
.menu-deco-left {
  left: 0;
  bottom: 0;
  width: min(30vw, 320px);
  height: 54%;
  display: flex;
  align-items: flex-end;
}
.menu-deco-left .crew { position: relative; width: 100%; height: 100%; }
.menu-deco-left .crew img { position: absolute; bottom: -4px; }
.menu-deco-left .p1 { left: 4%; height: 52%; }
.menu-deco-left .p2 { left: 28%; height: 46%; }
.menu-deco-left .p3 { left: 52%; height: 62%; }
.menu-deco-right {
  right: 0;
  bottom: 0;
  width: min(26vw, 300px);
  height: 48%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}
.menu-deco-right .thing { position: relative; width: 100%; height: 100%; }
.menu-deco-right .cart { position: absolute; right: 6%; bottom: 21%; height: 66%; width: auto; }
.menu-deco-right .scale { position: absolute; right: 1%; bottom: -6%; height: 44%; }
.menu-deco-right .medals { position: absolute; right: -2%; bottom: 44%; height: 19%; display: flex; gap: 2px; }
.menu-deco-right .medals img { height: 100%; width: auto; }
.menu-groceries {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 16%;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0;
  padding: 0 2vw;
  pointer-events: none;
  opacity: 0.98;
}
.menu-groceries img { height: 100%; width: auto; max-height: 130px; filter: drop-shadow(2px 3px 0 rgba(42, 38, 34, 0.14)); }
.menu-groceries img:nth-child(1) { height: 92%; }
.menu-groceries img:nth-child(2) { height: 74%; }
.menu-groceries img:nth-child(3) { height: 66%; }
.menu-groceries img:nth-child(4) { height: 58%; }
.menu-groceries img:nth-child(5) { height: 70%; }
.menu-groceries img:nth-child(6) { height: 74%; }
.menu-groceries img:nth-child(7) { height: 55%; }
.menu-groceries img:nth-child(8) { height: 72%; }
.receipt-strip {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px calc(5px + var(--safe-b));
  background: var(--cream-2);
  border-top: 3px solid var(--ink);
  font-family: var(--text);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.receipt-strip .spacer { flex: 1; }
.receipt-strip .strip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 2px solid var(--ink);
  background: var(--cream);
  color: var(--ink);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.receipt-strip .openlight { display: inline-flex; align-items: center; gap: 5px; }
.receipt-strip .openlight i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green); border: 2px solid var(--ink);
  box-shadow: 0 0 0 2px rgba(62, 142, 79, 0.25);
}

@media (max-width: 1100px) {
  .menu-deco { display: none; }
}
@media (max-width: 700px) {
  .menu-deco { display: none; }
  .menu-groceries { height: 9%; opacity: 0.9; }
  .menu-center { width: min(430px, 92vw); }
  .titlelock { width: min(380px, 84vw); }
  .menu-stage { justify-content: flex-start; padding-top: calc(12px + var(--safe-t)); }
  .menu-center { margin-top: 0; margin-bottom: auto; }
  .menu-list { gap: 7px; }
  .menu-bg { background-position: center 42%; }
}
@media (max-height: 640px) {
  .menu-groceries { display: none; }
  .titlelock { width: min(330px, 56vw, 34vh); }
}

/* ---------- map hub ---------- */
#scr-map { background: var(--cream); }
.map-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.map-main {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #d9d0bd;
}
.map-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.map-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 44%;
  user-select: none;
  -webkit-user-drag: none;
}
.map-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 48% 58%, rgba(42, 38, 34, 0) 30%, rgba(42, 38, 34, 0.12) 100%);
}
.map-bays { position: absolute; inset: 0; }
.bay {
  position: absolute;
  transform: translate(-50%, -50%);
  width: clamp(58px, 8.2vw, 104px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0;
  text-align: center;
  z-index: 3;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease;
}
.bay:hover { transform: translate(-50%, -50%) translateY(-3px); }
.bay:active { transform: translate(-50%, -50%) translateY(1px); }
.bay .badge {
  width: clamp(44px, 6.2vw, 76px);
  height: clamp(44px, 6.2vw, 76px);
  border-radius: 50%;
  background: var(--cream);
  display: grid;
  place-items: center;
  filter: drop-shadow(2px 4px 0 rgba(42, 38, 34, 0.22));
  position: relative;
}
.bay .badge img { width: 100%; height: 100%; object-fit: contain; }
.bay .badge svg { width: 62%; height: 62%; }
.bay .sign {
  display: block;
  width: 100%;
  background: var(--cream-2);
  border: 2.5px solid var(--ink);
  padding: 3px 4px 4px;
  box-shadow: 2px 3px 0 rgba(42, 38, 34, 0.2);
  line-height: 1.02;
}
.bay .sign b {
  display: block;
  font-family: var(--display);
  font-size: clamp(8px, 1.05vw, 12px);
  font-weight: 400;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bay .sign .rt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: var(--num);
  font-size: clamp(10px, 1.35vw, 15px);
  font-weight: 700;
  line-height: 1;
}
.bay .sign .rt em {
  font-style: normal;
  font-size: 7px;
  letter-spacing: 0.08em;
}
.bay.closed { opacity: 0.94; }
.bay.closed .badge { filter: grayscale(0.35) drop-shadow(2px 3px 0 rgba(42, 38, 34, 0.18)); }
.bay.closed .badge::after {
  content: "";
  position: absolute;
  inset: 12% -8%;
  background: repeating-linear-gradient(45deg, var(--mustard) 0 9px, var(--ink) 9px 15px);
  transform: rotate(-9deg);
  border: 2px solid var(--ink);
  box-shadow: 1px 2px 0 rgba(42, 38, 34, 0.2);
}
.bay.closed .sign { background: #e8dfcc; color: var(--ink-soft); }
.bay.office .badge { border: none; }
.bay.office .sign { background: var(--blue); color: var(--cream); }
.bay.office .sign .rt { color: var(--cream); }
.bay.bay-ready .badge { animation: baypulse 1.8s ease-in-out infinite; }
@keyframes baypulse {
  0%, 100% { filter: drop-shadow(2px 4px 0 rgba(42, 38, 34, 0.22)); }
  50% { filter: drop-shadow(0 0 0 3px rgba(242, 176, 43, 0.7)) drop-shadow(2px 4px 0 rgba(42, 38, 34, 0.22)); }
}
.walkers { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.walker {
  position: absolute;
  height: clamp(44px, 7.2vh, 86px);
  width: auto;
  transform-origin: 50% 100%;
  filter: drop-shadow(2px 3px 0 rgba(42, 38, 34, 0.2));
  animation: walkbob 0.62s steps(2, jump-none) infinite;
}
.walker.rival { height: clamp(42px, 6.8vh, 80px); }
.walker .shadow {
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 70%;
  height: 9px;
  transform: translateX(-50%);
  background: rgba(42, 38, 34, 0.18);
  border-radius: 50%;
  z-index: -1;
}
@keyframes walkbob {
  0% { transform: translateY(0) rotate(-0.7deg); }
  100% { transform: translateY(-2px) rotate(0.7deg); }
}
.walker.wander-1 { animation: walkbob 0.62s steps(2, jump-none) infinite, path1 16s linear infinite alternate; }
.walker.wander-2 { animation: walkbob 0.56s steps(2, jump-none) infinite, path2 21s linear infinite alternate; }
.walker.wander-3 { animation: walkbob 0.7s steps(2, jump-none) infinite, path3 25s linear infinite alternate; }
@keyframes path1 { from { margin-left: 0; } to { margin-left: 6vw; } }
@keyframes path2 { from { margin-left: 0; } to { margin-left: -5vw; } }
@keyframes path3 { from { margin-left: 0; } to { margin-left: 4vw; } }

.map-toast {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  z-index: 6;
  background: var(--mustard);
  border: 3px solid var(--ink);
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 rgba(42, 38, 34, 0.2);
  max-width: 92%;
  text-align: center;
}

/* job ticket floating on the map */
.job-ticket {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 5;
  width: min(230px, 46%);
  background: rgba(255, 249, 236, 0.92);
  border: 2.5px dashed rgba(42, 38, 34, 0.55);
  padding: 6px 8px;
  pointer-events: none;
}
.job-ticket .label { font-size: 8px; }
.job-ticket b { font-family: var(--display); font-size: 13px; display: block; line-height: 1.05; }
.job-ticket p { font-size: 9px; line-height: 1.3; }
.job-ticket .avg { font-family: var(--num); font-size: 20px; line-height: 1; }

.map-hud {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--cream-2);
  border-top: 3px solid var(--ink);
  overflow-x: auto;
  scrollbar-width: none;
  z-index: 8;
}
.map-hud::-webkit-scrollbar { display: none; }
.map-hud .chip {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 2.5px solid var(--ink);
  background: var(--cream);
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 2px 2px 0 rgba(42, 38, 34, 0.14);
  flex: 0 0 auto;
}
.map-hud .chip b { font-family: var(--num); font-size: 16px; letter-spacing: 0; }
.map-hud .chip.red { background: var(--red); color: var(--cream); }
.map-hud .chip.green { background: var(--green); color: var(--cream); }
.map-hud .chip.mustard { background: var(--mustard); }
.map-hud .spacer { flex: 1; }

/* side career panel */
.career-panel {
  display: none;
  width: 330px;
  flex: 0 0 auto;
  border-left: 3px solid var(--ink);
  background: var(--cream);
  overflow-y: auto;
  padding: 10px;
  gap: 10px;
}
@media (min-width: 1000px) {
  #scr-map.on { flex-direction: row; }
  .map-wrap { flex: 1; }
  .career-panel { display: flex; flex-direction: column; }
  #topbar .tb-rank { display: inline-block; }
}
.career-panel h3 {
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.05;
}
.career-panel .panel-sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.career-panel .panel-card { padding: 9px; }
.career-panel .panel-card + .panel-card { margin-top: 0; }
.gauge-card { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.gauge-wrap { position: relative; width: 100%; max-width: 210px; aspect-ratio: 1; }
.gauge-wrap img.face { width: 100%; height: 100%; object-fit: contain; }
.needle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4.6%;
  height: 34%;
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%) rotate(var(--ang, 0deg));
  background: linear-gradient(180deg, #f04a3c, var(--red) 60%, var(--red-dark));
  border: 2px solid var(--ink);
  clip-path: polygon(50% 0%, 100% 92%, 76% 100%, 50% 94%, 24% 100%, 0 92%);
  z-index: 3;
  transition: transform 0.7s cubic-bezier(0.2, 1.4, 0.4, 1);
  filter: drop-shadow(1px 2px 0 rgba(42, 38, 34, 0.25));
}
.hubcap {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 13%;
  height: 13%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--red);
  border: 2.5px solid var(--ink);
  z-index: 4;
  box-shadow: 1px 2px 0 rgba(42, 38, 34, 0.25);
}
.gauge-readout {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--num);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}
.gauge-readout small { font-size: 11px; letter-spacing: 0.08em; }
.gauge-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  font-family: var(--text);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.gauge-labels span { position: absolute; color: var(--ink); background: rgba(255, 249, 236, 0.8); padding: 0 2px; }
.gauge-labels .l60 { left: 78%; top: 33%; }
.gauge-labels .l80 { left: 83%; top: 17%; color: var(--red); }
.gauge-labels .lfloor { left: 12%; top: 60%; color: var(--mustard-dark); }

.receipt-card {
  background: var(--cream-2);
  border: 2.5px solid var(--ink);
  padding: 8px 9px 10px;
  background-image: repeating-linear-gradient(180deg, transparent 0 19px, rgba(42, 38, 34, 0.13) 19px 20px);
  position: relative;
}
.receipt-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -8px;
  height: 8px;
  background: linear-gradient(-45deg, var(--cream-2) 4px, transparent 0), linear-gradient(45deg, var(--cream-2) 4px, transparent 0);
  background-size: 8px 8px;
  background-repeat: repeat-x;
}
.receipt-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  min-height: 20px;
}
.receipt-line .v { font-family: var(--num); font-size: 14px; letter-spacing: 0; }
.receipt-line .mini-stamp { font-family: var(--display); font-size: 9px; padding: 1px 4px; border: 2px solid currentColor; transform: rotate(-4deg); }
.dept-rows { display: flex; flex-direction: column; gap: 4px; }
.dept-row {
  display: grid;
  grid-template-columns: 22px 1fr 38px;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dept-row img { width: 20px; height: 20px; object-fit: contain; }
.dept-row .bar {
  height: 8px;
  background: rgba(42, 38, 34, 0.12);
  border: 2px solid var(--ink);
  position: relative;
}
.dept-row .bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w, 50%);
  background: var(--green);
}
.dept-row .bar i.mid { background: var(--mustard); }
.dept-row .bar i.bad { background: var(--red); }
.dept-row .val { font-family: var(--num); font-size: 15px; text-align: right; }
.dept-row.dragging .val { color: var(--red); }

.promo-actions { display: flex; flex-direction: column; gap: 6px; }

/* ---------- generic screen header ---------- */
.screen-head {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-bottom: 3px solid var(--ink);
  background: var(--cream-2);
  display: flex;
  align-items: center;
  gap: 10px;
}
.screen-head h2 {
  font-family: var(--display);
  font-size: clamp(18px, 3.2vw, 28px);
  line-height: 1;
  letter-spacing: 0.01em;
}
.screen-head .sub { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.screen-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1.05fr 0.95fr; } }

/* ---------- dept sheet / modal ---------- */
#modal-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: 14px;
}
#modal-root.on { display: grid; }
.modal-back {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(42,38,34,.2) 0%, rgba(42,38,34,.52) 100%);
}
.modal {
  position: relative;
  width: min(520px, 100%);
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--cream-2);
  border: var(--line) solid var(--ink);
  box-shadow: var(--shadow-big);
  padding: 14px;
  animation: modalin 0.22s cubic-bezier(0.2, 1.2, 0.4, 1);
}
@keyframes modalin {
  from { transform: translateY(16px) scale(0.97); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.modal .close-x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 2.5px solid var(--ink);
  background: var(--cream);
  font-weight: 800;
  z-index: 2;
}
.modal-head { display: flex; align-items: center; gap: 10px; }
.modal-head img { width: 62px; height: 62px; object-fit: contain; }
.modal-head h3 { font-family: var(--display); font-size: 24px; line-height: 1; }
.modal-head .sub { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.modal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.stat {
  border: 2px solid var(--ink);
  background: var(--cream);
  padding: 6px;
  text-align: center;
}
.stat b { display: block; font-family: var(--num); font-size: 24px; line-height: 1; }
.stat span { font-size: 8px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.modal-blurb { font-size: 13px; line-height: 1.45; margin: 6px 0 10px; }
.modal-note { font-size: 11px; line-height: 1.6; padding: 10px 11px; border: 2px dashed rgba(42, 38, 34, 0.35); margin: 8px 0; min-height: 34px; }
.modal-actions { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.medal-row { display: flex; align-items: center; gap: 6px; }
.medal-row img { height: 44px; width: auto; }
.medal-row .off { filter: grayscale(1); opacity: 0.25; }

/* tutorial */
.tut-card { text-align: center; }
.tut-card .tut-art { height: 96px; margin: 4px auto 8px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.tut-card .tut-art img { height: 100%; width: auto; object-fit: contain; }
.tut-steps { display: flex; justify-content: center; gap: 5px; margin-top: 8px; }
.tut-steps i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--ink); background: var(--cream); }
.tut-steps i.on { background: var(--red); }

/* ---------- arcade select ---------- */
.arcade-grid { display: grid; grid-template-columns: 1fr; gap: 9px; }
@media (min-width: 700px) { .arcade-grid { grid-template-columns: 1fr 1fr; } }
.arcade-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  text-align: left;
  background: var(--cream-2);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
}
.arcade-card > img { width: 52px; height: 52px; object-fit: contain; flex: 0 0 auto; }
.arcade-card .grow { flex: 1; min-width: 0; }
.arcade-card b { font-family: var(--display); font-size: 15px; display: block; line-height: 1.05; }
.arcade-card small { font-size: 10px; color: var(--ink-soft); font-weight: 600; }
.arcade-card .best { font-family: var(--num); font-size: 18px; font-weight: 700; }
.arcade-card:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 rgba(42, 38, 34, 0.16); }

/* ---------- progress / records ---------- */
.sheet-paper {
  background: var(--cream-2);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 12px;
  position: relative;
  background-image: repeating-linear-gradient(180deg, transparent 0 23px, rgba(42, 38, 34, 0.09) 23px 24px);
}
.sheet-paper h3 { font-family: var(--display); font-size: 18px; margin-bottom: 2px; }
.sheet-paper .tag { display: inline-block; background: var(--mustard); border: 2px solid var(--ink); padding: 1px 6px; font-size: 9px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; transform: rotate(-2deg); }
.ladder { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ladder .rung {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 2px solid var(--ink);
  background: var(--cream);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ladder .rung.done { background: #e3efdf; }
.ladder .rung.now { background: var(--mustard); }
.ladder .rung .n {
  width: 22px; height: 22px; display: grid; place-items: center;
  border: 2px solid var(--ink); background: var(--cream);
  font-family: var(--num); font-weight: 700; font-size: 13px;
}
.ladder .rung .pay { margin-left: auto; font-family: var(--num); font-size: 12px; }
.ladder .rung .st { font-size: 8px; letter-spacing: 0.1em; padding: 1px 5px; border: 2px solid var(--ink); }
.ladder .rung.done .st { background: var(--green); color: var(--cream); }
.ladder .rung.now .st { background: var(--red); color: var(--cream); }
.rival-card {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  border: 2.5px solid var(--ink);
  background: var(--cream-2);
  padding: 8px;
}
.rival-card img.face { width: 58px; height: 92px; object-fit: contain; object-position: bottom; }
.rival-card .grow { flex: 1; min-width: 0; }
.rival-card .nm { font-family: var(--display); font-size: 15px; line-height: 1; }
.rival-card .tagline { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.rival-card .ratings { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 8px; margin-top: 4px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.rival-card .ratings span { display: flex; justify-content: space-between; border-bottom: 1px dotted rgba(42, 38, 34, 0.3); }
.rival-card .ratings b { font-family: var(--num); font-size: 12px; }
.rival-rank { font-size: 8px; font-weight: 800; letter-spacing: 0.08em; background: var(--blue); color: var(--cream); padding: 1px 5px; border: 2px solid var(--ink); }
.eotm-wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.eotm-slot {
  border: 2px solid var(--ink);
  background: var(--cream);
  min-height: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3px;
  text-align: center;
}
.eotm-slot img { height: 40px; width: auto; object-fit: contain; }
.eotm-slot .nm { font-size: 8px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.1; }
.eotm-slot .mo { font-family: var(--num); font-size: 10px; color: var(--ink-soft); }
.eotm-slot.empty { background: repeating-linear-gradient(45deg, #f0e6d2 0 8px, #e9dfc9 8px 16px); color: var(--ink-soft); font-size: 8px; font-weight: 800; letter-spacing: 0.08em; }
.board-list { display: flex; flex-direction: column; gap: 3px; font-size: 11px; }
.board-list .row { display: flex; gap: 6px; align-items: center; border-bottom: 1px dotted rgba(42, 38, 34, 0.3); padding: 2px 0; }
.board-list .row .rank { font-family: var(--num); width: 20px; font-weight: 700; }
.board-list .row a { font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--mustard); }
.board-list .row .val { margin-left: auto; font-family: var(--num); font-weight: 700; font-size: 14px; }
.empty-note { font-size: 11px; color: var(--ink-soft); padding: 6px 0; }

/* settings */
.setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  border-bottom: 2px dotted rgba(42, 38, 34, 0.25);
  padding: 10px 0;
}
.setting-row .grow { flex: 1; }
.setting-row b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.setting-row small { font-size: 10px; color: var(--ink-soft); }
.switch {
  width: 58px;
  height: 30px;
  border: 3px solid var(--ink);
  background: var(--cream);
  position: relative;
  flex: 0 0 auto;
}
.switch i {
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: var(--ink);
  transition: left 0.15s ease, background 0.15s ease;
}
.switch.on { background: var(--green); }
.switch.on i { left: 30px; background: var(--cream); border: 2px solid var(--ink); }

/* ---------- game stage ---------- */
#scr-game { background: #1d1a17; }
.game-shell {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.game-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #cfc6b4;
  touch-action: none;
}
.game-stage canvas { display: block; }
.game-stage > .stage-fallback { position: absolute; inset: 0; display: grid; place-items: center; }

.hud {
  position: absolute;
  z-index: 12;
  pointer-events: none;
  font-family: var(--text);
}
.hud * { pointer-events: auto; }
.hud-top {
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  padding: 8px;
}
.hud-bottom {
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
}
.hud-left, .hud-right { display: flex; flex-direction: column; gap: 6px; }
.hud-right { align-items: flex-end; }
.hud-center { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.hud-plate {
  background: rgba(255, 249, 236, 0.95);
  border: 3px solid var(--ink);
  padding: 4px 8px;
  box-shadow: 3px 3px 0 rgba(42, 38, 34, 0.25);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}
.hud-plate .k { font-size: 8px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.hud-plate .v { font-family: var(--num); font-size: 22px; font-weight: 700; }
.hud-plate.big .v { font-size: 30px; }
.hud-plate.red { background: var(--red); color: var(--cream); }
.hud-plate.red .k { color: rgba(251,243,226,.8); }
.hud-plate.mustard { background: var(--mustard); }
.hud-plate.green { background: var(--green); color: var(--cream); }
.hud-plate.green .k { color: rgba(251,243,226,.8); }
.hud-plate.blue { background: var(--blue); color: var(--cream); }
.hud-plate.blue .k { color: rgba(251,243,226,.8); }

.timer-plate { min-width: 88px; justify-content: center; }
.timer-plate .v { font-size: 30px; }

.cart-pips { display: flex; gap: 2px; flex-wrap: wrap; max-width: 160px; }
.cart-pips img { width: 18px; height: 20px; object-fit: contain; opacity: 0.22; filter: grayscale(1); }
.cart-pips img.on { opacity: 1; filter: none; }
.cart-pips img.spill { animation: pipspin 0.5s ease; }
@keyframes pipspin { 50% { transform: rotate(30deg) scale(1.2); } }

.joy {
  position: absolute;
  z-index: 15;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: rgba(255, 249, 236, 0.35);
  display: none;
  touch-action: none;
}
.joy.on { display: block; }
.joy i {
  position: absolute;
  left: 50%; top: 50%;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--cream-2);
  border: 3px solid var(--ink);
  transform: translate(-50%, -50%);
  box-shadow: 2px 3px 0 rgba(42, 38, 34, 0.2);
}

.action-btn {
  min-width: 76px;
  min-height: 54px;
  padding: 6px 12px;
  border: 3px solid var(--ink);
  background: var(--mustard);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 3px 4px 0 rgba(42, 38, 34, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  -webkit-tap-highlight-color: transparent;
}
.action-btn small { font-size: 8px; letter-spacing: 0.08em; opacity: 0.7; }
.action-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(42, 38, 34, 0.3); }
.action-btn.red { background: var(--red); color: var(--cream); }
.action-btn.green { background: var(--green); color: var(--cream); }
.action-btn.blue { background: var(--blue); color: var(--cream); }
.action-btn.cream { background: var(--cream); }
.action-row { display: flex; gap: 6px; align-items: flex-end; }

.combo-pop {
  font-family: var(--num);
  font-size: 26px;
  font-weight: 700;
  color: var(--mustard);
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 2px 3px 0 var(--ink);
  transform: rotate(-4deg);
  animation: comboIn 0.4s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes comboIn { from { transform: scale(0.4) rotate(-10deg); } to { transform: scale(1) rotate(-4deg); } }

.float-stamp {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border: 3px solid currentColor;
  background: rgba(255, 249, 236, 0.92);
  transform: translate(-50%, -50%) rotate(-7deg);
  animation: stampDrop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
  white-space: nowrap;
}
.float-stamp.green { color: var(--green); }
.float-stamp.red { color: var(--red); }
.float-stamp.mustard { color: var(--mustard-dark); }
.float-stamp.blue { color: var(--blue); }
@keyframes stampDrop {
  from { opacity: 0; transform: translate(-50%, -50%) rotate(-14deg) scale(1.6); }
  60% { opacity: 1; transform: translate(-50%, -50%) rotate(-5deg) scale(0.98); }
  to { opacity: 1; transform: translate(-50%, -50%) rotate(-7deg) scale(1); }
}

.pause-btn { pointer-events: auto; }
.pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(42, 38, 34, 0.55);
  backdrop-filter: blur(2px);
}
.pause-card {
  background: var(--cream-2);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-big);
  padding: 16px;
  width: min(330px, 88%);
  text-align: center;
}
.pause-card h3 { font-family: var(--display); font-size: 26px; }
.pause-card .btns { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }

/* bag board specific */
.bag-hint {
  position: absolute;
  left: 50%;
  bottom: 62px;
  transform: translateX(-50%);
  z-index: 10;
  background: var(--mustard);
  border: 2.5px solid var(--ink);
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}
.bag-zone-tag {
  position: absolute;
  z-index: 9;
  background: var(--ink);
  color: var(--cream);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 1px 4px;
  pointer-events: none;
}

/* management */
.manage-wrap { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.manage-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--cream-2);
  border-bottom: 3px solid var(--ink);
  flex-wrap: wrap;
}
.manage-top .clock { font-family: var(--num); font-size: 24px; font-weight: 700; line-height: 1; }
.manage-top .target { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.stability-bar {
  flex: 1;
  min-width: 120px;
  height: 18px;
  border: 3px solid var(--ink);
  background: var(--cream);
  position: relative;
  overflow: hidden;
}
.stability-bar i {
  display: block;
  height: 100%;
  width: var(--w, 60%);
  background: repeating-linear-gradient(90deg, var(--green) 0 12px, var(--green-dark) 12px 14px);
  transition: width 0.4s ease, background 0.3s;
}
.stability-bar i.mid { background: repeating-linear-gradient(90deg, var(--mustard) 0 12px, var(--mustard-dark) 12px 14px); }
.stability-bar i.bad { background: repeating-linear-gradient(90deg, var(--red) 0 12px, var(--red-dark) 12px 14px); }
.stability-bar b {
  position: absolute;
  top: 50%; left: var(--x, 60%);
  width: 3px; height: 200%;
  background: var(--ink);
  transform: translate(-50%, -50%);
}
.manage-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  align-content: start;
}
@media (min-width: 800px) { .manage-body { grid-template-columns: 1.1fr 0.9fr; } }
.incident-list { display: flex; flex-direction: column; gap: 7px; }
.incident {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 3px solid var(--ink);
  background: var(--cream-2);
  padding: 7px;
  box-shadow: 3px 3px 0 rgba(42, 38, 34, 0.16);
  animation: incid 0.25s ease;
}
@keyframes incid { from { transform: translateY(-8px); opacity: 0; } }
.incident.hot { border-color: var(--red); background: #fff1e6; }
.incident img { width: 40px; height: 40px; object-fit: contain; flex: 0 0 auto; }
.incident .grow { flex: 1; min-width: 0; }
.incident .nm { font-family: var(--display); font-size: 13px; line-height: 1.05; }
.incident small { font-size: 9.5px; font-weight: 600; color: var(--ink-soft); }
.incident .count { font-family: var(--num); font-size: 20px; font-weight: 700; width: 40px; text-align: center; }
.incident .count.warn { color: var(--red); }
.incident .assign { display: flex; flex-direction: column; gap: 3px; }
.incident .assign button {
  font-size: 9px;
  font-weight: 800;
  border: 2px solid var(--ink);
  background: var(--cream);
  padding: 4px 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.incident .assign button.sel { background: var(--mustard); }
.incident .assign button:active { transform: translate(1px,1px); }
.staff-list { display: flex; flex-direction: column; gap: 6px; }
.staff {
  display: flex;
  gap: 7px;
  align-items: center;
  border: 2.5px solid var(--ink);
  background: var(--cream);
  padding: 6px;
}
.staff img { width: 34px; height: 56px; object-fit: contain; object-position: bottom; }
.staff .grow { flex: 1; min-width: 0; }
.staff b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.1; }
.staff small { font-size: 9px; color: var(--ink-soft); }
.staff .energy { height: 6px; border: 2px solid var(--ink); background: var(--cream-2); margin-top: 3px; }
.staff .energy i { display: block; height: 100%; background: var(--green); }
.staff .energy i.low { background: var(--red); }
.staff.sick { opacity: 0.55; filter: grayscale(0.6); }
.staff.sick .grow b::after { content: " SICK"; color: var(--red); }
.decision-card {
  border: 3px solid var(--ink);
  background: var(--cream-2);
  padding: 9px;
  box-shadow: var(--shadow);
}
.decision-card h3 { font-family: var(--display); font-size: 16px; }
.decision-card p { font-size: 11.5px; line-height: 1.4; margin: 4px 0 8px; }
.decision-opt {
  display: block;
  width: 100%;
  text-align: left;
  border: 2.5px solid var(--ink);
  background: var(--cream);
  padding: 7px 8px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 5px;
  box-shadow: 2px 2px 0 rgba(42, 38, 34, 0.14);
}
.decision-opt:hover { background: var(--mustard); }
.manage-log { font-size: 10px; line-height: 1.5; max-height: 130px; overflow-y: auto; }
.manage-log div { border-bottom: 1px dotted rgba(42, 38, 34, 0.25); padding: 2px 0; }
.manager-rival {
  background: var(--cream-2);
  border: 3px solid var(--ink);
  padding: 7px;
}
.manager-rival .who { display: flex; align-items: center; gap: 6px; }
.manager-rival img { width: 42px; height: 62px; object-fit: contain; object-position: bottom; }
.manager-rival .nm { font-family: var(--display); font-size: 14px; line-height: 1; }
.manager-rival .bar { height: 12px; border: 2.5px solid var(--ink); background: var(--cream); margin-top: 5px; position: relative; }
.manager-rival .bar i { display: block; height: 100%; background: var(--red); width: var(--w, 50%); transition: width 0.5s; }

/* ---------- result receipt ---------- */
#scr-result { background: var(--cream); overflow-y: auto; }
.result-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.result-receipt {
  width: min(480px, 100%);
  background: var(--cream-2);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-big);
  position: relative;
  padding: 14px 16px 18px;
  background-image: repeating-linear-gradient(180deg, transparent 0 26px, rgba(42, 38, 34, 0.075) 26px 27px);
}
.result-receipt::before {
  content: "";
  position: absolute;
  top: -11px; left: 0; right: 0; height: 11px;
  background: linear-gradient(135deg, var(--cream-2) 6px, transparent 0), linear-gradient(-135deg, var(--cream-2) 6px, transparent 0);
  background-size: 12px 12px;
  background-repeat: repeat-x;
}
.result-head { text-align: center; border-bottom: 3px solid var(--ink); padding-bottom: 8px; }
.result-head .rk { font-family: var(--display); font-size: 21px; line-height: 1; }
.result-head .sub { font-size: 9px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); margin-top: 2px; }
.result-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 4px;
}
.result-title img { width: 44px; height: 44px; object-fit: contain; }
.result-title b { font-family: var(--display); font-size: 17px; line-height: 1; }
.result-title small { display: block; font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.result-lines { margin: 6px 0; }
.rline {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-height: 25px;
}
.rline .name { min-width: 92px; }
.rline .dots { flex: 1; border-bottom: 2px dotted rgba(42, 38, 34, 0.35); transform: translateY(-3px); }
.rline .v { font-family: var(--num); font-size: 17px; }
.rtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  padding: 7px 0;
  margin: 6px 0 8px;
}
.rtotal .k { font-family: var(--display); font-size: 15px; letter-spacing: 0.04em; }
.rtotal .v { font-family: var(--num); font-size: 44px; line-height: 0.9; font-weight: 700; }
.verdict {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.verdict .stamp { font-size: 20px; padding: 3px 9px; }
.result-medals { display: flex; align-items: flex-end; gap: 4px; }
.result-medals img { height: 54px; width: auto; filter: drop-shadow(2px 3px 0 rgba(42,38,34,.18)); }
.result-medals img.dim { filter: grayscale(1); opacity: 0.2; }
.result-medals img.drop { animation: medaldrop 0.7s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
@keyframes medaldrop {
  0% { transform: translateY(-34px) scale(1.25) rotate(-8deg); opacity: 0; }
  70% { transform: translateY(3px) scale(0.98) rotate(3deg); opacity: 1; }
  100% { transform: translateY(0) scale(1) rotate(0); }
}
.result-notes { font-size: 11px; line-height: 1.5; border: 2px dashed rgba(42, 38, 34, 0.35); padding: 7px; margin: 8px 0; }
.result-notes b { text-transform: uppercase; letter-spacing: 0.06em; }
.result-qual { display: flex; align-items: center; gap: 7px; padding: 6px 0; border-top: 2px dotted rgba(42, 38, 34, 0.3); }
.result-qual .mini { flex: 1; }
.result-qual .mini b { display: block; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.result-qual .mini small { font-size: 9px; color: var(--ink-soft); }
.result-qual .score { font-family: var(--num); font-size: 26px; font-weight: 700; }
.result-actions { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }

.record-banner {
  background: var(--mustard);
  border: 2.5px solid var(--ink);
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-block;
  transform: rotate(-1.5deg);
  margin-bottom: 4px;
}

.eotm-ceremony { text-align: center; }
.eotm-ceremony .big { font-family: var(--display); font-size: 26px; line-height: 1; }
.eotm-ceremony .wall { display: flex; justify-content: center; gap: 6px; margin: 10px 0; }
.eotm-ceremony .wall .slot { border: 2px solid var(--ink); background: var(--cream); padding: 4px; width: 74px; }
.eotm-ceremony .wall img { height: 62px; margin: 0 auto; object-fit: contain; }

/* promotion ceremony */
.promo-ceremony { text-align: center; position: relative; }
.promo-ceremony .rays {
  position: absolute;
  inset: -20px;
  z-index: -1;
  background: repeating-conic-gradient(from 0deg, rgba(242, 176, 43, 0.35) 0 8deg, transparent 8deg 16deg);
  animation: rayspin 18s linear infinite;
  border-radius: 50%;
}
@keyframes rayspin { to { transform: rotate(360deg); } }
.promo-ceremony .big { font-family: var(--display); font-size: clamp(24px, 6vw, 38px); line-height: 0.95; }
.promo-ceremony .ribbon2 {
  display: inline-block;
  background: var(--red);
  color: var(--cream);
  border: 3px solid var(--ink);
  padding: 5px 14px;
  font-family: var(--display);
  font-size: 20px;
  transform: rotate(-3deg);
  margin: 8px 0;
  box-shadow: 3px 3px 0 rgba(42, 38, 34, 0.2);
}
.promo-ceremony .unlock { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 0; }
.promo-ceremony .unlock img { height: 70px; }

/* victory */
#scr-victory { background: var(--cream); overflow-y: auto; }
.victory-wrap { flex: 1; overflow-y: auto; padding: 14px; display: flex; justify-content: center; }
.victory-card {
  width: min(560px, 100%);
  background: var(--cream-2);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow-big);
  padding: 18px;
  text-align: center;
  position: relative;
  background-image: radial-gradient(rgba(42, 38, 34, 0.12) 1px, transparent 1.4px);
  background-size: 10px 10px;
}
.victory-card .confetti { font-family: var(--display); letter-spacing: 0.15em; color: var(--red); font-size: 12px; }
.victory-card h2 { font-family: var(--display); font-size: clamp(26px, 6.4vw, 42px); line-height: 0.94; margin: 6px 0 4px; }
.victory-card .newtitle { display: inline-block; background: var(--grape); color: var(--cream); border: 3px solid var(--ink); padding: 4px 12px; font-family: var(--display); font-size: 19px; transform: rotate(-2deg); margin: 5px 0 10px; }
.victory-scene { position: relative; height: 190px; margin: 8px 0; }
.victory-scene .boss { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); height: 92%; }
.victory-scene .key { position: absolute; left: 12%; bottom: 18%; height: 36%; transform: rotate(-12deg); }
.victory-scene .trophy { position: absolute; right: 10%; bottom: 8%; height: 54%; }
.victory-scene .wall { position: absolute; left: 4%; top: 0; width: 92%; height: 34%; border: 3px solid var(--ink); background: var(--mustard); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 12px; color: var(--ink); letter-spacing: 0.05em; }
.victory-scene .wall::before { content: ""; position: absolute; inset: 4px; border: 2px dashed rgba(42, 38, 34, 0.45); }
.victory-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.victory-actions { display: flex; flex-direction: column; gap: 7px; }

/* toast */
#toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(14px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  width: min(420px, 92%);
}
.toast {
  background: var(--ink);
  color: var(--cream);
  border: 2.5px solid var(--cream);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
  animation: toastin 0.25s ease both;
  text-align: center;
  max-width: 100%;
}
.toast.red { background: var(--red); color: var(--cream); }
.toast.mustard { background: var(--mustard); color: var(--ink); border-color: var(--ink); }
.toast.green { background: var(--green); color: var(--cream); }
.toast.out { animation: toastout 0.3s ease both; }
@keyframes toastin { from { transform: translateY(10px); opacity: 0; } }
@keyframes toastout { to { transform: translateY(-6px); opacity: 0; } }

/* small helpers */
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mt6 { margin-top: 6px; } .mt10 { margin-top: 10px; } .mt14 { margin-top: 14px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.small { font-size: 10px; }
.muted { color: var(--ink-soft); }
.wrap-anywhere { overflow-wrap: anywhere; }
.tiny-tag { display: inline-block; border: 2px solid var(--ink); padding: 0 5px; font-size: 8px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; background: var(--cream); }
.tiny-tag.red { background: var(--red); color: var(--cream); }
.tiny-tag.mustard { background: var(--mustard); }
.tiny-tag.green { background: var(--green); color: var(--cream); }
.tiny-tag.grape { background: var(--grape); color: var(--cream); }

@media (min-width: 760px) {
  .tb-home span { display: inline; }
  #topbar { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 380px) {
  .menu-mini .btn { font-size: 9px; letter-spacing: 0.02em; }
  .bay .sign b { font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ================= BAGGING ================= */
.bag-shell {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, #efe6d2 0%, #e8dec9 100%);
}
.bag-belt {
  position: relative;
  flex: 0 0 auto;
  height: clamp(92px, 17vh, 128px);
  margin-top: 64px;
  background: #8fa3b2;
  border-top: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  overflow: hidden;
}
.bag-belt::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 42%;
  height: 34%;
  background: repeating-linear-gradient(90deg, #6f8494 0 22px, #7e93a2 22px 44px);
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  opacity: 0.85;
}
.bag-belt-inner {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.belt-item {
  position: absolute;
  top: 50%;
  width: clamp(52px, 8vw, 78px);
  height: clamp(62px, 10vw, 92px);
  display: grid;
  place-items: center;
  padding: 0;
  background: none;
  touch-action: none;
  transition: left 0.25s ease;
}
.belt-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(2px 4px 0 rgba(42, 38, 34, 0.22));
  pointer-events: none;
}
.belt-item.front { width: clamp(64px, 10vw, 96px); height: clamp(78px, 12vw, 114px); }
.belt-item.front img { filter: drop-shadow(3px 5px 0 rgba(42, 38, 34, 0.28)); }
.belt-item.holding { opacity: 0.25; }
.belt-tag {
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  background: var(--cream);
  border: 2px solid var(--ink);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0 4px;
  white-space: nowrap;
  z-index: 2;
}
.belt-tag.warn { background: var(--red); color: var(--cream); }
.belt-pick {
  display: none;
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  background: var(--mustard);
  border: 2px solid var(--ink);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 1px 5px;
  white-space: nowrap;
}
@media (min-width: 700px) {
  .belt-pick { display: block; }
}
.belt-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--display);
  font-size: 14px;
  color: rgba(42, 38, 34, 0.4);
  letter-spacing: 0.08em;
}
.bag-rack {
  flex: 1;
  min-height: 0;
  padding-bottom: 26px;
  align-content: start;
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), var(--bag-w, 220px));
  grid-auto-rows: var(--bag-h, 300px);
  gap: var(--bag-gap, 10px);
  justify-content: center;
  align-content: start;
  padding: 8px 8px 90px;
  overflow: hidden;
}
.bag-rack.wide { align-content: center; padding-bottom: 24px; }
.bag-rack:not(.wide) .bag:nth-child(3) { grid-column: 1 / -1; justify-self: center; }
.bag {
  position: relative;
  width: var(--bag-w, 220px);
  height: var(--bag-h, 300px);
  transition: transform 0.25s ease;
}
.bag-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
}
.bag-panel {
  position: absolute;
  left: 13%;
  right: 13%;
  top: 14%;
  bottom: 16%;
  background: rgba(244, 232, 208, 0.94);
  border: 2px dashed rgba(42, 38, 34, 0.45);
  overflow: hidden;
  z-index: 2;
  touch-action: none;
}
.packed {
  position: absolute;
  transform-origin: center center;
  z-index: 3;
}
.packed img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(1px 2px 0 rgba(42, 38, 34, 0.16));
  pointer-events: none;
}
.bag-weight {
  position: absolute;
  top: 1%;
  right: 5%;
  z-index: 7;
  background: var(--red);
  color: var(--cream);
  font-family: var(--num);
  font-size: 12px;
  font-weight: 700;
  padding: 0 4px;
  border: 2px solid var(--ink);
  opacity: 0;
  transition: opacity 0.15s;
}
.bag-weight.show { opacity: 1; }
.bag-weight.over { background: var(--ink); color: var(--cream); }
.bag-status {
  position: absolute;
  top: 2%;
  left: 5%;
  z-index: 7;
  background: var(--cream);
  border: 2px solid var(--ink);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0 4px;
}
.bag-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -12px;
  z-index: 8;
  text-align: center;
}
.seal-btn {
  background: var(--mustard);
  border: 2.5px solid var(--ink);
  box-shadow: 2px 2px 0 rgba(42, 38, 34, 0.18);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  text-transform: uppercase;
}
.seal-btn:disabled { background: var(--paper); color: rgba(42, 38, 34, 0.45); box-shadow: none; }
.bag-seal-plate {
  position: absolute;
  left: -4%;
  right: -4%;
  top: 38%;
  z-index: 6;
  background: var(--mustard);
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  text-align: center;
  font-family: var(--display);
  font-size: clamp(13px, 1.7vw, 22px);
  letter-spacing: 0.05em;
  padding: 3px 0;
  transform: rotate(-5deg);
  box-shadow: 2px 3px 0 rgba(42, 38, 34, 0.16);
}
.bag.perfect .bag-img { filter: drop-shadow(0 0 0 var(--mustard)); }
.bag.perfect { animation: bagpop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes bagpop {
  0% { transform: scale(1); }
  40% { transform: scale(1.05) rotate(-1deg); }
  100% { transform: scale(1); }
}
.bag.overloaded .bag-img { transform: scale(1.04, 0.96) rotate(1.5deg); }
.bag.sealed .bag-panel { border-style: solid; border-color: rgba(42, 38, 34, 0.25); }
.bag-callout {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-6deg);
  background: var(--red);
  color: var(--cream);
  border: 3px solid var(--ink);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  z-index: 9;
  white-space: nowrap;
  box-shadow: 2px 2px 0 rgba(42, 38, 34, 0.2);
}
.bag-tagstrip { display: none; }
.drag-ghost {
  position: fixed;
  z-index: 80;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.drag-ghost img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(3px 5px 0 rgba(42, 38, 34, 0.25)); }
.drag-ghost.good { outline: 3px solid rgba(62, 142, 79, 0.85); outline-offset: 2px; }
.drag-ghost.bad { outline: 3px solid rgba(226, 59, 46, 0.9); outline-offset: 2px; }
.drag-ghost .rotate-tip {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--cream);
  font-size: 7px;
  font-weight: 800;
  padding: 0 3px;
}
.bag-hud { position: absolute; inset: 0; pointer-events: none; z-index: 12; }
.bag-hud .hud-left, .bag-hud .hud-center, .bag-hud .hud-right { position: absolute; }
.bag-hud .hud-left { left: 8px; top: 8px; }
.bag-hud .hud-center { left: 50%; top: 8px; transform: translateX(-50%); }
.bag-hud .hud-right { right: 8px; top: 8px; }
.bag-hud .hud-left, .bag-hud .hud-center, .bag-hud .hud-right { display: flex; flex-direction: column; gap: 5px; }
.bag-actions { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.bag-pause { position: absolute; right: 8px; top: 8px; z-index: 14; }
.bag-hud .hud-plate { padding: 3px 6px; }
.bag-hud .hud-plate .v { font-size: 19px; }
.bag-hud .hud-plate.big .v { font-size: 24px; }

/* ================= NOTICES / CARDS ================= */
.notice-layer {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 10px;
  pointer-events: none;
}
.notice-layer:empty { display: none; }
.notice-card {
  position: relative;
  width: min(440px, 96%);
  max-height: 92%;
  overflow-y: auto;
  background: var(--cream-2);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-big);
  padding: 12px;
  pointer-events: auto;
  background-image: repeating-linear-gradient(180deg, transparent 0 25px, rgba(42, 38, 34, 0.06) 25px 26px);
  animation: modalin 0.22s cubic-bezier(0.2, 1.2, 0.4, 1);
}
.notice-kicker {
  display: inline-block;
  background: var(--mustard);
  border: 2px solid var(--ink);
  padding: 1px 6px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  transform: rotate(-2deg);
}
.notice-card h3 { font-family: var(--display); font-size: 21px; line-height: 1; margin: 6px 0 3px; }
.notice-card p { font-size: 12px; line-height: 1.4; margin-bottom: 8px; }
.notice-card .decision-q { font-weight: 800; text-transform: uppercase; font-size: 10px; letter-spacing: 0.06em; }
.notice-opts { display: flex; flex-direction: column; gap: 5px; }
.produce-plate {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2.5px dashed rgba(42, 38, 34, 0.5);
  background: var(--cream);
  padding: 5px 8px;
  margin-bottom: 6px;
}
.produce-plate img { height: 64px; width: auto; }
.produce-weight { display: flex; align-items: baseline; gap: 3px; }
.produce-weight b { font-size: 32px; }
.produce-weight span { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; }
.keypad-code {
  font-family: var(--num);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-align: center;
  border: 3px dashed var(--ink);
  background: var(--cream);
  padding: 2px;
  margin: 4px 0;
}
.keypad-display {
  font-family: var(--num);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
  background: #d8e6d0;
  border: 3px solid var(--ink);
  margin: 6px 0;
  padding: 1px 0;
}
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.key-btn {
  border: 2.5px solid var(--ink);
  background: var(--cream);
  font-family: var(--num);
  font-size: 18px;
  font-weight: 700;
  min-height: 42px;
  box-shadow: 2px 2px 0 rgba(42, 38, 34, 0.16);
}
.key-btn:active { transform: translate(1px, 1px); box-shadow: none; }
.manage-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(42, 38, 34, 0.52);
  backdrop-filter: blur(2px);
}
.manage-overlay .notice-card { max-height: 92dvh; }

/* ================= SPRINT ================= */
.list-card {
  width: min(230px, 47vw);
  background: rgba(255, 249, 236, 0.96);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(42, 38, 34, 0.22);
  padding: 5px 6px;
}
.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 2px;
}
.list-head b { font-family: var(--num); font-size: 13px; }
.list-rows { display: flex; flex-direction: column; margin-top: 2px; }
.list-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 2px 0;
  border-bottom: 1px dotted rgba(42, 38, 34, 0.28);
}
.list-row .tick {
  width: 12px; height: 12px;
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  font-size: 9px;
  background: var(--cream);
  flex: 0 0 auto;
}
.list-row.done { opacity: 0.62; }
.list-row.done .lbl { text-decoration: line-through; }
.list-row.done .tick { background: var(--green); color: var(--cream); }
.list-row .lbl { flex: 1; }
.list-row .cold-tag { font-size: 6px; border: 1.5px solid var(--blue); color: var(--blue); padding: 0 2px; }
.list-row .sub-tag { font-size: 6px; background: var(--grape); color: var(--cream); padding: 0 2px; }
.sat-dots { display: flex; gap: 3px; }
.sat-dots i {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--ink);
}
.sat-dots i.on { background: var(--green); }
.sat-dots i.on.low { background: var(--red); }

/* ================= MANAGEMENT ================= */
.manage-clock { display: flex; flex-direction: column; line-height: 1; }
.manage-clock .target { font-size: 7px; letter-spacing: 0.08em; }
.stab-num { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.stab-num b { font-family: var(--num); font-size: 24px; font-weight: 700; }
.stab-num span { font-size: 6.5px; font-weight: 800; letter-spacing: 0.08em; }
.stab-num.warn b { color: var(--red); }
.manage-score { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.manage-score b { font-family: var(--num); font-size: 22px; font-weight: 700; }
.manage-score span { font-size: 6.5px; font-weight: 800; letter-spacing: 0.08em; }
.mgr-grade { display: flex; flex-direction: column; align-items: flex-end; background: var(--red); color: var(--cream); border: 2.5px solid var(--ink); padding: 2px 6px; line-height: 1; }
.mgr-grade span { font-size: 7px; font-weight: 800; letter-spacing: 0.08em; opacity: 0.9; }
.mgr-grade b { font-size: 20px; }
.manage-left, .manage-right { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.manage-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 2px;
}
.manage-h b { font-family: var(--num); font-size: 14px; }
.incident-who { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: min(170px, 44vw); }
.who-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  border: 2px solid var(--ink);
  background: var(--cream);
  font-size: 7.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 3px 4px;
  box-shadow: 2px 2px 0 rgba(42, 38, 34, 0.12);
  min-height: 30px;
}
.who-btn b { font-family: var(--num); font-size: 12px; }
.who-btn.me { background: var(--blue); color: var(--cream); grid-column: 1 / -1; }
.who-btn.off { opacity: 0.32; }
.who-btn:active { transform: translate(1px, 1px); box-shadow: none; }
.incident { flex-wrap: wrap; }
.incident .grow { min-width: 120px; }
.incident-progress { height: 8px; border: 2px solid var(--ink); background: var(--cream); margin-top: 3px; }
.incident-progress i { display: block; height: 100%; width: 0; background: var(--mustard); }
.incident-worker { font-size: 8px; font-weight: 700; color: var(--ink-soft); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.04em; }
.staff-card {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 2.5px solid var(--ink);
  background: var(--cream-2);
  padding: 5px 6px;
  transition: background 0.2s, opacity 0.2s;
}
.staff-card img { width: 38px; height: 62px; object-fit: contain; object-position: bottom; flex: 0 0 auto; }
.staff-info { flex: 1; min-width: 0; }
.staff-info b { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.03em; line-height: 1.05; }
.staff-info small { font-size: 7.5px; font-weight: 800; letter-spacing: 0.06em; color: var(--ink-soft); }
.staff-skills { display: flex; flex-wrap: wrap; gap: 3px; margin: 3px 0; }
.staff-skills span {
  font-size: 7px;
  font-weight: 700;
  border: 1.5px solid rgba(42, 38, 34, 0.3);
  padding: 0 3px;
  color: var(--ink-soft);
}
.staff-skills span.hi { background: var(--mustard); border-color: var(--ink); color: var(--ink); }
.staff-card.busy { background: #f1e7d2; }
.staff-card.sick { opacity: 0.62; filter: grayscale(0.5); }
.manage-log-card { background: var(--cream-2); border: 2.5px solid var(--ink); padding: 6px; }
.manage-tip, .manage-note { font-size: 10px; line-height: 1.4; border: 2px dashed rgba(42, 38, 34, 0.35); padding: 6px; background: var(--paper); }
.quick-card .quick-bar { position: relative; height: 26px; border: 3px solid var(--ink); background: var(--cream); margin: 8px 0; }
.quick-zone { position: absolute; top: 0; bottom: 0; background: var(--green); opacity: 0.8; }
.quick-needle { position: absolute; top: -5px; bottom: -5px; width: 4px; background: var(--red); border: 1px solid var(--ink); }

/* ================= MISC ================= */
.row-icon { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto; }
.row-icon svg { display: block; }
.badge.cash-badge { background: transparent; }
.badge.cash-badge svg { width: 100%; height: 100%; }
.closed-list { display: flex; flex-direction: column; gap: 5px; }
.closed-row { display: flex; align-items: center; gap: 8px; border: 2px solid var(--ink); background: var(--cream); padding: 4px 6px; }
.closed-row .badge, .closed-row .badge img { width: 34px; height: 34px; }
.closed-row b { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; display: block; }
.closed-row small { font-size: 9px; color: var(--ink-soft); }
.career-modal .gauge-wrap { max-width: 190px; }
.career-modal .btn-ghost { width: 100%; }

@media (max-width: 999px) {
  .bay.closed { display: none; }
  .bay[data-dept="cart"] { left: 43% !important; top: 56% !important; }
  .bay[data-dept="bag"] { left: 30% !important; top: 72% !important; }
  .bay[data-dept="cash"] { left: 54% !important; top: 70% !important; }
  .bay[data-dept="sprint"] { left: 64% !important; top: 52% !important; }
  .bay[data-dept="office"] { left: 70% !important; top: 28% !important; }
  .job-ticket { width: min(180px, 44%); padding: 4px 6px; }
  .job-ticket b { font-size: 11px; }
  .job-ticket p { display: none; }
  .job-ticket .avg { font-size: 16px; }
  .map-img { object-position: center 46%; }
}
@media (max-width: 1100px) {
  .menu-deco { display: none; }
}
@media (max-width: 700px) {
  .job-ticket { display: none; }
  .map-hud { flex-wrap: wrap; overflow-x: visible; }
  .map-hud .spacer { display: none; }
  .map-hud .chip { font-size: 8px; padding: 3px 6px; }
  .list-card { width: min(186px, 50vw); }
  .list-row { font-size: 7.5px; }
  .manage-body { padding: 7px; gap: 7px; }
  .manage-top { gap: 6px; padding: 5px 7px; }
  .manage-top .clock { font-size: 20px; }
  .staff-list { display: grid; grid-template-columns: 1fr; }
  .incident img { width: 34px; height: 34px; }
  .incident .nm { font-size: 12px; }
  .incident small { font-size: 8.5px; }
  .incident-who { width: 100%; grid-template-columns: repeat(4, 1fr); }
  .who-btn { flex-direction: column; align-items: center; gap: 0; min-height: 34px; }
  .who-btn.me { grid-column: auto; }
  .bag-belt { margin-top: 66px; height: clamp(86px, 15vh, 110px); }
  .bag-rack { padding: 6px 6px 12px; }
  .bag-hud .hud-plate .v { font-size: 17px; }
  .bag-hud .hud-plate.big .v { font-size: 20px; }
}
@media (max-height: 640px) {
  .bag-belt { margin-top: 54px; height: 82px; }
  .menu-groceries { display: none; }
}
@media (max-width: 390px) {
  .manage-top { gap: 5px; }
  .manage-top .clock { font-size: 18px; }
  .stability-bar { min-width: 74px; }
}
.victory-scene .boss-wrap { position: absolute; left: 50%; bottom: 0; height: 92%; aspect-ratio: 224 / 408; transform: translateX(-50%); }
.victory-scene .boss-wrap .boss { position: static; height: 100%; width: 100%; object-fit: contain; transform: none; left: auto; }
.victory-scene .boss-wrap .apron {
  position: absolute;
  left: 24%;
  top: 35%;
  width: 52%;
  height: 44%;
  background: #1f6fb2;
  border: 2px solid var(--ink);
  clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.12);
}
.victory-scene .key { position: absolute; left: 8%; bottom: 16%; height: 34%; width: auto; transform: rotate(-10deg); filter: drop-shadow(2px 3px 0 rgba(42,38,34,.2)); }
.victory-tag { position: absolute; background: var(--mustard); border: 2px solid var(--ink); font-size: 7px; font-weight: 800; letter-spacing: 0.1em; padding: 1px 4px; text-transform: uppercase; }
.victory-scene .key-tag { left: 8%; bottom: 8%; transform: rotate(-4deg); }
.victory-scene .uni-tag { right: 8%; bottom: 12%; background: var(--blue); color: var(--cream); transform: rotate(3deg); }
@media (max-height: 760px) {
  .titlelock { width: min(400px, 70vw, 44vh); }
  .menu-list { gap: 6px; }
  .menu-list .btn-lg { padding: 10px 13px; font-size: clamp(14px, 1.9vw, 17px); }
  .menu-mini .btn { min-height: 52px; }
  .menu-center { gap: 6px; }
}
.badge {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
}
.badge img { width: 100%; height: 100%; object-fit: contain; }
.modal-head .badge { width: 62px; height: 62px; }
.result-title .badge { width: 44px; height: 44px; }
.arcade-card .badge { width: 52px; height: 52px; }

.portrait-wrap { position: relative; width: 58px; height: 96px; flex: 0 0 auto; }
.portrait-wrap img { height: 100%; width: 100%; object-fit: contain; object-position: bottom; }
.portrait-wrap .gold-stripe {
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 33%;
  height: 4px;
  background: var(--mustard);
  border: 1.5px solid var(--ink);
  transform: rotate(-2deg);
  box-shadow: 1px 1px 0 rgba(42, 38, 34, 0.2);
}
.victory-scene .lamp { position: absolute; right: 26%; bottom: 46%; width: 18%; height: auto; opacity: 0.9; }
.victory-scene .office-tag { right: 5%; bottom: 3%; background: var(--ink); color: var(--cream); }
.bay .stall {
  width: auto;
  max-width: 140%;
  height: clamp(46px, 5.8vw, 68px);
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(2px 4px 0 rgba(42, 38, 34, 0.22));
  user-select: none;
  -webkit-user-drag: none;
}
.bay .stall + .sign { margin-top: -2px; }
.bay.bay-ready .stall { animation: stallpulse 1.8s ease-in-out infinite; }
@keyframes stallpulse {
  0%, 100% { filter: drop-shadow(2px 4px 0 rgba(42, 38, 34, 0.22)); }
  50% { filter: drop-shadow(0 0 0 3px rgba(242, 176, 43, 0.7)) drop-shadow(2px 4px 0 rgba(42, 38, 34, 0.22)); }
}
.bay.office .badge.office-plate {
  border-radius: 8px;
  background: var(--blue);
  border: 3px solid var(--ink);
  color: var(--cream);
  display: grid;
  place-items: center;
  width: clamp(44px, 6.2vw, 76px);
  height: clamp(40px, 5.4vw, 62px);
  box-shadow: 2px 4px 0 rgba(42, 38, 34, 0.2);
}
.modal-head .stall-thumb { width: 104px; height: 88px; object-fit: contain; object-position: bottom; flex: 0 0 auto; }
.arcade-card .stall-thumb { width: 68px; height: 58px; object-fit: contain; object-position: bottom; flex: 0 0 auto; }
@media (max-width: 700px) {
  .modal-head .stall-thumb { width: 82px; height: 70px; }
  .arcade-card .stall-thumb { width: 58px; height: 52px; }
}
.incident img { object-fit: contain; width: 44px; height: 38px; }

.bag-wall {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: clamp(150px, 27vh, 240px);
  background: url("../assets/bagging_wall.webp") center top / cover no-repeat;
  z-index: 0;
  pointer-events: none;
}
.bag-wall::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(251, 243, 226, 0.03) 0%, rgba(251, 243, 226, 0) 52%, rgba(251, 243, 226, 0.94) 100%);
}
.bag-shell > .bag-belt, .bag-shell > .bag-rack { position: relative; z-index: 2; }
.bag-shell > .bag-hud { z-index: 12; }
.bag-shell > .bag-ghost-layer { position: relative; z-index: 14; }
@media (max-width: 700px) {
  .bay .stall { height: 52px; }
}
.bag-wall {
  inset: 0;
  height: auto;
  background: url("../assets/bagging_scene.webp") center 22% / cover no-repeat;
  opacity: 0.95;
  z-index: 0;
}
.bag-wall::after {
  background: linear-gradient(180deg, rgba(251, 243, 226, 0.52) 0%, rgba(251, 243, 226, 0.3) 36%, rgba(251, 243, 226, 0.9) 100%);
}
.bag-belt {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0 8px, transparent 8px calc(100% - 8px), rgba(0, 0, 0, 0.16) calc(100% - 8px) 100%),
    repeating-linear-gradient(90deg, #6f8494 0 22px, #7d93a3 22px 44px);
  box-shadow: inset 0 6px 0 rgba(0, 0, 0, 0.16), 0 4px 0 rgba(42, 38, 34, 0.18);
}
.bag-belt::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 6px;
  background: var(--mustard);
  border-bottom: 2px solid var(--ink);
  z-index: 3;
}
.bag-belt::after {
  top: 38%;
  height: 26%;
  background: repeating-linear-gradient(90deg, #596d7d 0 18px, #6a8091 18px 36px);
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  opacity: 0.9;
}
.bag-img {
  filter: drop-shadow(3px 6px 0 rgba(42, 38, 34, 0.18));
}
.bag-panel {
  background: linear-gradient(180deg, #e9d9b9 0%, #f4e7cd 22%, #f6ebd5 100%);
  border: 2px solid rgba(42, 38, 34, 0.55);
  border-top: 0;
  box-shadow: inset 0 9px 12px rgba(42, 38, 34, 0.2), inset 0 -3px 0 rgba(255, 255, 255, 0.42);
  border-radius: 1px 1px 4px 4px;
}
.bag-panel::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 9px;
  background: rgba(42, 38, 34, 0.16);
  border-bottom: 2px solid rgba(42, 38, 34, 0.35);
}
.bag-brand {
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 7.5%;
  z-index: 4;
  text-align: center;
  font-family: var(--display);
  font-size: clamp(9px, 1.55vw, 15px);
  letter-spacing: 0.08em;
  color: var(--red);
  text-shadow: 1px 1px 0 rgba(251, 243, 226, 0.7);
  pointer-events: none;
}
.bag-brand::before, .bag-brand::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2px;
  background: currentColor;
  opacity: 0.55;
}
.bag-brand::before { top: -3px; }
.bag-brand::after { bottom: -3px; }
.cash-hud-bottom { bottom: calc(var(--lane-h, 0px) + 8px); }
.cash-hint {
  top: 142px;
  bottom: auto;
  max-width: 94%;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
}
.coach-card {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 249, 236, 0.97);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-big);
  padding: 8px 10px;
  max-height: 132px;
  animation: modalin 0.25s ease;
}
.coach-art { width: 46px; height: 54px; object-fit: contain; object-position: bottom; flex: 0 0 auto; }
.coach-copy { flex: 1; min-width: 0; }
.coach-kicker { font-size: 7px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--red); }
.coach-copy b { display: block; font-family: var(--display); font-size: 13px; line-height: 1.05; }
.coach-copy p { font-size: 10px; line-height: 1.3; margin-top: 1px; }
.coach-dots { display: flex; gap: 3px; margin-top: 3px; }
.coach-dots i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--cream); }
.coach-dots i.on { background: var(--red); }
.coach-actions { display: flex; flex-direction: column; gap: 4px; flex: 0 0 auto; }
.coach-next { border: 2.5px solid var(--ink); background: var(--red); color: var(--cream); font-size: 9px; font-weight: 800; letter-spacing: 0.06em; padding: 6px 9px; text-transform: uppercase; box-shadow: 2px 2px 0 rgba(42, 38, 34, 0.2); }
.coach-skip { border: 2px solid var(--ink); background: var(--cream); font-size: 8px; font-weight: 800; padding: 3px 9px; text-transform: uppercase; }
@media (max-width: 420px) {
  .coach-card { max-height: 118px; padding: 6px 8px; gap: 6px; }
  .coach-art { width: 36px; height: 44px; }
  .coach-copy b { font-size: 11px; }
  .coach-copy p { font-size: 9px; }
}
.bay .sign { position: relative; }
.bay .bay-play {
  position: absolute;
  right: -4px;
  bottom: -7px;
  background: var(--red);
  color: var(--cream);
  border: 2px solid var(--ink);
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  padding: 1px 3px;
  transform: rotate(3deg);
  box-shadow: 1px 1px 0 rgba(42,38,34,.2);
}
.map-tap-hint {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%) rotate(-1deg);
  z-index: 6;
  background: var(--mustard);
  border: 2.5px solid var(--ink);
  padding: 3px 8px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  white-space: nowrap;
  box-shadow: 2px 2px 0 rgba(42,38,34,.2);
  pointer-events: none;
}
@media (max-width: 700px) {
  .map-tap-hint { font-size: 7px; top: 4px; }
}
.modal .modal-actions {
  position: sticky;
  bottom: -14px;
  z-index: 4;
  background: var(--cream-2);
  padding: 8px 0 4px;
  margin-top: 8px;
  border-top: 2px dashed rgba(42, 38, 34, 0.28);
}
.dept-scene {
  position: relative;
  width: 132px;
  height: 96px;
  flex: 0 0 auto;
  overflow: hidden;
  background: #e8dfcc;
  border: 3px solid var(--ink);
  box-shadow: 2px 2px 0 rgba(42,38,34,.18);
}
.dept-scene img { position: absolute; object-fit: contain; pointer-events: none; }
.dept-scene .ds-ground { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dept-scene .ds-car { left: 2px; bottom: 34px; width: 56px; }
.dept-scene .ds-corral { right: -4px; bottom: 4px; width: 76px; }
.dept-scene .ds-player { left: 48px; bottom: 6px; height: 56px; width: auto; }
.dept-scene .ds-shopper { right: 74px; bottom: 12px; height: 46px; width: auto; }
@media (max-height: 560px) and (orientation: landscape) {
  #modal-root .modal { width: min(760px, 96vw); max-height: 94dvh; padding: 10px; }
  .modal .modal-head .stall-thumb, .modal .dept-scene { width: 96px; height: 72px; }
  .modal .modal-blurb { font-size: 12px; margin: 4px 0; }
  .modal .modal-stats { margin: 6px 0; }
  .modal .modal-notes { margin: 4px 0; }
  .modal .modal-actions { bottom: -10px; padding-top: 6px; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .modal .modal-note { padding: 8px 10px; line-height: 1.55; margin: 5px 0; font-size: 11px; }
}
.bag-controls {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 20;
  display: flex;
  gap: 6px;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.bag-controls > * { pointer-events: auto; }
.bag-move { display: flex; gap: 6px; }
.bag-pad { min-width: 54px; }
.bag-controls .action-btn { min-height: 56px; padding: 5px 8px; }
.bag-controls .action-btn span { font-size: 15px; }
.bag-controls .action-btn small { font-size: 8.5px; }
.bag-hint { bottom: 76px; font-size: 9.5px; }
.bag-rack { padding-bottom: 150px; }
.bag-rack.wide { padding-bottom: 122px; }
.falling {
  position: absolute;
  z-index: 7;
  pointer-events: none;
  filter: drop-shadow(2px 4px 0 rgba(42, 38, 34, 0.24));
}
.falling img { width: 100%; height: 100%; object-fit: contain; }
.falling::after {
  content: "";
  position: absolute;
  inset: -2px;
  border: 2px dashed rgba(42, 38, 34, 0.45);
  pointer-events: none;
}
.bag.active .bag-panel {
  outline: 3px solid var(--mustard);
  outline-offset: 3px;
  box-shadow: inset 0 9px 12px rgba(42, 38, 34, 0.2), 0 0 0 3px rgba(242,176,43,.25);
}
.bag.active .bag-status { background: var(--mustard); color: var(--ink); }
@media (max-width: 700px) {
  .bag-controls { gap: 5px; }
  .bag-controls .action-btn { min-height: 58px; padding: 4px 6px; }
  .bag-controls .action-btn span { font-size: 14px; }
  .bag-pad { min-width: 50px; }
  .bag-hint { bottom: 78px; font-size: 8.5px; max-width: calc(100% - 24px); }
}
/* readability: larger, heavier labels at phone size */
.btn { font-size: 17px; font-weight: 900; letter-spacing: 0.045em; }
.btn-sm { font-size: 14px; }
.btn .txt small { font-size: 11.5px; font-weight: 700; }
.btn .ico { width: 38px; height: 38px; }
.icon-btn { width: 38px; height: 38px; }
.icon-btn svg { width: 20px; height: 20px; }
.hud-plate { padding: 5px 9px; }
.hud-plate .k { font-size: 9.5px; letter-spacing: 0.09em; }
.hud-plate .v { font-size: 25px; }
.hud-plate.big .v { font-size: 34px; }
.timer-plate .v { font-size: 32px; }
.map-hud .chip { font-size: 10px; padding: 5px 9px; }
.map-hud .chip b { font-size: 18px; }
.tb-rank { font-size: 11px; }
.bay .sign { padding: 4px 5px 5px; }
.bay .sign b { font-size: clamp(9.5px, 1.25vw, 14px); font-weight: 900; }
.bay .sign .rt { font-size: clamp(12px, 1.55vw, 17px); }
.bay .sign .rt em { font-size: 8px; }
.bay .bay-play { font-size: 7.5px; padding: 1px 4px; }
.map-tap-hint { font-size: 9px; padding: 4px 9px; }
.modal-head h3 { font-size: 27px; }
.modal-head .sub { font-size: 11px; }
.modal-blurb { font-size: 14.5px; line-height: 1.5; }
.modal-note { font-size: 12.5px; line-height: 1.6; }
.modal-stats .stat b { font-size: 27px; }
.modal-stats .stat span { font-size: 9.5px; letter-spacing: 0.09em; }
.label { font-size: 11px; }
.small { font-size: 11.5px; }
.dept-row { font-size: 11px; grid-template-columns: 22px 1fr 44px; }
.dept-row .val { font-size: 17px; }
.receipt-line { font-size: 11px; }
.receipt-line .v { font-size: 15px; }
.career-panel h3 { font-size: 18px; }
.career-panel .panel-sub { font-size: 11px; }
.gauge-readout { font-size: 38px; }
.gauge-readout small { font-size: 12px; }
.action-btn { font-size: 14px; font-weight: 900; }
.action-btn small { font-size: 9.5px; }
.seal-btn { font-size: 10px; }
.bag-status { font-size: 8.5px; }
.bag-weight { font-size: 13px; }
.bag-callout { font-size: 10.5px; }
.belt-tag { font-size: 9px; }
.bag-hint { font-size: 10px; }
.bag-controls .action-btn span { font-size: 14px; font-weight: 900; }
.bag-controls .action-btn small { font-size: 9px; }
.coach-copy b { font-size: 15px; }
.coach-copy p { font-size: 11px; }
.coach-next { font-size: 10.5px; }
.coach-skip { font-size: 9.5px; }
.key-btn { font-size: 20px; }
.notice-card h3 { font-size: 23px; }
.notice-card p { font-size: 13px; }
.arcade-card b { font-size: 17px; }
.arcade-card small { font-size: 11px; }
.arcade-card .best { font-size: 20px; }
.rival-card .nm { font-size: 17px; }
.rival-card .tagline { font-size: 10px; }
.rival-card .ratings { font-size: 10px; }
.rival-card .ratings b { font-size: 13px; }
.menu-mini .btn { font-size: 12px; }
.menu-save { font-size: 11px; }
.menu-save b { font-size: 16px; }
.job-ticket b { font-size: 15px; }
.job-ticket .avg { font-size: 22px; }
.job-ticket p { font-size: 10.5px; }
.screen-head .sub { font-size: 11.5px; }
.result-head .rk { font-size: 23px; }
.result-head .sub { font-size: 10px; }
.rline { font-size: 12px; }
.rline .v { font-size: 19px; }
.rtotal .v { font-size: 50px; }
.verdict .stamp { font-size: 22px; }
.setting-row b { font-size: 13px; }
.setting-row small { font-size: 11px; }
.bag-belt { margin-top: 104px; }
@media (max-width: 700px) {
  .bag-belt { margin-top: 104px; }
  .bay .sign b { font-size: 9.5px; }
  .bay .sign .rt { font-size: 13px; }
  .map-hud .chip { font-size: 10px; padding: 4px 7px; }
  .map-hud .chip b { font-size: 17px; }
  .btn { font-size: 16px; }
  .btn-sm { font-size: 13px; }
  .hud-plate .k { font-size: 9.5px; }
  .hud-plate .v { font-size: 24px; }
}
@media (max-height: 640px) {
  .bag-belt { margin-top: 98px; height: 76px; }
  .bag-hint { bottom: 74px; }
}

/* ===== fresh pass: layout fixes + phone HUD / map ------------- */
/* the cashier hint shared the coaching rule and stretched over the play field */
.hud .hint-cash, .coach-hint { bottom: auto; }
.bag-hint.cash-hint {
  top: 128px;
  bottom: auto;
  width: auto;
  height: auto;
  max-width: min(92%, 420px);
  padding: 4px 10px;
  line-height: 1.2;
  z-index: 11;
}

/* phone HUD: keep every number on screen and big */
@media (max-width: 700px) {
  .hud-top { padding: 6px; gap: 5px; }
  .hud-bottom { padding: 6px 6px 8px; gap: 5px; flex-wrap: wrap; }
  .hud-left .hud-plate, .hud-right .hud-plate { padding: 3px 6px; }
  .hud-plate { border-width: 2.5px; box-shadow: 2px 2px 0 rgba(42,38,34,.25); }
  .hud-plate .k { font-size: 7.5px; letter-spacing: .06em; }
  .hud-plate .v, .hud-plate.big .v { font-size: 19px; }
  .timer-plate { min-width: 64px; padding: 3px 5px; }
  .timer-plate .v { font-size: 19px; }
  .cart-pips { max-width: 104px; gap: 1px; }
  .cart-pips img { width: 13px; height: 15px; }
  .hud-bottom .hud-plate { padding: 3px 6px; }
  .hud-bottom .hud-plate .k { font-size: 7px; letter-spacing: .03em; }
  .hud-bottom .grow { display: none; }
}

/* phone store map: the art stays as a header, the bays become big cards */
@media (max-width: 700px) {
  #scr-map .map-main { display: flex; flex-direction: column; }
  #scr-map .map-canvas {
    position: relative;
    inset: auto;
    flex: 0 0 30%;
    min-height: 158px;
  }
  #scr-map .map-img { object-position: center 42%; }
  #scr-map .map-bays, #scr-map .walkers { display: none; }
  #scr-map .map-shade { background: linear-gradient(180deg, rgba(42,38,34,0) 55%, rgba(42,38,34,.22) 100%); }
  #map-mobile {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
    background: #fbf3e4;
    border-top: 3px solid var(--ink);
    align-content: start;
    -webkit-overflow-scrolling: touch;
  }
  #map-mobile .mm-bay {
    position: relative;
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 76px;
    padding: 6px 8px;
    text-align: left;
    background: var(--cream-2);
    border: 3px solid var(--ink);
    box-shadow: 3px 3px 0 rgba(42,38,34,.2);
    font: inherit;
    color: var(--ink);
    cursor: pointer;
    overflow: hidden;
  }
  #map-mobile .mm-bay:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(42,38,34,.2); }
  #map-mobile .mm-bay img { width: 52px; height: 46px; object-fit: contain; object-position: bottom; flex: 0 0 auto; filter: drop-shadow(2px 2px 0 rgba(42,38,34,.18)); }
  #map-mobile .mm-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  #map-mobile .mm-name { font-family: var(--display); font-size: 13px; line-height: 1; white-space: normal; }
  #map-mobile .mm-rate { display: flex; align-items: baseline; gap: 4px; font-family: var(--num); font-weight: 700; font-size: 19px; }
  #map-mobile .mm-rate em { font-style: normal; font-family: var(--text); font-size: 8px; font-weight: 800; letter-spacing: .08em; color: var(--ink-soft); text-transform: uppercase; }
  #map-mobile .mm-play { position: absolute; top: 0; right: 0; background: var(--red); color: var(--cream); border-left: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); font-size: 8px; font-weight: 900; letter-spacing: .08em; padding: 2px 5px; }
  #map-mobile .mm-bay.office { grid-column: 1 / -1; background: var(--blue); color: var(--cream); min-height: 62px; }
  #map-mobile .mm-bay.office .mm-rate em { color: rgba(251,243,226,.8); }
  #map-mobile .mm-bay.ready { animation: mmready 1.6s ease-in-out infinite; }
  #map-mobile .mm-bay.closed { filter: grayscale(.65); opacity: .8; }
  #map-mobile .mm-bay.closed .mm-play { background: #7d766c; }
}
@keyframes mmready {
  0%, 100% { box-shadow: 3px 3px 0 rgba(42,38,34,.2); }
  50% { box-shadow: 0 0 0 4px rgba(242,176,43,.75), 3px 3px 0 rgba(42,38,34,.2); }
}
@media (min-width: 701px) { #map-mobile { display: none !important; } }

/* bagging HUD buttons were unreachable: the hud shell eats pointer events */
.bag-hud .bag-pause { pointer-events: auto; }
.bag-hud .hud-right { right: 54px; }
@media (max-width: 700px) {
  .bag-hud .hud-right { right: 50px; }
  .bag-hud .bag-pause { top: 6px; right: 6px; width: 34px; height: 34px; }
}

/* ===== critic pass: readable map bar, illustrated office sheet ===== */
.map-hud .chip.tap-chip {
  background: #f7c34b;
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .09em;
}
.map-hud .chip.stat { gap: 8px; }
.map-hud .chip.nav {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  padding: 7px 12px;
  border-width: 3px;
  box-shadow: 3px 3px 0 rgba(42,38,34,.2);
}
.map-hud .career-nav { background: var(--blue); color: var(--cream); }
.map-hud .arcade-nav { background: var(--green); color: var(--cream); }
.map-hud .closed-nav { background: var(--cream-2); color: var(--ink); }
.map-hud .next-nav { background: var(--red); color: var(--cream); }
.map-hud .next-nav.mustard { background: var(--mustard); color: var(--ink); }
.map-hud .challenge-chip { font-size: 10.5px; font-weight: 900; justify-content: center; }

@media (max-width: 700px) {
  .map-hud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 8px calc(9px + var(--safe-b));
    overflow: visible;
    align-items: stretch;
  }
  .map-hud .tap-chip {
    flex: 1 1 100%;
    justify-content: center;
    min-height: 30px;
    font-size: 12px;
    letter-spacing: .08em;
    border-width: 3px;
  }
  .map-hud .chip.stat {
    flex: 1 1 calc(33.333% - 6px);
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    min-height: 54px;
    padding: 5px 8px 6px;
    border-width: 3px;
    box-shadow: 2px 3px 0 rgba(42,38,34,.2);
  }
  .map-hud .chip.stat span { font-size: 8.5px; font-weight: 900; letter-spacing: .1em; opacity: .92; }
  .map-hud .chip.stat b { font-size: 23px; line-height: 1; }
  .map-hud .chip.nav,
  .map-hud .chip.challenge-chip {
    flex: 1 1 calc(50% - 6px);
    min-height: 46px;
    justify-content: center;
    text-align: center;
    font-size: 13px;
    padding: 8px 5px;
  }
  .map-hud .challenge-chip { flex: 1 1 100%; min-height: 36px; font-size: 11px; }
  .map-hud .spacer { display: none; }
}

/* office sheet */
.modal.office-modal {
  padding: 0;
  overflow: hidden;
  border: 4px solid var(--ink);
  background: #fff4de;
  box-shadow: 7px 9px 0 rgba(42,38,34,.32), 0 0 0 2px rgba(255,244,222,.55) inset;
}
.office-modal .close-x {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 6;
  background: var(--cream);
  border: 2.5px solid var(--ink);
  box-shadow: 2px 2px 0 rgba(42,38,34,.25);
  font-weight: 900;
}
.office-hero {
  position: relative;
  height: 172px;
  overflow: hidden;
  border-bottom: 4px solid var(--ink);
  background: #cfc6b4;
}
.office-hero .office-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 52%;
  filter: saturate(1.04);
}
.office-hero .office-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(31,111,178,.78) 0%, rgba(31,111,178,.18) 48%, rgba(42,38,34,0) 72%),
    linear-gradient(0deg, rgba(42,38,34,.38) 0%, rgba(42,38,34,0) 46%);
}
.office-plate {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 7px 11px 8px;
  background: var(--cream-2);
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(42,38,34,.28);
  transform: rotate(-1deg);
  max-width: 66%;
}
.office-kicker {
  display: block;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .14em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.office-plate h3 {
  font-family: var(--display);
  font-size: clamp(20px, 5.6vw, 27px);
  line-height: .94;
  margin: 1px 0 3px;
}
.office-state {
  display: inline-block;
  background: var(--mustard);
  color: var(--ink);
  border: 2px solid var(--ink);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 2px 6px;
}
.office-state.open { background: var(--green); color: var(--cream); }
.office-boss {
  position: absolute;
  right: 10px;
  bottom: -16px;
  height: 148%;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(3px 4px 0 rgba(42,38,34,.25));
}
.office-boss-tag {
  position: absolute;
  right: 10px;
  top: 12px;
  background: var(--ink);
  color: var(--cream);
  border: 2px solid var(--cream);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
  padding: 2px 6px;
  transform: rotate(2deg);
}
.office-body { padding: 11px 13px 13px; }
.office-memo {
  position: relative;
  background: #fff9ec;
  border: 2.5px dashed rgba(42,38,34,.42);
  padding: 8px 10px 9px;
  margin-bottom: 9px;
}
.office-memo .label { display: block; margin-bottom: 2px; }
.office-memo p { font-size: 13.5px; line-height: 1.45; }
.office-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 9px;
}
.office-stat {
  background: var(--cream-2);
  border: 2.5px solid var(--ink);
  box-shadow: 2px 2px 0 rgba(42,38,34,.16);
  padding: 5px 6px 6px;
  min-width: 0;
}
.office-stat b {
  display: block;
  font-family: var(--num);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.office-stat span {
  display: block;
  margin-top: 3px;
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 1.1;
}
.office-actions { display: flex; flex-direction: column; gap: 7px; }
.office-actions .btn { width: 100%; justify-content: center; }
.office-actions .btn small { display: block; font-size: 10px; font-weight: 700; opacity: .8; letter-spacing: .02em; }
@media (min-width: 701px) {
  .modal.office-modal { width: min(560px, 100%); }
  .office-hero { height: 196px; }
  .office-body { padding: 13px 16px 16px; }
  .office-stat b { font-size: 28px; }
  .office-memo p { font-size: 14px; }
}
@media (max-width: 700px) {
  .modal.office-modal { border-width: 3.5px; }
  .office-hero { height: 150px; }
  .office-boss { height: 136%; right: 2px; }
  .office-plate { left: 9px; bottom: 9px; max-width: 72%; padding: 6px 9px 7px; }
  .office-body { padding: 10px 10px 12px; }
  .office-memo p { font-size: 12.5px; }
  .office-stat b { font-size: 21px; }
}

/* office hero character sits inside the frame, name plate stays readable */
.office-hero .office-boss {
  top: 7px;
  bottom: auto;
  height: 132%;
  z-index: 2;
}
.office-boss-tag {
  z-index: 3;
  right: 9px;
  top: auto;
  bottom: 10px;
  background: var(--ink);
  color: var(--cream);
}
@media (max-width: 700px) {
  .office-boss { height: 126%; top: 5px; bottom: auto; }
  .office-boss-tag { bottom: 8px; right: 8px; }
}

/* let the map art take the spare height on taller phones; the bays keep their size */
@media (max-width: 700px) {
  #scr-map .map-canvas { flex: 1 1 auto; min-height: 120px; }
  #map-mobile { flex: 0 1 auto; min-height: 0; max-height: 100%; overflow-y: auto; }
}

/* small phones: the map and the big bar still fit without clipping */
@media (max-width: 700px) and (max-height: 630px) {
  .map-hud { padding: 6px; gap: 4px; }
  .map-hud .tap-chip { min-height: 26px; font-size: 11px; }
  .map-hud .chip.stat { min-height: 42px; padding: 3px 6px; }
  .map-hud .chip.stat span { font-size: 8px; }
  .map-hud .chip.stat b { font-size: 19px; }
  .map-hud .chip.nav,
  .map-hud .chip.challenge-chip { min-height: 38px; font-size: 11.5px; padding: 5px 4px; }
  #map-mobile { gap: 5px; padding: 6px; }
  #map-mobile .mm-bay { min-height: 58px; padding: 4px 6px; gap: 6px; }
  #map-mobile .mm-bay.office { min-height: 46px; }
  #map-mobile .mm-bay img { width: 42px; height: 36px; }
  #map-mobile .mm-name { font-size: 11.5px; }
  #map-mobile .mm-rate { font-size: 16px; }
  #map-mobile .mm-rate em { font-size: 7.5px; }
  #scr-map .map-canvas { min-height: 92px; }
}

/* tutorial sheet: turn the plain card into a game card */
.modal.tutorial-modal {
  border-width: 4px;
  background:
    radial-gradient(circle at 50% 0%, rgba(242,176,43,.22) 0%, rgba(242,176,43,0) 55%),
    repeating-linear-gradient(0deg, rgba(42,38,34,.025) 0 2px, transparent 2px 7px),
    #fff6e4;
  box-shadow: 7px 9px 0 rgba(42,38,34,.3);
  width: min(480px, 100%);
}
.tut-card { text-align: center; }
.tut-card > .label {
  display: inline-block;
  background: var(--blue);
  color: var(--cream);
  border: 2.5px solid var(--ink);
  box-shadow: 2px 2px 0 rgba(42,38,34,.2);
  padding: 4px 10px;
  transform: rotate(-1deg);
  font-size: 9px;
  letter-spacing: .11em;
  margin-bottom: 9px;
}
.tut-card .tut-art {
  position: relative;
  height: 158px;
  margin: 0 auto 12px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 78%, rgba(255,249,236,.95) 0%, rgba(255,249,236,.2) 48%, rgba(255,249,236,0) 68%),
    repeating-conic-gradient(from 0deg at 50% 58%, rgba(242,176,43,.18) 0deg 12deg, rgba(242,176,43,0) 12deg 24deg),
    linear-gradient(180deg, #f9d98f 0%, #f2b02b 100%);
  border: 3px solid var(--ink);
  box-shadow: inset 0 0 0 4px rgba(255,249,236,.55), 3px 4px 0 rgba(42,38,34,.22);
  overflow: hidden;
}
.tut-card .tut-art img {
  height: 82%;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(3px 5px 0 rgba(42,38,34,.2));
  transform: rotate(-2deg);
}
.tut-card .h-display { font-size: clamp(21px, 5.4vw, 26px) !important; line-height: 1; margin-bottom: 5px; }
.tut-card .modal-blurb { font-size: 14px; line-height: 1.5; margin: 0 2px 7px; }
.tut-card .tut-steps i { width: 11px; height: 11px; }
.tut-card .modal-actions { margin-top: 12px; }
.tut-card .btn-red { font-size: 16px; padding: 12px; }
@media (max-width: 700px) {
  .tut-card .tut-art { height: 136px; }
  .tut-card .tut-art img { height: 80%; }
  .tut-card .modal-blurb { font-size: 13.5px; }
}

/* short phones held sideways: use the illustrated map directly and keep one compact bar */
@media (max-width: 700px) and (max-height: 500px) {
  #scr-map .map-main { display: block; position: relative; flex: 1 1 auto; min-height: 0; }
  #scr-map .map-canvas { position: absolute; inset: 0; height: auto; min-height: 0; flex: none; }
  #map-mobile { display: none !important; }
  #scr-map .map-bays, #scr-map .walkers { display: block; }
  .map-hud {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 5px 7px;
    gap: 5px;
  }
  .map-hud .tap-chip { display: none; }
  .map-hud .chip.stat {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    min-height: 0;
    padding: 3px 7px;
    border-width: 2.5px;
  }
  .map-hud .chip.stat span { font-size: 8px; }
  .map-hud .chip.stat b { font-size: 17px; }
  .map-hud .chip.nav { flex: 0 0 auto; min-height: 32px; font-size: 10px; padding: 5px 9px; }
  .map-hud .challenge-chip { flex: 0 0 auto; min-height: 32px; }
}

/* the bar wraps instead of hiding controls on tablet widths */
@media (min-width: 701px) and (max-width: 1200px) {
  .map-hud { flex-wrap: wrap; overflow-x: visible; row-gap: 5px; }
  .map-hud .spacer { display: none; }
  .map-hud .chip.nav { flex: 0 1 auto; }
}

@media (max-width: 700px) {
  .office-hero .office-boss { right: 26px; }
}

/* short phones held sideways: the title sits beside the choices so nothing clips */
.titlelock { container-type: inline-size; }
.titlelock .ribbon span { font-size: clamp(11px, 5.4cqw, 25px); }

@media (orientation: landscape) and (max-height: 560px) and (max-width: 900px) {
  .menu-stage {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-content: center;
    align-items: center;
    justify-content: center;
    column-gap: 18px;
    row-gap: 8px;
    padding: 8px 16px;
  }
  .menu-center { display: contents; }
  .titlelock {
    grid-column: 1;
    grid-row: 1 / -1;
    width: min(30vw, 240px, 56vh);
    margin: 0;
  }
  .menu-list,
  .menu-mini,
  .menu-save { grid-column: 2; width: min(420px, 56vw); }
  .menu-list { grid-row: 1; margin-top: 0; }
  .menu-mini { grid-row: 2; margin-top: 0; }
  .menu-save { grid-row: 3; margin-top: 0; }
  .menu-list .btn-lg { padding: 8px 12px; }
  .menu-mini .btn { min-height: 44px; padding: 5px 6px; }
  .menu-save { padding: 3px 8px; }
}

/* ---------- extra department shifts ---------- */
.sp-shell {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(242,176,43,.16) 0%, rgba(242,176,43,0) 55%),
    linear-gradient(180deg, #fbf3e2 0%, #f6ecd8 100%);
  overflow: hidden;
}
.sp-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--cream-2);
  border-bottom: 3px solid var(--ink);
  flex-wrap: wrap;
}
.sp-brand { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sp-brand img { width: 34px; height: 34px; object-fit: contain; flex: 0 0 auto; }
.sp-brand b { display: block; font-family: var(--display); font-size: 14px; line-height: 1; }
.sp-brand span { display: block; font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.sp-stats { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.sp-stats .hud-plate { padding: 3px 5px; gap: 4px; border-width: 2.5px; }
.sp-stats .hud-plate .v { font-size: 15px; }
.sp-icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2.5px solid var(--ink);
  background: var(--cream);
  box-shadow: 2px 2px 0 rgba(42,38,34,.22);
}
.sp-task {
  flex: 0 0 auto;
  padding: 5px 8px;
  background: var(--mustard);
  border-bottom: 2.5px solid var(--ink);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
  text-align: center;
}
.sp-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}
.sp-hint {
  flex: 0 0 auto;
  padding: 4px 8px calc(4px + var(--safe-b));
  background: var(--cream-2);
  border-top: 2.5px solid var(--ink);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-soft);
}
.sp-pause {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(42, 38, 34, 0.55);
  backdrop-filter: blur(2px);
}
.sp-order, .sp-ticket, .sp-po {
  border: 3px solid var(--ink);
  background: var(--cream-2);
  padding: 6px 8px;
  box-shadow: 3px 3px 0 rgba(42,38,34,.18);
}
.sp-order-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.sp-order-head b { font-family: var(--num); }
.sp-slots { display: flex; gap: 6px; margin-top: 5px; }
.sp-slot {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  border: 2.5px dashed rgba(42,38,34,.35);
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 2px;
  opacity: .4;
}
.sp-slot img { height: 28px; width: auto; object-fit: contain; }
.sp-slot span { font-size: 7px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.sp-slot.filled { opacity: 1; border-style: solid; border-color: var(--green); background: #eef7e8; }
.sp-ovens { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sp-oven {
  border: 3px solid var(--ink);
  background: var(--cream-2);
  padding: 4px;
  text-align: center;
  box-shadow: 2px 3px 0 rgba(42,38,34,.18);
  min-width: 0;
}
.sp-oven img { height: 34px; width: auto; max-width: 100%; object-fit: contain; margin: 0 auto; }
.sp-oven-name {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-gauge {
  position: relative;
  height: 13px;
  border: 2.5px solid var(--ink);
  background: #e8dfcc;
  margin: 5px 0;
  overflow: hidden;
}
.sp-gauge .zone { position: absolute; left: 62%; width: 22%; top: 0; bottom: 0; background: rgba(62,142,79,.5); }
.sp-gauge .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--red); }
.sp-gauge .fill.in-zone { background: var(--green); }
.sp-oven.hot { outline: 2px solid var(--red); outline-offset: 1px; }
.sp-oven.done { opacity: .7; background: #eef7e8; }
.sp-pull {
  width: 100%;
  min-height: 34px;
  border: 2.5px solid var(--ink);
  background: var(--red);
  color: var(--cream);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  box-shadow: 2px 2px 0 rgba(42,38,34,.2);
}
.sp-oven.done .sp-pull { background: var(--green); }
.sp-oven.done .sp-pull::after { content: " READY"; }
.sp-apple {
  position: relative;
  border: 3px solid var(--ink);
  background: var(--cream-2);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  padding: 2px;
  box-shadow: 2px 3px 0 rgba(42,38,34,.18);
  overflow: hidden;
}
.sp-apple img { width: 82%; height: 82%; object-fit: contain; pointer-events: none; }
.sp-bruise { position: absolute; border-radius: 50%; background: #6a4324; box-shadow: 0 0 0 1px rgba(42,38,34,.35); pointer-events: none; }
.sp-bruise.b1 { width: 12px; height: 10px; left: 34%; top: 44%; }
.sp-bruise.b2 { width: 8px; height: 7px; left: 55%; top: 58%; }
.sp-apple.bad { background: #f3e6d2; }
.sp-apple.picked { opacity: .18; transform: scale(.82) !important; transition: all .25s ease; pointer-events: none; }
.sp-apple.shake { animation: spshake .34s ease; }
@keyframes spshake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px) rotate(-2deg); }
  70% { transform: translateX(4px) rotate(2deg); }
}
.sp-produce { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.sp-ticket { text-align: center; }
.sp-ticket b { display: block; font-family: var(--display); font-size: clamp(15px, 3.6vw, 20px); line-height: 1.05; margin: 2px 0; }
.sp-form { display: flex; flex-direction: column; gap: 7px; }
.sp-group .label { margin-bottom: 3px; }
.sp-opts { display: flex; flex-wrap: wrap; gap: 5px; }
.sp-opt {
  border: 2.5px solid var(--ink);
  background: var(--cream-2);
  min-height: 38px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 2px 2px 0 rgba(42,38,34,.16);
}
.sp-opt.sel { background: var(--blue); color: var(--cream); }
.sp-serve {
  min-height: 48px;
  border: 3px solid var(--ink);
  background: var(--red);
  color: var(--cream);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .05em;
  box-shadow: 3px 3px 0 rgba(42,38,34,.22);
}
.sp-serve:disabled { opacity: .45; cursor: not-allowed; }
.sp-cut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.sp-cut {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 3px solid var(--ink);
  background: var(--cream-2);
  padding: 4px 6px;
  text-align: left;
  min-height: 50px;
  box-shadow: 2px 2px 0 rgba(42,38,34,.16);
}
.sp-cut img { width: 46px; height: 36px; object-fit: contain; flex: 0 0 auto; }
.sp-cut b { display: block; font-size: 11px; line-height: 1.05; }
.sp-cut small { display: block; font-size: 8px; color: var(--ink-soft); }
.sp-cut.sel { background: #fff3cf; outline: 3px solid var(--mustard); outline-offset: 1px; }
.sp-scale {
  border: 3px solid var(--ink);
  background: var(--cream-2);
  padding: 6px 8px;
  box-shadow: 3px 3px 0 rgba(42,38,34,.18);
}
.sp-scale-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sp-weight { font-family: var(--num); font-size: 24px; }
.sp-scale input[type="range"] { width: 100%; min-height: 34px; accent-color: var(--red); }
.sp-weigh {
  width: 100%;
  min-height: 40px;
  border: 2.5px solid var(--ink);
  background: var(--blue);
  color: var(--cream);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .05em;
}
.sp-weigh:disabled { opacity: .45; cursor: not-allowed; }
.sp-safety {
  border: 3px dashed rgba(42,38,34,.4);
  background: #fff9ec;
  padding: 6px 8px;
}
.sp-safety p { margin: 2px 0 6px; }
.sp-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sp-choice {
  min-height: 46px;
  border: 3px solid var(--ink);
  background: var(--cream-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  box-shadow: 2px 2px 0 rgba(42,38,34,.16);
}
.sp-choice.accept { background: var(--green); color: var(--cream); }
.sp-choice.reject { background: var(--red); color: var(--cream); }
.sp-po-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  border-bottom: 1.5px dashed rgba(42,38,34,.22);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.sp-po-row b { font-family: var(--num); font-size: 14px; }
.sp-po-row .r-good { color: var(--green); }
.sp-box {
  border: 3px solid var(--ink);
  background: var(--cream-2);
  padding: 8px;
  text-align: center;
  box-shadow: 3px 3px 0 rgba(42,38,34,.18);
}
.sp-box-art { width: 64px; height: 54px; object-fit: contain; margin: 2px auto; }
.sp-box b { display: block; font-family: var(--display); font-size: 16px; }
.sp-tags { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; margin: 4px 0; }
.sp-tag {
  border: 2px solid var(--ink);
  background: var(--mustard);
  padding: 1px 6px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .07em;
}
.sp-tag.red { background: var(--red); color: var(--cream); }
.sp-tag.green { background: var(--green); color: var(--cream); }
.sp-box-choices { margin-top: 0; }
.sp-case {
  border: 3px solid var(--ink);
  background: var(--cream-2);
  padding: 8px;
  box-shadow: 3px 3px 0 rgba(42,38,34,.18);
}
.sp-customer { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.sp-customer img { width: 50px; height: 68px; object-fit: contain; object-position: bottom; flex: 0 0 auto; }
.sp-customer b { display: block; font-family: var(--display); font-size: 15px; line-height: 1.05; }
.sp-case p { font-size: 12px; line-height: 1.4; margin-bottom: 6px; }
.sp-answers { display: flex; flex-direction: column; gap: 5px; }
.sp-answer {
  width: 100%;
  border: 2.5px solid var(--ink);
  background: var(--cream);
  padding: 8px 9px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 800;
  box-shadow: 2px 2px 0 rgba(42,38,34,.14);
}
.sp-answer:disabled { opacity: .6; }
.sp-why { margin-top: 6px; padding: 5px 7px; font-size: 10.5px; font-weight: 700; border: 2px dashed rgba(42,38,34,.35); }
.sp-why.good { background: #eef7e8; }
.sp-why.bad { background: #fbe6e1; }
.sp-meter {
  height: 16px;
  border: 3px solid var(--ink);
  background: #e8dfcc;
  box-shadow: 2px 2px 0 rgba(42,38,34,.16);
  overflow: hidden;
}
.sp-meter i { display: block; height: 100%; width: 72%; background: var(--green); transition: width .3s ease; }
@media (max-width: 420px) {
  .sp-brand b { font-size: 12px; }
  .sp-brand span { font-size: 7px; }
  .sp-stats .hud-plate { padding: 2px 4px; }
  .sp-stats .hud-plate .v { font-size: 13px; }
  .sp-stats .hud-plate .k { font-size: 6.5px; }
  .sp-icon-btn { width: 30px; height: 30px; }
  .sp-produce { gap: 5px; }
  .sp-oven-name { font-size: 7px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .sp-top { padding: 4px 6px; }
  .sp-brand img { width: 26px; height: 26px; }
  .sp-task { padding: 3px 6px; font-size: 9px; }
  .sp-body { padding: 6px; gap: 6px; }
  .sp-hint { font-size: 8px; padding: 2px 6px; }
  .sp-produce { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .sp-apple { min-height: 54px; }
  .sp-slot { min-height: 36px; }
  .sp-ovens { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sp-cut-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sp-cut { flex-direction: column; text-align: center; gap: 2px; padding: 3px; }
  .sp-cut img { width: 40px; height: 28px; }
  .sp-form { gap: 5px; }
  .sp-opt { min-height: 32px; padding: 4px 7px; font-size: 10px; }
  .sp-serve { min-height: 38px; font-size: 13px; }
  .sp-case p { font-size: 11px; }
  .sp-answer { padding: 5px 7px; font-size: 10.5px; }
}

/* ---------- local competitive race ---------- */
.duel-card { text-align: left; }
.duel-card .modal-blurb { margin: 4px 0 8px; }
.duel-total { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.duel-total > div {
  border: 3px solid var(--ink);
  background: var(--cream-2);
  box-shadow: 3px 3px 0 rgba(42,38,34,.18);
  padding: 6px 8px;
  text-align: center;
}
.duel-total .num { display: block; font-family: var(--num); font-size: 30px; line-height: 1; }
.duel-total .label { font-size: 9px; letter-spacing: .1em; }
@media (max-width: 420px) {
  .duel-total .num { font-size: 24px; }
}

/* dense store map on tablet and short landscape */
@media (max-width: 999px) {
  .bay { width: 54px; }
  .bay .badge { width: 44px; height: 44px; }
  .bay .sign { padding: 2px 3px 3px; }
  .bay .sign b { font-size: 8px; }
  .bay .sign .rt { font-size: 11px; gap: 2px; }
  .bay .sign .rt em { display: none; }
  .bay .bay-play { font-size: 6.5px; padding: 0 3px; }
  .bay .stall { height: 46px; }
}

/* bagging on a short landscape screen: keep bags, labels and controls apart */
@media (max-height: 560px) and (orientation: landscape) {
  .bag-belt { margin-top: 58px; height: 62px; }
  .bag-wall {
    background-size: 124% auto;
    background-position: center 26%;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
  }
  .bag-rack, .bag-rack.wide { padding: 4px 8px 72px; }
  .bag-hint { display: none; }
  .bag-brand { display: none; }
  .bag-foot { bottom: 4px; }
  .bag-panel { top: 12%; bottom: 20%; left: 29%; right: 29%; }
  .bag-status { top: 1%; left: 4%; }
  .belt-item { width: clamp(36px, 5.6vw, 48px); height: clamp(46px, 6.8vw, 58px); }
  .belt-item.front { width: clamp(44px, 7vw, 54px); height: clamp(52px, 8vw, 60px); }
  .belt-tag { font-size: 6.5px; bottom: -6px; }
  .bag-controls { bottom: 4px; }
  .bag-controls .action-btn { min-height: 48px; padding: 4px 7px; }
}

/* the button labels already name every action; keep the hint off the bags */
.bag-hint { display: none; }

/* ================= BAGGING: ONE BIG BAG ================= */
.mbag {
  background: #1d1a17;
}
.mbag-scene {
  position: absolute;
  inset: 0;
  background: url("../assets/bagging_scene.webp") center 30% / cover no-repeat;
  opacity: 0.4;
  filter: saturate(0.9);
  pointer-events: none;
}
.mbag::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
  z-index: 1;
}
.mbag-hud {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 5px;
  height: 0;
  z-index: 12;
  pointer-events: none;
}
.mbag-hud-left,
.mbag-hud-right {
  position: absolute;
  top: 0;
  display: flex;
  gap: 5px;
  align-items: flex-start;
}
.mbag-hud-left { left: 0; }
.mbag-hud-right { right: 44px; }
.mbag-hud .hud-plate { padding: 3px 7px; box-shadow: 2px 3px 0 rgba(42, 38, 34, 0.22); }
.mbag-hud .hud-plate .k { font-size: 8px; }
.mbag-hud .hud-plate .v { font-size: 17px; }
.mbag-hud .hud-plate.big .v { font-size: 22px; }
.mbag-hud .timer-plate .v { font-size: 20px; }
.mbag-pause {
  position: absolute;
  right: 0;
  top: 0;
  pointer-events: auto;
  width: 38px;
  height: 38px;
}
.mbag-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 50px 6px 84px;
  display: flex;
  justify-content: center;
  z-index: 2;
}
.mbag-mega {
  position: relative;
  width: 100%;
  max-width: 1100px;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0 8px 6px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0) 6%, rgba(255, 255, 255, 0.14) 50%, rgba(0, 0, 0, 0) 94%, rgba(0, 0, 0, 0.22) 100%),
    linear-gradient(180deg, #dcbc83 0%, #d0a767 14%, #c99e5c 55%, #b98a49 100%);
  border: 4px solid var(--ink);
  border-radius: 12px 12px 26px 26px;
  box-shadow: 0 9px 0 rgba(0, 0, 0, 0.24), inset 0 0 0 4px rgba(255, 255, 255, 0.16), inset 0 -30px 34px rgba(0, 0, 0, 0.14);
}
.mbag-rim {
  position: relative;
  flex: 0 0 auto;
  height: 34px;
  margin: -4px -8px 0;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.06) 0 3px, rgba(255, 255, 255, 0.06) 3px 7px),
    linear-gradient(180deg, #e6cb98 0%, #d3ab6c 100%);
  border-bottom: 3px solid var(--ink);
  border-radius: 8px 8px 0 0;
  color: #5d3d17;
  overflow: hidden;
}
.mbag-rim::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 3px;
  height: 2px;
  background: rgba(42, 38, 34, 0.22);
}
.mbag-rim-label {
  flex: 1;
  min-width: 0;
  font-family: var(--display);
  font-size: clamp(7px, 1.4vw, 11px);
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mbag-next-label {
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: #6b471b;
}
.mbag-next {
  display: flex;
  gap: 4px;
  align-items: center;
}
.mbag-mini {
  width: 26px;
  height: 26px;
  display: grid;
  gap: 1px;
  padding: 1px;
  background: rgba(251, 243, 226, 0.5);
  border: 2px solid rgba(42, 38, 34, 0.55);
  border-radius: 3px;
}
.mbag-mini-cell {
  display: block;
  border-radius: 1px;
  box-shadow: inset 0 0 0 1px rgba(42, 38, 34, 0.35);
}
.mbag-board {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 4px 0 0;
  background-color: #f7ecd7;
  background-image:
    linear-gradient(to right, rgba(42, 38, 34, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(42, 38, 34, 0.055) 1px, transparent 1px);
  background-size: calc(100% / var(--cols, 10)) 100%, 100% calc(100% / var(--rows, 14));
  border: 3px solid rgba(42, 38, 34, 0.72);
  border-radius: 3px 3px 10px 10px;
  box-shadow: inset 0 10px 16px rgba(42, 38, 34, 0.24), inset 0 -4px 0 rgba(255, 255, 255, 0.4);
  overflow: hidden;
  touch-action: none;
}
.mbag-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.mbag-block {
  position: absolute;
  padding: 2px;
  display: grid;
  place-items: center;
  background: var(--tile, #3e8e4f);
  border: 2px solid var(--ink);
  border-radius: 5px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18), inset 0 3px 0 rgba(255, 255, 255, 0.24);
  overflow: hidden;
}
.mbag-block img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(1px 1px 0 rgba(42, 38, 34, 0.28));
  pointer-events: none;
}
.mbag-falling { z-index: 3; }
.mbag-ghost {
  background: rgba(42, 38, 34, 0.05);
  border: 2px dashed rgba(42, 38, 34, 0.38);
  box-shadow: none;
  opacity: 0.55;
}
.mbag-packed { z-index: 1; }
.mbag-clear {
  animation: mbagflash 0.32s ease-out;
}
@keyframes mbagflash {
  0% { box-shadow: inset 0 0 0 7px rgba(242, 176, 43, 0.95), inset 0 10px 16px rgba(42, 38, 34, 0.24); }
  100% { box-shadow: inset 0 0 0 0 rgba(242, 176, 43, 0), inset 0 10px 16px rgba(42, 38, 34, 0.24); }
}
.mbag-front {
  flex: 0 0 auto;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  color: #5d3d17;
  font-family: var(--display);
}
.mbag-front span { font-size: 11px; letter-spacing: 0.12em; }
.mbag-front b { font-size: 8px; letter-spacing: 0.1em; opacity: 0.8; }
.mbag-controls {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 20;
  display: flex;
  gap: 6px;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.mbag-controls > * { pointer-events: auto; }
.mbag-move { display: flex; gap: 6px; }
.mbag-pad { min-width: 56px; }
.mbag-controls .action-btn { min-height: 58px; padding: 5px 9px; }
.mbag-controls .action-btn span { font-size: 15px; }
.mbag-controls .action-btn small { font-size: 8.5px; }
.mbag-hint {
  position: absolute;
  left: 50%;
  bottom: 75px;
  transform: translateX(-50%);
  z-index: 11;
  background: rgba(251, 243, 226, 0.94);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 rgba(42, 38, 34, 0.2);
  padding: 2px 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
@media (max-width: 430px) {
  .mbag-hud-left { gap: 4px; }
  .mbag-hud .hud-plate { padding: 2px 5px; }
  .mbag-hud .hud-plate .v { font-size: 15px; }
  .mbag-hud .hud-plate.big .v { font-size: 19px; }
  .mbag-hud .timer-plate .v { font-size: 17px; }
  .mbag-hud-right { right: 40px; }
  .mbag-pause { width: 34px; height: 34px; }
  .mbag-controls { gap: 5px; }
  .mbag-controls .action-btn { min-height: 56px; padding: 4px 6px; }
  .mbag-controls .action-btn span { font-size: 13px; }
  .mbag-pad { min-width: 50px; }
  .mbag-hint { font-size: 8px; bottom: 72px; max-width: calc(100% - 24px); overflow: hidden; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .mbag-wrap { margin: 44px 6px 72px; }
  .mbag-hud .hud-plate .v { font-size: 15px; }
  .mbag-hud .hud-plate.big .v { font-size: 19px; }
  .mbag-hint { bottom: 64px; }
  .mbag-controls .action-btn { min-height: 50px; }
}
.mbag-mega::before,
.mbag-mega::after {
  content: "";
  position: absolute;
  top: -30px;
  width: 19%;
  height: 34px;
  border: 5px solid #b98a49;
  border-bottom: 0;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  box-shadow: 0 -2px 0 rgba(42, 38, 34, 0.25);
  z-index: 0;
  pointer-events: none;
}
.mbag-mega::before { left: 13%; }
.mbag-mega::after { right: 13%; }
@media (max-width: 520px) {
  .mbag-mega::before, .mbag-mega::after { top: -24px; height: 28px; border-width: 4px; width: 22%; }
}

/* Bagging Blitz: drawn bag body, bold scoreboard, grocery-art next pieces */
.mbag-wrap {
  margin-top: 58px;
  margin-left: 4px;
  margin-right: 4px;
}
.mbag-mega {
  padding: 0 5px 5px;
  background:
    repeating-linear-gradient(92deg, rgba(255, 255, 255, 0.05) 0 3px, rgba(0, 0, 0, 0.035) 3px 7px),
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 62%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.24) 0%, rgba(0, 0, 0, 0) 7%, rgba(255, 255, 255, 0.12) 50%, rgba(0, 0, 0, 0) 93%, rgba(0, 0, 0, 0.26) 100%),
    linear-gradient(180deg, #e0c18b 0%, #d2a969 14%, #c99e5c 55%, #b48342 100%);
  border: 5px solid var(--ink);
  border-radius: 16px 16px 30px 30px;
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.26), inset 0 0 0 5px rgba(255, 255, 255, 0.17), inset 0 -34px 40px rgba(0, 0, 0, 0.16);
}
.mbag-rim {
  height: 38px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.055) 0 4px, rgba(255, 255, 255, 0.07) 4px 9px),
    linear-gradient(180deg, #f0dcb0 0%, #e0c18a 42%, #cba366 100%);
  border-bottom: 4px solid var(--ink);
  box-shadow: inset 0 5px 0 rgba(255, 255, 255, 0.32), inset 0 -10px 12px rgba(0, 0, 0, 0.1);
}
.mbag-rim-label {
  font-size: clamp(8px, 1.5vw, 12px);
  letter-spacing: 0.06em;
}
.mbag-next-label {
  font-size: 9px;
}
.mbag-next {
  gap: 5px;
}
.mbag-mini {
  width: 40px;
  height: 40px;
  padding: 2px;
  gap: 1px;
  background: rgba(251, 243, 226, 0.62);
  border: 2px solid rgba(42, 38, 34, 0.62);
  border-radius: 4px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4);
}
.mbag-mini-cell {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(42, 38, 34, 0.42);
}
.mbag-mini-cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 1px 0 rgba(42, 38, 34, 0.3));
}
.mbag-board {
  margin: 5px 16px 0;
  background-color: #f5e7ca;
  box-shadow:
    inset 0 15px 22px rgba(42, 38, 34, 0.3),
    inset 10px 0 18px rgba(42, 38, 34, 0.12),
    inset -10px 0 18px rgba(42, 38, 34, 0.12),
    inset 0 -5px 0 rgba(255, 255, 255, 0.36);
  border-radius: 4px 4px 12px 12px;
}
.mbag-board::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 11px;
  background: linear-gradient(180deg, rgba(42, 38, 34, 0.34), rgba(42, 38, 34, 0));
  z-index: 4;
  pointer-events: none;
}
.mbag-gusset {
  position: absolute;
  top: 38px;
  bottom: 50px;
  width: 16px;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(155deg, rgba(0, 0, 0, 0.08) 0 9px, rgba(255, 255, 255, 0.06) 9px 12px),
    linear-gradient(90deg, #8f5f2b 0%, #b98447 34%, #d8b177 62%, #a9763c 100%);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.24);
}
.mbag-gusset.left { left: 0; border-radius: 0 0 0 26px; border-right: 2px solid rgba(42, 38, 34, 0.35); }
.mbag-gusset.right { right: 0; border-radius: 0 0 26px 0; border-left: 2px solid rgba(42, 38, 34, 0.35); }
.mbag-front {
  flex: 0 0 auto;
  height: 48px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, #c99c59 0%, #bd8c4a 60%, #ab7738 100%);
  border-top: 3px solid rgba(42, 38, 34, 0.55);
  border-radius: 0 0 24px 24px;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.28), inset 0 -14px 18px rgba(0, 0, 0, 0.14);
}
.mbag-logo {
  font-family: var(--display);
  font-size: clamp(17px, 2.4vw, 28px);
  letter-spacing: 0.05em;
  color: var(--red);
  -webkit-text-stroke: 0.6px var(--ink);
  text-shadow: 1px 2px 0 rgba(251, 243, 226, 0.45);
}
.mbag-tagline {
  font-family: var(--display);
  font-size: clamp(7px, 1.1vw, 11px);
  letter-spacing: 0.16em;
  color: #5d3d17;
  padding: 2px 6px;
  border: 2px solid rgba(42, 38, 34, 0.4);
  transform: rotate(-2deg);
  background: rgba(251, 243, 226, 0.18);
}
.mbag-mega::before,
.mbag-mega::after {
  top: -40px;
  width: 22%;
  height: 46px;
  border: 9px solid #c19156;
  border-bottom: 0;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.32), 0 -2px 0 rgba(42, 38, 34, 0.32);
  z-index: 0;
}
.mbag-hud .hud-plate {
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 3px 8px 4px;
  border-width: 3px;
}
.mbag-hud .hud-plate .k {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.07em;
}
.mbag-hud .hud-plate .v {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}
.mbag-hud .hud-plate.big .v {
  font-size: 28px;
}
.mbag-hud .timer-plate {
  min-width: 0;
}
.mbag-hud .timer-plate .v {
  font-size: 25px;
}
@media (max-width: 430px) {
  .mbag-wrap { margin-top: 54px; }
  .mbag-hud-left { gap: 5px; }
  .mbag-hud .hud-plate { padding: 3px 6px 4px; }
  .mbag-hud .hud-plate .k { font-size: 8.5px; }
  .mbag-hud .hud-plate .v { font-size: 20px; }
  .mbag-hud .hud-plate.big .v { font-size: 23px; }
  .mbag-hud .timer-plate .v { font-size: 21px; }
  .mbag-hud-right { right: 42px; gap: 4px; }
  .mbag-board { margin-left: 14px; margin-right: 14px; }
  .mbag-gusset { width: 14px; }
  .mbag-mini { width: 36px; height: 36px; }
  .mbag-front { height: 44px; gap: 7px; }
  .mbag-mega::before, .mbag-mega::after { top: -34px; height: 40px; border-width: 8px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .mbag-wrap { margin-top: 50px; }
  .mbag-front { height: 40px; }
  .mbag-gusset { bottom: 42px; }
  .mbag-hud .hud-plate { padding: 3px 7px 4px; }
  .mbag-hud .hud-plate .k { font-size: 9px; }
  .mbag-hud .hud-plate .v { font-size: 21px; }
  .mbag-hud .hud-plate.big .v { font-size: 24px; }
  .mbag-hud .timer-plate .v { font-size: 22px; }
}

/* scoreboard centred between the bag handles, pause sits in the bag rim */
.mbag-hud-row {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  align-items: flex-start;
}
.mbag-rival {
  position: absolute;
  top: 54px;
  right: 0;
}
.mbag-rim .mbag-pause {
  position: static;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  right: auto;
  top: auto;
  border-width: 2.5px;
  box-shadow: 2px 2px 0 rgba(42, 38, 34, 0.22);
}
.mbag-rim .mbag-pause svg { width: 15px; height: 15px; }
.mbag-rim {
  height: 46px;
  gap: 7px;
}
.mbag-mini {
  width: 44px;
  height: 44px;
  padding: 2px;
}
.mbag-mega::before {
  left: 3%;
  right: auto;
  width: 13%;
}
.mbag-mega::after {
  right: 3%;
  left: auto;
  width: 13%;
}
@media (max-width: 430px) {
  .mbag-hud-row { gap: 4px; }
  .mbag-rim { height: 44px; }
  .mbag-mini { width: 40px; height: 40px; }
  .mbag-mega::before, .mbag-mega::after { width: 12%; }
}
@media (max-width: 370px) {
  .mbag-hud .hud-plate .v { font-size: 18px; }
  .mbag-hud .hud-plate.big .v { font-size: 20px; }
  .mbag-hud .timer-plate .v { font-size: 19px; }
  .mbag-hud .hud-plate .k { font-size: 7.5px; }
  .mbag-hud .hud-plate { padding: 2px 5px 3px; }
  .mbag-mega::before, .mbag-mega::after { width: 10%; }
}

/* larger, square grocery previews */
.mbag-rim {
  height: 52px;
}
.mbag-mini {
  width: 48px;
  height: 48px;
  padding: 2px;
  gap: 1px;
}
.mbag-mini-cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}
@media (max-width: 430px) {
  .mbag-rim { height: 50px; }
  .mbag-mini { width: 44px; height: 44px; }
}

.mbag-rim {
  overflow: visible;
}
.mbag-rim::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 10px;
  z-index: 3;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='10' viewBox='0 0 48 10'%3E%3Cpath d='M0 0H48V4L40 10L32 4L24 10L16 4L8 10L0 4Z' fill='%23cba366'/%3E%3C/svg%3E") repeat-x;
  background-size: 48px 10px;
}

/* Online race lobby */
.online-card {
  width: min(680px, 100%);
  margin: 10px auto;
  padding: 16px;
}
.online-presence {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.online-player {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 rgba(42, 38, 34, 0.14);
  font-size: 13px;
}
.online-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--ink);
  flex: 0 0 auto;
}
.online-link {
  margin-top: 4px;
  padding: 8px 9px;
  background: var(--paper);
  border: 2px dashed rgba(42, 38, 34, 0.45);
  font-family: var(--num);
  font-size: 11px;
  line-height: 1.45;
  word-break: break-all;
  overflow-wrap: anywhere;
}

/* Employee of the Month: month progress and trophy */
.eotm-trophy {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 26px;
  flex: 0 0 auto;
  background: var(--mustard);
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  box-shadow: 2px 2px 0 rgba(42, 38, 34, 0.18);
}
.eotm-pips {
  display: flex;
  gap: 4px;
  margin: 7px 0 5px;
}
.eotm-pips i {
  flex: 1;
  height: 9px;
  border: 2px solid var(--ink);
  background: var(--cream);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35);
}
.eotm-pips i.on {
  background: var(--mustard);
}
.eotm-month {
  border-top: 2px dashed rgba(42, 38, 34, 0.25);
  padding-top: 8px;
}
.eotm-slot {
  position: relative;
}
.eotm-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  background: var(--mustard);
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  box-shadow: 1px 1px 0 rgba(42, 38, 34, 0.2);
}
.eotm-ceremony-trophy {
  display: grid;
  place-items: center;
  width: 58px;
  height: 54px;
  margin: 0 auto 5px;
  background: var(--mustard);
  border: 3px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  box-shadow: 3px 4px 0 rgba(42, 38, 34, 0.2);
  transform: rotate(-4deg);
}
.eotm-ceremony .wall .slot {
  position: relative;
}
.eotm-ceremony .wall .slot.win {
  background: #fff4cf;
  box-shadow: inset 0 0 0 2px var(--mustard);
}

.eotm-trophy {
  width: 34px;
  height: 32px;
}
.eotm-badge {
  width: 20px;
  height: 20px;
}
.eotm-ceremony .modal-actions {
  position: static;
  bottom: auto;
  background: transparent;
  border-top: 0;
  padding-top: 6px;
}
.eotm-ceremony p.small {
  margin: 4px 8px 6px;
}

/* ================= SHELF STACKER ================= */
.shf-shell {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, #e7dcc8 0%, #ded1b8 100%);
}
.shf-scene {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 10%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 55%),
    repeating-linear-gradient(90deg, rgba(42, 38, 34, 0.035) 0 2px, transparent 2px 52px);
  pointer-events: none;
}
.shf-hud {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 5px;
  height: 0;
  z-index: 14;
  pointer-events: none;
}
.shf-hud-row {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  align-items: flex-start;
}
.shf-hud .hud-plate {
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 3px 8px 4px;
  box-shadow: 2px 3px 0 rgba(42, 38, 34, 0.22);
}
.shf-hud .hud-plate .k { font-size: 9px; font-weight: 900; letter-spacing: 0.07em; }
.shf-hud .hud-plate .v { font-family: var(--display); font-size: 22px; font-weight: 400; line-height: 1; }
.shf-hud .hud-plate.big .v { font-size: 26px; }
.shf-hud .timer-plate { min-width: 0; }
.shf-hud .timer-plate .v { font-size: 23px; }
.shf-pause {
  position: absolute;
  right: 0;
  top: 0;
  width: 34px;
  height: 34px;
  pointer-events: auto;
}
.shf-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 54px 6px 162px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  -webkit-overflow-scrolling: touch;
}
.shf-plan {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}
@media (min-width: 700px) {
  .shf-plan { grid-template-columns: repeat(3, 1fr); }
}
.shf-section {
  position: relative;
  background: linear-gradient(180deg, #fbf3e2 0%, #f3e5c9 100%);
  border: 3px solid var(--ink);
  border-radius: 6px;
  padding: 6px;
  box-shadow: 3px 4px 0 rgba(42, 38, 34, 0.16);
}
.shf-head {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
  min-height: 24px;
}
.shf-head img { width: 26px; height: 26px; object-fit: contain; }
.shf-head b { font-family: var(--display); font-size: 14px; line-height: 1; }
.shf-front {
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--red);
  border: 2px solid var(--red);
  padding: 1px 3px;
  transform: rotate(-4deg);
}
.shf-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 3px;
}
.shf-cell {
  position: relative;
  min-height: 42px;
  padding: 0;
  overflow: hidden;
  background: rgba(42, 38, 34, 0.045);
  border: 2px dashed rgba(42, 38, 34, 0.32);
  border-radius: 3px;
  touch-action: manipulation;
}
.shf-cell.filled {
  border-style: solid;
  border-color: var(--ink);
  background: var(--tile, var(--mustard));
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.16), inset 0 3px 0 rgba(255, 255, 255, 0.22);
}
.shf-cell img { width: 100%; height: 100%; object-fit: contain; padding: 2px; filter: drop-shadow(1px 1px 0 rgba(42, 38, 34, 0.25)); }
.shf-cell .shf-stock {
  position: absolute;
  left: 1px;
  top: 1px;
  z-index: 2;
}
.shf-stock {
  display: inline-block;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.05em;
  padding: 1px 3px;
  border: 1.5px solid var(--ink);
  background: var(--cream);
  line-height: 1;
}
.shf-stock.old { background: var(--red); color: var(--cream); }
.shf-stock.new { background: var(--mustard); color: var(--ink); }
.shf-section.match {
  outline: 3px solid var(--mustard);
  outline-offset: 2px;
}
.shf-section.perfect {
  box-shadow: 3px 4px 0 rgba(42, 38, 34, 0.16), inset 0 0 0 3px var(--mustard);
}
.shf-perfect-stamp {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-5deg);
  background: var(--mustard);
  border: 3px solid var(--ink);
  box-shadow: 2px 3px 0 rgba(42, 38, 34, 0.2);
  padding: 3px 7px;
  font-family: var(--display);
  font-size: 12px;
  white-space: nowrap;
  z-index: 4;
}
.shf-section.perfect .shf-perfect-stamp { display: block; }
.shf-tray {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 66px;
  z-index: 20;
  background: rgba(255, 249, 236, 0.97);
  border: 3px solid var(--ink);
  box-shadow: 3px 4px 0 rgba(42, 38, 34, 0.18);
  padding: 5px 8px 6px;
}
.shf-tray-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.08em;
}
.shf-tray-note { font-family: var(--text); font-size: 8px; font-weight: 800; letter-spacing: 0.04em; color: var(--ink-soft); text-align: right; }
.shf-boxes {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: flex-end;
  min-height: 58px;
}
.shf-box {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 82px;
  padding: 4px 6px;
  background: var(--cream);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 rgba(42, 38, 34, 0.16);
}
.shf-box.selected {
  outline: 3px solid var(--mustard);
  outline-offset: 1px;
  background: #fff4cf;
}
.shf-box-art {
  width: calc(var(--bw, 1) * 22px);
  height: calc(var(--bh, 1) * 22px);
  max-width: 58px;
  max-height: 52px;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 2px;
}
.shf-box-art img { width: 100%; height: 100%; object-fit: contain; padding: 1px; }
.shf-box-name { font-size: 8px; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1; }
.shf-empty { font-family: var(--display); font-size: 12px; color: var(--ink-soft); padding: 12px; }
.shf-hint { display: none; }
.shf-controls {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 22;
  display: flex;
  gap: 6px;
  justify-content: center;
  pointer-events: none;
}
.shf-controls > * { pointer-events: auto; }
.shf-controls .action-btn { min-height: 50px; padding: 4px 9px; }
.shf-controls .action-btn:disabled { opacity: 0.4; }
@media (max-width: 430px) {
  .shf-hud .hud-plate { padding: 3px 6px 4px; }
  .shf-hud .hud-plate .k { font-size: 8px; }
  .shf-hud .hud-plate .v { font-size: 19px; }
  .shf-hud .hud-plate.big .v { font-size: 22px; }
  .shf-hud .timer-plate .v { font-size: 20px; }
  .shf-wrap { margin: 50px 5px 154px; }
  .shf-tray { bottom: 62px; padding: 4px 6px 5px; }
  .shf-box { min-width: 74px; padding: 3px 4px; }
  .shf-box-art { width: calc(var(--bw, 1) * 18px); height: calc(var(--bh, 1) * 18px); }
  .shf-box-name { font-size: 7px; }
  .shf-tray-note { display: none; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .shf-wrap { margin: 46px 6px 126px; }
  .shf-tray { bottom: 56px; padding: 3px 7px 4px; }
  .shf-box { min-width: 70px; }
  .shf-box-art { width: calc(var(--bw, 1) * 17px); height: calc(var(--bh, 1) * 17px); }
  .shf-tray-head { margin-bottom: 2px; }
  .shf-tray-note { font-size: 7px; }
  .shf-cell { min-height: 34px; }
}

/* Bagging Blitz: the scoreboard is printed on the bag's own rim, not floating above it */
.mbag-wrap { margin-top: 16px; }
.mbag-rim {
  height: auto;
  min-height: 54px;
  padding: 5px 8px;
  gap: 6px;
  align-items: center;
}
.mbag-hud {
  position: static;
  left: auto;
  right: auto;
  top: auto;
  height: auto;
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  pointer-events: none;
}
.mbag-hud-row {
  position: static;
  left: auto;
  top: auto;
  transform: none;
  display: flex;
  width: 100%;
  gap: 5px;
  align-items: stretch;
  justify-content: center;
}
.mbag-hud .hud-plate {
  flex: 1 1 0;
  min-width: 0;
  padding: 2px 4px 3px;
  border-width: 2.5px;
}
.mbag-hud .hud-plate .k {
  font-size: 8px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mbag-hud .hud-plate .v,
.mbag-hud .timer-plate .v {
  font-size: clamp(13px, 2vw, 21px);
  line-height: 1.05;
  white-space: nowrap;
}
.mbag-hud .hud-plate.big .v { font-size: clamp(15px, 2.3vw, 24px); }
.mbag-next-group {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
}
.mbag-rim .mbag-next-label { font-size: 8px; }
.mbag-rival {
  position: absolute;
  top: 66px;
  right: 22px;
  z-index: 8;
}
.mbag-mega::before,
.mbag-mega::after {
  top: -15px;
  height: 18px;
  border-width: 7px;
}
@media (max-width: 430px) {
  .mbag-wrap { margin-top: 14px; }
  .mbag-rim { min-height: 50px; padding: 4px 5px; gap: 4px; }
  .mbag-hud-row { gap: 4px; }
  .mbag-hud .hud-plate { padding: 2px 3px 3px; }
  .mbag-hud .hud-plate .k { font-size: 7px; }
  .mbag-hud .hud-plate .v,
  .mbag-hud .timer-plate .v { font-size: 15px; }
  .mbag-hud .hud-plate.big .v { font-size: 17px; }
  .mbag-next-group { gap: 3px; }
  .mbag-rim .mbag-pause { width: 28px; height: 28px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .mbag-wrap { margin-top: 12px; }
  .mbag-rim { min-height: 46px; padding: 3px 7px; }
  .mbag-rim .mbag-pause { width: 30px; height: 30px; }
}
