/* ==========================================================================
   PANCREAS INC. — Manual Pancreas Division
   Comic-book design system: newsprint, heavy ink, halftone, hard shadows.
   ========================================================================== */

:root {
  --paper: #f7f0dd;
  --paper-2: #eee2c6;
  --paper-3: #fffdf3;
  --ink: #14110f;
  --ink-2: #3d352d;
  --red: #e0342a;
  --red-dark: #a8221b;
  --yellow: #ffc63c;
  --cyan: #1fa9c7;
  --green: #3aa76d;
  --magenta: #dc3f92;
  --orange: #f07c2c;

  --display: "Bangers", "Impact", "Haettenschweiler", "Arial Narrow Bold", sans-serif;
  --bold: "Archivo Black", "Arial Black", "Segoe UI", system-ui, sans-serif;
  --ui: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --type: "Special Elite", "Courier New", ui-monospace, monospace;

  --hard: 6px 6px 0 var(--ink);
  --hard-sm: 4px 4px 0 var(--ink);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.45;
  background-color: var(--paper-2);
  background-image:
    radial-gradient(circle at 12% 4%, rgba(224, 52, 42, .10), transparent 42%),
    radial-gradient(circle at 88% 12%, rgba(255, 198, 60, .18), transparent 38%),
    radial-gradient(circle at 78% 92%, rgba(31, 169, 199, .12), transparent 46%),
    radial-gradient(rgba(20, 17, 15, .055) 1px, transparent 1.2px);
  background-size: auto, auto, auto, 5px 5px;
  overflow-x: hidden;
}

h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px dashed var(--red); outline-offset: 3px; }

.noscript {
  margin: 40px auto;
  max-width: 520px;
  padding: 20px;
  border: 4px solid var(--ink);
  background: var(--yellow);
  font-family: var(--bold);
  text-align: center;
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 18px 72px;
}

/* ---------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  margin-bottom: 18px;
  border-bottom: 5px solid var(--ink);
}

.brand { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }

.brand__logo {
  font-family: var(--display);
  font-size: clamp(30px, 5.2vw, 54px);
  line-height: .82;
  letter-spacing: .5px;
  transform: rotate(-1.4deg);
  text-shadow: 3px 3px 0 var(--red);
}
.brand__logo em { font-style: normal; color: var(--red); text-shadow: 3px 3px 0 var(--ink); }

.brand__sub {
  font-family: var(--type);
  font-size: 10.5px;
  line-height: 1.35;
  letter-spacing: .2em;
  text-transform: uppercase;
  padding-left: 11px;
  margin-bottom: 5px;
  border-left: 3px solid var(--ink);
  max-width: 190px;
}

.brand__manual {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 2px;
  font-family: var(--type);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.brand__manual:hover { color: var(--red); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 11px 6px;
  border: 3px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  box-shadow: 3px 3px 0 rgba(20, 17, 15, .3);
  min-width: 76px;
}
.chip--yellow { background: var(--yellow); color: var(--ink); }
.chip--red { background: var(--red); color: #fff; }
.chip__k {
  font-family: var(--type);
  font-size: 8.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .8;
}
/* Bangers draws 7 without a crossbar, so "7 / 14" reads as "1 / 14". */
.chip__v { font-family: var(--bold); font-size: 15px; line-height: 1.15; letter-spacing: 0; }

/* Three chips share ~320px on a narrow phone, leaving ~66px of text, and the
   STATUS value "CRITICAL" was cut to "CRITICA". Tighter padding and a smaller
   readout give the word its last two letters back. The word needs 79.1px at the
   default 15px size, which the chips only offer from ~377px up, so the narrow
   treatment runs to 379px instead of stopping at 361 and clipping in between. */
@media (max-width: 379px) {
  .chip { padding: 4px 7px 5px; }
  .chip__k { font-size: 8px; letter-spacing: .12em; }
  .chip__v { font-size: 13px; }
}

/* Below 320px three chips cannot hold "CRITICAL" even at 13px (it needs ~69px
   and they offer 55-67px), and the quickbar's MUSCLE label runs 2-4px past its
   cell. Rather than shrink the type into illegibility, two chips share the first
   row and the status chip gets a full row; the quickbar labels tighten a little.
   The selectors are one class deeper than the mobile block later in this file,
   which would otherwise win with `flex: 1` and the 8px labels. */
@media (max-width: 319px) {
  .chips .chip { flex: 1 1 45%; }
  .quickbar .qb i { font-size: 7px; letter-spacing: .05em; }
}

/* ------------------------------------------------------------------- board */

.board {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .92fr);
  gap: 18px;
  align-items: start;
}

.col-main, .col-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ------------------------------------------------------------------ panels */

.panel {
  position: relative;
  background: var(--paper);
  border: 4px solid var(--ink);
  box-shadow: var(--hard);
}
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(20, 17, 15, .9) 1px, transparent 1.1px);
  background-size: 5px 5px;
  opacity: .045;
  z-index: 0;
}
.panel > * { position: relative; z-index: 1; }

.panel--flush { overflow: hidden; }
.panel--pad { padding: 13px 14px 15px; }

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 13px;
  background: var(--ink);
  color: var(--paper);
}
.panel__title {
  font-family: var(--bold);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.panel__note {
  font-family: var(--type);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .7;
}

/* -------------------------------------------------------------------- stage */

.stage {
  position: relative;
  background: var(--ink);
  border-bottom: 4px solid var(--ink);
  aspect-ratio: 320 / 200;
  overflow: hidden;
}
.stage svg { display: block; width: 100%; height: 100%; }
.stage__tape {
  position: absolute;
  top: 10px;
  left: -34px;
  transform: rotate(-8deg);
  background: var(--yellow);
  border: 3px solid var(--ink);
  padding: 3px 40px;
  font-family: var(--bold);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  box-shadow: 2px 2px 0 rgba(20, 17, 15, .4);
  z-index: 2;
}

.event__body { padding: 14px 15px 4px; }

.kicker {
  display: inline-block;
  font-family: var(--type);
  font-size: 9.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  background: var(--yellow);
  border: 2.5px solid var(--ink);
  padding: 2px 7px;
  transform: rotate(-.8deg);
  margin-bottom: 7px;
}

/* The tape only clears the artwork on a wide panel. On a phone it ran straight
   across the panel's own lettering, so there it becomes a chip above the title. */
.kicker--card { display: none; }
@media (max-width: 640px) {
  .stage__tape--card { display: none; }
  .kicker--card { display: inline-block; }
}

.event__title {
  font-family: var(--display);
  font-size: clamp(25px, 3.4vw, 37px);
  line-height: .95;
  letter-spacing: .4px;
  margin-bottom: 8px;
  text-wrap: balance;
}

.narration {
  font-family: var(--type);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-2);
  border-left: 4px solid var(--red);
  padding-left: 11px;
}

/* ------------------------------------------------------------------- panky */

.panky { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px 13px; }
.panky__art { flex: 0 0 74px; width: 74px; }
.panky__art svg { display: block; width: 100%; height: auto; }

.bubble {
  position: relative;
  flex: 1;
  background: var(--paper-3);
  border: 3px solid var(--ink);
  border-radius: 13px 13px 13px 3px;
  padding: 8px 11px;
  font-family: var(--type);
  font-size: 12.5px;
  line-height: 1.4;
  box-shadow: 3px 3px 0 var(--ink);
  min-height: 42px;
}
.bubble::before {
  content: "";
  position: absolute;
  left: -9px;
  bottom: 9px;
  width: 12px;
  height: 12px;
  background: var(--paper-3);
  border-left: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: rotate(45deg);
}

/* ----------------------------------------------------------------- options */

.opts { display: flex; flex-direction: column; gap: 10px; padding: 13px 14px 15px; }

.opt {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  width: 100%;
  text-align: left;
  padding: 11px 13px;
  background: var(--paper-3);
  border: 3px solid var(--ink);
  box-shadow: var(--hard-sm);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  animation: rise .28s ease both;
}
.opt:nth-child(2) { animation-delay: .04s; }
.opt:nth-child(3) { animation-delay: .08s; }
.opt:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); background: #fff; }
.opt:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.opt:disabled { opacity: .42; cursor: not-allowed; filter: grayscale(1); }

.opt__idx {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--yellow);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1;
  padding-top: 2px;
}

.opt__label { font-weight: 700; font-size: 14.5px; line-height: 1.3; }
.opt__meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.opt__lock {
  margin-top: 6px;
  font-family: var(--type);
  font-size: 10.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--red-dark);
}

.fx {
  font-family: var(--type);
  font-size: 9.5px;
  letter-spacing: .04em;
  padding: 1px 6px;
  border: 2px solid var(--ink);
  background: #fff;
  white-space: nowrap;
}
.fx--good { background: #d6efe0; }
.fx--bad { background: #ffd8d4; }
.fx--warn { background: #ffe6bd; }

/* -------------------------------------------------------------------- plan */

.plan { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; padding: 13px 14px 15px; }

.plan__btn {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 11px;
  text-align: left;
  background: var(--paper-3);
  border: 3px solid var(--ink);
  box-shadow: var(--hard-sm);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.plan__btn:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); background: #fff; }
.plan__btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.plan__btn:disabled { cursor: default; opacity: .5; filter: grayscale(.7); }
.plan__btn--picked {
  background: var(--yellow);
  opacity: 1 !important;
  filter: none !important;
  box-shadow: var(--hard-sm);
}
.plan__btn--picked .plan__name { text-decoration: underline; text-underline-offset: 3px; }

.plan__icon { width: 100%; height: 44px; }
.plan__icon svg { display: block; width: 100%; height: 100%; }
.plan__name { font-family: var(--bold); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; line-height: 1.2; }
.plan__desc { font-family: var(--type); font-size: 10.5px; line-height: 1.35; color: var(--ink-2); }

.panel__body { padding: 2px 13px 12px; }

.recap-line {
  margin-top: 12px;
  padding: 8px 10px;
  border: 2.5px dashed rgba(20, 17, 15, .45);
  background: rgba(255, 253, 243, .7);
  font-family: var(--type);
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-2);
}
.recap-line b {
  display: block;
  font-family: var(--bold);
  font-size: 8.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--red-dark);
  margin-bottom: 3px;
}

.needle {
  transform-box: view-box;
  transform-origin: 110px 110px;
  transform: rotate(var(--to));
  animation: needle .55s cubic-bezier(.2, .8, .3, 1) both;
}

.hintline {
  padding: 0 14px 14px;
  font-family: var(--type);
  font-size: 11.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ------------------------------------------------------------------- gauge */

.gauge { padding: 10px 12px 12px; }
.gauge__svg { display: block; width: 100%; height: auto; }

.gauge__readout { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin-top: -6px; }
.gauge__num {
  font-family: var(--display);
  font-size: 42px;
  line-height: .9;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  animation: pop .3s ease;
}
.gauge__unit { font-family: var(--type); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }

.status {
  margin: 8px auto 0;
  width: fit-content;
  font-family: var(--bold);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: 3px 10px;
  border: 2.5px solid var(--ink);
  background: var(--green);
  color: #06281a;
  transform: rotate(-1deg);
}
.status--warn { background: var(--orange); color: #2b1100; }
.status--bad { background: var(--red); color: #fff; animation: blink 1.1s steps(2, end) infinite; }

/* --------------------------------------------------------------- resources */

.res { display: grid; grid-template-columns: 20px 72px minmax(0, 1fr) 30px; gap: 7px; align-items: center; padding: 5px 0; }
.res + .res { border-top: 2px dotted rgba(20, 17, 15, .22); }
.res__icon { width: 20px; height: 20px; }
.res__icon svg { display: block; width: 100%; height: 100%; }
.res__name { font-family: var(--bold); font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; }
.res__bar { height: 13px; border: 2.5px solid var(--ink); background: #e4d8bb; overflow: hidden; }
.res__bar i {
  display: block;
  height: 100%;
  background: var(--c, var(--cyan));
  transition: width .45s cubic-bezier(.2, .8, .3, 1);
  border-right: 2px solid var(--ink);
}
.res__val { font-family: var(--display); font-size: 16px; text-align: right; font-variant-numeric: tabular-nums; }
.res--danger .res__val { color: var(--red-dark); }
.res--danger .res__bar i { background: var(--red); }

/* ------------------------------------------------------------- departments */

.dept { display: grid; grid-template-columns: 34px minmax(0, 1fr) 32px; gap: 9px; align-items: center; padding: 7px 0; }
.dept + .dept { border-top: 2px dotted rgba(20, 17, 15, .22); }
.dept__face { width: 34px; height: 34px; border: 3px solid var(--ink); background: var(--paper-3); border-radius: 50%; overflow: hidden; }
.dept__face svg { display: block; width: 100%; height: 100%; }
.dept__name { font-family: var(--bold); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; }
.dept__bar { height: 9px; margin-top: 4px; border: 2.5px solid var(--ink); background: #e4d8bb; overflow: hidden; }
.dept__bar i { display: block; height: 100%; background: var(--c, var(--green)); transition: width .45s cubic-bezier(.2, .8, .3, 1); }
.dept__val { font-family: var(--display); font-size: 17px; text-align: right; font-variant-numeric: tabular-nums; }
.dept--low .dept__val { color: var(--red-dark); }

/* --------------------------------------------------------------------- log */

.log { display: flex; flex-direction: column; gap: 5px; padding: 11px 13px 13px; font-family: var(--type); font-size: 11.5px; line-height: 1.4; }
.log__line { display: flex; gap: 6px; color: var(--ink-2); }
.log__line b { color: var(--ink); flex: 0 0 auto; font-family: var(--bold); font-size: 9px; letter-spacing: .08em; padding-top: 2px; }
.log__line--result b { color: var(--red-dark); }
.log__line--order b { color: var(--cyan); }
.log__empty { color: rgba(20, 17, 15, .45); font-style: italic; }

/* ------------------------------------------------------------------ covers */

.cover { display: flex; flex-direction: column; gap: 18px; }

.cover__top {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .85fr);
  gap: 18px;
  align-items: stretch;
}

.cover__left { padding: 6px 4px 0; }

.issue {
  display: inline-block;
  font-family: var(--bold);
  font-size: 9.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  padding: 4px 9px;
  transform: rotate(-1.4deg);
  margin-bottom: 14px;
}

.cover__title {
  font-family: var(--display);
  font-size: clamp(58px, 11vw, 132px);
  line-height: .78;
  letter-spacing: 1px;
  text-shadow: 5px 5px 0 var(--red), 9px 9px 0 var(--ink);
  transform: rotate(-1.6deg);
  margin: 0 0 6px;
}
.cover__title em { font-style: normal; display: block; color: var(--red); text-shadow: 5px 5px 0 var(--ink); }

.cover__tag {
  font-family: var(--display);
  font-size: clamp(20px, 2.6vw, 30px);
  line-height: 1;
  letter-spacing: .5px;
  margin: 16px 0 12px;
  padding-left: 12px;
  border-left: 6px solid var(--yellow);
}

.cover__blurb {
  font-family: var(--type);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 48ch;
  margin-bottom: 20px;
}

.cover__right {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px;
  border: 4px solid var(--ink);
  background: var(--yellow);
  box-shadow: var(--hard);
  overflow: hidden;
  min-height: 300px;
}
.cover__right::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(20, 17, 15, .85) 1.2px, transparent 1.3px);
  background-size: 6px 6px;
  opacity: .14;
  pointer-events: none;
}
.cover__mascot { position: relative; z-index: 1; width: 100%; max-width: 260px; margin: 0 auto; }
.cover__mascot svg { display: block; width: 100%; height: auto; }
.cover__stamp {
  position: absolute;
  top: 14px;
  right: 10px;
  transform: rotate(9deg);
  font-family: var(--bold);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 3px solid var(--red-dark);
  color: var(--red-dark);
  padding: 3px 8px;
  z-index: 2;
}

.cover__rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.rule {
  padding: 13px 14px 15px;
  border: 4px solid var(--ink);
  background: var(--paper);
  box-shadow: var(--hard-sm);
}
.rule__n {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-family: var(--display);
  font-size: 15px;
  margin-bottom: 8px;
  border: 2.5px solid var(--ink);
}
.rule__t { font-family: var(--bold); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 5px; }
.rule__d { font-family: var(--type); font-size: 12px; line-height: 1.45; color: var(--ink-2); }

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 24px;
  border: 4px solid var(--ink);
  background: var(--paper-3);
  box-shadow: var(--hard-sm);
  font-family: var(--display);
  font-size: 23px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn--primary { background: var(--red); color: #fff; text-shadow: 2px 2px 0 rgba(0, 0, 0, .35); }
.btn--ghost { background: transparent; font-size: 18px; padding: 9px 18px; }

.cover__hint {
  margin-top: 10px;
  font-family: var(--type);
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(20, 17, 15, .5);
}

/* ----------------------------------------------------------------- endings */

.over { display: flex; flex-direction: column; gap: 18px; }

.over__hero {
  position: relative;
  padding: 26px 22px 24px;
  border: 5px solid var(--ink);
  background: var(--yellow);
  box-shadow: 8px 8px 0 var(--ink);
  overflow: hidden;
  text-align: center;
}
.over__hero--bad { background: var(--red); color: #fff; }
.over__hero--good { background: var(--green); color: #06281a; }
.over__hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(currentColor 1.2px, transparent 1.3px);
  background-size: 6px 6px;
  opacity: .1;
}
.over__kicker {
  position: relative;
  font-family: var(--type);
  font-size: 10.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  margin-bottom: 6px;
  opacity: .8;
}
.over__title {
  position: relative;
  font-family: var(--display);
  font-size: clamp(46px, 9vw, 104px);
  line-height: .82;
  letter-spacing: 1px;
  text-shadow: 4px 4px 0 rgba(20, 17, 15, .9);
}
.over__hero--good .over__title { text-shadow: 4px 4px 0 rgba(0, 0, 0, .45); }
.over__sub {
  position: relative;
  font-family: var(--type);
  font-size: 14px;
  line-height: 1.55;
  max-width: 60ch;
  margin: 12px auto 0;
  opacity: .95;
}

.report {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0;
  border: 4px solid var(--ink);
  background: var(--paper);
  box-shadow: var(--hard);
}
.report__cell { padding: 12px 14px; border-right: 3px solid var(--ink); }
.report__cell:last-child { border-right: 0; }
.report__k { font-family: var(--type); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.report__v { font-family: var(--display); font-size: 26px; line-height: 1.1; }

.grade {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 5px solid var(--ink);
  background: var(--yellow);
  font-family: var(--display);
  font-size: 48px;
  box-shadow: var(--hard-sm);
  transform: rotate(-6deg);
  flex: 0 0 auto;
}
.grade--s { background: var(--yellow); }
.grade--a { background: var(--green); color: #06281a; }
.grade--b { background: var(--cyan); color: #04222b; }
.grade--c { background: var(--orange); }
.grade--d { background: var(--red); color: #fff; }

.over__foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.over__verdict { flex: 1 1 240px; }
.over__verdict-text { font-family: var(--type); font-size: 13px; line-height: 1.45; color: var(--ink-2); }

.over__mascot { width: 116px; margin: 0 auto 2px; position: relative; }
.over__mascot svg { display: block; width: 100%; height: auto; }
.over__title { text-wrap: balance; }

.opt__label { display: block; }

/* -------------------------------------------------------------- animations */

@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(.86); } to { transform: scale(1); } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes needle { from { transform: rotate(var(--from)); } }
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5px, 2px); }
  40% { transform: translate(4px, -3px); }
  60% { transform: translate(-3px, -2px); }
  80% { transform: translate(3px, 3px); }
}
.shake { animation: shake .42s ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 1000px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .cover__top { grid-template-columns: minmax(0, 1fr); }
  .cover__right { min-height: 220px; }
  .cover__mascot { max-width: 200px; }
  .cover__rules { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .page { padding: 14px 11px 54px; }
  .masthead { gap: 10px; }
  .brand__sub { display: none; }
  .chips { width: 100%; }
  .chip { flex: 1; min-width: 0; }
  .plan { grid-template-columns: minmax(0, 1fr); }
  .plan__btn { flex-direction: row; align-items: center; gap: 10px; }
  .plan__icon { flex: 0 0 56px; width: 56px; height: 40px; }
  .opt { grid-template-columns: 26px minmax(0, 1fr); gap: 9px; padding: 10px 11px; }
  .opt__idx { width: 25px; height: 25px; font-size: 15px; }
  .gauge__num { font-size: 36px; }
  .cover__title { text-shadow: 3px 3px 0 var(--red), 6px 6px 0 var(--ink); }
  .panky__art { flex-basis: 56px; width: 56px; }
}

/* ==========================================================================
   Visual pass — layout corrections found by looking at the rendered page.
   ========================================================================== */

/* The cover bubble sits in a flex column; without this it stretches to fill. */
.cover__right .bubble { flex: 0 0 auto; }

/* Option rows: label left, effect chips right, so the width is used. */
.opt__body { min-width: 0; }
.opt__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}
.opt__meta { margin-top: 0; }
.opt__lock { display: block; }

/* Plan button: icon plus a text block, so name and description stack. */
.plan__body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

/* Readouts use the label face: Bangers' 7 reads as a 1 at small sizes. */
.dept__val { font-family: var(--bold); font-size: 15px; letter-spacing: 0; }
.res__val { font-family: var(--bold); font-size: 13px; letter-spacing: 0; }

/* A mascot big enough to actually see its face. */
@media (min-width: 641px) {
  .panky__art { flex-basis: 86px; width: 86px; }
}

/* Ending heroes: white on a darker field, otherwise the title vanishes. */
.over__hero--bad { background: #c9302a; }
.over__hero--good { background: #267a4e; color: #fff; }
.over__hero--good .over__title { text-shadow: 4px 4px 0 rgba(0, 0, 0, .55); }

/* The log spans the page, so the short sidebar leaves no empty column. */
.board-foot { margin-top: 16px; }

/* Report strip: gaps draw the rules, so wrapped rows stay separated. */
.report { gap: 3px; background: var(--ink); }
.report__cell { border-right: 0; background: var(--paper); }

/* Compact vitals strip, mobile only. */
.quickbar { display: none; }

/* The sidebar is ~875px tall; pinning it on a shorter screen would hide the
   departments panel behind the fold, so sticky only applies when it fits. */
@media (min-width: 1001px) and (min-height: 920px) {
  .col-side { position: sticky; top: 14px; align-self: start; }
}

@media (max-width: 1000px) {
  .quickbar {
    position: sticky;
    top: 0;
    z-index: 9;
    display: flex;
    margin-bottom: 12px;
    background: var(--ink);
    color: var(--paper);
    border: 3px solid var(--ink);
    box-shadow: 3px 3px 0 rgba(20, 17, 15, .28);
  }
  .qb {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 5px 7px 6px;
    border-right: 2px solid rgba(247, 240, 221, .18);
  }
  .qb:last-child { border-right: 0; }
  .qb i {
    font-family: var(--type);
    font-style: normal;
    font-size: 8px;
    letter-spacing: .12em;
    opacity: .7;
    white-space: nowrap;
  }
  .qb b { font-family: var(--bold); font-size: 15px; line-height: 1; }
  .qb--warn b { color: var(--yellow); }
  .qb--bad b { color: #ff7a6e; }
}

@media (max-width: 640px) {
  .report { grid-template-columns: 1fr 1fr; }
  .plan__btn { flex-direction: row; align-items: flex-start; gap: 11px; }
  .plan__icon { flex: 0 0 52px; width: 52px; height: 38px; }
  .plan__body { flex: 1 1 auto; }
  .gauge__svg { max-width: 250px; margin: 0 auto; }
  .panel__head { align-items: flex-start; }
  .panel__note { font-size: 9px; }
  .opt__row { gap: 5px 8px; }
}

/* ==========================================================================
   Depth pass — acts, upgrades, line wear, overtime, glucose trace.
   ========================================================================== */

/* Act banner: reads like a comic caption between panels. */
.actbar {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 14px;
  padding: 8px 13px;
  border: 3px solid var(--ink);
  background: var(--paper-2);
  box-shadow: 3px 3px 0 var(--ink);
}
.actbar__n {
  font-family: var(--bold);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  padding: 3px 8px;
}
.actbar__name { font-family: var(--display); font-size: 19px; letter-spacing: .5px; }
.actbar__blurb { font-family: var(--type); font-size: 11.5px; color: var(--ink-2); }
.actbar--ii { background: var(--yellow); }
.actbar--iii { background: #ffb9ad; }

/* Glucose history. */
.trace { padding: 0 12px 10px; }
.trace__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-family: var(--bold);
  font-size: 8px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.trace__svg {
  display: block;
  width: 100%;
  height: auto;
  border: 2.5px solid var(--ink);
  background: #fdf8ea;
}

/* Upgrade shop. */
.upgrades {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(212px, 1fr));
  gap: 8px;
  padding: 12px;
}
.up {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name cost" "blurb cost";
  gap: 2px 10px;
  align-items: center;
  text-align: left;
  padding: 8px 10px;
  border: 3px solid var(--ink);
  background: var(--paper-3);
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease;
}
.up:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.up:active:not(:disabled) { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.up:disabled { cursor: default; }
.up:disabled:not(.up--owned) { opacity: .55; }
.up__name { grid-area: name; font-family: var(--bold); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.up__blurb { grid-area: blurb; font-family: var(--type); font-size: 10.5px; line-height: 1.3; color: var(--ink-2); }
.up__cost {
  grid-area: cost;
  font-family: var(--display);
  font-size: 17px;
  padding: 3px 7px;
  border: 2.5px solid var(--ink);
  background: var(--magenta);
  color: #fff;
}
.up:disabled:not(.up--owned) .up__cost { background: #ddd0b3; color: var(--ink-2); }
.up--owned { background: #e9f3e6; }
.up--owned .up__cost {
  font-family: var(--bold);
  font-size: 8.5px;
  letter-spacing: .1em;
  padding: 5px 8px;
  background: var(--green);
  color: #06281a;
}

/* Overtime: the one button that should look like a bad idea. */
.overtime {
  display: flex;
  align-items: center;
  gap: 11px;
  width: calc(100% - 24px);
  margin: 0 12px 12px;
  padding: 9px 11px;
  border: 3px dashed var(--red-dark);
  background: #fff2f0;
  text-align: left;
  cursor: pointer;
}
.overtime:disabled {
  cursor: default;
  opacity: .55;
  border-style: solid;
  border-color: var(--ink);
  background: var(--paper-2);
}
.overtime__badge {
  flex: 0 0 auto;
  font-family: var(--bold);
  font-size: 8px;
  letter-spacing: .14em;
  padding: 4px 7px;
  border: 2.5px solid var(--ink);
  background: var(--red);
  color: #fff;
}
.overtime__body { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.overtime__name { font-family: var(--bold); font-size: 9.5px; letter-spacing: .1em; color: var(--red-dark); }
.overtime__desc { font-family: var(--type); font-size: 10.5px; line-height: 1.3; color: var(--ink-2); }
.overtime__left { flex: 0 0 auto; font-family: var(--display); font-size: 15px; text-align: right; }
.overtime__left span { display: block; font-family: var(--type); font-size: 9px; letter-spacing: .04em; color: var(--ink-2); }

/* Line wear. */
.plan__note {
  font-family: var(--type);
  font-size: 9.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--red-dark);
}
.plan__btn--warm { background: #fff6e2; }

/* CGM forecast. */
.opt__predict {
  font-family: var(--bold);
  font-size: 8px;
  letter-spacing: .08em;
  padding: 2px 6px;
  border: 2.5px solid var(--ink);
  background: var(--cyan);
  color: #04222b;
}

/* Department under a board warning. */
.dept__warn {
  font-family: var(--bold);
  font-style: normal;
  font-size: 7.5px;
  letter-spacing: .1em;
  color: var(--red-dark);
}

/* Ending actions. */
.over__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.over__seed {
  font-family: var(--type);
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(20, 17, 15, .55);
}

@media (max-width: 640px) {
  .actbar { padding: 7px 10px; }
  .res { grid-template-columns: 20px 74px minmax(0, 1fr) 30px; gap: 6px; }
  .actbar__blurb { flex-basis: 100%; font-size: 10.5px; }
  .upgrades { grid-template-columns: minmax(0, 1fr); padding: 10px; }
  .overtime {
    width: calc(100% - 20px);
    margin: 0 10px 10px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "badge body" "left left";
    align-items: start;
    gap: 8px 9px;
  }
  .overtime__badge { grid-area: badge; }
  .overtime__body { grid-area: body; }
  .overtime__left { grid-area: left; text-align: left; }
  .over__actions { align-items: stretch; }
}
