/* PACK OUT — a loading bay at dusk. Plywood truck box, manila job sheet, three stop colours. */

:root {
  --night: #1b2230;
  --night-2: #232c3d;
  --asphalt: #2c3342;
  --ply: #c9a878;
  --ply-dark: #a98a5c;
  --paper: #f3ecd9;
  --paper-edge: #dcd1b4;
  --ink: #26221c;
  --ink-soft: #62594b;
  --stop0: #e8a33a;
  --stop1: #37a79f;
  --stop2: #9d74d8;
  --bad: #d2463c;
  --good: #4c9a5a;
  --lamp: #ffd98a;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Avenir Next", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(ellipse at 70% 0%, #3a4660 0%, var(--night) 55%), var(--night);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  overflow: hidden;
}
.hidden { display: none !important; }

#app { display: flex; flex-direction: column; height: 100vh; }

#topbar {
  display: flex; align-items: baseline; gap: 22px;
  padding: 12px 22px 8px;
  font-family: var(--mono); letter-spacing: 0.12em; font-size: 14px; color: #c9d2e4;
}
#brand { color: var(--lamp); font-weight: 700; font-size: 17px; animation: lamp 6s infinite; }
@keyframes lamp { 0%, 100% { opacity: 1; } 47% { opacity: 1; } 50% { opacity: 0.86; } 53% { opacity: 1; } }
#stars-top { margin-left: auto; }

#game { flex: 1; display: grid; grid-template-columns: 330px 1fr; gap: 18px; padding: 6px 22px 10px; min-height: 0; }

/* ---- the job sheet ---- */
.paper {
  background: var(--paper); color: var(--ink);
  border-radius: 4px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  border: 1px solid var(--paper-edge);
}
#sheet { padding: 14px 14px 10px; overflow: auto; }
#sheet h2 { font-size: 13px; letter-spacing: 0.16em; margin: 0 0 2px; color: var(--ink-soft); font-family: var(--mono); }
#sheet .client { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.row {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px;
  padding: 6px 8px; margin: 3px 0; border-radius: 4px; cursor: pointer;
  border-left: 6px solid var(--c); background: rgba(0, 0, 0, 0.03);
}
.row:hover { background: rgba(0, 0, 0, 0.08); }
.row .key { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); }
.row .nm { font-weight: 600; font-size: 15px; }
.row .spec { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }
.row .tags { font-size: 12px; font-family: var(--mono); color: var(--bad); }
.row.inhand { background: #fff6d8; outline: 2px solid var(--ink); }
.row.placed { opacity: 0.42; text-decoration: line-through; }
.sheet-foot { margin-top: 10px; font-size: 13px; color: var(--ink-soft); line-height: 1.45; }

/* ---- the yard ---- */
#yard { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
#brief { font-size: 18px; color: #e9edf5; }
#brief b { color: var(--lamp); }
#route { display: flex; gap: 10px; align-items: center; font-size: 14px; flex-wrap: wrap; }
.stopchip { padding: 5px 11px; border-radius: 14px; background: var(--c); color: #111; font-weight: 700; }
.stopchip.done { opacity: 0.35; }
.stopchip.now { outline: 3px solid #fff; }
.arrow { color: #8793aa; }

#truckwrap { position: relative; display: flex; align-items: flex-end; margin-top: 18px; isolation: isolate; }
#cab { flex-shrink: 0;
  position: relative; width: 120px; height: 150px; background: #d9dee6;
  border-radius: 30px 6px 0 0; border: 3px solid #9aa4b4; border-right: 0; margin-bottom: 26px;
}
.cab-window { position: absolute; left: 14px; top: 16px; width: 70px; height: 52px; background: #5d7593; border-radius: 16px 4px 4px 4px; }
.wheel { position: absolute; left: 30px; bottom: -40px; width: 40px; height: 40px; border-radius: 50%; background: #15181f; border: 8px solid #3a3f4a; }
.exhaust { position: absolute; left: -26px; bottom: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgba(210, 215, 225, 0.35); animation: puff 2.4s infinite ease-out; }
@keyframes puff { 0% { transform: translate(0, 0) scale(0.6); opacity: 0.6; } 100% { transform: translate(-30px, -26px) scale(2); opacity: 0; } }

#truck { flex-shrink: 0;
  position: relative; background:
    repeating-linear-gradient(90deg, var(--ply) 0 calc(var(--cell) - 2px), var(--ply-dark) calc(var(--cell) - 2px) var(--cell)),
    var(--ply);
  border: 6px solid #e4e7ec; border-bottom-width: 10px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35);
  margin-bottom: 26px;
}
#truck::after { /* rear wheel, hung below the floor so it never covers cargo */
  content: ""; position: absolute; right: 50px; bottom: -40px; width: 40px; height: 40px; border-radius: 50%;
  background: #15181f; border: 8px solid #3a3f4a; z-index: -1;
}
.gridcell { position: absolute; border: 1px dashed rgba(90, 65, 30, 0.28); }
.gridcell.col-hot { background: rgba(255, 255, 255, 0.12); }
#door { flex-shrink: 0;
  width: 16px; background: #e4e7ec; margin-bottom: 26px; border-radius: 0 4px 4px 0;
  align-self: stretch; margin-top: 0;
}
#door::before { content: "DOOR"; writing-mode: vertical-rl; font-family: var(--mono); font-size: 12px; color: #4b5261; letter-spacing: 0.3em; display: block; padding-top: 8px; }
#pavement { margin-left: 26px; margin-bottom: 26px; display: flex; flex-direction: column; gap: 6px; min-width: 190px; align-self: stretch; }
.pave-chip { background: var(--paper); color: var(--ink); padding: 5px 9px; border-radius: 3px; font-size: 13px; border-left: 6px solid var(--c); }
.pave-label { font-family: var(--mono); font-size: 12px; color: #b9c2d4; letter-spacing: 0.1em; }

.item {
  position: absolute; border-radius: 5px; padding: 5px 7px; overflow: hidden;
  background: var(--paper); color: var(--ink); border: 2px solid #3d352a;
  border-top: 7px solid var(--c); cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.item .nm { font-weight: 700; font-size: 14px; line-height: 1.1; }
.item .meta { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }
.item .gauge { height: 7px; background: #d8cfb8; border-radius: 3px; overflow: hidden; margin-top: 3px; }
.item .gauge > i { display: block; height: 100%; background: var(--good); }
.item.over { background: #f7d2cc; border-color: var(--bad); }
.item.over .gauge > i { background: var(--bad); }
.item.fragile .nm::after { content: " ✱"; color: var(--bad); }
.item.gone { transform: translateX(600px); opacity: 0; }
.item.lifted { transform: translateY(-14px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4); }
.item.hintglow { outline: 3px solid var(--lamp); }
.ghost { position: absolute; border: 3px dashed #fff; border-radius: 5px; background: rgba(255, 255, 255, 0.28); pointer-events: none; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #1b2230; font-size: 14px; }
.ghost.bad { border-color: var(--bad); background: rgba(210, 70, 60, 0.3); color: #fff; }

#keys { font-family: var(--mono); font-size: 13px; color: #aeb8cb; line-height: 1.7; }
#keys b { color: #fff; background: #3a4458; padding: 1px 6px; border-radius: 3px; font-weight: 600; }

#coach {
  display: flex; gap: 14px; align-items: center; padding: 12px 22px; background: #10151f;
  border-top: 2px solid #2f3a4f; font-size: 17px; min-height: 58px;
}
#coach-label { font-family: var(--mono); font-weight: 700; color: #111; background: var(--lamp); padding: 3px 9px; border-radius: 3px; font-size: 14px; }

/* ---- overlays ---- */
.overlay { position: fixed; inset: 0; background: rgba(12, 16, 24, 0.84); display: flex; align-items: center; justify-content: center; z-index: 10; }
.card { background: var(--paper); color: var(--ink); padding: 30px 38px; border-radius: 6px; max-width: 880px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
.card h1 { font-size: 64px; margin: 0; letter-spacing: 0.08em; }
.card h2 { margin: 0 0 8px; letter-spacing: 0.1em; }
.card .pitch { font-size: 18px; line-height: 1.5; margin: 12px 0 16px; }
.card table { border-collapse: collapse; font-size: 14px; }
.card td { padding: 3px 14px 3px 0; vertical-align: top; }
.card td:first-child { font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.card .go { margin-top: 18px; font-family: var(--mono); font-size: 16px; font-weight: 700; animation: lamp 3s infinite; }
.card .small { font-size: 13px; color: var(--ink-soft); margin-top: 10px; line-height: 1.45; }
.ledger { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 14px; }
.ledger div { border: 1px solid var(--paper-edge); padding: 6px; font-size: 13px; text-align: center; }
.starrow { display: flex; gap: 12px; margin: 14px 0; }
.star { padding: 10px 14px; border-radius: 4px; font-family: var(--mono); font-weight: 700; font-size: 15px; border: 2px solid var(--ink); }
.star.on { background: var(--good); color: #fff; border-color: var(--good); }
.star.off { background: #efe3de; color: var(--bad); border-color: var(--bad); }
.lines { font-size: 15px; line-height: 1.6; }
.lines .bad { color: var(--bad); }

#toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 20;
  background: #fff3d6; color: #2a2419; padding: 10px 18px; border-radius: 4px; font-size: 16px;
  border-left: 6px solid var(--bad); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
#toast.hint { border-left-color: var(--lamp); }
#toast.info { border-left-color: #8793aa; }
#stopbanner { align-self: flex-start; font-family: var(--mono); font-size: 16px; font-weight: 700; padding: 5px 12px; border-radius: 3px; color: #111; }

#laws { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 6px; max-width: 1000px; }
.law { background: rgba(255, 255, 255, 0.06); border: 1px solid #3a4458; border-radius: 5px; padding: 10px 12px; font-size: 14px; line-height: 1.45; color: #d7deea; }
.law b { display: block; color: var(--lamp); font-family: var(--mono); font-size: 13px; letter-spacing: 0.1em; margin-bottom: 3px; }

/* ---- compact: portal card shots, small shells ---- */
@media (max-width: 900px) {
  body { font-size: 13px; }
  #topbar { padding: 6px 10px 4px; font-size: 12px; gap: 10px; }
  #brand { font-size: 14px; }
  #game { grid-template-columns: 170px 1fr; gap: 10px; padding: 4px 10px 6px; }
  #sheet { padding: 8px; }
  #sheet .client { font-size: 14px; margin-bottom: 4px; }
  .row { padding: 3px 6px; grid-template-columns: 14px 1fr; }
  .row .spec, .row .tags, .sheet-foot, #laws, #keys { display: none; }
  #brief { font-size: 13px; }
  #route { font-size: 12px; gap: 6px; }
  .stopchip { padding: 2px 8px; }
  #truckwrap { margin-top: 8px; }
  #cab { width: 56px; border-radius: 16px 4px 0 0; }
  .cab-window { left: 8px; top: 10px; width: 34px; height: 28px; }
  .wheel { left: 12px; width: 30px; height: 30px; border-width: 6px; bottom: -32px; }
  #truck::after { width: 30px; height: 30px; border-width: 6px; bottom: -32px; }
  .item { padding: 2px 4px; border-top-width: 5px; }
  .item .nm { font-size: 12px; }
  .item .meta { font-size: 12px; }
  #pavement { min-width: 80px; margin-left: 10px; }
  #coach { padding: 6px 10px; font-size: 13px; min-height: 40px; }
  .card { padding: 16px 20px; }
  .card h1 { font-size: 40px; }
}
