/* EVERYBODIES GOT SOMETHIN — style.css */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 100%; height: 100%;
  background: #17131a;
  overflow: hidden;
  font-family: "Comic Sans MS", "Chalkboard SE", "Segoe Print", cursive, sans-serif;
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

#wrap {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  height: 100dvh;
}

#game {
  background: #17131a;
  image-rendering: auto;
  display: block;
}

/* ---------- overlay (menus / quiz / cards) ---------- */
#overlay {
  position: fixed; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(14, 10, 18, 0.82);
  z-index: 20;
  padding: 12px;
}
#overlay.show { display: flex; }
#overlay:not(.lightbg) { backdrop-filter: blur(2.5px); }
#overlay.lightbg { background: rgba(14, 10, 18, 0.5); }   /* title: let the atmospheric canvas backdrop breathe */

.panel {
  background: #f6eedd;
  color: #2c2333;
  border: 4px solid #2c2333;
  border-radius: 14px;
  box-shadow: 0 10px 0 rgba(0,0,0,.45), inset 0 0 60px rgba(120, 90, 40, .12);
  max-width: 640px;
  width: min(94vw, 640px);
  max-height: 92dvh;
  overflow-y: auto;
  padding: 22px 26px;
  text-align: center;
  transform: rotate(-0.4deg);
}
.panel.wide { max-width: 720px; width: min(96vw, 720px); }
@media (prefers-reduced-motion: no-preference) {
  @keyframes panelIn { from { translate: 0 12px; opacity: 0; } to { translate: 0 0; opacity: 1; } }
  .panel { animation: panelIn 0.16s ease-out; }
}

/* inked icons (icons.js symbol sheet) */
.ic { width: 1.06em; height: 1.06em; display: inline-block; vertical-align: -0.16em; margin-right: 1px; flex: 0 0 auto; }
.deckbtn .ic { width: 22px; height: 22px; }
.tbtn .ic { width: 17px; height: 17px; display: block; margin: 0 auto 1px; }
/* paper-toned scrollbars inside panels (WebKit) */
.panel::-webkit-scrollbar, .achlist::-webkit-scrollbar, .bgrid::-webkit-scrollbar, .talgrid::-webkit-scrollbar { width: 10px; height: 10px; }
.panel::-webkit-scrollbar-track, .achlist::-webkit-scrollbar-track, .bgrid::-webkit-scrollbar-track, .talgrid::-webkit-scrollbar-track { background: rgba(120, 100, 70, 0.12); border-radius: 8px; }
.panel::-webkit-scrollbar-thumb, .achlist::-webkit-scrollbar-thumb, .bgrid::-webkit-scrollbar-thumb, .talgrid::-webkit-scrollbar-thumb { background: #c8b894; border: 2px solid #f6eedd; border-radius: 8px; }

h1.logo {
  font-size: clamp(26px, 6vw, 46px);
  line-height: 1.02;
  color: #3a2a4a;
  text-shadow: 3px 3px 0 #e8b64c, 5px 5px 0 rgba(0,0,0,.2);
  transform: rotate(-1.5deg);
  margin: 4px 0 2px;
}
.tagline { font-size: clamp(13px, 2.6vw, 16px); color: #6b5a4a; margin-bottom: 10px; font-style: italic; }

.walrusbox { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 10px; }
#walrusCanvas, .walrusCanvas { width: 132px; height: 132px; flex: 0 0 auto; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-2deg);} 50% { transform: translateY(-6px) rotate(2deg);} }

.bubble {
  position: relative;
  background: #fff;
  border: 3px solid #2c2333;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: clamp(14px, 3vw, 17px);
  text-align: left;
  min-height: 58px;
  flex: 1;
}
.bubble:before {
  content: ""; position: absolute; left: -14px; top: 40%;
  border: 8px solid transparent; border-right-color: #2c2333;
}
.qcount { font-size: 12px; color: #8a7a68; margin-bottom: 6px; letter-spacing: 1px; }

.btn {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 13px 16px;
  font-family: inherit;
  font-size: clamp(15px, 3.4vw, 18px);
  background: #e8b64c;
  color: #2c2333;
  border: 3px solid #2c2333;
  border-radius: 10px;
  box-shadow: 0 4px 0 #2c2333, inset 0 2px 0 rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: transform .06s;
  text-align: center;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #2c2333, inset 0 2px 0 rgba(255, 255, 255, 0.18); }
@media (hover: hover) { .btn:hover { filter: brightness(1.06); } }
.btn:focus-visible, .talnode:focus-visible, .charCard:focus-visible { outline: 3px solid #3a5ac8; outline-offset: 2px; }
.btn.answer { background: #fff; text-align: left; }
.btn.answer:hover { background: #ffe9bd; }
.btn.minor { background: #d8cfc2; font-size: 14px; padding: 9px 12px; }
.btn.danger { background: #e0705a; color: #fff; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; }
.btnrow .btn { flex: 1 1 130px; }

/* section dividers on busy menus — like headings on an intake form */
.secdiv {
  display: flex; align-items: center; gap: 10px;
  margin: 13px 2px 3px; color: #9a8a74;
  font-size: 10.5px; font-weight: bold; letter-spacing: 2.5px;
}
.secdiv:before, .secdiv:after { content: ""; flex: 1; border-top: 2px dashed #d2c6ae; }

/* the Patient Handbook — a tri-fold leaflet in the rack by the door */
.btn.pamphlet {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #eef4ff, #d6e4f8);
  border-color: #2c3a68; color: #22305a;
  box-shadow: 0 4px 0 #2c3a68;
}
.btn.pamphlet:before, .btn.pamphlet:after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 2px;
  background: rgba(44, 58, 104, 0.18);
}
.btn.pamphlet:before { left: 33.3%; }
.btn.pamphlet:after { left: 66.6%; }
.btn.pamphlet:active { box-shadow: 0 1px 0 #2c3a68; }

.rx {
  border: 3px dashed #b03030;
  border-radius: 10px;
  background: #fff8f0;
  padding: 12px 14px;
  margin: 10px 0;
  text-align: left;
  position: relative;
}
.rx .stamp {
  position: absolute; right: 8px; top: -14px;
  color: #b03030; border: 3px solid #b03030; border-radius: 8px;
  padding: 2px 10px; font-weight: bold; font-size: clamp(14px, 3vw, 19px);
  transform: rotate(8deg);
  background: rgba(255,255,255,.85);
  letter-spacing: 1px;
}
.rx h2 { font-size: clamp(19px, 4.4vw, 26px); margin-bottom: 4px; }
.rx .sub { font-size: 13px; color: #8a5a4a; font-style: italic; }
.rx .mech { margin-top: 8px; font-size: clamp(13px, 3vw, 15.5px); }
.rx .presc { margin-top: 8px; font-size: 14px; color: #2c5a33; }

.smallprint { font-size: 11px; color: #8a7a68; margin-top: 10px; line-height: 1.45; }
.stats-line { font-size: 13.5px; color: #55445e; margin: 6px 0; }
.kbd { display: inline-block; border: 2px solid #2c2333; border-bottom-width: 4px; border-radius: 6px; padding: 0 7px; background: #fff; font-size: 12.5px; margin: 0 2px; }
.controls-grid { text-align: left; font-size: 14.5px; line-height: 2.05; margin: 8px 0; }
.deathline { font-style: italic; color: #7a4a55; font-size: clamp(14px, 3.2vw, 17px); margin: 8px 0; }

/* ---------- run summary ---------- */
.summary { margin: 10px 2px; }
.sumrow {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: clamp(14px, 3.2vw, 16.5px);
  padding: 6px 8px; border-bottom: 2px dotted #d8cdb8;
}
.sumrow:last-child { border-bottom: none; }
.sumrow span { color: #6b5a4a; }
.sumrow b { color: #2c2333; font-size: 1.15em; }
.newunlocks {
  border: 3px solid #e0a028; border-radius: 12px; background: #fff6df;
  padding: 10px 12px; margin: 10px 0;
  box-shadow: 0 0 0 3px rgba(232,182,76,.25);
}
.nutitle { font-weight: bold; color: #b07818; font-size: clamp(15px, 3.4vw, 18px); margin-bottom: 6px; letter-spacing: 1px; }
.nurow { text-align: left; font-size: 13.5px; margin: 4px 0; }
.nurow b { color: #2c2333; }
.nurow span { color: #6b5a4a; display: block; font-size: 12.5px; }

/* ---------- unlocks / achievements list ---------- */
.achlist { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; max-height: 58vh; overflow-y: auto; padding: 2px; }
.ach {
  display: flex; align-items: center; gap: 12px; text-align: left;
  border: 3px solid #2c2333; border-radius: 12px; padding: 9px 12px;
  box-shadow: 0 3px 0 #2c2333;
}
.ach.got { background: #fff6df; }
.ach.locked { background: #d8d2c8; opacity: .8; }
.achicon { font-size: 26px; flex: 0 0 auto; }
.achbody { flex: 1 1 auto; }
.achname { font-weight: bold; font-size: clamp(14px, 3.2vw, 16.5px); color: #2c2333; }
.ach.locked .achname { color: #7a7268; }
.achdesc { font-size: 12.5px; color: #6b5a4a; margin-top: 1px; }
.achreward { font-size: 11.5px; color: #2c5a33; margin-top: 3px; font-style: italic; }

/* ---------- bestiary (rogues' gallery of boss portraits) ---------- */
.bgrid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  margin: 10px 0; max-height: 64vh; overflow-y: auto; padding: 2px;
}
@media (min-width: 640px) { .bgrid { grid-template-columns: repeat(3, 1fr); } }
.bcard {
  border: 3px solid #2c2333; border-radius: 12px; padding: 8px; text-align: center;
  background: #efe4cc; box-shadow: 0 3px 0 #2c2333;
}
.bcard.locked { background: #d8d0c0; opacity: .85; }
.bframe {
  display: flex; align-items: center; justify-content: center; min-height: 128px; padding: 3px 0;
  background: radial-gradient(ellipse at 50% 42%, #574852, #221a26 74%);
  border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 18px rgba(0,0,0,.55);
}
.bportrait { width: 100%; max-width: 150px; height: auto; display: block; }
.bqm { font-size: 46px; font-weight: bold; color: rgba(240,232,216,.22); }
.bname { font-weight: bold; color: #b23636; font-size: 13px; letter-spacing: .4px; margin-top: 7px; }
.bcard.locked .bname { color: #8a8078; }
.bsub { font-size: 11.5px; color: #6b5a4a; font-style: italic; margin: 3px 0; min-height: 28px; }
.bnote { font-size: 11px; color: #55463c; line-height: 1.32; }

/* ---------- settings sliders ---------- */
.setrow { text-align: left; margin: 16px 4px; }
.setrow label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: clamp(15px, 3.4vw, 18px); font-weight: bold; color: #3a2a4a; margin-bottom: 8px;
}
.setrow label span { font-size: 15px; color: #8a5a2a; }
input[type=range].slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 16px; border-radius: 10px;
  background: #e6ddcb; border: 3px solid #2c2333;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.12);
  outline: none; cursor: pointer;
}
input[type=range].slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 30px; height: 30px; border-radius: 50%;
  background: #e8b64c; border: 3px solid #2c2333;
  box-shadow: 0 3px 0 #2c2333; cursor: pointer; margin-top: -1px;
}
input[type=range].slider::-webkit-slider-thumb:active { transform: translateY(2px); box-shadow: 0 1px 0 #2c2333; }
input[type=range].slider::-moz-range-thumb {
  width: 28px; height: 28px; border-radius: 50%;
  background: #e8b64c; border: 3px solid #2c2333; box-shadow: 0 3px 0 #2c2333; cursor: pointer;
}
input[type=range].slider::-moz-range-track { height: 12px; border-radius: 10px; background: #e6ddcb; }

/* ---------- character select (patient files) ---------- */
.charGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 10px 0;
}
@media (max-width: 560px) { .charGrid { grid-template-columns: repeat(2, 1fr); } }
.charCard {
  background: #fff;
  border: 3px solid #2c2333;
  border-radius: 12px;
  box-shadow: 0 4px 0 #2c2333;
  padding: 10px 6px 8px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: transform .07s;
}
.charCard:hover { background: #ffe9bd; transform: translateY(-2px); }
.charCard:active { transform: translateY(2px); box-shadow: 0 1px 0 #2c2333; }
.charCard canvas { width: 74px; height: 74px; }
.charCard .cname { font-weight: bold; font-size: 14px; line-height: 1.15; }
.charCard .cline { font-size: 11px; color: #6b5a4a; font-style: italic; margin-top: 2px; }
.charCard .cbest { font-size: 10.5px; color: #8a7a68; margin-top: 4px; }
.charCard.locked { background: #d8d2c8; color: #8a8078; }
.charCard.locked canvas { filter: brightness(0.15); }
.charCard.locked:hover { background: #d8d2c8; transform: none; }

/* ---------- touch controls ---------- */
#deck, #padLand { display: none; }

/* ===== LANDSCAPE overlay: floating twin-stick + corner buttons ===== */
#padLand { position: fixed; inset: 0; pointer-events: none; z-index: 15; }
body.touch.inrun #padLand { display: block; }
@media (orientation: portrait) { body.touch #padLand { display: none !important; } }

.lzone { position: fixed; bottom: 0; height: 68%; width: 45%; pointer-events: auto; }
#zoneMoveL { left: 0; } #zoneAimL { right: 0; }
.stick {
  position: fixed; width: 116px; height: 116px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.28); background: rgba(255,255,255,.06);
  transform: translate(-50%, -50%);
  display: none; pointer-events: none; z-index: 16;
}
.stick .nub {
  position: absolute; inset: 0; margin: auto; width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,.4);
}
#landBtns { position: fixed; top: calc(6px + env(safe-area-inset-top)); right: calc(8px + env(safe-area-inset-right)); display: flex; gap: 8px; pointer-events: none; }
.tbtn {
  width: 56px; height: 56px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.5);
  background: rgba(40,30,50,.62);
  color: #fff; font-family: inherit; font-size: 10px; line-height: 1.15;
  pointer-events: auto;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.tbtn:active { transform: translateY(2px); background: rgba(60,45,75,.8); }

/* ===== PORTRAIT: Game Boy control deck below the game ===== */
@media (orientation: portrait) {
  body.touch #wrap { flex-direction: column; justify-content: flex-start; }
  body.touch.inrun #deck { display: flex; }
}
#deck {
  width: 100%; flex: 1 1 auto; min-height: 0;
  flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 8px 12px calc(20px + env(safe-area-inset-bottom));
  background: linear-gradient(#2b2436, #14101c);
  border-top: 3px solid #0d0a12;
  touch-action: none;
}
#deckStatus {
  flex: 1 1 auto; width: 100%; min-height: 0; display: block;
}
#deckControls {
  width: 100%; flex: 0 0 auto;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 8px;
}
.pad {
  position: relative; flex: 0 0 auto;
  width: min(37vw, 158px); height: min(37vw, 158px);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 33%, #4c4258, #2a2434);
  border: 3px solid #0d0a12;
  box-shadow: inset 0 5px 10px rgba(0,0,0,.45), 0 3px 0 #0d0a12;
  touch-action: none;
}
.pad .padbase {
  position: absolute; inset: 0; margin: auto; width: 40%; height: 40%;
  border-radius: 50%; background: rgba(0,0,0,.28);
}
.pad .nub {
  position: absolute; inset: 0; margin: auto; width: 47%; height: 47%; border-radius: 50%;
  background: radial-gradient(circle at 40% 33%, #f2d98e, #d8a838);
  border: 3px solid #0d0a12; box-shadow: 0 3px 0 rgba(0,0,0,.35);
}
.pad .plabel {
  position: absolute; left: 0; right: 0; bottom: -20px; text-align: center;
  font-size: 12px; color: #b3a7b8; letter-spacing: 1px;
}
.deckmid {
  flex: 1 1 auto; max-width: 44%;
  display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 8px;
}
.deckbtn {
  font-family: inherit; font-size: clamp(13px, 3.6vw, 16px); font-weight: bold; color: #2c2333;
  background: #e8b64c; border: 3px solid #0d0a12; border-radius: 12px;
  box-shadow: 0 4px 0 #0d0a12; padding: 11px 6px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.deckbtn span { font-size: 11px; }
.deckbtn.small { padding: 8px; font-size: 17px; background: #cfc6ba; }
.deckbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #0d0a12; }

/* ---------- patient chart (codex) ---------- */
.codextabs { display: flex; gap: 6px; margin: 6px 0 4px; }
.codextabs .codextab { margin: 0; flex: 1; padding: 8px 4px; font-size: 13px; }
.codextab.active { background: #e8b64c; box-shadow: 0 2px 0 #2c2333; transform: translateY(1px); }
.codexicon { width: 48px; height: 48px; flex: 0 0 auto; image-rendering: auto; }
.codexicon.locked {
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: bold; color: #8a8078;
  background: #cfc7ba; border-radius: 10px;
}

/* ---------- daily calendar ---------- */
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 8px auto 12px; max-width: 320px; }
.calh { font-size: 11px; color: #8a7a68; text-align: center; padding-bottom: 2px; }
.calcell {
  height: 32px; border-radius: 6px; background: #e6ddcb;
  display: flex; align-items: center; justify-content: center; position: relative;
  border: 2px solid transparent;
}
.calcell.empty { background: transparent; }
.calcell .caldd { font-size: 11px; color: #a89a84; }
.calcell.played { background: #e8b64c; }
.calcell.played .calward { font-size: 13px; font-weight: bold; color: #2c2333; }
.calcell.today { border-color: #b03030; }

/* ---------- challenge (seed sharing) ---------- */
.seedcode { font-family: "Courier New", monospace; font-size: 20px; letter-spacing: 2px; color: #3a5ac8; }
.seedfield {
  width: 100%; margin-top: 6px; padding: 12px 14px; font-family: "Courier New", monospace;
  font-size: 18px; letter-spacing: 1px; text-align: center;
  background: #fff; color: #2c2333; border: 3px solid #2c2333; border-radius: 10px; outline: none;
}
.seedfield:focus { border-color: #3a5ac8; }

/* ---------- comorbidity cards ---------- */
.cmgrid { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.cmcard {
  font-family: inherit; text-align: left; cursor: pointer;
  background: #fff; color: #2c2333; border: 3px solid #2c2333; border-radius: 12px;
  box-shadow: 0 4px 0 #2c2333; padding: 12px 14px; transition: transform .07s;
}
.cmcard:hover { background: #ffe9bd; transform: translateY(-2px); }
.cmcard:active { transform: translateY(2px); box-shadow: 0 1px 0 #2c2333; }
.cmname { font-weight: bold; font-size: clamp(15px, 3.6vw, 18px); color: #7a3a8a; }
.cmdesc { font-size: clamp(12.5px, 3vw, 14.5px); color: #55445e; margin-top: 3px; }
/* treatment-plan ward cards (extend .cmcard) */
.wardname { font-weight: bold; font-size: clamp(15px, 3.6vw, 18px); color: #3a2a4a; }
.wardcard .cmdesc { color: #6b5a4a; }
.cmtag { font-size: clamp(11px, 2.8vw, 13px); color: #2c5a33; margin-top: 5px; font-style: italic; }
/* Treatment Plan skill tree */
.panel.treat { max-width: 1040px; width: min(97vw, 1040px); }
.talgrid { display: flex; gap: 8px; margin: 14px 0; justify-content: flex-start; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.talcol { display: flex; flex-direction: column; align-items: stretch; min-width: 132px; flex: 1 1 0; scroll-snap-align: start; }
@media (min-width: 900px) { .talgrid { justify-content: center; } }
.talhead { font-weight: bold; font-size: 14px; color: #2c2333; text-align: center; padding: 6px; background: #efe4d0; border: 2px solid #2c2333; border-radius: 8px; margin-bottom: 8px; }
.tallink { width: 3px; height: 12px; background: #2c2333; opacity: 0.35; align-self: center; }
.talnode { font-family: inherit; text-align: left; cursor: default; background: #fff; color: #2c2333; border: 3px solid #2c2333; border-radius: 10px; box-shadow: 0 3px 0 #2c2333; padding: 8px 10px; transition: transform .07s; }
.talnode .talname { font-weight: bold; font-size: 13.5px; color: #3a2a4a; }
.talnode .taldesc { font-size: 11.5px; color: #55445e; margin-top: 2px; line-height: 1.25; }
.talnode .talcost { font-size: 12px; font-weight: bold; margin-top: 4px; }
.talnode.avail { cursor: pointer; background: #fffef2; }
.talnode.avail:hover { background: #ffe9bd; transform: translateY(-2px); }
.talnode.avail:active { transform: translateY(2px); box-shadow: 0 1px 0 #2c2333; }
.talnode.avail .talcost { color: #2c5a33; }
.talnode.owned { background: #e6f3e0; border-color: #3a7a3a; box-shadow: 0 3px 0 #3a7a3a; }
.talnode.owned .talname { color: #2c5a2c; }
.talnode.owned .talcost { color: #3a7a3a; }
.talnode.locked { opacity: 0.5; }
.talnode.locked .talcost { color: #8a5a5a; }
.talnode.cap { border-width: 3px; background: linear-gradient(180deg, #fff8e0, #ffedb8); border-color: #7a5a18; box-shadow: 0 3px 0 #7a5a18; }
.talnode.cap .talname { color: #6a4a10; }
.talnode.cap.owned { background: linear-gradient(180deg, #eef7d8, #dff0c0); border-color: #3a7a3a; box-shadow: 0 3px 0 #3a7a3a; }
.talnode.cap.locked { background: #f3ecdc; }
/* keep the portrait deck's 4 action buttons compact */
.deckmid .deckbtn { padding: 8px 6px; }
/* the Waiting Room has no pills or claims — hide run-only buttons, keep OPEN + pause */
body.inhub #btnPillD, body.inhub #btnBombD, body.inhub #btnPillL, body.inhub #btnBombL { display: none; }

/* ============ THE PATIENT HANDBOOK (Form EGS-1) ============ */
.panel.hb { max-width: 920px; width: min(97vw, 920px); }
.hbtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 10px; }
.hbtabs .codextab { flex: 1 1 100px; margin: 0; padding: 8px 4px; font-size: 12px; }
.hbbody { text-align: left; }
.hbh { font-weight: bold; font-size: 15px; color: #3a2a4a; margin: 16px 0 5px; border-bottom: 2px dashed #d2c6ae; padding-bottom: 3px; letter-spacing: 0.5px; }
.hbbody .hbh:first-child { margin-top: 2px; }
.hbrow { font-size: 12.5px; margin: 4px 0; line-height: 1.45; color: #3a3040; }
.hbrow b { color: #2c2333; }
.hbtag { font-size: 10.5px; color: #8a7a68; font-style: italic; }
.hbnote { font-size: 12px; color: #55445e; font-style: italic; margin: 6px 0; line-height: 1.5; }
.hbfoot { margin-top: 14px; border-top: 1.5px dashed rgba(120, 100, 70, 0.4); padding-top: 6px; font-size: 10.5px; color: #8a7a68; letter-spacing: 1px; text-align: center; }

/* ============ MISFILED DOCUMENTS + PATIENT DIARY (paper reader) ============ */
.docpaper { position: relative; background: #f4edd8; border: 2px solid #b8a882; border-radius: 4px; box-shadow: 0 4px 0 rgba(44,35,51,0.5), inset 0 0 40px rgba(160,140,100,0.18); padding: 20px 22px 14px; margin: 8px 0 12px; text-align: left; color: #3a3040; transform: rotate(-0.4deg); }
.docstamp { position: absolute; top: 10px; right: 14px; border: 3px solid #a03030; color: #a03030; font-weight: bold; font-size: 13px; letter-spacing: 2px; padding: 3px 9px; border-radius: 4px; transform: rotate(8deg); opacity: 0.85; font-family: Impact, "Arial Black", sans-serif; }
.doctitle { font-weight: bold; font-size: clamp(16px, 4vw, 20px); color: #2c2333; margin-bottom: 2px; padding-right: 90px; }
.docsub { font-style: italic; font-size: clamp(11px, 3vw, 13px); color: #7a6a58; border-bottom: 1.5px solid rgba(120,100,70,0.35); padding-bottom: 7px; margin-bottom: 8px; }
.docbody { font-size: clamp(12.5px, 3.2vw, 14.5px); }
.docfoot { margin-top: 12px; border-top: 1.5px dashed rgba(120,100,70,0.4); padding-top: 6px; font-size: 11px; color: #8a7a68; letter-spacing: 1px; }

/* ============ ROOM DESIGNER (GAME TESTER) ============ */
#dgWrap { display: inline-block; margin: 10px auto 6px; padding: 6px; background: #2c2333; border-radius: 8px; touch-action: none; }
.dgrow { display: flex; }
.dgc { width: 27px; height: 27px; padding: 0; margin: 0; border: 1px solid rgba(44,35,51,0.4); background: #d8cfc0; font-size: 13px; line-height: 1; cursor: pointer; font-family: inherit; user-select: none; }
.dgc:active { outline: 2px solid #e8c84c; }
@media (max-width: 520px) { .dgc { width: 22px; height: 22px; font-size: 11px; } }

/* ============ WARD BINGO ============ */
.bingogrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin: 12px auto; max-width: 480px; }
.bingoc { position: relative; background: #fffef2; border: 2.5px solid #2c2333; border-radius: 8px; box-shadow: 0 3px 0 #2c2333; min-height: 66px; padding: 6px 3px 4px; font-size: 17px; text-align: center; color: #3a3040; }
.bingoc span { display: block; font-size: 8.5px; line-height: 1.15; margin-top: 3px; color: #55445e; font-weight: bold; }
.bingoc.free { background: #efe4d0; }
.bingoc.done { background: #e6f3e0; border-color: #3a7a3a; box-shadow: 0 3px 0 #3a7a3a; }
.bingoc.done span { color: #2c5a2c; }
.bingoc .bstamp { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; font-style: normal; color: rgba(58,122,58,0.55); transform: rotate(-12deg); pointer-events: none; }
@media (max-width: 480px) { .bingoc { min-height: 58px; font-size: 14px; } .bingoc span { font-size: 7.5px; } }
